#emc-devel | Logs for 2010-12-26

[09:04:17] <mhaberler> psha: hi!
[09:06:00] <psha> hi
[09:07:47] <mhaberler> now, what was the result of the pillow studies ?-)
[09:09:51] <psha> both toggle action and one-shot actions are needed
[09:10:06] <mhaberler> how come?
[09:10:28] <mhaberler> I currently set_active() as needed
[09:10:43] <psha> via emit i think
[09:10:54] <psha> hold on, i'll roll patch in a half an hour
[09:11:08] <mhaberler> btw: dumbo question: how do I get an event when the program ends (m2)? interp-idle?
[09:11:18] <psha> dunno :)
[09:11:22] <psha> i think yes
[09:11:42] <psha> interp-idle states that interp ends it work - via stop or program end
[09:13:26] <mhaberler> where do I connect that to?
[09:13:52] <psha> interp-idle?
[09:13:59] <mhaberler> which widget?
[09:16:02] <psha> don't catch question
[09:17:10] <mhaberler> ok. I my program I need a handler to be called on interp-idle.
[09:17:11] <mhaberler> connect(signame,handler) is a widget method
[09:17:13] <mhaberler> so the question is: which widget?
[09:17:27] <psha> GStat
[09:17:34] <psha> interp-idle is global state
[09:18:18] <mhaberler> you mean like foowidget.gstat,.connect(signame,hdlr)?
[09:19:08] <psha> yes
[09:19:13] <mhaberler> capito
[09:19:17] <psha> it's not available in glade though
[09:19:24] <mhaberler> yep, I see
[09:19:35] <psha> but if it's needed - simple Action wrapper on top of GStat may be added
[09:20:02] <mhaberler> that would be useful eventually, yes - I'll take in on the do-list
[09:28:07] <psha> check gladevcp-actions for ToggleAction
[09:32:38] <mhaberler> ok, gstat connect worked..
[09:34:36] <psha> i'm nearly ready with Stat widget for gldae
[09:35:06] <mhaberler> yes, we need to add this in a more sane way
[09:35:07] <mhaberler> currently you need to builder.get_object("<any action>").gstat.connect(signame,hdlr)...
[09:35:16] <mhaberler> quite a contraption ;-)
[09:35:38] <mhaberler> what's Stat supposed to do?
[09:36:55] <psha> nothing - just provide signals
[09:37:03] <mhaberler> I see
[09:37:33] <mhaberler> I need to do the test drive post breakfast... stomach walls caving in...
[09:39:39] <psha> pull
[09:39:45] <psha> ok
[09:57:26] <psha> bbl
[11:43:36] <mhaberler> is there a #5xxx parameter(s) which returns the current *absolute* machine position?
[12:35:26] <psha> mhaberler: have you examined gstat widget?
[12:35:52] <mhaberler> psha: yes, perfect - see mail
[12:36:04] <mhaberler> +/- perfect, that is;)
[12:36:16] <mhaberler> I am migrated..
[12:39:07] <psha> yes, saving actions is pointless
[12:42:49] <mhaberler> had to fix persistence.py; see http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/gladevcp-candidate
[12:42:51] <mhaberler> I would actually appreciate a critical review of the first 140 lines of persistence.py - it lacks style :-/
[12:42:54] <psha> btw in Actions don't fall into current save/restore checks - Adjustment, Scale, etc
[12:44:14] <mhaberler> dont think so; the widget list is a whitelist - see persistence.py select_widgets
[12:45:00] <mhaberler> ah, I see - on all widgets that might fail. WIll not to test that case.
[12:46:08] <psha> one point i see - exception in 'accessor' is a bit useless...
[12:46:11] <psha> i think )
[12:47:49] <psha> hm, maybe it's useful
[12:47:50] <mhaberler> by now: yes..
[12:48:52] <psha> i'd better return methods, not names in accessor
[12:48:59] <psha> this will simplify code a bit
[12:49:05] <psha> and None, None if it's not found
[12:51:11] <mhaberler> ah, ok - makes sense - drop getattr
[12:56:55] <mhaberler> looks better: http://git.mah.priv.at/gitweb/emc2-dev.git/blob/f427105a0c1848c9d69d8520631976c1418401c6:/lib/python/gladevcp/persistence.py
[13:01:06] <psha> why so many levels of exception checking?
[13:01:18] <psha> for example get_value/set_value _and_ in parent calls?
[13:01:42] <mhaberler> I toldya: it lacks style..
[13:02:02] <mhaberler> catch at lowest or highes level?
[13:02:03] <psha> i'd rather replace get_value with something:
[13:02:12] <psha> getter, _ = accessors(w)
[13:02:16] <psha> if not getter: return
[13:02:18] <psha> return getter()
[13:02:24] <psha> without any try's
[13:02:45] <psha> or even 'return getter and getter()'
[13:02:53] <psha> which is identical to previous statement
[13:03:03] <psha> so you'd rather get 'None' or value
[13:03:26] <psha> but i have to warn you that my coding style is strongly influenced by Maybe monad from haskell :)
[13:03:54] <mhaberler> oh, the famous Maybe monad.. WTF?
[13:04:57] <mhaberler> I like it. Code which isnt there cant break.
[13:09:06] <psha> Maybe is excelent idiom - it's either value or Nothing :)
[13:09:27] <psha> very useful to declare functions that may (not must) return value
[13:09:36] <mhaberler> yes, that makes sense
[13:09:50] <psha> in python it usualy simulated this by None value
[13:09:54] <psha> either None or some value
[13:10:13] <psha> in C it's NULL pointer, in java - null value
[13:11:53] <mhaberler> monad.. sounds very Leibnitz...
[13:18:12] <mhaberler> ok, looks better now. Even works. http://git.mah.priv.at/gitweb/emc2-dev.git/blob/14e930c37409a547671133915ce364f1bcc9fdcd:/lib/python/gladevcp/persistence.py
[13:24:01] <mhaberler> anyway, I'm running out of feeping creatures for the time being, I guess I have what I need
[13:24:03] <mhaberler> lets merge-plan: I need at least this evening to document and do examples
[13:24:04] <mhaberler> we could either do tomorrow or tuesday evening, am busy on wednesday
[13:33:30] <psha> so let it be either tomorrow
[13:34:01] <psha> or today if docs goes to wiki and not git
[13:43:42] <mhaberler> so you mean wiki update and merge should be same day, is that what you're saying?
[14:03:57] <psha> not should but may :)
[14:04:07] <psha> i feel i won't have enought time tomorrow
[14:05:52] <mhaberler> ok, I'll be back in about 2hrs and start on the wiki
[14:05:54] <mhaberler> maybe you can look over it later tonight
[14:05:55] <mhaberler> what's your timeframe for today?
[14:07:19] <psha> till 23:30 GMT+3 i think
[14:08:10] <mhaberler> ok, that looks doable, will ping you when I'm back
[14:12:18] <psha> ok
[16:43:01] <mhaberler> psha: I'm baack
[16:43:24] <psha> тшсу
[16:43:25] <psha> nice
[16:49:16] <mhaberler> do we have an example for an action which brings its own label/tooltip, ro an ActionGroup? I dont quite see where the latter might make sense
[16:49:54] <mhaberler> do we stay with 'HAL widgets' ;-?
[16:50:12] <mhaberler> there are few HAL-free by now
[16:50:35] <psha> ActionGroup?
[16:50:45] <mhaberler> just skimming the gtk manual
[16:50:59] <psha> i've not found use cases for it besides UI Manager
[16:51:07] <mhaberler> ok
[16:52:05] <psha> action with it's own label/tooltip - ESTOP action with tooltip from axis :)
[17:04:16] <mhaberler> why cant I associate a G-code ngc file with an EMC Action Run widget?
[17:05:04] <psha> it's impossible :)
[17:05:14] <mhaberler> ha? what?
[17:05:24] <psha> run actions just runs currently loaded program
[17:05:34] <mhaberler> Because you say so?
[17:05:47] <psha> consulte code if you wont' believe me :)
[17:05:56] <mhaberler> I'm saying: "optionally" load an ngc file and run it
[17:06:23] <psha> that's not 'why cant I associate' :)
[17:07:05] <mhaberler> Ok. since you're bugging me. How do I load a f...g ngc file with an action?
[17:07:17] <psha> i think it's not possible yet :(
[17:07:25] <psha> why?
[17:07:39] <psha> i really want to retain compatibility with axis filters
[17:07:58] <psha> i've created filechooser derivative with support for filters but it's not landed yet
[17:08:30] <mhaberler> well, think outside the touchy/Axis box: maybe there's a canned app which just has the capability to run a couple of predefined ngc files and basta..
[17:09:03] <psha> that's good use case
[17:09:16] <psha> but then you don't need pause/resume buttons?
[17:09:36] <mhaberler> that's optional I'd say
[17:10:12] <mhaberler> and we have the gcode parse() method, isnt that what we need?
[17:10:29] <psha> i think load/run action deserves it's place under the sun but as derivative of simple RUN action
[17:10:56] <psha> gcode parse is not needed - just ask EMC to load file
[17:15:03] <mhaberler> whatever class derivation makes you happy
[17:15:05] <mhaberler> that would be emc.command.program_open() I'd assume
[17:15:22] <psha> yes
[17:15:42] <psha> i mean current RUN actions are fine without loading gcodes
[17:15:57] <mhaberler> sure
[17:16:43] <psha> but don't you think that 'load' button is better?
[17:17:00] <psha> that loads arbitrary file (may be fixed at interface creation)
[17:17:28] <psha> so running fixed file will be done in two steps - load file with fixed button, check via backplot and then hit 'run'
[17:17:31] <psha> ?
[17:17:46] <mhaberler> why do I have to load it explicitely?
[17:17:48] <mhaberler> there should be a way to press a button, and it executes a given file if told to do so
[17:17:59] <mhaberler> need to cover the simple case
[17:18:37] <psha> i'm not specialist in machine safety but i believe that two stage run will lower chances to run incorrect file
[17:19:20] <mhaberler> you are stubborn geek
[17:19:22] <mhaberler> maybe somebody comes up with a UI which has no relation to g-code whatsoever, like JT's sausage smoker
[17:19:52] <psha> consider JT's smoker - it has two operations
[17:20:13] <psha> smoke sausage and shred everthing around in 2m radius
[17:20:26] <psha> second one is useful too - to clean workspace for example
[17:20:45] <mhaberler> 1. probe sausage wether it fits in smoker
[17:20:47] <mhaberler> 2. smoke the s...t out of sausage
[17:21:12] <psha> so you place sousage in smoker and press... 2!
[17:21:25] <psha> you loose you dinner!
[17:21:29] <mhaberler> excellent. Now the smoker has 2 buttons: 'Probe Sausage Caliber' and 'Smoke"
[17:22:10] <mhaberler> it has no 'Load Probe Sausage .ngc File" button
[17:24:03] <psha> yea, it has 'Probe' and "smoke' buttons
[17:24:05] <mhaberler> The JT Smoker doesnt sport a G-Code preview window
[17:24:12] <psha> and extra 'do what i said!' button
[17:24:41] <mhaberler> man, that's so sixties, like loading a deck of cards, and the push 'Execute'
[17:25:00] <psha> )
[17:25:01] <mhaberler> 80-column
[17:25:27] <mhaberler> I sincerely suggest we give the user enough rope to hang herself.
[17:26:24] <psha> sure :)
[17:27:20] <psha> but i'd really leave this thing not excessively advertised :)
[17:27:32] <psha> or you'll have tons of hanged users :)
[17:27:52] <mhaberler> but people have the right to own guns as well.
[17:28:01] <mhaberler> at least in the colonies
[17:28:18] <psha> send to you as silant reproach
[17:31:36] <mhaberler> this I dont understand
[17:34:41] <psha> don't mind :)
[17:38:29] <psha> so let's add it in next patch series
[17:38:40] <mhaberler> chicken!
[17:58:11] <mhaberler> q: mode signals like mode-mid,mode-auto - these are emitted when emc transitions into this mode, right?
[18:07:49] <mhaberler> psha: mdi-command-start and mdi-command-stop only available with EMC_ToggleAction_MDI, right?
[18:10:52] <psha> yes
[18:11:01] <mhaberler> ok
[18:11:12] <psha> also it enables/disables button for free )
[18:11:19] <mhaberler> yep
[18:12:11] <psha> Action is a sort of 'one shot' action
[18:12:16] <mhaberler> ok, see http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?GladeVCPprogramming
[18:12:18] <mhaberler> 'Extending....HAL value change events'
[18:12:21] <psha> ok
[18:19:00] <mhaberler> psha: I'm editing this as you read..
[18:21:09] <mhaberler> I'll start a new page for ActioWidgets - this bloats too much
[18:22:02] <psha> ok
[18:22:55] <psha> there is one extra signal
[18:23:15] <psha> syntethic
[18:23:24] <mhaberler> explain
[18:23:40] <psha> interp-run
[18:24:11] <psha> it indicates that interp switched from idle to one of active states
[18:24:25] <psha> pause, reading or waiting
[18:24:44] <psha> it's not represented in EMC by sepearate state flag
[18:24:54] <mhaberler> I see
[18:25:22] <mhaberler> do I need to document that?
[18:28:27] <mhaberler> do I get this right: no Action has a direct UI appearance - just in association with a button, correct?
[18:29:33] <psha> yes
[18:29:52] <psha> Action is backend for UI
[18:30:07] <psha> but you may attach any UI you want - menu, toolbutton, button,...
[18:30:17] <mhaberler> hm, EMC Stat is an 'Object', not an 'Action', but I'll subsume it there anyway
[18:35:00] <psha> yes
[18:45:50] <mhaberler> could you do a screenshot of the glade HAL Python section only ? I have run-in-place and the icons of meter and graph are missing..
[18:49:19] <psha> i'm running RIP too :)
[18:49:30] <psha> oh, there are no icons for graph and meter
[18:50:25] <mhaberler> I see, it's a feature
[18:55:43] <mhaberler> please start thinking about text for http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?ActionWidgets
[18:55:45] <mhaberler> sections "EMC Action widgets" and "EMC ToggleAction widgets"
[18:57:42] <awallin> the usual "nist-logic" has one button to switch something on, one button to switch it off, and one indicator "is-on" to tell the state
[19:02:45] <psha> awallin: which is represented with 'toggle button' :)
[19:03:37] <awallin> right. if you are running multiple UI's the toggle button should respond to state-changes by other UIs too...
[19:03:53] <psha> that's why gtk Actions were added
[19:04:44] <psha> they are driven by changes in global EMC state
[19:04:56] <psha> so you may place 100 ESTOP buttons and they will behave just like one
[19:05:47] <awallin> sounds good. this will go in the direction of a completely modular emc2-gui ?
[19:06:04] <psha> i hope so
[19:06:08] <psha> but the way is very long...
[19:06:32] <psha> currently there are only ESTOP, ON/OFF, run, pause, stop and MDI command actions
[19:07:04] <psha> important things are program listing, loading file with filters and error reporting
[19:14:14] <mhaberler> psha: do we have foreign hal component pins yet?
[19:14:40] <psha> not yet
[19:14:46] <mhaberler> Ahem.
[19:15:42] <psha> i'm preparing candidate actions branch
[19:15:56] <mhaberler> Was this a "yes, I will do it"?
[19:18:04] <mhaberler> daditdadit,dahadida
[19:19:51] <mhaberler> psha: bug: ActionMDI stays active when G-code program is running
[19:22:14] <psha> fixed
[19:22:30] <psha> check gladevcp-actions2 branch
[19:22:34] <mhaberler> not bad.. turnaround time: 190seconds ;-)
[19:26:52] <psha> :)
[19:34:26] <mhaberler> approved ;-)
[19:35:25] <psha> ok
[19:35:30] <mhaberler> psha: I understand I may document foreign hal component pins in Action MDI command and they will work when merged?
[19:35:45] <psha> you may mark them as TODO
[19:35:48] <mhaberler> like component.pin?
[19:35:54] <mhaberler> ooooooohhhhhh..
[19:35:55] <psha> and i'll add support for them in next patchset
[19:36:11] <psha> unfortunately my report ate most of my time today
[19:36:28] <mhaberler> ah, scientific endeavours 'n such
[19:37:20] <psha> heh, scientific... another try for grant...
[19:38:53] <psha> so i've to pick fixes from combobox-fix branch?
[19:40:39] <psha> hm
[19:40:41] <psha> i've lost
[19:41:17] <psha> may you push new branch? :) all your branches (combobox-fix, candidate) has my gladevcp-actions branch merged :)
[19:41:30] <psha> push branch with only needed fixes
[19:46:00] <mhaberler> hold on...
[19:47:01] <mhaberler> while I do this, please contribute some text as requested here: http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?ActionWidgets
[19:47:03] <mhaberler> I wont touch the wiki page until you tell me you#re done ;-)
[20:09:10] <mhaberler> ok, my repo branch gladevcp-combofix should be it
[20:09:12] <mhaberler> I would love to slide in the abort patch but jepler might nootice ;-)
[20:09:59] <mhaberler> psha: methinks you're suffering writers block again on ActionWidgets
[20:11:45] <psha> oops :) forgot to tell you that i was afk :)
[20:11:58] <mhaberler> no.
[20:12:07] <mhaberler> I dont buy it
[20:15:12] <psha> aaa, grasping explioter! no chance to rest, no chance to eat, and i'm not talking about short sleep!
[20:15:15] <psha> :)
[20:15:53] <mhaberler> have a drink
[20:16:28] <mhaberler> honestly, a good explanation why we need one-shot and toogle would be helpful
[20:16:30] <mhaberler> explain it to me and I'll explain it to the wiki
[20:18:16] <psha> yes, adding it
[20:24:16] <psha> i've added a bit about toggles
[20:25:25] <mhaberler> ok
[20:25:27] <mhaberler> when would I use one-shots?
[20:25:33] <mhaberler> *at all*, that is?
[20:28:06] <psha> 'stop' may be simple action, not toggle
[20:28:24] <psha> but i've make it toggle too to retain visual compatibility with axis
[20:29:16] <psha> also 'step' action is not toggle
[20:29:30] <psha> added a bit for simple actions
[20:29:39] <mhaberler> super, thanks
[20:30:27] <mhaberler> whazza ToggleToolButton?
[20:31:04] <psha> ESTOP button in axis
[20:31:14] <psha> it's toggle button in Toolbar
[20:31:27] <mhaberler> uhum
[20:31:39] <psha> combofix has only one patch?
[20:31:52] <psha> great
[20:32:16] <psha> pused gladevcp branch
[20:32:35] <mhaberler> yes, collected wisdom of many days
[20:32:40] <psha> :)
[20:33:18] <psha> jepler, cradek: anyone around?
[20:34:16] <psha> mhaberler: it seem that we'll have another day for testing :)
[20:34:33] <mhaberler> I fear so. Emc unplugged ;-)
[20:34:55] <psha> christmas was too merry? :)
[20:35:24] <mhaberler> Oh. We can do foreign components and 'load files', and even test it.. wouldnt that just be wunderful
[20:35:47] <psha> :))
[20:43:40] <psha> bb
[20:45:10] <mhaberler> cu