Back
[13:01:12] <dgarr> /join #emc
[16:11:09] <psha> jepler: here?
[16:11:22] <psha> i've tried to use gremlin today and it seem working
[16:11:52] <psha> but i really don't understand how set_view_* functions are working :)
[16:16:27] <mhaberler> psha: no, but mhaberler here ;-)
[16:17:36] <psha> :)
[16:29:00] <mhaberler> psha: baack
[16:29:53] <psha> so let's look at userfuncs first
[16:30:12] <psha> what branch is with latest userfuncs code?
[16:30:27] <mhaberler> there's nothing to see yet, hold on...
[16:30:53] <psha> i think it's time to land it in my gladevcp branch
[16:31:05] <psha> and then ask bonny to test it :)
[16:31:12] <mhaberler> positively not yet....
[16:33:27] <mhaberler> psha: you need python-configobj package
[16:33:58] <psha> already have one
[16:34:18] <psha> used by bzr )
[16:37:16] <mhaberler> psha: ok, get gladevcp-persistence branch
[16:41:47] <mhaberler> psha: I can get at all the halwidgets (gladevcp_work.py:114) - what I'd like to do is: take that list or a subset of them, and save/restore them in the ini file {hal} section
[16:41:49] <mhaberler> for that I need a method halwidget.get_state() and restore_state() so I can set the right pin whatever that pin is named
[16:43:40] <psha> mhaberler: i think it's possible to have list of pins in object
[16:43:50] <psha> so you may do .get() on them and then .set() on restore
[16:43:53] <mhaberler> it's not orthogonal - eg spinbutton has -f and -s, proably I'd save/restore just -f
[16:44:24] <mhaberler> ok, I can decide on widget type but that's an extra dependency
[16:44:32] <psha> mhaberler: it's no harm in saving/restoring both
[16:46:12] <mhaberler> I guess I need to look at the sensitive base widgets only
[16:46:36] <psha> no, sensetive widgets are driven by input hal pins
[16:46:40] <psha> sensitive
[16:46:50] <mhaberler> oops
[16:46:58] <mhaberler> then the other way round
[16:47:00] <psha> you only need buttons/sliders
[16:47:18] <mhaberler> spinbox?
[16:47:35] <psha> yes and combobox
[16:47:45] <psha> and radio/check boex :)
[16:47:59] <mhaberler> see... now we're talking
[16:50:20] <mhaberler> what's a nice kludge to get at all the pin names of hal widget? I hate doing case in py
[16:50:49] <psha> i'll add list with pin objects
[16:50:57] <mhaberler> perfect
[16:55:43] <mhaberler> it would be cool if I could set a property 'persistent' in glade which I can read in the backend.. I could all this crappy configobj spec file format fully automatic - no hands needed
[17:05:32] <psha> mhaberler: it's time to move from getopt to optparse
[17:05:35] <psha> too many options
[17:05:48] <mhaberler> yes, will do
[17:13:12] <psha> mhaberler: i think code in gladevcp
[17:13:13] <psha> 188 h = getattr(mod,hdl_func)
[17:13:17] <psha> won't work correct
[17:13:27] <psha> if there is no hdl_func it'll raise exception
[17:13:44] <mhaberler> ah, ok - will fix that
[17:13:57] <mhaberler> see it
[17:13:58] <psha> proper syntax is getattr(mod, hdl_func, None)
[17:14:13] <psha> 3d param is default value
[17:14:23] <mhaberler> fixed
[17:14:49] <psha> push
[17:15:41] <mhaberler> done
[17:18:38] <psha> mhaberler: also there is another issue i don't like
[17:18:50] <psha> gladevcp pins are created after user pins
[17:18:55] <psha> that's not good i think...
[17:20:13] <mhaberler> dont think so, arent the gladevcp pins done through GladePanel? that's before all the hal_init calls
[17:20:38] <psha> after
[17:20:52] <psha> 269 panel = gladevcp.makepins.GladePanel( halcomp, xmlname, builder, buildertype)
[17:20:58] <psha> ah
[17:20:59] <psha> correct
[17:21:00] <psha> sorry
[17:21:36] <psha> hal_init ones - yes
[17:21:42] <psha> but others - no
[17:22:21] <psha> i think it's time for same splitting of one huge functions to several small ones
[17:22:22] <mhaberler> well, if a user does it in the class __init__ thats dumb..
[17:22:41] <mhaberler> functionality first...
[17:22:49] <psha> not dumb
[17:23:03] <psha> he's creating pins in constructor
[17:23:06] <psha> why not?
[17:23:39] <psha> let me reorganize code a bit
[17:23:57] <mhaberler> I need the object handle first so I can get at the methods, but at that time its too early for hal:stuff
[17:23:59] <psha> if it's ok then we'll move forward on top of it
[17:24:06] <psha> if not - we'll send it to trash
[17:24:09] <mhaberler> fine
[17:25:46] <mhaberler> well, one could delay connecting signals to later ..
[17:26:28] <mhaberler> would be great if we can drop the hal_init crap
[17:36:12] <mhaberler> one could pass halcomp.builder,panel through get_handlers and __init__ if sequencing is OK
[17:44:22] <psha> mhaberler: i'm nearly done with optparse
[17:44:38] <mhaberler> I just started ;-)
[17:45:30] <psha> needs some testing though
[17:47:11] <psha> psha/gladevcp-persistence
[17:47:28] <mhaberler> thats fine; I gotta leave in 30min but will be back late
[17:47:30] <mhaberler> the hal_widgets stuff is more relevant, I can do simple stuff like optionparser..
[17:47:31] <mhaberler> also: please do one example for me how to set a boolean 'persistent' in hal_widgets _gproperties
[17:47:57] <psha> don't catch
[17:48:06] <psha> you need another gprop?
[17:50:04] <mhaberler> group... dunno - I want to havee a prop in HAL widget (those where it makes sense) - boolean 'persistent' settable in glade and readable at runtiime. Dont know the glade speak..
[17:50:49] <psha> why not to dump all and then resotore all?
[17:51:58] <mhaberler> ok..
[17:53:12] <psha> we are already too intrusive :)
[17:53:17] <psha> good fix is small fix
[17:55:38] <mhaberler> Traceback (most recent call last):
[17:55:39] <mhaberler> File "/usr/bin/gladevcp", line 292, in <module>
[17:55:41] <mhaberler> main()
[17:55:42] <mhaberler> File "/usr/bin/gladevcp", line 243, in main
[17:55:44] <mhaberler> if "+" in opts.geometry:
[17:55:45] <mhaberler> TypeError: argument of type 'NoneType' is not iterable
[17:55:47] <psha> oops
[17:55:58] <psha> will land in next commit
[17:57:49] <mhaberler> well, if you really want to reorder things so halpins can be done in __init__ let me know and I take the evening off ;-) no point in my example fighting your gladevcp ...
[17:58:39] <psha> oh no :0
[17:58:47] <psha> i'm just reorganizing gladevcp main call
[17:58:52] <psha> splitting it into functions
[17:59:10] <mhaberler> I see.. well, it IS a whale by now
[18:01:51] <psha> and that's what i don't like :)
[18:01:57] <psha> it was prety simple and now it's huge :)
[18:02:28] <mhaberler> creature feep
[18:03:32] <mhaberler> anyway, gotta run; bb later!
[20:47:32] <psha> jepler: ping?
[20:58:28] <jepler> psha: what's up?
[21:01:45] <psha> i've question about gremlin
[21:02:04] <psha> first to mention it's working great :)
[21:02:14] <jepler> cool
[21:02:38] <psha> but i don't understand how setting view mode is performed
[21:02:43] <psha> http://psha.org.ru/tmp/touchy-gremlin.png
[21:02:53] <psha> here are examples of set_view_z, y, x, p
[21:03:07] <psha> x not working but that's not a problem :)
[21:03:28] <psha> text is always written in same direction
[21:03:42] <psha> so at least one label is always flat
[21:04:17] <jepler> yeah, I had noticed that the dimensions aren't drawn the same in gremlin as in axis, but I haven't tried to figure out why
[21:04:29] <psha> ah, so i'll try to dig in
[21:04:41] <jepler> I'll take a quick look too
[21:05:24] <jepler> view = self.get_view()
[21:05:36] <psha> thanks
[21:05:53] <jepler> in gremlin it's hard-coded
[21:05:53] <jepler> def get_view(self): return 'z'
[21:06:03] <psha> yes, thanks, i'll fix it
[21:06:10] <cradek> everything about the P view is wrong...
[21:06:18] <psha> in gremlin?
[21:06:24] <psha> or in glcanon?
[21:06:44] <jepler> and returns the wrong thing -- it's supposed to be a number 0,1,2,3 rather than a string
[21:07:03] <psha> yes, i've looked in axis
[21:07:13] <jepler> but python of course doesn't complain when asked to compare a number and a string for equality..
[21:07:21] <psha> that's half of problems...
[21:07:40] <psha> main proble is that i don't catch how to set view that's not killed on 'expose'
[21:08:32] <psha> in gremlin 'expose' (and redraw) are killing all changes done with mouse
[21:09:17] <jepler> hm, gremlin's broken for me today
[21:09:24] <jepler> AttributeError: 'Gremlin' object has no attribute 'get_program_alpha'
[21:09:25] <psha> get_alpha.
[21:09:29] <jepler> did you fix this locally?
[21:09:32] <psha> you've added it for blending :)
[21:09:37] <jepler> yeah I know I broke it
[21:09:43] <jepler> but if you have the fix then I don't have to make it manually
[21:09:57] <psha> only stashed by now
[21:10:56] <psha> there are too much noise on my gremlin work branch :)
[21:11:20] <psha> my main goal is to add property to easily set view mode
[21:11:38] <psha> but i'm loosing it on expose...
[21:11:46] <jepler> running gremlin itself I can't reproduce that expose/redraw/resize modify the view
[21:12:19] <psha> yes, i've introduced that bug later... :)
[21:12:36] <jepler> - def get_view(self): return 'z'
[21:12:36] <jepler> + def get_view(self): return 3 # assume perspective
[21:12:48] <jepler> this improves the dimensions display but ideally it would return the actual view of the moment..
[21:13:07] <psha> yes, i'll add propert return value to it later
[21:13:11] <jepler> OK
[21:13:23] <psha> i understand that many gremlins at same time is not 'good' use case
[21:13:48] <psha> but is it possible to set correct view mode from lat/lon on expose event?
[21:14:33] <psha> i've looked at set_viewangle function on glnav but is it doing all needed transformations?
[21:15:32] <jepler> - g = GremlinApp(argv[1])
[21:15:33] <jepler> + g1 = GremlinApp(argv[1])
[21:15:33] <jepler> + g2 = GremlinApp(argv[1])
[21:15:42] <jepler> I did this and I still don't encounter any problem with the views
[21:16:01] <Jymmm> feed it after midnight and try it then
[21:16:01] <jepler> if I rotate one and then expose or resize the other they both stay right
[21:16:05] <cradek> I kind of like the four views
[21:16:26] <psha> thanks so i need to review all noise on my working branch
[21:16:28] <cradek> having the DROs is silly in touchy though
[21:16:34] <psha> sorry for stupid questions :)
[21:16:44] <Jymmm> cradek: why's that?
[21:16:54] <psha> cradek: if i'll find how to disable them - there will be according property :)
[21:16:56] <jepler> Jymmm: there's the DRO right above the 4 gremlin dros
[21:17:03] <Jymmm> jepler: ah
[21:17:14] <cradek> yes five on the screen is approximately four more than needed
[21:17:29] <Jymmm> wel, xyz is always nice at a glance
[21:17:54] <jepler> psha: OK, I'll push the get_display_alpha fix and the get_view "fix" to master..
[21:18:03] <jepler> wow gremlin updates a ton faster than axis!
[21:18:12] <jepler> and on this nvidia system running emc2 as sim that's lightning fast
[21:19:40] <jepler> hm, I have a bunch of debug spew on my terminal. I wonder what it's from.
[21:19:41] <jepler> 30857halcmd30857halcmd30857halcmd30857halcmd30857y.decreasehalui.feed-override.countshalui.feed-override.count-enablehalui.feed-override.direct-valuehalui.feed-override.scalehalui.feed-override.increasehalui.feed-override.decrease
[21:20:18] <cradek> ha
[21:20:41] <psha> jepler: thanks
[21:20:56] <jepler> oh, I'm not where I expected to be -- EMC2 - 2.4.0~pre joints_axes
[21:21:37] <jepler> $ git checkout master
[21:21:37] <jepler> Already on 'master'
[21:21:42] <jepler> OK, now I'm really starting to feel puzzled
[21:22:02] <psha> :)
[21:22:02] <jepler> and argh, I see that I pushed some commits with the wrong name attached
[21:22:07] <cradek> just need to run configure?
[21:25:08] <jepler> well happily for me the debug spew seems to be gone
[21:25:10] <jepler> bbl
[21:40:10] <psha> at least i've found how to disable DRO :)
[22:03:35] <psha> cradek:
http://psha.org.ru/tmp/touchy-gremlin.png
[22:03:55] <psha> i've left one for example
[22:05:20] <psha> one gremlin is working perfect now
[22:05:41] <psha> many are still racing on redraw...
[22:28:39] <CIA-41> EMC: 03jepler 07master * r1e4346892456 10/src/emc/usr_intf/gremlin/gremlin.py: gremlin: implement required get_program_alpha
[22:28:41] <CIA-41> EMC: 03jepler 07master * r66bf760dcd5a 10/src/emc/usr_intf/gremlin/gremlin.py: gremlin: improve appearance of dimensions
[22:28:51] <jepler> psha: in your app or in gremlin.py minimally modified like I did earlier?
[22:28:52] <jepler> - g = GremlinApp(argv[1])
[22:28:52] <jepler> + g1 = GremlinApp(argv[1])
[22:28:52] <jepler> + g2 = GremlinApp(argv[1])
[22:29:20] <psha> in my app
[22:29:31] <psha> i've added properties to set different views (x, y, z, p)
[22:29:37] <psha> it's ok until i try to reload file
[22:30:08] <psha> then there is small race and some instances are ok and some have incorrect view
[22:30:13] <psha> it's common problem with opengl :(
[22:30:27] <psha> when you have more then one gl area in same window
[22:30:41] <psha> at least there are no textures :)
[22:31:03] <psha> if you miss context with texture functions you may get segfault
[22:39:52] <jepler> I'm sure not saying there's *not* a bug here
[22:40:55] <psha> bug is not correct word, i suspect simple race...
[22:45:13] <jepler> activate/deactivate methods are what is supposed to switch the opengl context at the right times
[22:45:32] <jepler> for axis/tkinter they end up calling glXMakeCurrent inside _togl.so
[22:46:11] <jepler> for gremlin/gtk they call gldrawable.gl_begin and I'm not familiar with what that actually does
[22:46:39] <psha> they have to use same glx functions
[22:46:39] <jepler> so it could be that my expectations about gldrawable.gl_begin are wrong, or that an activate call is missing somewhere, or something else...
[22:46:56] <psha> i'll check activate
[22:50:08] <jepler> yes, as we both suspected, ultimately gdk_gl_window_impl_x11_make_context_current calls glXMakeCurrent
[22:51:48] <psha> it seem that all rendering (except expose) are done under with_context decorators
[22:53:49] <jepler> gremlin.py Gremlin.expose does little more than call redraw_perspective or redraw_ortho which should get the decorated version
[22:56:20] <psha> adding decorator around Gremlin.load lowers number of incorrect views from 3 to 1 :)
[23:01:15] <psha> this may be my bug for 'y' view
[23:02:04] <psha> not for y, for x
[23:02:33] <jepler> oh! yeah that would probably be a good place for the decorator
[23:03:02] <psha> yes, issue is with set_view_x
[23:03:13] <psha> if i set other view (y,z,p) it's ok
[23:03:23] <psha> also in axis there is some additional gl code in set_view_x
[23:05:17] <psha> yea
[23:05:21] <psha> it's working now
[23:05:48] <jepler> set_view_* are making opengl calls too, so they must need @with_context
[23:06:19] <psha> nonono
[23:06:21] <jepler> no?
[23:06:31] <psha> they are called only within some other functions
[23:06:34] <psha> i think...
[23:06:38] <psha> but have to check
[23:06:54] <jepler> that would be the next problem, if there are ever nested functions both decorated @with_context
[23:07:32] <psha> two subsequent set context are harmless i think
[23:09:18] <jepler> probably true on linux, where activate does glXCreateContext and deactivate does nothing
[23:09:36] <jepler> reading the libgtkgl source I saw that gl_end frees a dc, so you could run into trouble there
[23:10:35] <psha> so better not to set too many decorators
[23:11:05] <jepler> not that I care whether any software I write has a hope of running on windows!
[23:12:00] <jepler> in axis, set_view_x is called in response to the user clicking a toolbar button or pressing a hotkey
[23:12:02] <JT-Hardinge> come on jepler you know you love winblows at heart LOL
[23:12:54] <psha> jepler: btw why there are two additional gl commands in set_view_x in axis?
[23:13:02] <psha> + glRotatef(-90, 0, 1, 0)
[23:13:03] <psha> + glRotatef(-90, 1, 0, 0)
[23:13:22] <jepler> let me be honest: no idea
[23:13:22] <psha> i've added this to gremlin for set_view_x and it's working better
[23:13:47] <psha> how many users of set_view_x in emc?
[23:13:51] <psha> axis, ...?
[23:13:54] <jepler> just axis
[23:14:18] <psha> maybe it's better to move this Magick Code (tm) into glnav directly?
[23:15:25] <psha> i'm fine with another copy of this hack in gremlin :)
[23:17:22] <jepler> looking at 6d0b2ca739a7f1eae0d3680310e7d72c83755e5b it seems that I just moved the wrong lines from axis.py to glnav.py
[23:17:32] <jepler> o.reset() / glRotatef()*2 should probably move
[23:18:44] <psha> yes
[23:18:55] <jepler> better to do that than put copies of the lines in gremlin
[23:18:56] <psha> it seem that theese glRotate's are just lost in transition
[23:20:02] <mhaberler> psha: hal_init() is history, all done through hanlder's__init__() including hal pins. a tiny reshuffle in gladevcp.
[23:20:26] <psha> mhaberler: good
[23:21:24] <jepler> psha: if you prepare me a branch with just gremlin/glnav bugfixes like the set_view_x and @with_context load changes, I'd be happy to merge it
[23:21:52] <jepler> at least I am guessing that the gladevcp/gremlin widget is going to take a little longer than those bugfixes alone
[23:22:03] <psha> ok
[23:23:11] <jepler> bbl, it's dinnertime here
[23:23:16] <jepler> psha: remember to quit *before* the sun comes up, eh?
[23:25:25] <psha> preparing :)
[23:26:46] <andypugh> jepler, could you spare a minute?
[23:27:05] <psha> btw this is all needed to integrade gremlin to gladevcp:
http://psha.org.ru/cgit/psha/emc2.git/tree/lib/python/gladevcp/hal_gremlin.py?h=gremlin-work&id=c24ba529f97032e0fad4782e8e8fe60e03341901
[23:27:10] <psha> :)
[23:28:05] <andypugh> I have been compiling gearchange.comp with comp --install with no trouble, I am now trying to get back to the 8i20 driver and finding that "make" fails, with some errors that I really don't understand.
http://www.pastebin.ca/2008152
[23:34:00] <SWPadnos> just to ask a silly question - can you still compile gearchange.comp?
[23:34:13] <SWPadnos> (in case something changed since the last time you tried)
[23:34:30] <SWPadnos> err, stupid me
[23:37:11] <psha> jepler: Gremlin.load is definitely needs with_context but it's also called from Gremlin.realize which is also under with_context decorator...
[23:38:29] <andypugh> SWPadnos: Is there an option to create docs or not? That might be the issue.
[23:38:50] <SWPadnos> you can try --compile (but that won't install)
[23:39:25] <SWPadnos> have you changed the doc strings in gearchange since the last time it worked?
[23:39:35] <andypugh> Hmm, I definitely get the out-of-date docs.
[23:39:49] <SWPadnos> yes, the new ones were never installed
[23:39:49] <andypugh> Looks like a problem with my doc formatting then.
[23:40:17] <SWPadnos> that's what it sounds like to me, a(nother?) python neophyte
[23:45:14] <andypugh> Other than closing all the quotes correctly I am stumped as to what could be wrong.
[23:46:48] <SWPadnos> any percents?
[23:47:20] <SWPadnos> I think you're supposed to be able to have anything you want between """, but I don't know for sure
[23:47:52] <SWPadnos> I don't know if you can put " characters inside a "normal" string, ie one delineated by single " instead of triple "
[23:47:59] <SWPadnos> dinner time here, bb
[23:48:00] <SWPadnos> l
[23:58:48] <psha> jepler: i've not added with_context to load since in stock gremlin it's called only once and only from realize
[23:59:02] <psha> branch is gremlin-fix
[23:59:37] <psha> http://psha.org.ru/cgit/psha/emc2.git/commit/?h=gremlin-fix&id=e01c51ad4b889c942db7dcaeaff00cddf8a3c442