#emc-devel | Logs for 2009-12-28

[03:55:35] <CIA-62> EMC: 03jepler 07master * rfa9a4b0a7897 10/tests/ (24 files in 12 dirs): var files are not needed in these tests
[03:55:45] <CIA-62> EMC: 03jepler 07master * re5df50502cb8 10/tests/ (12 files in 6 dirs): tbl files are not needed in these tests
[03:55:46] <CIA-62> EMC: 03jepler 07master * r7b8ca1776f19 10/tests/ (12 files in 12 dirs): indicate when rs274 exits with an error
[16:13:50] <cradek> fwiw, #<rad>=1 #<ang>=33, g0@#<rad><#<ang> does work
[16:13:54] <cradek> jepler_: ^
[16:38:22] <jepler_> good
[16:56:42] <cradek> bugs me to use < for two different things (with neither of them being "less than", but that's beside the point)
[16:57:12] <SWPadnos> how about a colon or something instead?
[16:57:14] <cradek> I could use any other character there, but it wouldn't be like autocad (and clones?) anymore
[16:57:21] <SWPadnos> (the colon isn't otherwise used, is it?)
[16:57:25] <SWPadnos> heh
[16:57:57] <SWPadnos> given that you can't (I presume) copy autocad coed into EMC and run it, that doesn't seem like it should matter much
[16:58:16] <SWPadnos> I can see how it would matter when your fingers automatically start typing things a certain way though
[16:59:26] <cradek> it's the ascii character that looks most like the angle symbol
[16:59:35] <SWPadnos> yeah, I had noticed that
[16:59:45] <cradek> and the @ is kind of round...
[17:00:13] <SWPadnos> kind of
[17:00:37] <cradek> it could be two characters: /_
[17:00:40] <cradek> hahaha
[17:00:51] <SWPadnos> err - yay! :)
[17:01:10] <cradek> that's the symbol I want, but my keyboard doesn't have it...
[17:01:23] <SWPadnos> U+something
[17:01:30] <cradek> U+&ang;
[17:02:08] <SWPadnos> so g0@rU+&ang;t
[17:02:19] <cradek> we don't use / yet do we?
[17:02:29] <SWPadnos> only for math
[17:02:33] <SWPadnos> AFAIK
[17:02:39] <cradek> oh right, math
[17:02:41] <cradek> forget it
[17:05:10] <cradek> ^ is unused
[17:06:00] <cradek> using < that is unmatched by > is a curse forever upon people who think gcode editors should have colors
[17:06:06] <SWPadnos> indeed
[17:06:40] <cradek> ^ is unused because gcode spells ^ **
[17:06:47] <SWPadnos> be daring, use a |
[17:07:45] <cradek> why is that daring?
[17:08:13] <SWPadnos> because it has the potential to wreak havoc on scripts and command lines that have G-code on them :)
[17:09:19] <cradek> worse, \
[17:09:25] <SWPadnos> heh, yeah
[17:09:45] <cradek> arg
[17:09:49] <cradek> I don't know what to do
[17:10:06] <SWPadnos> I do think that something other than the < would be better
[17:10:30] <SWPadnos> due to both the overloading and the fact that it's "normally" matched to a >
[17:11:24] <SWPadnos> I'd be happy with '#' or ':', and probably others as well
[17:11:35] <cradek> can't be #
[17:11:51] <SWPadnos> oh, is that the optional block delete or something?
[17:12:23] <cradek> no, it's how variable names start
[17:12:29] <SWPadnos> oh, duh
[17:12:34] <cradek> block delete is / (ugh)
[17:12:40] <SWPadnos> is ! used?
[17:12:44] <cradek> !?!?
[17:12:55] <cradek> (no)
[17:13:02] <cradek> I could also use @ a second time
[17:13:05] <cradek> @r@t
[17:13:11] <SWPadnos> that actually makes some sense though, since / is often "not" in schematic/signal notaions
[17:13:35] <SWPadnos> too bad we can't use letters over
[17:13:55] <SWPadnos> since @Rxx.xTxx.x would make a lot of sense
[17:14:28] <SWPadnos> and would also theoretically let you specify e.g. the radius once and then step through the angles
[17:14:29] <cradek> I could actually do that, but I don't want to
[17:15:00] <cradek> I think it's worse - more magic
[17:15:18] <SWPadnos> yes, it's definitely worse at the moment
[17:15:30] <cradek> I could do @R,T
[17:16:22] <SWPadnos> one control I saw had a more or less context aware parser, so there might be an M code with A, B, I and J, and also another code that used one or more of those letters on the same line
[17:16:31] <SWPadnos> yeah, the comma makes sense too
[17:16:50] <SWPadnos> too bad parens are used for comments, since @(r,t) would be mathematically acceptable too
[17:17:46] <cradek> we have {} available but I would rather not have another syntax
[17:17:54] <SWPadnos> nope
[17:18:08] <cradek> I like that @< is key-value-key-value just like the rest of the normal words
[17:18:33] <SWPadnos> except that the < "key" already has a meaning
[17:18:47] <cradek> yeah in other contexts it's part of a syntax
[17:40:55] <jepler_> jepler_ is now known as jepler
[18:05:26] <cradek> http://timeguy.com/cradek-files/emc/touchy-polar-mdi.png
[18:06:25] <cradek> ^ (possibly bad idea)
[18:09:57] <SWPadnos> is the ->1 the radius?
[18:33:50] <alex_joni> °
[18:34:07] <alex_joni> the german keyboard has a degree key
[18:34:41] <skunkworks> cradek: I so love the reference to acad..
[18:37:44] <alex_joni> hmm, seems it was missing from ASCII 7-bit, but was added in latin-1 in 1987
[18:39:54] <alex_joni> cradek: how about % ?
[19:38:44] <cradek> I changed it to ^
[20:37:54] <CIA-62> EMC: 03micges 07master * r141cbba38fe2 10/src/emc/usr_intf/axis/scripts/axis.py: Fix last fix of touch off window
[20:41:39] <jepler> now that I reconsider that code, it looks like you should have just one 'if' with an 'or'
[20:41:58] <jepler> because now the elif case will leave the defaultsystem as T, which is problably just as wrong in that case
[20:42:19] <jepler> I assume the problem you fixed was losing the last G5x coordinate system when you were on the wrong axis and had no tool
[20:52:16] <micges> you're right
[20:53:40] <CIA-62> EMC: 03cradek 07master * r6bfbe806a0d7 10/ (7 files in 2 dirs): Allow use of polar coordinates in @radius^angle format in place of X,Y
[20:53:42] <CIA-62> EMC: 03cradek 07master * r71319f3615a0 10/src/emc/usr_intf/touchy/ (mdi.py touchy.glade touchy.py): polar coordinate support for touchy
[21:00:41] <CIA-62> EMC: 03micges 07master * r98b244d5ed4e 10/src/emc/usr_intf/axis/scripts/axis.py: Another fix for touch off
[21:12:48] <CIA-62> EMC: 03micges 07master * r74ce25ac44d7 10/ (13 files in 13 dirs): make sure that canon path control mode is equal motion path control mode
[21:29:18] <micges> jepler: SF bug #2891275, is cradek' soulution to this is ok?
[21:29:41] <micges> (it's in description)\
[21:34:09] <jepler> I'd just like to take this moment to note that (A) I hate the sf bug trackers and (B) it still hasn't loaded for me
[21:34:47] <micges> https://sourceforge.net/tracker/?func=detail&aid=2891275&group_id=6744&atid=106744
[21:35:31] <jepler> micges: I have no idea. cradek's statement is vague and hand-wavy.
[21:35:50] <cradek> :-P
[21:36:02] <cradek> there was more context iirc
[21:36:20] <jepler> and what is the path from sf.net/projects/emc to the tracker, anyway?
[21:36:37] <jepler> I see that once you get to that page there's a not-a-tab for tracker, but at the front page that not-a-tab isn't listed
[21:37:10] <jepler> ugh, now you've got me on an "I hate sf" tangent :(
[21:37:17] <jepler> did I mention how ugly the tracker is?
[21:37:52] <micges> very?
[21:37:56] <jmkasunich> nice tangent
[21:38:55] <jepler> my own log of that day's IRC: http://emergent.unpy.net/files/sandbox/emc-devel-2009-11-02.log
[21:39:00] <micges> hi jmkasunich
[21:39:05] <jmkasunich> hi
[21:39:13] <jepler> I notice the real bug in that bug is that it is assigned to jmkasunich
[21:39:18] <jepler> :-P
[21:39:26] <jmkasunich> * jmkasunich runs away
[21:40:05] <cradek> I think they finally gave up on searchable mailing list archives - or at least it's totally hidden now
[21:40:47] <jepler> cradek: https://sourceforge.net/search/?group_id=6744&type_of_search=mlists
[21:41:08] <cradek> how did you get there?
[21:41:34] <jmkasunich> teleportation
[21:41:39] <jepler> if you can get to a page where "tracker" and "mailing lists" appear on the not-a-list-of-tabs, hover "mailing lists" and click "search"
[21:42:18] <cradek> http://sourceforge.net/mailarchive/forum.php?forum_name=emc-users
[21:42:26] <micges> to get that page: main window -> develop
[21:42:35] <cradek> this is where the person I was trying to help ended up (when searching for info on a different project)
[21:42:49] <cradek> bbl
[21:43:11] <jepler> if you can guess to hover Mailing Lists on that page you get search
[21:43:20] <jepler> "1 message has been excluded from this view by a project administrator." wtf
[21:44:12] <micges> jmkasunich: got a moment?
[21:45:53] <jmkasunich> micges: go ahead
[21:48:07] <micges> I was thinking (few times) about adding support for callbacks functions to hal pins, I can handle implementation but I have hard time to guess whole logic
[21:48:31] <jepler> I saw that idea go by the other day, and I have to say I don't think it makes sense
[21:48:49] <jmkasunich> please clarify "callback functions"
[21:49:02] <jepler> hal is based on read inputs - do calculations - write outputs
[21:49:21] <jepler> if an individual component wants to short-circuit something when inputs don't change, then it caches the old input and does an inexpensive comparison
[21:49:25] <micges> function that must be called on pin value change
[21:50:04] <micges> I was thinking rather about userspace python modules
[21:50:34] <jmkasunich> userspace and realtime modules are completely different
[21:51:04] <jmkasunich> for realtime callbacks make no sense at all - and most HAL modules are realtime, so that is what I thought you were talking about
[21:52:08] <jmkasunich> for userspace it might make more sense - userspace programs tend to use callbacks rather than polling for lots of things, it might be nice if hal pin changes were "events" just like mouse clicks and such in a gui program
[21:52:35] <jepler> there's still nothing a userspace program can do but check 'does new value equal cached value'
[21:52:44] <jepler> but you can sure write something in Python to encapsulate that
[21:53:09] <jepler> my first instinct would be to write it as a Python class of its own, instead of adding it to the python hal module
[21:53:29] <jmkasunich> jepler: how does py/tk (or whatever) handle things like mouse click events?
[21:53:49] <jepler> jmkasunich: each GUI library has a different "main loop"
[21:54:14] <jepler> that "main loop" typically has a way to say "call this function aproximately every 100ms" or "call this function when idle"
[21:54:23] <jmkasunich> does the main loop poll? and then implement something that looks event driven to the rest of the program
[21:54:50] <jepler> GUIs all end in select(), because events come from the X server over a socket; the program blocks until a timer runs out or an event is available
[21:55:06] <jmkasunich> ok, so they don't poll - they use select
[21:56:04] <jepler> right
[21:56:16] <jepler> but if you have a 'do when idle' then the GUI event loop calls that before entering select
[21:56:25] <jepler> and if you have a 'do after 100ms' then the GUI sets a time limit of 100ms for the select
[21:56:34] <jmkasunich> unfortunately hal pins are asynchronous, so the only way to detect changes is to poll
[21:57:28] <alex_joni> yay stack smashing
[21:57:56] <jmkasunich> ?
[21:58:13] <alex_joni> working on a program, and it barfs
[21:58:59] <jepler> the python code would look something like this: http://pastebin.ca/1729951
[21:59:06] <alex_joni> jmkasunich: http://pastebin.ca/1729950
[21:59:29] <jepler> so you'd construct a RunOnChange with the hal component, the pin name (which must already have been created and set to its initial value), and the function to call when it changes
[21:59:49] <jepler> then you arrange for the poll method of that object to be called from time to time; if the value does change, it calls func with the old and new values
[21:59:54] <jepler> (untested, of course0
[21:59:57] <jepler> s/0/)
[22:00:11] <jmkasunich> micges has been very quiet....
[22:00:49] <jmkasunich> if this is what he is asking about, I have no opinion - I don't see it as any fundamental change to HAL, it is just a technique that can be used by a userspace HAL program
[22:00:53] <jepler> If you have a very large number of pins then you'll want to arrange to run a bunch of poll()s from the same GUI callback. That way, you'll have one callback every 100ms instead of 100 callbacks that eventually stagger themselves to be on each millisecond
[22:01:05] <jepler> jmkasunich: yeah, it's just a useful abstraction for a component to use
[22:01:58] <jmkasunich> pyvcp does something like that now, doesn't it?
[22:02:12] <jmkasunich> (sorry, too tired/lazy to look - recovering from flu)
[22:02:19] <jepler> and halui would benefit from it in C++
[22:02:56] <jepler> same here (lazy that is)
[22:03:36] <jmkasunich> I know GTK has that "run this every x ms" call, and the original C vcp used it, so it would know when to redraw the color of an LED
[22:05:31] <jepler> ooh, 4pm, time to bail from the ofifce
[22:06:06] <jmkasunich> time to venture out into the snow and find cough drugs
[22:06:19] <jmkasunich> micges - hope we answered? your question
[22:08:06] <micges> still reading.... :)
[22:08:57] <jmkasunich> bbl
[22:10:23] <SWPadnos> it seems to me that the usefulness of a callback would be to decrease the (expected) response time
[22:10:49] <SWPadnos> so putting a "check the input(s) and act like it's an event if it/they changed" doesn't help much
[22:11:25] <SWPadnos> except that it may save some computation since it would avoid doing some calculations that may now be done every time through that loop
[22:13:17] <micges> I was hoping to do that at lower level (in c)
[22:13:46] <micges> I was hoping to save computation time and not decrease response time
[22:14:08] <SWPadnos> that is probably very difficult, since there's no standard "event interface", unless you count select/poll
[22:15:35] <micges> but it was cool to see others point of view
[22:19:30] <alex_joni> how come a project starts really simple, but when you're at 80% it's quite complicated
[22:19:55] <alex_joni> started out as a 2-3h thing, and now I'm at 3600 LOCs
[22:29:23] <jepler> compared to human response time you will be simply unable to measure the impact of doing the 'if new != old' test in C vs Python
[22:33:53] <jepler> 1 million iterations take under 1 second on my 2.2GHz machine: http://emergent.unpy.net/files/sandbox/comparison-microbenchmark.py
[22:34:41] <jepler> er, I guess that's 2 million poll() calls since I call twice per loop
[22:53:38] <micges> I see
[22:56:11] <micges> thanks for clearing the subject