#linuxcnc-devel | Logs for 2015-06-08

[11:49:01] <Roguish> hey all. question about Gladevcp. I am trying to create a simple panel to display the axes following error. Which one of the hal python widgets is best? needs to display a float.
[11:49:51] <Roguish> the 'label' only links to a U32.
[12:02:49] * jthornton wonders why the config picker forces you to copy a sim to your directory with the options of Yes or Cancel? now my configs directory is flooded with sim1 sim2 sim3 etc.
[12:04:28] <cradek> jthornton: the configs don't work right unless they're writable, because of the var file. so running them in the system installed directory makes them work weirdly (like touch off is broken) so we disallowed it
[12:04:49] <cradek> why you get more than one though, I'm not sure
[12:05:19] <cradek> if you already have a sim in your home directory, just pick that one
[12:07:54] <JT-Shop> that makes sense
[12:08:05] <mozmck> I wonder if you could make the var file a symlink to one in the user's home directory?
[12:08:28] <cradek> which user?
[12:08:30] <mozmck> and avoid copying them unless that was really wanted.
[12:08:36] <mozmck> User who is running!
[12:08:58] <cradek> yeah but which one?
[12:09:13] <cradek> the installed symlink can only point to one place
[12:09:19] <mozmck> Or user who installs I guess. I wonder how many people using linuxcnc on a multi-user computer?
[12:09:20] <cradek> more than one user can run linuxcnc-sim at the same time
[12:09:34] <cradek> more than one user can install or update packages
[12:09:53] <mozmck> True, but I wonder if anyone does, but I see your point.
[12:10:20] <cradek> a more correct fix would be to make linuxcnc use the running user's home directory for the var file, but then you break multiple configs
[12:10:34] <JT-Shop> would it make sense to check to see if a sim directory exists and suggest that one?
[12:10:54] <cradek> possibly
[12:11:44] <cradek> I suppose it's hard to tell whether they are compatible
[12:12:19] <cradek> why not just pick the one you want to run? I'm losing sight of what problem we are trying to solve here
[12:13:27] <mozmck> Maybe jthornton is copying the same sim multiple times?
[12:13:46] <JT-Shop> I guess it is just habit to pick a new one from Sample Configurations
[12:14:11] <mozmck> Once you copy it, you can run the one you copied next time.
[12:14:16] <JT-Shop> I might look at axis 3 axis sim then look at axis lathe
[12:14:18] <JT-Shop> yea
[12:14:27] <JT-Shop> just an old habit I guess
[12:15:37] <JT-Shop> I guess the copy popup should not ask if you want to copy but just say I'm going to copy... Ok Cancel
[12:19:54] <JT-Shop> must be nap time lol
[14:21:20] <Roguish> JT-Shop: did you see my post at 9:26 pst about Glade?
[14:24:23] <JT-Shop> at 11:26 my time?
[14:24:50] <JT-Shop> just change the value to a string and update the label
[14:25:52] <mozmck> In which case you would use a standard label, not HAL_LABEL
[14:26:29] <JT-Shop> yea
[14:31:25] <Roguish> mozmck: thanks. but how do i change it to a string? using 'label' in the 'control and display' section.
[14:31:30] <mozmck> self.thcfwrev_label.set_text( str( float(hal_pin.get()) / 10.0 ) )
[14:31:57] <mozmck> there's one I'm doing for example.
[14:32:34] <mozmck> That's in the hal pin's 'value-changed' callback
[14:36:42] <Roguish> ok, in Glade. got the window, got the vbox, then drop in a 'label' from the 'Control and Display' ...... name the label 'x_f_error'
[14:37:45] <mozmck> ok, so then you need a handler python file with some code in it.
[14:38:03] <mozmck> unless JT-Shop knows a better way to do it.
[14:38:30] <JT-Shop> nope that's the way I do it
[14:38:41] <JT-Shop> Roguish, have you seen my tutorials?
[14:39:05] <mozmck> There is a sample handler file somewhere that will help get started - or JT's tutorials...
[14:39:45] <Roguish> ok. JT_Shop. yes. been thru most of the tuts. (well done). with the assortment of widgets, I hoped it would be simple. i'm not inherently a coder.
[14:40:46] <JT-Shop> pyvcp is simple, gladevcp is more powerful
[14:40:53] <mozmck> Name the handler file the same as the glade file except with a .py extension.
[14:41:04] <Roguish> i've been looking at lots of code. even the source for gmoccapy, both the glade and the py file.
[14:42:23] <Roguish> JT-Shop: recall anything like this in the forums? I am pretty good at modifying code.
[14:43:32] <JT-Shop> is following error something you need to watch all the time?
[14:44:18] <Roguish> yes. my mill motors are seriously undersized so I keep an eye on the f errors.
[14:45:09] <Roguish> where are the Glade HAL widgets defined/created ?
[14:47:48] <JT-Shop> so you have a gladevcp panel that loads up with your gui now?
[14:50:13] <Roguish> I am creating the panel. it won't load 'due to the type mismatch between the glade file and the .hal file.
[14:55:11] <Roguish> sounds like i'm going to have to have a .py file (where I want one or not)
[14:56:19] <Roguish> so, if I have f-error.glade, and f-error.py, do I still need an f-error.hal?
[14:56:55] <mozmck> Roguish: look at the meter.py file in configs/sim/axis/gladevcp/ for a simple sample that you could probably rename and modify to do just what you want.
[14:57:27] <mozmck> It goes with the meter_scale.ui glade file.
[15:05:58] <JT-Shop> hmm I don't see that one in the config picker
[15:07:12] <JT-Shop> mozmck, what version are you looking at?
[15:07:58] <mozmck> 2.7 I think
[15:08:27] <mozmck> I'm looking in the directory in the code - not the config picker.
[15:08:45] <mozmck> Seems like I've run that example though - but I'm not sure how right now.
[15:08:54] <JT-Shop> in 2.7 gladevcp is in apps/gladevcp
[15:09:21] <mozmck> This the the linuxcnc-dev/configs/sim/axis/gladevcp directory
[15:09:36] <mozmck> is in the...
[15:11:11] <Roguish> ok, back online... computer locked up and had to reboot, etc.
[15:11:42] <Roguish> mozmck: was that meter.py in config/sim/axis/gladevcp ????
[15:11:52] <mozmck> yes
[15:12:17] <mozmck> meter_scale.py
[15:13:24] <Roguish> running Synergy (and IP km) and was PuTTY/Xming into the linuxcnc box.
[15:13:33] <mozmck> In the __init__ function it creates a hal pin, connects a callback to the 'value-changed' event.
[15:14:18] <mozmck> Then it gets the 'meter' object and assigns it to a class variable.
[15:14:48] <mozmck> You can delete the lines dealing with the inifile.
[15:16:11] <mozmck> So if your label is named 'x_f_error' your line would be something like: self.x_ferr_label = self.builder.get_object('x_f_error')
[15:17:32] <mozmck> Then in the callback you just need one line like this: self.x_ferr_label.set_text( str( float( hal_pin.get() ) ) )
[15:21:02] <JT-Shop> I still wonder why the glade files us the .ui extension and not the .glade extension
[15:21:27] <JT-Shop> us/use
[15:21:43] <mozmck> I don't know. Maybe that was the original extension for glade files?
[15:22:13] <JT-Shop> no it is the extension for hmm the c one
[15:22:36] <mozmck> QT?
[15:22:41] <JT-Shop> yea
[15:22:53] <mozmck> Roguish: so your .py file would look something like this: http://pastie.org/10230182
[15:24:04] <mozmck> and you would connect the x-ferr pin in a hal file to the pin you want to monitor
[15:24:36] <mozmck> JT-Shop: maybe that's why they changed to .glade???
[15:27:30] <_Roguish> holly cow. locked up again. mozmck, when your message pops up and i'm working in the Xming window, my box locks up.
[15:27:56] <mozmck> oops!
[15:28:30] <_Roguish> not your prob. it's all on my side. give me a minute to get sorted
[15:38:05] <_Roguish> gonna have to submit bug to Synergy.
[15:38:20] <_Roguish> back on.
[15:43:04] <guilherme3333> hello all
[15:47:13] <Roguish> found the logs.
[15:48:44] <guilherme3333> hi i'm new to emc and looking for some help
[15:49:19] <JT-Shop> guilherme3333, normal help is in the #linuxcnc channel
[15:49:34] <JT-Shop> this channel is for develement issues usually
[15:49:34] <guilherme3333> ok thanks
[15:50:56] <JT-Shop> mozmck, I've asked that before on the glade mailing list and iirc glade has always used .glade
[15:51:07] <mozmck> interesting!
[15:51:25] <mozmck> Ultimately it probably doesn't matter what extension you put on it.
[15:54:20] <JT-Shop> except when your trying to edit it...
[15:54:39] <JT-Shop> .ui wants to open it in Qt lol
[15:55:19] <mozmck> huh, on my machine it opens with Glade.
[15:56:06] <JT-Shop> on wheezy it opens it with Icewheasel lol
[15:56:09] <mozmck> Click Open in Glade and look at the file filters. If you select GtkBuilder Files it will only show .ui files.
[15:56:17] <JT-Shop> you must have told it to use glade
[15:56:18] <mozmck> That's because it's xml
[15:56:26] <mozmck> I don't know, I might have.
[15:56:55] <mozmck> The "All Glade Files" shows .glade and .ui files.
[15:57:12] <mozmck> So it looks like GtkBuilder file extension is .ui normally.
[16:01:39] <JT-Shop> what is a GtkBuilder file?
[16:03:32] <JT-Shop> I found it they are libary files
[16:08:24] <JT-Shop> if you save a file in glade with no extension it gets .glade
[16:09:01] <JT-Shop> googling shows tons of confusion on this subject
[16:10:33] <Tom_itx> googles of confusion?
[16:10:53] <Tom_itx> someone turned up the furnace here
[16:11:18] <JT-Shop> The XML format of the exported Glade file is called "GtkBuilder". This is the new format that succeeded the former format called "GladeXML". GladeXML is also called "libglade". GtkBuilder supports both GTK v2 and v3. GladeXML uses the "*.glade" file extension while GtkBuilder uses the ".xml" file extension. Developers can convert from GladeXML to GtkBuilder by using the gtk-builder-convert utility
[16:11:26] <JT-Shop> http://www.linux.org/threads/understanding-gtk.6291/
[16:12:04] <mozmck> I think one of GTK's design goals is to cause confusion ;)
[16:12:23] <JT-Shop> that I agree on for sure
[16:12:50] <mozmck> Each version seems to break backwards compatibility, especially in the GTK3 versions from what I hear.
[16:13:35] <JT-Shop> Gtk3 is broken as far as I'm concerned
[16:14:59] <JT-Shop> time to walk the dog and check the score on JT vs squirrels
[16:16:49] <mozmck> ok
[16:17:23] <JT-Shop> in the end I prefer to use an extension that the program will open
[16:17:34] <mozmck> yep, that helps!
[17:06:05] <cmorley> _Roguish: hal_label can display from a HAL float pin. Is that what you want? You choose the type of pin in the editor.
[17:07:37] <cmorley> set the 'HAL pin type" to 1 for floats
[17:23:00] <skunkworks> zlog:
[17:55:46] <Roguish> cmorley: THANKS. got it.
[17:56:25] <cmorley> Welcome :)
[17:57:01] <Roguish> cmorley, JT-Shop, and mozmck: thank you for the help. also works best if the .hal stuff is in the post_gui file....................
[17:57:38] <Roguish> as usual, it's right or wrong. nothing in between.
[17:58:38] <Roguish> on an other note. just got word from Google, they don't want me for one of their solar energy project. doh!!! probably picking one of their Stanford buddies.
[17:59:05] <Roguish> had a pretty fair on-site interview though.
[18:08:55] <mozmck> cmorley: that's good to know about the hal_label. If I had seen it I certainly forgot about it.
[18:14:22] <cmorley> Yes - I had forgot how it worked but knew I had made a widget that would display floats :)
[18:19:00] <Roguish> kinda worm out here today in Saranap. WeatherUnderground is showing 100+ in the neighborhood
[18:19:44] <Roguish> Saranap: a small county enclave between Lafayette and Walnut Creek, CA
[18:38:33] <kwallace> Roguish, you are almost near me. I'm just west of Yosemite Park.
[18:42:39] <cradek> kwallace: did you get your clock working?
[18:45:29] <kwallace> cradek, no, I haven't touched it. I accidentally got this, which is keeping me busy for now: http://www.wallacecompany.com/machine_shop/fire_master_h1818/
[18:45:49] <cradek> haha accidentally
[18:45:54] <cradek> did you get it dried out?
[18:48:24] <kwallace> Yes, and melted some aluminum. I have some SSRs and thermocouples on order. I'm planning on throwing an Arduino at it to control temperature for now.
[18:48:38] <cradek> neat
[18:48:49] <cradek> those will be some serious SSRs!
[18:49:57] <kwallace> http://www.ebay.com/itm/301156865194
[18:50:32] <kwallace> http://www.ebay.com/itm/121085779704
[18:50:35] <cradek> neat
[18:50:41] <cradek> is it < 25A? I'm surprised.
[18:51:57] <kwallace> The dataplate shows 28 Amps, but has two elements, so 14 A each, maybe.
[18:52:10] <cradek> aha
[18:52:17] <kwallace> http://www.ebay.com/itm/301193478531
[18:56:43] <kwallace> And found these while shopping: http://www.ebay.com/itm/141682548045
[19:11:25] <cradek> nice!
[19:11:52] <cradek> some day I really want two on my lathe(s)
[19:12:19] <cradek> I do so much manualish machining
[19:12:32] <cradek> it would be much nicer to have two.
[19:12:44] <cradek> that was a really good price.
[21:40:42] <cradek> why yes it's time for my yearly reboot. so why not change everything at once?