#emc-devel | Logs for 2007-05-23

Back
[00:31:40] <jmkasunich> hi guys
[00:31:41] <SWPadnos> hey petev, have you seen the latest on mesa FPGA configuration?
[00:31:44] <SWPadnos> hi jmk
[00:31:47] <SWPadnos> funny :)
[00:32:32] <jmkasunich> regarding either printing G-code ref cards, and/or Live CDs - I'll pitch in a little for that
[00:32:52] <SWPadnos> word to the wise: don't buy any Tyan products off eBay. they treat auction purchases as out of warrantee, regardless of age
[00:32:55] <cradek> which do you think?
[00:33:05] <jmkasunich> not sure
[00:33:12] <SWPadnos> I'd like some of both, I think
[00:33:23] <SWPadnos> I'm willing to chip in $20 - $50 or thereabouts
[00:33:28] <jmkasunich> to be honest, I bet you could _sell_ the g-code reference cards for a buck apiece and have plenty of takers
[00:34:11] <SWPadnos> as long as they're nicely laminated, and probably punched for a ring or magnet or something
[00:34:30] <jmkasunich> right
[00:34:41] <jmkasunich> http://cgi.ebay.com/Machinists-Speed-Feed-Calculator-CNC-Mill-Tooling_W0QQitemZ230124914455QQihZ013QQcategoryZ104242QQssPageNameZWDVWQQrdZ1QQcmdZViewItem
[00:34:48] <jmkasunich> the equivalent of that
[00:34:50] <jmkasunich> for g-code
[00:35:13] <SWPadnos> yep
[00:36:50] <jmkasunich> last year I had printed copies of the HAL manual, and sold maybe 6-8 at $5 each - thats much more of a niche item than the card
[00:37:16] <jmkasunich> I wasn't even trying to sell them, people sought them out (I think after attending one of ray's talks)
[00:37:53] <SWPadnos> unfortunately, G-code is slightly niche, since everyone has extensions to it ...
[00:38:04] <SWPadnos> but I do think a G-code ref card would be more popular
[00:38:05] <jmkasunich> well obviously se
[00:38:13] <jmkasunich> we're gonna cover our dialect
[00:38:39] <SWPadnos> heh.
[00:38:42] <SWPadnos> I knew that ;)
[00:38:44] <jmkasunich> I don't expect hardcore mach users to want to use a g-code card with "linuxcnc.org" printed right on it ;-)
[00:39:02] <SWPadnos> especially if we don't document G10 and G11 (and on and on)
[00:39:02] <jmkasunich> "oh, free software cooties, can't touch that"
[00:39:06] <SWPadnos> heh
[00:39:53] <cradek> [insert troll here]
[00:40:04] <cradek> typetypetypetypetypetypetypetypetype control-U
[00:40:14] <jmkasunich> what are you trolling about?
[00:40:30] <cradek> non-free software
[00:41:52] <jepler> just make sure and put a note that the viral GPL infects the g-code files they produce while using the card
[00:42:24] <cradek> trollllll
[00:43:03] <SWPadnos> viruses! get penicillin (tm)
[00:44:22] <jmkasunich> has anybody looked into lamination costs?
[00:44:35] <jmkasunich> (I assume thats the most expensive part of making the cards)
[00:44:38] <SWPadnos> I tried, but couldn't find prices on the Kinkos site
[00:44:54] <SWPadnos> I'm sure it is. copies are $0.05 each or thereabouts
[00:45:07] <SWPadnos> a bit more on card stock
[00:45:11] <jmkasunich> I have staples and office max both within 2 miles of home, I'll check their sites
[00:45:41] <jepler> ingrid told me officemax here charges $0.99 per sheet for lamination; she couldn't tell me if they had a discount for quantity
[00:47:12] <jmkasunich> I wonder how big the card would have to be
[00:47:39] <jmkasunich> 11x4.25? 8.5x3.67?
[00:48:34] <jepler> this was for letter sheets
[00:48:39] <jepler> (I think)
[00:48:55] <jmkasunich> I was thinking cutting after lamination, but that won't work, you need some edge seal
[00:49:02] <cradek> the gcode quick ref is probably too much information for less than letter size
[00:49:18] <jepler> it makes a pretty full sheet of paper
[00:49:23] <jmkasunich> ok
[00:49:48] <jepler> could be put on both sides of a half-letter page
[00:49:50] <jepler> I suppose
[00:49:53] <SWPadnos> the local Kinko's is $1.79/sheet for lamination (in 50-100 qty), and $0.25 - $0.37 for 2-sided printing on card stock
[00:50:43] <cradek> I'll take 1, maybe 2 :-)
[00:50:49] <SWPadnos> heh
[00:51:01] <jmkasunich> I'm calling the local stapes - their site suck
[00:51:05] <SWPadnos> if we really wanted 100 of them, we could buy a laminating machine ;)
[00:51:27] <SWPadnos> I have no stapes, you insensitive clod!
[00:51:30] <SWPadnos> :)
[00:51:47] <mschuhmacher> fine night all
[00:51:51] <SWPadnos> good night
[00:52:02] <jmkasunich> staples is a buck a sheet, no price breaks for quantity
[00:54:38] <SWPadnos> well, it's $1.99 / sheet at the Staples here, so that's a good deal
[00:55:00] <SWPadnos> plus $0.09/side for B+W copying, I didn't bother checking on the charge for card stock
[00:56:59] <jmkasunich> office max: $1 page, $0.24 per sheet (both sides) to print B/W on card stock
[00:57:20] <jmkasunich> color printing (on plain paper) is $0.80 per side - we don't want that
[00:58:03] <jmkasunich> they have a roll lamintor, 2ft wide, and charge $2 per linear foot, so if you were doing smaller things you could save quite a bit
[00:58:23] <jmkasunich> 6x11 would easily go 3 across, 5x11 would go 4 across
[00:58:48] <jmkasunich> although we'd have to cut them apart afterwards
[00:59:06] <SWPadnos> that's OK, as long as the punched hole is already there before lamination (and oversized)
[00:59:19] <jmkasunich> hmm
[00:59:35] <SWPadnos> interesting: http://www.ctlaminating.com/Pages/ReferenceCardsAndCharts.html
[00:59:37] <jmkasunich> getting the hole in the paper would be a problem
[00:59:43] <SWPadnos> just make the ref card out of plastic ...
[01:00:30] <jmkasunich> no online pricing?
[01:00:33] <SWPadnos> no :(
[01:00:57] <jmkasunich> I wonder if they're still answering their phone?
[01:01:04] <jmkasunich> if they're retail, maybe
[01:01:18] <SWPadnos> probably not, they're in Connecticut
[01:01:29] <SWPadnos> it's after 9:00 here
[01:02:01] <jmkasunich> here too, I think I caught the office-max gal as she was closing
[01:02:17] <SWPadnos> yeah. it seemed the same when I called the local Staples
[01:02:39] <jmkasunich> you willing to do a little research tomorrow?
[01:03:00] <SWPadnos> I think so, thought I've been wasting^Wspending a lot of time looking into CD duplication as well :)
[01:03:29] <jmkasunich> well, we have a lower limit of $1.24 for 8-1/2 x 11
[01:04:03] <jmkasunich> regarding the hole - we can print a diagonal line at the top corner of the page, and tell them "stick the stack on a paper cutter and cut on this line before you laminate"
[01:04:04] <SWPadnos> I can check with a local printer I've used before, but I suspect they'll only be competitive for larger quantities
[01:04:19] <jmkasunich> that will leave enough space to punch a hole in the lamination
[01:04:22] <SWPadnos> yep
[01:05:26] <jmkasunich> I'm willing to finance $20-50 bucks as well... if we get several people to pitch in, 100 cards won't be at all out of reach
[01:05:52] <SWPadnos> I'd hate to spend more on a single reference card than a color printed CDR with jewel case though
[01:05:55] <SWPadnos> it would just be annoying
[01:06:10] <jmkasunich> how much are the cds?
[01:06:25] <SWPadnos> I've found them for ~1.25 or thereabouts in 100 quantity
[01:06:29] <jmkasunich> wow
[01:06:46] <jmkasunich> thing is - the CD will be used once (to install) and then quickly become obsolete
[01:06:49] <SWPadnos> duplicated, color printed, and in a jewel case (I think - I've looked at a lot of sites)
[01:06:51] <SWPadnos> yep
[01:06:53] <jmkasunich> the card will remain in the shop for years
[01:07:01] <SWPadnos> unless it's not laminated ;)
[01:09:19] <SWPadnos> hmmm. printing and cutting is cheap. a desktop laminating machine is cheap ...
[01:09:37] <jmkasunich> as a user I'd certainly pay more for the card than the cd (people with dialup might disagree)
[01:10:08] <jmkasunich> but as someone footing the bill for giveaways, I agree with you
[01:11:14] <jmkasunich> if we _do_ come up with a nice reference card, we should include it (as a pdf) in the docs part of EMC
[01:11:28] <jmkasunich> let people print it (and laminate it if desired) themselves
[01:12:32] <SWPadnos> yep. I think this is supposed to be an update to the existing quick reference
[01:14:48] <jepler> right now there's nothing more than a .ps version of the quick ref from firefox File > Print
[01:14:57] <jepler> (and the obvious conversion to pdf)
[01:15:57] <cradek> if hypertext is not needed, it's trivial to recreate in latex
[01:16:49] <jepler> it would not be hard to convert the existing gcode.html into other formats, it uses a very small subset of html that can be processed easily by python programs...
[01:17:21] <jmkasunich> ohhh, speaking of processing text with python.....
[01:17:36] <jepler> uh oh
[01:17:52] <jmkasunich> jepler: pete, swp, and I have been talking about vhdl/driver tools for the 5i20
[01:18:31] <jmkasunich> http://pastebin.ca/499631
[01:18:33] <jepler> yep I think I saw one of the pastebins you showed him
[01:18:59] <jepler> not that one
[01:19:20] <jmkasunich> given a set of name/value pairs, and a text file with $(NAME) in it, there are lots of ways to do substitition
[01:19:30] <jmkasunich> the C preprocessor, bash, sed, etc
[01:19:42] <jmkasunich> I suppose python can do it pretty well to ;-)
[01:19:48] <jepler> of course
[01:19:58] <jmkasunich> what about expressions...
[01:20:07] <jepler> arithmetic or something?
[01:20:36] <jmkasunich> suppose a line in the file was "$(foo) | $(bar) << $(baz) | $(blat) << 2"
[01:20:42] <jmkasunich> and we want the 8 bit result
[01:20:53] <jmkasunich> (assuming that foo, bar, and friends are numbers)
[01:20:57] <jepler> hm you can't depend on vhdl to figure out that's a compile-time constant?
[01:21:14] <jepler> in C that's how "#define f(x) ((x)*(x))" "does" its arithmetic
[01:21:17] <jmkasunich> the expressions aren't for vhdl, the go into the FPGA ram block
[01:21:28] <jepler> oh
[01:21:48] <jmkasunich> there are two substitition passes - one is strict text subst, and yeilds VHDL
[01:21:51] <jepler> in Python you can easily treat a string as a Python expression
[01:22:04] <SWPadnos> just like TCL
[01:22:06] <jmkasunich> the other is substitute and evaluate, and yields binary data
[01:22:07] <SWPadnos> * SWPadnos ducks
[01:22:12] <jepler> >>> s = "3+3"
[01:22:11] <jepler> >>> eval(s)
[01:22:11] <jepler> 6
[01:22:29] <jmkasunich> cool, thats exactly what I'm looking for
[01:22:41] <jmkasunich> one line at a time, substitute, then eval
[01:22:43] <jepler> SWPadnos: I know I'm being trolled, but the difference is that in tcl you can't avoid it
[01:23:25] <SWPadnos> heh
[01:23:49] <jmkasunich> jepler: does the pastebin I posted make any sense at all to someone who hasn't been in the conversation?
[01:24:22] <jmkasunich> the substitution step I've been talking about is line 36
[01:24:35] <jmkasunich> and/or line 38
[01:24:53] <jepler> jmkasunich: there is a lot there to try to figure out -- my eyes crossed well before lines 36 and 38
[01:25:10] <jmkasunich> I figured, you don't have the benefit of the discussion
[01:25:26] <jmkasunich> or even what level N users are all about
[01:25:29] <jepler> >>> from string import Template
[01:25:29] <jepler> >>> s = Template("${foo} | ${bar} << ${baz} | ${blat} << 2")
[01:25:29] <jepler> >>> s.substitute(foo=3, bar=3, baz=5, blat=6)
[01:25:29] <jepler> '3 | 3 << 5 | 6 << 2'
[01:25:29] <jepler> >>> eval(_)
[01:25:30] <jmkasunich> (that was another pastebin)
[01:25:31] <jepler> 123
[01:26:02] <jmkasunich> are you shitting me?
[01:26:06] <jepler> not one bit
[01:26:09] <jmkasunich> its already in the language?
[01:26:22] <SWPadnos> heh
[01:27:11] <jepler> (and I think that with a little surgery you could have the $() syntax instead of ${}, but I don't know if you care about that or not)
[01:27:13] <jmkasunich> well that takes a lot of the grunt work out of the picture
[01:27:18] <jmkasunich> I don't
[01:27:38] <jepler> now one potential problem is that the Python expression syntax is not the VHDL expression syntax
[01:27:44] <jmkasunich> I don't care
[01:27:49] <jepler> so you can't write constants in hex or binary in the VHDL way
[01:28:02] <jepler> at least not if they're going into the configuration RAM
[01:28:03] <jmkasunich> the substutition into vhdl will be strictly textual
[01:28:12] <jmkasunich> ah, I see
[01:28:57] <jmkasunich> http://pastebin.ca/499569
[01:29:08] <jepler> if foo turns out to be an expression, that works too, though you will have better results if you add parens to the template
[01:29:09] <jmkasunich> here is something a bit less high-level than the last pastebin
[01:29:10] <jepler> >>> s.substitute(foo="(2+2)", bar=3, baz=5, blat=6)
[01:29:13] <jepler> '(2+2) | 3 << 5 | 6 << 2'
[01:29:16] <jepler> >>> eval(_)
[01:29:18] <jepler> 124
[01:29:24] <jepler> yes I think that's the pastebin I saw
[01:30:02] <jmkasunich> the constants and vars are the variables we want to substiture
[01:30:17] <jmkasunich> most of them are basically enums or otherwise range limited
[01:30:52] <jmkasunich> so if we need to print them in one numerical format when substituting into VHDL and another form in an expression, that can be done
[01:31:41] <jepler> let me finish up these image-to-gcode changes and then I'll give you more of my attention
[01:31:46] <jepler> maybe 10 minutes
[01:31:51] <jmkasunich> no rush
[01:31:56] <jepler> OK
[01:31:59] <jmkasunich> I appreciate the help
[01:57:24] <jepler> OK so that was more than 10 minutes
[01:57:28] <jepler> but I think I'm ready now
[01:57:40] <jmkasunich> jepler: I noticed in the 2nd screenshot that the horizontal offset from rough to finish seems less than the vertical
[01:57:44] <jmkasunich> is that on purpose?
[01:58:28] <jmkasunich> you only mentioned roughing offset and depth-per-pass, not a separate horizontal offset
[01:58:39] <jepler> now that I look at it again I see what yo umean
[01:58:44] <jepler> seems like they should be the same
[01:59:03] <jmkasunich> actually it might be a feature to be able to spec them separately
[01:59:12] <jepler> dang I've got one of the background music tunes from mario64 in my head
[01:59:13] <jepler> * jepler whistles
[01:59:28] <jmkasunich> darn you
[01:59:44] <jmkasunich> now I have one of the silly tunes that goes with Dr. Mario in my head
[01:59:49] <jepler> hah
[02:00:55] <jepler> sorry about that
[02:01:03] <jmkasunich> I'll live
[02:01:21] <jepler> oh I think I know the reason -- it's a diameter vs radius thing
[02:02:01] <jmkasunich> that sounds reasonable - looks like a 2:1 ratio on the screencap
[02:02:53] <jepler> thanks for making me look at that
[02:03:29] <jmkasunich> you're welcome
[02:03:31] <jepler> you'll be disappointed to know that Python won't already parse your ini-like file format (http://pastebin.ca/499569) as easily as it will substitute the expressions
[02:04:23] <jmkasunich> there is nothing special about the format, its really more of a pseudo-format (like pseudo-code), to establish exactly what info is needed
[02:04:40] <jmkasunich> if there are more readily parsed formats that are still human friendly thats fine
[02:05:48] <jmkasunich> I see some gotchas in that format anyway... for example the VHDL template should be completely freeform text, but as it stands, a [ in there would be a bad thing
[02:05:54] <jepler> what's [POST_FGPA_VARS]?
[02:06:14] <jmkasunich> things that don't affect the VHDL but do affect what the HAL driver exports
[02:06:26] <jmkasunich> (equivalent to insmod time params for other drivers)
[02:06:38] <jepler> so it's like a promise that those variables aren't used in the [VHDL_TEMPLATE]
[02:06:38] <jmkasunich> there are too many of them to do as insmod params, so they go in the 1K ram instead
[02:06:45] <jmkasunich> yes
[02:07:02] <jmkasunich> and its a promise that you can change them after doing the place/route
[02:07:19] <jmkasunich> did you see the pastebin about the 4 classes of users?
[02:07:27] <jepler> yes but I still didn't get all the way through it
[02:07:35] <jmkasunich> http://pastebin.ca/496116
[02:07:37] <jmkasunich> that one
[02:07:51] <jmkasunich> the part after class 4 is probably no longer relevant, but the classes are
[02:08:12] <jmkasunich> the POST_FPGA vars are what let people without the FPGA tools (class 2 folks) tweak the config
[02:10:40] <jmkasunich> I wish I knew more python
[02:11:01] <jmkasunich> enough to start a program from scratch instead of needing someone else's skeleton to hack on
[02:11:51] <jmkasunich> I think the best way to do this is create some sample files of the various types, and just go to it
[02:12:04] <jmkasunich> but where to start, thats always what hangs me up
[02:12:32] <SWPadnos> start by defining what information has to be in the file (which we've gotten a fair way on)
[02:12:52] <jmkasunich> right, I think its time to make a few sample module specs
[02:13:35] <SWPadnos> well, we know the kind of data we want (the semantics) - I think it may be better to define how want to encode it (the syntax)
[02:13:51] <jmkasunich> that goes hand in hand with how we decode it
[02:14:13] <jmkasunich> for example, if py can easily do substitution when you use ${}, then we should use ${}, not $()
[02:14:16] <jepler> my bias is to encode it as a python program
[02:14:51] <jmkasunich> hmm
[02:15:37] <jmkasunich> right now we're assuming that class 4 people have a working knowledge of VHDL and C, in order to create a new module and driver for it
[02:15:42] <jepler> http://pastebin.ca/503879
[02:15:44] <SWPadnos> I'm not partial to that idea, but that's my bias :)
[02:15:52] <jmkasunich> if we require them to also know py, that makes things a bit tougher
[02:16:26] <SWPadnos> hmmm. looking at the sample code, it may not be so bad
[02:17:01] <jmkasunich> is Range something built into py, or something we would write?
[02:17:01] <jepler> barring typos, I think that the right clever code can make this python "program" behave in the right way
[02:17:20] <jepler> Range and Enum are items that I could write
[02:18:08] <SWPadnos> the Enum type would need to be tuples, since the constants for the enum items aren't guaranteed to be contiguous
[02:18:08] <jmkasunich> I agree that this could be managed by the class 4 user (if he R's TFM)
[02:18:27] <jmkasunich> I must admit I have no clue how the classes actually work
[02:18:36] <jepler> there is a lot of support code not shown (well, not written yet)
[02:18:46] <jmkasunich> I gathered that much
[02:19:03] <jmkasunich> there is the program, which reads the specs (which happen to be programs, or program snippets)
[02:19:16] <jmkasunich> you've just written a sample spec
[02:19:57] <jepler> yes
[02:20:04] <jmkasunich> argh, sometimes I think my mind has a blind spot when it comes to OO
[02:20:21] <jmkasunich> is the class something that gets executed?
[02:20:25] <jepler> this isn't a good example of OO
[02:20:27] <SWPadnos> I think the RAM_TEMPLATE would end up giving us a series of numbers, each on a separate line, right?
[02:20:40] <jmkasunich> SWPadnos: yes
[02:20:52] <SWPadnos> I think you can look at the class keyword in the example as simply preventing namespace collisions
[02:20:55] <jmkasunich> and eventually they'd get packed into a stream of bytes
[02:21:06] <SWPadnos> yep
[02:21:17] <jepler> in Python, the body of a class statement is a series of statements. at the time its containing unit is evaluated, each statement in the class is executed in order
[02:21:54] <jepler> if the statement creates something that is named, then the name becomes a member of the class with the given value
[02:22:08] <SWPadnos> right -so al lthe ID_CODES are separate
[02:22:12] <SWPadnos> all the
[02:22:16] <jmkasunich> what is the member syntax? stepgen.ID_CODE? or something liek that
[02:22:52] <jepler> yes, "." works similar to "." or "->" in C -- it gets the thing named ID_CODE out of the object stepgen
[02:22:56] <jmkasunich> ok
[02:22:58] <jepler> s/object/thing/
[02:23:22] <SWPadnos> within the class, it should just be the member name, unless you need to explicitly use another item with the same name (in another context)
[02:23:35] <jepler> (and with = it puts a new value there, if that makes sense: stepgen.step_up_phA = 1)
[02:23:38] <jmkasunich> if I want multiple stepgens, does that mean I execute the code you posted multiple times? or do I execute it once to define the class, and then somehow instantiate the class multiple times?
[02:24:47] <jepler> jmkasunich: you'd create an instance of the class. That looks like a function call, but you'll probably assign it to a name or otherwise keep the value around: one_particular_stepper = StepDriver(step_up_phA=1, ...)
[02:25:19] <jmkasunich> assume for a moment that Range prompts for a value
[02:25:29] <SWPadnos> hmmm. in this case, INSTANCE would need to be "automatically" held and incremented for each new stepgen ...
[02:25:38] <jmkasunich> does that mean when you do foo = StepDriver(), it will invoke Range?
[02:26:18] <jmkasunich> oh, I think I get it
[02:26:25] <jepler> oh, I didn't imagine an interactive program
[02:26:30] <jmkasunich> foo.Pre_Fpga_Vars would invoke Range
[02:26:54] <jmkasunich> forget interaction for the moment - Range needs to be invoked whether its interactive or not, right?
[02:27:19] <jepler> so you're asking "what happens if I try to make step_up_pha=999"?
[02:27:33] <SWPadnos> I think in the example, Range is an instance of an Enum class, sop it contains all the options ...
[02:27:39] <SWPadnos> s/sop/so/
[02:27:59] <jmkasunich> the premise of that syntax was to say "step_up_pha must be between 0 and 71, and it is the answer to this question
[02:28:40] <jmkasunich> whether that means that the program asks the question, or simply validates a value from a file, depends on the implementation
[02:29:22] <jepler> when you attempt to set one_particular_stepper.step_up_phA to some value (whatever the source), some part of this 'Range' object will be invoked, and it will get to accept or reject the value
[02:29:50] <jmkasunich> oh, Range isn't a function
[02:29:56] <jepler> no, it's a class too
[02:30:24] <jmkasunich> lol, I really do think something in my head is broken
[02:30:34] <jmkasunich> I have the hardest time groking this
[02:30:57] <jmkasunich> so executing PreFpgaVars doesn't infact execute any code to speak of
[02:31:07] <jepler> I'm having a bad time explaining it -- I am starting to realize how much weird python stuff my little code snippet assumes, hiding quietly in the background
[02:31:16] <jmkasunich> it simply creates an object of type range, and calls it step_up_pha
[02:31:45] <SWPadnos> if there were any code, then it would execute it, I think
[02:31:47] <jmkasunich> well, hiding quietly is a good thing for the users, they don't have to worry about it
[02:32:11] <jepler> PreFpgaVars() does a magic thing that makes the lines below (like step_up_phA) add things to the group of what you called PRE_FPGA_VARS
[02:32:12] <SWPadnos> I suspect that was a placeholder for "whatever needs to be done to specify that these are pre-fpga-vars"
[02:32:17] <jmkasunich> I was thinking of step_up_pha as an integer
[02:32:45] <SWPadnos> (in my best matrix kid voice:) what if there are no integers :)
[02:33:36] <jmkasunich> it can be a class if we want, but when substitution time comes, the value it has for substitution purposes needs to be that integer (actually the string representation of the integer)
[02:34:04] <jmkasunich> actually, I think I'm starting to get it
[02:34:07] <jmkasunich> (scary as that is)
[02:34:29] <jmkasunich> the class can carry not just the value, but other things like the question to be asked and the allowable answers
[02:34:39] <jepler> the class carries the questions and the allowable answers
[02:34:42] <jepler> the instance carries the values
[02:34:59] <SWPadnos> the class can even have the functions that ask the questions
[02:35:23] <jmkasunich> poof
[02:35:31] <jmkasunich> that was the sound of my light bulb burning out
[02:35:35] <SWPadnos> heh
[02:35:49] <jmkasunich> step_up_pha is an instance of class Range, right?
[02:36:05] <jmkasunich> dir_down_phb is another instance of class Range
[02:36:13] <SWPadnos> yes
[02:36:19] <jmkasunich> they have different questions, _and_ different resulting values
[02:36:30] <SWPadnos> yes
[02:36:40] <jmkasunich> so how can the class carry the questions?
[02:36:59] <SWPadnos> if I might make an analogy (to HAL)
[02:37:07] <jmkasunich> the class Range accepts A question, an instance of Range has a specific question
[02:37:16] <jepler> Range has two instances: StepDriver.step_up_phA and StepDriver.dir_down_phB. Each instance has different questions (they happen to have the same allowable values, but they could differ there too)
[02:37:36] <jmkasunich> ok, that I get
[02:37:54] <jmkasunich> it contradicts something you said earlier, about the class carrying the question, and the instance only carrying the answer
[02:38:17] <jepler> an instance of StepDriver, one_particular_stepper has (or behaves like it has) one_particular_stepper.step_up_phA and one_particular_stepper.dir_down_phB which have particular values
[02:38:29] <SWPadnos> jmkasunich, it depends on which class you're referring to, I think
[02:39:05] <jepler> when you assign one_particular_stepper.step_up_phA, the particular Range known as StepDriver.step_up_phA gets a chance to approve of the value, or disapprove and issue an error.
[02:39:20] <jepler> let me see if I can make a small example...
[02:39:57] <jmkasunich> so "one_particular_stepper.step_up_phA = 23" is a legal line
[02:40:25] <SWPadnos> hmmm. I shouldn't get into python syntax here, because I don't know python but ...
[02:40:33] <jepler> jmkasunich: yes
[02:40:49] <SWPadnos> that would assign the object called one_particular_stepper.step_up_phA the value 23
[02:40:50] <jepler> but behind the scenes lots of stuff happens that wouldn't happen in C
[02:40:55] <jmkasunich> and that would result in invoking some method of the Range class
[02:41:14] <jmkasunich> s/would/could/ I guess, depends on the class
[02:41:17] <SWPadnos> * SWPadnos whispers to jepler - wouldn't that cause it to no longer be type Ragne
[02:41:20] <SWPadnos> ?
[02:41:42] <SWPadnos> err - range
[02:41:55] <jmkasunich> seems like Range will have a member to hold the value, as well as other members for things like the limits and the question
[02:42:17] <SWPadnos> yep, that would make sense for the Range class
[02:45:00] <jepler> here's a full runnable program which uses 'property' to reduce a value to the range 0..2pi when it is stored. Range would be the same kind of thing as property()
[02:45:04] <jepler> http://pastebin.ca/504150
[02:45:38] <jepler> I don't know if it muddies the waters or not
[02:45:50] <SWPadnos> hmmm. is that a typo on line 5?
[02:45:52] <jmkasunich> well, let me see if I can understand it
[02:45:54] <SWPadnos> self.__theta
[02:46:23] <SWPadnos> ah - nevermind
[02:46:25] <jmkasunich> when executed, lines 3-14 do nothing visible, they just define the class
[02:46:39] <jmkasunich> what is line 16 gonna do?
[02:46:52] <jepler> on my system it printed this: <property object at 0xb7d39054>
[02:47:01] <SWPadnos> heh
[02:48:02] <jepler> what I am getting out of this conversation is that whether my python example looks nice, it will be extremely hard for anyone in the project but me to maintain or enhance all the support code
[02:48:05] <jepler> that's probably not a good thing to do
[02:48:17] <jmkasunich> my system doesn't like me copying it and pasting it into an interactive python
[02:48:27] <SWPadnos> I think you're the only really competent python programmer in the project
[02:48:35] <SWPadnos> (no offense to anyone else who is too)
[02:48:47] <cradek> HEY
[02:48:50] <cradek> oh wait, you're right
[02:48:57] <jmkasunich> jepler: I agree that the support code needs to be maintainable
[02:49:13] <jepler> hm the first two times I read that I missed the word "python" and figured SWPadnos was talking to jmkasunich
[02:49:33] <SWPadnos> heh - that would be a problem, wouldn't it ;)
[02:50:00] <jepler> jmkasunich: yeah I also have problems pasting anything more than one-liners into an interactive python
[02:50:10] <jepler> it seems like it's a bug the Python maintainers should fix :-P
[02:50:15] <jmkasunich> ok, so its better to paste into an editor, save, and run it
[02:50:16] <SWPadnos> I managed to paste in the entire class definition in one go
[02:50:18] <SWPadnos> and it worked
[02:50:29] <jmkasunich> I was trying to "run it" by inspection, so I'd understand it
[02:50:33] <jmkasunich> maybe not the best thing to do
[02:51:12] <SWPadnos> the real key there is the property function
[02:51:34] <jepler> when you write 'x.theta = 1.0' it calls X.set_theta(x, 1.0)
[02:51:42] <SWPadnos> that tells python that whenever you try to write to the variable, it should really call the set_theta function
[02:51:50] <jepler> right
[02:51:52] <jmkasunich> yes, I actually figured that part out just now
[02:51:57] <SWPadnos> and similarly it should run the "get_theta" function whenever you read theta
[02:52:03] <jmkasunich> if I had skipped line 16, I would have been better off
[02:52:15] <SWPadnos> (which incidentally is exactly what you want for HAL parameters ...)
[02:52:31] <jepler> it's bedtime around here -- I'll let you guys stay up till 1AM speculating about what python does or does not do :-P
[02:52:37] <SWPadnos> heh
[02:52:41] <jmkasunich> SWPadnos: please don't change the subject, my poor brain can barely keep up as is
[02:52:43] <cradek> goodnight
[02:52:51] <SWPadnos> night jepler
[02:52:54] <jmkasunich> goodnight jeff
[02:54:19] <jmkasunich> so if I really want to understand that code, I need to read about property
[02:54:40] <SWPadnos> type "help(property)" in your python shell
[02:55:49] <jmkasunich> as I expected, it takes more than 2 args
[02:56:03] <jepler> I have done more testing and found that when I put the machine in estop it jumps to the next line of code to be executed.
[02:56:03] <SWPadnos> it's allowed to take more than 2 args ...
[02:56:06] <jepler> Then when I bring it out of estop and push the machine on button it takes off to the next instruction and not finishing the previous line of code,it could be a rapid move!
[02:56:24] <jepler> ^^^ wow I don't think this is what estop is supposed to do!
[02:56:45] <cradek> reproduced?
[02:56:52] <jepler> no -- when I press F1 F1 F2 the machine stays stopped
[02:56:58] <jmkasunich> I've been ignoring that, I managed to convince myself its a task issue
[02:57:31] <cradek> can I come stay in your world too?
[02:57:37] <SWPadnos> hmmm. I read it as a problem with the active line getting bumped by one on e-stop and then again on machine on
[02:58:28] <cradek> I sure like the hal block manpages
[02:58:49] <SWPadnos> block?
[02:59:07] <cradek> isn't that what they're called?
[02:59:16] <cradek> man mux2, man scale
[02:59:23] <SWPadnos> ah, components
[02:59:32] <SWPadnos> they were in blocks, I think
[02:59:37] <SWPadnos> but that's deprecated in my mind
[02:59:45] <cradek> yeah blocomponents
[02:59:49] <cradek> that's what I said
[03:00:14] <SWPadnos> or, even more confusingly, comp components
[03:00:21] <SWPadnos> the comp component comp
[03:50:34] <SWPadnos> hey jmkasunich, got any brain function left for a little OOP info (I think it could help)
[03:51:23] <jmkasunich> I can try
[03:51:27] <SWPadnos> heh - ok
[03:51:31] <SWPadnos> http://pastebin.ca/504515
[03:52:02] <jmkasunich> that I understand
[03:52:05] <SWPadnos> this is c++ code - I guess I could have hilighted it that way
[03:52:19] <jmkasunich> the top half is good old C
[03:52:25] <SWPadnos> ok, there's only one difference between myStruct and myClass
[03:52:39] <SWPadnos> and it's not the different declaration syntax of fred
[03:52:52] <SWPadnos> the top is also good old c++
[03:53:05] <jmkasunich> there is nothing good about C++
[03:53:07] <jmkasunich> ;-)
[03:53:23] <SWPadnos> the only difference is that by default, the rest of the program can directly modify a and b, and can call fred
[03:53:33] <SWPadnos> the good old parts of c++ are C ;)
[03:53:45] <SWPadnos> in the struct, that is
[03:54:00] <SWPadnos> in the class, the default is to have all members "private"
[03:54:11] <jmkasunich> ok
[03:54:25] <SWPadnos> that demonstrates one of the pieces of OOP - encapsulation
[03:54:47] <SWPadnos> if I don't declare an interface to my code and data, you can't access it ("you' being the rest of the code)
[03:55:04] <SWPadnos> if you try, you'll get a compile error
[03:55:10] <jmkasunich> it equivalent to defining struct myStruct in one file, and then referring to it simply as struct myStruct elsewhere, with the format not visible
[03:55:29] <SWPadnos> similar, yes
[03:56:37] <jmkasunich> ok, encapsulation is not at all the hard part, I already grasp the benefit of having things static, for example
[03:57:17] <jmkasunich> the hard part is the stuff that C++ does in the absence of code that explicitly says "do this"
[03:57:19] <SWPadnos> another aspect is that data and the code that operates on that data is kept in the same "container"
[03:57:44] <SWPadnos> yeah. it's hard to (a) know exactly what's going to happen and (b) trust that it isn't full of bloat
[03:58:12] <SWPadnos> there are more "hidden" rules,
[03:58:27] <SWPadnos> but once you understand them, you can forget about them for the most part
[03:59:20] <jmkasunich> going back to your example
[03:59:31] <SWPadnos> hmmm. I lied before. the class and struct have one other difference. the struct allows each instance of fred to point at a different function, whereas the class will have exactly one function called "myClass::Fred"
[03:59:36] <jmkasunich> in the struct case, I must define a function somewhere, and assign its address to fred
[03:59:58] <SWPadnos> yes
[04:00:07] <jmkasunich> I thought so, but I was gonna let that slide as an implementation detail (reduction of duplicate values)
[04:00:25] <SWPadnos> in the C version, fred can be any function that takes 2 ints, and returns an int
[04:00:51] <jmkasunich> in the class version, the class definition needs to include a definition for fred, doesn't it
[04:00:53] <SWPadnos> it may have nothing to do with myStruct, but I can still assign it to a myStruct.fred variable
[04:00:55] <SWPadnos> yes
[04:01:37] <SWPadnos> I was going to say that's another feature of OOP, but it isn't. it's the strong type safety of C++
[04:01:58] <jmkasunich> if you were doing pseudo-oo stuff, fred would most likely NOT accept 2 ints and return int, at least one of its args, its return value, or both, would be a struct myStruct
[04:02:07] <SWPadnos> that's true
[04:02:27] <jmkasunich> and thats the first hidden thing I bet
[04:02:44] <SWPadnos> yes, every class member function gets a "this" pointer
[04:02:50] <jmkasunich> doesn't fred (in the class) have a hidden arg of type "instance of myClass"
[04:02:59] <SWPadnos> yep
[04:03:10] <SWPadnos> that's an implementation detail though
[04:03:36] <jmkasunich> I wouldn't say that
[04:04:00] <jmkasunich> the idea that fred acts on a specific object is pretty fundamental isn't it?
[04:04:05] <SWPadnos> conceptually, the idea is that frred is part of the class, and it's only used as part of the class. how that's done is a detail
[04:04:38] <petev> I can't beleive what I'm reading, JMK is talking OOP
[04:05:07] <jmkasunich> I'm not inherently anti-OOP
[04:05:15] <jmkasunich> I'm inherently anti-obfuscation
[04:05:21] <SWPadnos> shhh - I was trying to get him to not notice )
[04:05:32] <petev> an object is just the combination of data and the functions that operate on it
[04:05:47] <jmkasunich> except when its not
[04:05:58] <petev> why do you say that?
[04:06:09] <SWPadnos> yeah, with some extra behind-the-scenes stuff that makes sure everything works right
[04:06:12] <jmkasunich> an instance of an object is the data, the functions are not part of the instance, they're tucked away somewhere
[04:06:23] <SWPadnos> petev, take the "this" pointer, for example
[04:06:25] <petev> you are being too literal
[04:06:39] <jmkasunich> an "object" has no existance itself, only instances have existance
[04:06:42] <petev> the language gives you some help to make things easy
[04:06:43] <SWPadnos> that's an implementation detail ;)
[04:07:01] <SWPadnos> jmkasunich, actually, that's not true in C++
[04:07:16] <SWPadnos> but again, it's an implementation detail
[04:07:18] <jmkasunich> ok, what is the address of myClass?
[04:07:48] <SWPadnos> there will be one, since each non-trivial class has some information about it
[04:08:02] <petev> the class is just like a struct in C
[04:08:16] <petev> when you declare an instance, then memory is actually allocated
[04:08:44] <SWPadnos> any functions that are fully defined at compile-time, and any class-specific data (such as a table) will have one instance in the program, and that will be in the class info
[04:09:07] <petev> true, static class data will be allocated at compile time
[04:09:27] <petev> but most class data is not static, unless it's stuff like lookup tables
[04:09:53] <SWPadnos> again, these are implementation details. I was trying to make sure the conceptual base is all there
[04:10:34] <jmkasunich> I think part of my problem is that I'm unwilling to accept the concepts on faith
[04:10:39] <SWPadnos> heh
[04:11:02] <SWPadnos> I'll bring the notes from an excellent talk I attended at ESC
[04:11:05] <petev> then what you need to do is look at the compiler output in assembly and convince yourself you understand how it is implementing the features
[04:11:06] <jmkasunich> I'm quite capable of working at differnet levels of abstraction, I do it all the time... but only when I'm confortable that I understand the transition between the levels
[04:11:15] <petev> then you won't have a problem using them anymore
[04:11:25] <SWPadnos> well, I wouldn't jump to that level at first
[04:11:38] <SWPadnos> the gcc assembly output is nearly unreadable for C code ...
[04:11:39] <jmkasunich> petev: I don't need to go to the assembly level... C is enough
[04:11:56] <jmkasunich> because I'm confident that I understand the C -> asm abstraction level already
[04:12:00] <petev> well it seems that you don't like the language helping you with things
[04:12:06] <SWPadnos> that's actually why I mentioned earlier that HAL is quite OO, even though it's in C
[04:12:10] <jmkasunich> (not well enough to be a compiler, but well enough to trust a compiler)
[04:12:16] <petev> so the way to get past that is to understand how the language features are implemented
[04:12:57] <jmkasunich> petev: right - thats what I'm trying to say... once I truly "know" what the compiler is doing, then I'm willing to work at the higher level
[04:13:00] <petev> for instance, it would be very tedious to pass the this pointer manually and have to specify it all the time, just look at my HAL modules
[04:13:22] <jmkasunich> heh, to be honest, I absolutely hate the style of writing "this"
[04:13:26] <SWPadnos> heh
[04:13:28] <petev> it would also be very difficult to implement things like multiple inheritance
[04:13:34] <jmkasunich> if its a foo, call it foo, not this
[04:13:51] <SWPadnos> it's rare to declare a variable like this: int int;
[04:13:57] <SWPadnos> you don't call an int "int"
[04:13:57] <petev> the point is, you don't even have to say this to access member data
[04:14:52] <jmkasunich> this is a digression (what else is new), but how does C++ deal with functions that manipulate multiple objects, possibly of differnent classes?
[04:14:53] <petev> implementing multiple inheritance would be a nested struct, type cast fiasco without compiler help
[04:15:12] <petev> go back to the fundamental concept
[04:15:24] <petev> an object is data and the functions that manipulate it
[04:15:40] <jmkasunich> suppose I have a class "point", a 3D point
[04:15:48] <SWPadnos> perfect :)
[04:15:49] <petev> so if one objects functions need to manipulate another, then they call the functions of the other object
[04:15:55] <petev> they don't do it directly
[04:15:57] <jmkasunich> and I have a class "transform", a transformation matrix, that I want to apply to many points
[04:16:01] <SWPadnos> hold up a sec Pete - he started the graphics thing :)
[04:16:11] <petev> of course there are exceptions, like using "friend" classes
[04:16:15] <jmkasunich> somewhere there is a function that takes a point and a transformation, and returns a modified point
[04:16:25] <SWPadnos> then just have an array (or even better, some other container class full) of points ...
[04:16:30] <jmkasunich> is that a method of point, or a method of transformation, or what?
[04:17:02] <SWPadnos> Transformation member functions would likely accept arguments of type "Point"
[04:17:19] <petev> isn't the transformation specified by the matrix?
[04:17:24] <SWPadnos> that isn't an inheritance question, I think
[04:17:45] <petev> so don't you really just want vector/matrix multiplication?
[04:18:09] <jmkasunich> petev: what does that have to do with it?
[04:18:25] <jmkasunich> there is some code that implements the transform, given the transformation info and the point
[04:18:25] <petev> it has to do with what you are really trying to do
[04:18:47] <SWPadnos> the relation is that you want to design the program correctly, so you don't get bogged down in nearly impossible tasks
[04:18:54] <SWPadnos> but that isn't he subject here
[04:18:54] <jmkasunich> maybe the transformation is in terms of roll/pitch/yaw, or a quaternion, or whatever
[04:19:06] <jmkasunich> what I want to do is apply the transform to the point
[04:19:28] <petev> do you so you want a func that takes a point and returns another?
[04:19:38] <SWPadnos> so you'd have this function: Point Transform(Point *P)
[04:20:03] <SWPadnos> you may define a class "PerspectiveTransform"
[04:20:07] <petev> wait, first specify the inputs and outputs
[04:20:11] <jmkasunich> in C, I have struct xfm, and struct pt, and function "transform( struct point *src, struct *dst, struct xfm *transformation)"
[04:20:32] <jmkasunich> oops, struct point *dst
[04:20:38] <petev> jmk, you really need more detail than this for OOP
[04:20:43] <SWPadnos> ok, let's look at the assumptions you have there
[04:20:59] <petev> I have found that the best OOP approach is to model the real objects and not to make up fake ones
[04:21:09] <petev> so what is in xfm?
[04:21:12] <SWPadnos> 1) you have a data struct that can defin all possible transforms (or at least all the ones you're interested in)
[04:21:31] <SWPadnos> 2) these transforms can be applied to individual points
[04:21:40] <jmkasunich> xfm might be a quaternion, might be roll/pitch/yaw/translate, might be a matrix
[04:21:49] <jmkasunich> doesn't matter, we're encapsulating things remember
[04:21:57] <petev> well each one might have a different best way to implement it
[04:21:57] <SWPadnos> 3) there is a single function that can do all this work, given only a single point and a tranform struct
[04:22:35] <SWPadnos> are there any more assumptions? I'm not sure I got them all
[04:22:41] <petev> if there is a single function, then it's either an ugly switch statement, or xfm has one format
[04:22:59] <petev> and it makes a difference in picking the best implementation
[04:23:02] <SWPadnos> that's fine - let's look at the problem as stated
[04:23:09] <jmkasunich> petev: xfm only has one format, my point is that the format is not relevant to the discussion
[04:23:18] <petev> lets take another example for a quick second
[04:23:24] <SWPadnos> hold on with that please
[04:23:25] <petev> jmk, it is relavant
[04:23:31] <jmkasunich> why?
[04:23:34] <petev> let me make a case why
[04:23:39] <jmkasunich> the whole point is encapsulation
[04:23:45] <petev> lets take an automobile example
[04:23:59] <SWPadnos> no no no !!!
[04:24:04] <jmkasunich> please don't switch examples midstream
[04:24:15] <petev> it will be much easier to show you why
[04:24:23] <SWPadnos> let's save that for later, if we can
[04:24:26] <jmkasunich> I've done this graphics code in C, I understand the problem
[04:24:31] <petev> it has to do with type of and composed of
[04:24:48] <SWPadnos> it's ok - we can twist this example around a bit, I'm sure ;)
[04:24:50] <petev> and it's an important fundamental concept for picking the right structure
[04:24:55] <jmkasunich> I'm trying to explain why the format of xfm doesn't matter
[04:25:18] <SWPadnos> it doesn't matter in the non=OOP paradigm, that doesn't mean that it won't nmatter in OOP
[04:25:49] <jmkasunich> I have functions like make_rotate_xfm(struct xfm *dst, float angleX, float angleY, float angleZ)
[04:25:53] <SWPadnos> if you have a simple function like this, it probably isn't a good candidate for "class-ification"
[04:26:08] <jmkasunich> I tell it that I want to rotate things, and it gives me an xfm that will do that
[04:26:27] <jmkasunich> another function gives me xfms that translate things
[04:26:36] <SWPadnos> ok, so you've already made a non-OOP implementation, and you're asking why making it partially OOP would help
[04:26:44] <jmkasunich> not at all
[04:27:04] <jmkasunich> I'm saying, here's a problem that I understand, now how do you oop it
[04:27:14] <petev> I think what you are giving in your example would be multiple classes
[04:27:16] <jmkasunich> and replying to petes statement that the format of xfm matters
[04:27:16] <SWPadnos> yes, that set of functions is a non-OOP paradigm, and there's a better one (or mre) using OOP
[04:27:21] <petev> let me take a shot here
[04:27:30] <SWPadnos> s/mre/more/
[04:27:32] <SWPadnos> ok
[04:27:35] <petev> you would have a point class
[04:27:55] <petev> then you would have a class for each of the different xform formats, quaternion, matrix, etc.
[04:28:06] <jmkasunich> to me a transform is an object, I can make them, modify them, concatenate them (get a new transform that does what the first two would have done if applied in sequence), etc
[04:28:19] <petev> these classes would have a method that knows how to apply an xfm to a point
[04:28:20] <jmkasunich> I don't need to know the contents or implementation of the transforms
[04:28:28] <petev> let me get to that
[04:28:45] <petev> you really want to jump to advnaced stuff right away?
[04:29:01] <petev> to do what you want, you need a common base class and virtual functions
[04:29:06] <jmkasunich> this isn't advanced
[04:29:12] <jmkasunich> and we're talking past each other again
[04:29:25] <petev> it's advanced concepts of C++ to implement it properly
[04:29:28] <jmkasunich> I never said I would have quaternions and matrices in the same program
[04:29:46] <petev> well pick one then so we can make an implementation
[04:29:54] <jmkasunich> I said that users of the "class" don't care whether the transform uses matrices or quatenernian
[04:30:14] <jmkasunich> only the implementer cares
[04:31:26] <petev> if an xfm is some abstract notion that can take any type of implementation, then the right way to do it is with a common base class and a virtual func
[04:32:03] <petev> if you don't want to do that, then it's really just a matrix or quaternion, but you aren't making that transparent and you can only use one at a time
[04:32:21] <petev> so which example do you want to do?
[04:32:24] <jmkasunich> things you can do to/with a transform
[04:32:48] <petev> and a transform is general and can be any type?
[04:33:01] <jmkasunich> create one, from a spec like "rotate around X by 20 degrees" "scale by a factor of 3 in all coords" "shift by 3 along Y"
[04:33:13] <jmkasunich> concantenate them
[04:33:35] <jmkasunich> so you can take the three I just created, and end up with one that does all three steps in order
[04:33:45] <jmkasunich> apply them to points
[04:33:51] <petev> and how does the user of the class pick the underlying implementation to use?
[04:34:00] <petev> is only one implementation needed at a time?
[04:34:14] <jmkasunich> (and by implication, apply them to line segments, triangles, and solid objects)
[04:34:19] <SWPadnos> the user doesn't care how it's implemented, they just want to be able to do all those things in whatever order
[04:34:32] <jmkasunich> the implementation is anything that generates the proper result
[04:34:53] <petev> I understand, but you have more tools with C++
[04:35:03] <petev> you could use templates, virtuals, etc.
[04:35:14] <jmkasunich> if I create a "shift by 3 along X" transform, and apply it to (0,0,0), I better get (3,0,0)
[04:35:20] <petev> you need to provide more info on the usage to select the right way
[04:35:27] <petev> sure
[04:35:29] <jmkasunich> if you care about how that happens, you just violated encapsulation
[04:35:40] <petev> no, you are missing the point
[04:36:02] <jmkasunich> so what is the point?
[04:36:10] <petev> the user may care because he is running on an embeded hard RT system and all mem allocation must be static or whatever
[04:36:19] <petev> the point is there are many ways to implement what you want
[04:36:36] <jmkasunich> it sounds like we've traded places
[04:36:37] <petev> without more detail, it's hard to say any given method would be best
[04:36:43] <petev> no, not at all
[04:36:50] <petev> you are asking a specific question
[04:36:53] <SWPadnos> yeah - the problem here is that c++ allows you to do transforms that weren't known when the class user was written
[04:36:55] <jmkasunich> I'm supposed to be the one that says "C++ sucks because you don't know what its doing"
[04:36:56] <petev> how do I do this in C++
[04:37:11] <petev> the answer depends on having more requirements of the class
[04:38:09] <petev> I think the point isn't getting across
[04:38:15] <petev> there are a lot of tools in C++
[04:38:22] <SWPadnos> let's assume that there are no more requirements - that all the transforms to be performed are known at compile time
[04:38:30] <SWPadnos> not the values, but the kinds of transforms
[04:38:44] <petev> the choice of which one to use for a given problem requires enough spec of the problem to eliminate bad options
[04:38:46] <SWPadnos> so you'll have a translate(), rotate(), scale() ...
[04:38:57] <jmkasunich> SWPadnos: exactly
[04:39:07] <jmkasunich> sort of ;-)
[04:39:20] <SWPadnos> jmkasunich, the only reason I'm saying that is that you aren't restricted to things known at original compile time in C++
[04:39:42] <petev> jmk, if the underlying implementation were some hard coded routines for rotate, scale, etc.
[04:40:14] <petev> then you can't concatenate them and keep track of that easily without creating some nasty linked list of function calls
[04:40:23] <jmkasunich> right
[04:40:33] <petev> so some info on implemetation is approriate if you want an example of how to do it
[04:40:34] <jmkasunich> since the actual implementation is matrices, its a non-issue
[04:40:51] <petev> ok, so you want a matrice/point example?
[04:40:57] <jmkasunich> but again I ask, why does the user (or the external specification of the class) give a flying fsck about that
[04:41:10] <jmkasunich> I want to transform points
[04:41:14] <SWPadnos> the user doesn't - but you're asking how to be the implementer ...
[04:41:21] <petev> they don't, but I can't give an implemenation example if I don't know what the implemenation is
[04:41:38] <jmkasunich> I'm asking how the classes would be presented to the user
[04:42:02] <jmkasunich> my initial problem was you have a transform class, and a point class, and one can be applied to the other
[04:42:08] <petev> the user would have some xfm object, and a point object
[04:42:12] <jmkasunich> obviously the "this" can only be one or the other
[04:42:23] <petev> the xfm object would have a method taking a point as an arg
[04:42:32] <petev> the method would apply the xfm to the point
[04:42:42] <jmkasunich> or the point object would have a method taking a transform as an arg
[04:42:51] <petev> depending on the actual implementation, many things could happen
[04:42:55] <petev> no
[04:43:01] <jmkasunich> why not?
[04:43:03] <SWPadnos> for a relatively simple example such as this, the implementations won't be too different, which is good for the purposes of this discussion
[04:43:13] <petev> you apply an xform to a point
[04:43:17] <petev> not a point to an xfm
[04:43:40] <petev> it gets back to the way you think of things, being type of, or composed of, etc.
[04:43:45] <jmkasunich> but you also apply a transform to a line, a triangle, and a 3d solid
[04:43:58] <petev> right, that's were overloading comes in
[04:44:02] <jmkasunich> I don't want to add methods to xfm for all those things
[04:44:09] <petev> you can use the same method name with different args
[04:44:15] <petev> why not?
[04:44:35] <jmkasunich> because each of those things "knows" that it is made of simpler things
[04:44:49] <petev> I don't follow
[04:44:50] <jmkasunich> when you invoke a method on a triangle, the triangle code invokes three point methods
[04:45:07] <jmkasunich> the point methods transform the points
[04:45:18] <jmkasunich> the transform code doesn't need to be changed to handle triangles
[04:45:26] <SWPadnos> you can't translate a line with the C example you gave, unless you have an additional function that takes an array of points (and loops), or one that takes a struct Line* and manually applies the point transform to the endpoints
[04:45:37] <petev> if you do it the other way, then when you want a different implemetation for xform, you have to re-do all the other classes
[04:45:44] <SWPadnos> similar for the triangle example
[04:45:45] <jmkasunich> no
[04:45:46] <petev> it makes the xfm transparent
[04:45:59] <jmkasunich> we are so badly not communicatiing
[04:46:01] <petev> no who?
[04:46:02] <SWPadnos> heh
[04:46:17] <jmkasunich> SWPadnos: you said "I can't transform a line"
[04:46:45] <jmkasunich> the line "object" DOES have a loop (well, for a line there are only 2 points, so it wouldn't be a real loop)
[04:47:18] <SWPadnos> right - it manually calls the point transform function as many times as needed
[04:47:25] <petev> jmk, what happens when you want to use quaternions instead of matrices, you re-write point, line, trianlge?
[04:47:27] <SWPadnos> but that function exists somewhere
[04:47:49] <SWPadnos> whether it's in the transform "object" or in the line "object" is irrelevant
[04:47:54] <jmkasunich> petev: no, only point
[04:48:16] <jmkasunich> line simply knows that it has 2 points
[04:48:18] <petev> well the other way, you could select the xfm type without having to change the other code
[04:48:27] <petev> you could even do it dynamically with virtuals
[04:48:49] <petev> so it comes down to the other requirements of the implementation
[04:49:09] <jmkasunich> this is stupid
[04:49:08] <SWPadnos> jmkasunich, so to more closely duplicate what you have in mind, we can construct a pont type that contains a transform function within it
[04:49:25] <SWPadnos> and a line type that has two points as data members
[04:49:43] <jmkasunich> right, and triangles that consist of three points, and so on
[04:49:47] <petev> and I have usually found the best approach is to have a one-to-one relation between physical objects and code objects, and for more complex objects to operate on simpler objects
[04:50:00] <jmkasunich> the transform FUNCTION and the transform DATA are two different things
[04:50:19] <petev> I don't see how you can separate them
[04:50:20] <SWPadnos> yes. that can be done, but it isn't necessarily the ideal way to do it in C++ - it would just more closely match what you've already got
[04:50:40] <SWPadnos> err - that was directed at jmk
[04:50:45] <petev> if they are separate and dont know about each other, how can the func apply the data?
[04:51:00] <jmkasunich> if the "ideal way" involves the transform class needing to have unique code to transform triangles, lines, and points, then I like C++ even less than I did before
[04:51:39] <petev> you don't have to do it that way, but it gives the power to switch implemetations by only touching the xfm class and to do it dynamically
[04:51:41] <jmkasunich> petev: SWPadnos suggested that the transform function might be part of the point class
[04:51:46] <petev> so define your requirements
[04:52:00] <jmkasunich> this whole discussion started when I asked about things that cross class boundaries
[04:52:09] <petev> you are also taking advantage of the fact that your other shapes can leverage point functionality
[04:52:17] <petev> what happens when this isn't true?
[04:52:26] <jmkasunich> it is true
[04:52:53] <jmkasunich> isn't having things like triangle take advantage of point an example of inheritance?
[04:52:54] <petev> it's only true if you know all of the things to be xformed at compile time
[04:52:59] <SWPadnos> it's true in your implementation, and the implementation you want us to duplicate ;)
[04:53:00] <petev> no
[04:53:04] <petev> jmk, no
[04:53:10] <petev> lets use this as an example
[04:53:16] <SWPadnos> though it could be done that way ...
[04:53:18] <petev> a triangle is not a type of point
[04:53:25] <SWPadnos> that's where I thought we were going
[04:53:27] <petev> so it should not be inherited from point
[04:53:31] <jmkasunich> a triangle builds on points
[04:53:38] <petev> a triangle is composed of points
[04:53:56] <jmkasunich> right, so it can reuse point code
[04:54:00] <petev> so the triangle should contain member variables of type point
[04:54:04] <jmkasunich> maybe inheritance isn't the right word
[04:54:15] <petev> it's a very important distinction
[04:54:31] <petev> that's why I wanted to start with an example to show the difference
[04:54:33] <jmkasunich> right, triangle contains members of type point
[04:54:37] <SWPadnos> hold on there - a triangle is a perfect example of inheritance and proper design
[04:54:38] <petev> right
[04:54:43] <SWPadnos> or it can be
[04:54:46] <jmkasunich> transform only has to know about points, not triangles
[04:55:02] <jmkasunich> if you transform the points, you have transformed the triangle
[04:55:06] <petev> well you said it should know how to xfm triangles and lines
[04:55:07] <SWPadnos> if you define the triangle as a "base point" and two sets of offsets
[04:55:17] <petev> now you are changing the requirements
[04:55:24] <jmkasunich> if you transform the points, you have transformed the triangle
[04:55:49] <petev> yes, but you started with wanting to pass other objects to an xfm func
[04:55:53] <SWPadnos> the triangle object needs to have a transform function that calls the point transform for each of its member points
[04:55:56] <jmkasunich> therefore, if transform can handle points, my program can transform anything made of points
[04:56:00] <petev> now you are saying we only need to xfm points
[04:56:03] <SWPadnos> this is an exact translation of the C version
[04:56:11] <SWPadnos> stop a sec
[04:56:50] <SWPadnos> to transform a triangle that contains 3 Points, you only need to have a function like Transform(Point), since the triangle class can call that function for each of its 3 points
[04:56:58] <jmkasunich> right
[04:56:58] <petev> exactly
[04:56:59] <SWPadnos> so "you only need to transform points" is correct
[04:57:05] <petev> and it's a big difference
[04:57:14] <jmkasunich> the transform method for a triangle is trivial, since it invoke the point method
[04:57:24] <SWPadnos> because transforming the points that make up more complex objects will also transfor mthe objects themselves
[04:57:31] <jmkasunich> right
[04:57:52] <jmkasunich> I can have a duodecahedron, made out of 20 triangles, and transform the whole thing
[04:58:10] <petev> well now you are saying that anything that will be xfmed is made of points and will be xfmed by applying the xfm to the points
[04:58:11] <jmkasunich> or an airplane made out of 2000 triangles
[04:58:18] <jmkasunich> yes
[04:58:24] <jmkasunich> I thought that went without saying?
[04:58:27] <petev> this is different than the initial description of the problem
[04:58:29] <SWPadnos> no, it doesn't
[04:58:35] <SWPadnos> that's an implementation-specific requirement
[04:58:40] <petev> right
[04:58:58] <jmkasunich> the application is 3D rendering
[04:59:00] <SWPadnos> you used that idea to make the C version of the code, but it's not a necessary choice
[04:59:11] <petev> so I would still put one method in the xfm object for applying the xfm to a point
[04:59:31] <petev> then the other triangles and whatever just xform thier points
[05:00:00] <petev> and you can change the implementation of the xfm class by linking another class, using virtuals, using templates, or whatever
[05:00:08] <petev> and you never have to touch the code in point to do it
[05:00:14] <jmkasunich> or just rewriting the methods
[05:00:29] <petev> sure, that's linking another xfm class
[05:00:56] <jmkasunich> if you say so
[05:01:12] <jmkasunich> I think its editing the source of the original xfm class and recompiling
[05:01:36] <petev> that is fundamentally the same thing, the obj that is linked with point is different
[05:02:04] <jmkasunich> your point is that "point" doesn't need to be recompiled?
[05:02:13] <jmkasunich> thats true in the C version too
[05:02:13] <petev> yes
[05:02:26] <petev> now if you want to have multiple implemtations active at once, or want to choose at runtime
[05:02:35] <jmkasunich> I don't
[05:02:37] <petev> you can use a common base class and virtuals
[05:02:52] <petev> jmk, nobody is saying you can do things in C++ that you can't do in C
[05:02:57] <petev> quite the opposite
[05:03:11] <petev> the point is that you can do it easier in C++ because the compiler helps you
[05:03:26] <jmkasunich> well, thats what I'm not seeing
[05:03:39] <petev> let's take the dynamic example
[05:03:46] <jmkasunich> why?
[05:03:53] <petev> maybe some xforms are better suited to quaternions and some to matrices
[05:04:01] <petev> so why not be able to use both representations?
[05:04:15] <jmkasunich> I mean, why do you need the dynamic example to show the superiority of C++
[05:04:16] <SWPadnos> because that's not in the requirements ;)
[05:04:23] <petev> I'm trying to make an example here to show you how C++ helps, don't be so difficult ;-)
[05:04:39] <jmkasunich> show me how C++ makes my example easier than doing it in C
[05:04:54] <petev> well you picked a very simple example
[05:05:07] <SWPadnos> that may not be possible, if you want to restrict the answer to being exactly what you did in C
[05:05:10] <petev> where C++ helps here is in defining the interfaces clearly and enforcing them
[05:05:25] <jmkasunich> are you admitting that C++ is only beneficial for complex examples? ;-)
[05:05:31] <petev> no
[05:05:34] <SWPadnos> yes
[05:05:35] <SWPadnos> no
[05:05:37] <SWPadnos> maybe
[05:05:39] <SWPadnos> :)
[05:05:40] <petev> you just aren't seeing the benefit
[05:05:43] <petev> for example
[05:05:57] <petev> lets say there is some private data in the xfm object
[05:06:05] <jmkasunich> btw, you don't want to know "exactly what I did in C"
[05:06:04] <petev> and only the xfm func should have access to
[05:06:09] <SWPadnos> heh
[05:06:25] <petev> what keeps C code from acessing any struct member?
[05:06:27] <petev> nothing
[05:06:37] <petev> in C++ you can declare the data as private
[05:06:45] <petev> then only member funcs have access
[05:07:21] <petev> so it will enforce good coding and will make it easier for others to understand the scope of the data usage
[05:07:31] <petev> is that not an advantage?
[05:07:58] <jmkasunich> I never said data hiding was bad, in fact you can do it in C as well, within limitations
[05:08:27] <SWPadnos> you can only hide data that's static in a function or file (from other funtions and files, respectively)
[05:08:27] <petev> but there is no enforcement of it, and there is nothing to indicate it to others, besides comments
[05:08:51] <jmkasunich> petev: SWPadnos just explained how you can do it
[05:09:01] <petev> are you kidding me?
[05:09:06] <SWPadnos> but it isn't enforced
[05:09:23] <petev> how do you make private data in each instance of a data struct?
[05:09:40] <petev> static data is global data, that is crap
[05:09:42] <SWPadnos> you don't - the idea is that ther eis primitive data hiding in C as well
[05:09:51] <petev> for globals?
[05:09:55] <petev> big deal
[05:10:12] <SWPadnos> oh, I'm not disagreeing with you - I know the advantage of C++ there:)
[05:10:18] <jmkasunich> if outside code only has to pass around instances of an object without accessing its content, you can declare the structure itself inside the inplementation file, and simply declare "struct xfm" in the public .h file
[05:10:25] <petev> once you understand the C++ extensions you will see the power they give you
[05:10:43] <jmkasunich> static data is global data?
[05:10:44] <SWPadnos> to paraphrase: "Feel the power of the dark side!"
[05:10:50] <petev> what if the outside code has to allocate one?
[05:10:58] <petev> it doesn't know how big it is
[05:11:18] <petev> yes, static data is essentially global data
[05:11:23] <jmkasunich> haven't you heard of constructors?
[05:11:31] <SWPadnos> no, what are they? ;)
[05:11:40] <jmkasunich> struct point *new_point()
[05:11:57] <jmkasunich> the caller of that doesn't need to know about the contents of struct point, or how big it is
[05:12:10] <SWPadnos> what you're talking about (and have done) is written C++ in C
[05:12:22] <petev> so now you are having to add extra code to do this?
[05:12:33] <petev> and what if some data needs be shared, but not all of it?
[05:12:40] <SWPadnos> it's not extra code, relative to C++
[05:12:46] <SWPadnos> it's just explicitly written
[05:12:47] <jmkasunich> what extra code? the implementation of new_point()? thats the same as a C++ constructor
[05:12:49] <petev> and what if I have an embedded app and want all static allocation?
[05:12:56] <petev> no it's no
[05:13:12] <petev> a constructor does not allocate an object
[05:13:17] <petev> new does that
[05:13:21] <SWPadnos> heh - implementation detail ;)
[05:13:35] <jmkasunich> ok, all that proves is that I don't know C++ terminology
[05:13:36] <jmkasunich> so sue me
[05:13:44] <petev> the bottom line is you have many more tools at your disposal with C++
[05:13:49] <jmkasunich> I misused constructor when I meant new
[05:13:54] <SWPadnos> "new" is an allocator, the constructor is what initializes things
[05:13:59] <petev> you have everytihg you have in C, and more
[05:14:27] <petev> I often use C++ in embedded hard RT projects
[05:14:38] <petev> there is no way a heap or dynamic allocation is going in there
[05:14:52] <petev> and often times you have shared and private data
[05:15:02] <petev> you can't do this easily with C
[05:16:38] <jmkasunich> going back to the basics - I will never be comfortable with C++ until I can read the code and understand what is being executed, what is being allocated, etc
[05:16:49] <SWPadnos> I like the idea of overriding new so it sticks memory-mapped stuff on the actual hardware registers
[05:17:02] <petev> don't complicate things
[05:17:07] <jmkasunich> that may not be the way the C++ folks like to teach it, which may be why I've had terrible luck trying to learn it from books
[05:17:26] <petev> most C++ books suck
[05:18:32] <petev> jmk, knowing how you look at things, I would really write a few simple exapmles and look at the mixed assembly listing
[05:18:33] <SWPadnos> about the only thing you get for free with C++ is the added type safety
[05:18:42] <petev> turn off optimization
[05:19:02] <petev> I wasn't comfortable using C++ in hard RT stuff until I looked at much assembler output
[05:19:18] <alex_joni> morning
[05:19:26] <SWPadnos> hi Alex
[05:19:27] <jmkasunich> petev: I don't suppose the compiler can produce C output can it?
[05:19:45] <petev> AT&T had a C++ front end
[05:19:52] <petev> it was a pre-processor
[05:19:52] <SWPadnos> if you compile C code with a C++ compiler, you get the exsact same output as C, with the exceptiokn of the linker names
[05:20:00] <petev> gcc is native and can't
[05:20:17] <petev> I think what he wants is to see the C++ in C form
[05:20:25] <SWPadnos> sure
[05:20:29] <petev> so see what virtuals do, inheritance, etc.
[05:20:34] <jmkasunich> even without optimization, examining asm output is not the easiest way to shed light on C++
[05:20:44] <petev> mixed assem ;-)
[05:20:53] <petev> I thought you were a low level guy ;-)
[05:21:07] <SWPadnos> have I mentioned tha tGNU assembler syntax is nearly unreadable? ;)
[05:21:30] <jmkasunich> yes, you have, but I don't think pete saw that
[05:21:32] <petev> you might be able to find the old AT&T front end somewhere
[05:22:01] <petev> I don't have any problems with gnu assembler
[05:22:37] <SWPadnos> for some reason I do - I think I'm used to asm variants with dest and src swapped
[05:22:42] <alex_joni> * alex_joni wanders off scared
[05:22:47] <jmkasunich> I'm used to MASM
[05:22:53] <jmkasunich> and that was a long time ago
[05:22:55] <alex_joni> serves me right to wake up this early
[05:22:58] <SWPadnos> heh
[05:23:05] <SWPadnos> serves me right to be up this late
[05:23:09] <jmkasunich> ditto
[05:23:11] <petev> jmk, start with the stroustrup C++ book
[05:23:30] <petev> it is more of a reference and shows you a bit of how things are implmented
[05:23:37] <jmkasunich> actually, I'm gonna start working on the 5i20 project again
[05:23:47] <alex_joni> jmkasunich: that's good to hear..
[05:23:56] <jmkasunich> and if I learn an OOP language, it will be Python, not C++
[05:23:58] <SWPadnos> I have a great paper by Scott Meyers that shows all the vtable stuff and other under-the-hood things
[05:24:29] <petev> alex_joni, you don't know any cheap sources for a puma 560, do you?
[05:24:47] <alex_joni> ebay
[05:24:53] <alex_joni> nothing besides that
[05:25:03] <petev> I havent seen any there, do they come up often?
[05:25:24] <jmkasunich> has to be a puma 560, not just a puma shaped robot?
[05:25:33] <alex_joni> petev: once in a while
[05:25:37] <alex_joni> SWPadnos: http://www.youtube.com/watch?v=JrH5j5kHC28&eurl=http://www.techamok.com/
[05:25:38] <petev> could be just puma shaped and about the same size
[05:26:05] <jmkasunich> how big is a 560?
[05:26:23] <alex_joni> table size :D
[05:26:29] <petev> about 300 lbs
[05:26:29] <alex_joni> (but a largish table)
[05:26:33] <jmkasunich> http://www.hgrindustrialsurplus.com/search-products/product-detail.aspx?id=40-988-026&searchtable=2&sortExpression=&SortASC=&pageSize=50&currentPageIndex=0
[05:26:41] <jmkasunich> smaller than that I guess?
[05:26:57] <alex_joni> a bit
[05:27:20] <petev> hmm, seems a bit pricy without a control
[05:27:34] <alex_joni> so where does emc fit in?
[05:27:36] <SWPadnos> heh - that's a reasonably fast camera
[05:27:43] <jmkasunich> ?
[05:27:47] <petev> seems like guys are picking up used puma 560s in the $200-$300 range
[05:27:51] <alex_joni> jmkasunich: the link I pasted
[05:28:01] <alex_joni> petev: never seen em that cheap
[05:28:34] <petev> that's what I have read on the web, never saw one on eBay, most needed repair, but were fairly complete
[05:28:38] <jmkasunich> petev: if you know where the "guys" are getting them, why are you asking us?
[05:28:44] <petev> I don't
[05:28:48] <petev> they just say they got them
[05:28:54] <petev> I have not been able to even find one
[05:29:05] <SWPadnos> there's one on eBay for only $89500
[05:29:12] <petev> what?
[05:29:17] <petev> that can't be a puma 560
[05:29:22] <SWPadnos> but it has a turning center attached
[05:29:25] <petev> these things were made in the 70s
[05:29:28] <SWPadnos> no, it's a puma 200 :)
[05:30:40] <jmkasunich> goodnight guys
[05:30:45] <SWPadnos> see you jmk
[05:30:47] <petev> gn
[05:46:28] <alex_joni> good night
[12:29:53] <jepler> bah. the only thing you need to understand about OO is that "class" is "struct" and class methods are called with an implicit pointer-to-struct argument.
[12:30:07] <jepler> then you can see all of OO through your C-programmer glasses
[14:21:01] <cradek_> cradek_ is now known as cradek
[14:22:22] <SWPadnos> jepler, yes, that would have been a much better route to take
[14:24:39] <jepler> actually that doesn't explain Python classes very well
[14:25:19] <jepler> I feel bad that I caused the whole evening to be lost on "what is all this complicated Python stuff" instead of the important FPGA-related things
[14:26:02] <SWPadnos> yeah - I thought things were going pretty well for a while, but then we digressed into a "beat jmk with OOP" session
[14:26:21] <SWPadnos> but it wasn't your fault, by any means
[14:27:55] <SWPadnos> my original intent was to show how similar the constructs can be, then point out that HAL is largely "manual OOP
[14:27:58] <SWPadnos> "
[14:34:06] <SWPadnos> ok - I just talked to a local print house. they're about the same price as Kinko's for printing (~$25 for 100x 2-sided card stock)
[14:34:51] <alex_joni> laminated?
[14:34:58] <SWPadnos> she'll get back to me with the lamination quote (tomorrow morning), and I did ask about getting the cards punched before/after lamination
[15:14:27] <cradek> jepler: thanks for fishing for that bug report
[15:34:12] <SWPadnos> now isn't this interesting:
[15:34:14] <SWPadnos> In the near future, DeskCNC will work with the ncPOD. There will be some changes because the ncPOD uses the more advanced EMC2 interpreter/trajectory planner.
[15:34:15] <SWPadnos> Fred Smith - IMService
[15:34:42] <SWPadnos> from the cad/cam/edm/dro list
[15:35:40] <SWPadnos> so I guess there's a port of (parts of) EMC2 to some embedded processor
[15:40:17] <jepler> what's an ncPOD?
[15:40:29] <cradek> are they playing by the GPL?
[15:41:55] <jepler> no sign of source at http://ncpod.oemtech.com/
[15:42:36] <cradek> oh good grief
[15:42:41] <jepler> "*Trajectories may be imported from 3rd Parties (includes EMC Trajectory Planner)"
[15:43:06] <jepler> (click "hardware features")
[15:43:49] <SWPadnos> well, maybe we can ask him for a copy at CNC workshop
[15:44:38] <jepler> I'm downloading "ncPOD SDK 0.3.3.1.zip"
[15:45:38] <SWPadnos> taht is an annoying site design
[15:45:40] <SWPadnos> that
[15:45:46] <jepler> ho kidding
[15:45:49] <jepler> no kidding
[15:45:59] <SWPadnos> are you calling me a ho?
[15:46:06] <jepler> ho ho ho
[15:46:09] <jepler> I mean, no no no
[15:46:13] <SWPadnos> yo yo yo
[15:46:57] <SWPadnos> that is one large SDK
[15:46:59] <SWPadnos> 26M
[15:47:41] <SWPadnos> hmmm. I'm trying to remember the IRC nick of the person from ncpod
[15:47:57] <SWPadnos> I think he was one of the people talking about an ARM port
[15:48:08] <jepler> I love the "software with realistic 3d view" http://ncpod.oemtech.com/control-panel.png
[15:48:15] <SWPadnos> heh - yeah
[15:55:46] <jepler> private static void writeIniFile (string iniFileName)
[15:55:46] <jepler> {
[15:55:46] <jepler> Org.Mentalis.Files.IniReader ini = new Org.Mentalis.Files.IniReader (iniFileName);
[15:55:49] <jepler> ini.Section = "EMC";
[15:55:51] <jepler> ini.Write ("MACHINE", "NCPOD");
[15:55:54] <jepler> ini.Write ("DEBUG", "0x00000003");
[15:55:57] <jepler> ...
[15:57:49] <SWPadnos> looking through the file list, I don't see a whole lot of EMC source files
[15:58:54] <jepler> './ncPOD SDK 0.3.1.1/gcodecompiler/gcodecompiler.exe' is some version of the emc interpreter
[15:59:01] <jepler> I'm looking at strings to see if I can find out more
[16:00:01] <jepler> it's at least old enough not to have lathe canned cycles: L word with no canned cycle or g10
[16:00:17] <jepler> vs this string from current emc: ("L word with no canned cycle, g10, or g76 to use it")
[16:00:46] <jepler> K word with no g2, g3, g33, or g87 to use it
[16:01:18] <jepler> but it has g33 which I think is clearly emc2/g33 days
[16:01:23] <jepler> er, emc2/gpl days
[16:01:43] <cradek> you better check emc1 to be sure - g33 was there (but disabled) for a while
[16:02:19] <jepler> 1.22 (cradek 30-Apr-07): /* 94 */ _("K word with no g2, g3, g33, g87, or g43 to use it"), // check_other_codes
[16:02:22] <SWPadnos> I don't think it was in the non-GPL days, didn't Paul add it?
[16:02:33] <cradek> ok
[16:02:53] <cradek> that was my work then
[16:03:19] <jepler> http://cvs.linuxcnc.org/cvs/emc2/src/emc/rs274ngc/rs274ngc_errors.cc.diff?r1=1.21;r2=1.22
[16:03:22] <jepler> -/* 88 */ _("I word with no g2, g3 or g87 to use it"), // check_other_codes
[16:03:23] <jepler> +/* 88 */ _("I word with no g2, g3, g87, or g43 to use it"), // check_other_codes
[16:07:06] <jepler> er I guess that's the wrong line
[16:08:19] <SWPadnos> argh. on an installed system, is /usr/realtime there, or do you need /usr/realtime-2.6.15-i386-magma ?
[16:08:24] <jepler> 121: /* 94 */ _("K word with no g2, g3, g33, or g87 to use it"), // check_other_codes
[16:08:25] <SWPadnos> or whatever it really is
[16:08:27] <jepler> 1.7 paul_c
[16:09:16] <cradek> SWPadnos: in the packages I/alex made, it's /usr/realtime-`uname -r`
[16:09:40] <SWPadnos> ok. I'm trying to type in specific instructions for someone who would boot from the liveCD
[16:10:22] <SWPadnos> we ought to think about putting a link on the desktop (or somewhere) for a terminal in the RT testsuite directory
[16:10:44] <SWPadnos> hmmm. this is more complicated, he's got to make the rtf devices in /dev
[16:12:11] <cradek> he can run the latency test exactly the same was as on an installed system
[16:12:15] <cradek> the instructions are in the wiki
[16:12:20] <cradek> way
[16:12:40] <jepler> OK how about this string?
[16:12:42] <SWPadnos> ok - I'm writing an email to someone on the geckodrive list who's complaining that Mach can't generate a smooth pulsetrain on a 900MHz computer
[16:12:43] <jepler> http://cvs.linuxcnc.org/cgi-bin/cvsweb.cgi/emc2/src/emc/rs274ngc/rs274ngc_errors.cc.diff?r1=1.11;r2=1.12
[16:12:55] <SWPadnos> the suggestions so far have been to upgrade to a 1.6GHz or faster P4
[16:13:04] <jepler> $ strings gcodecompiler.exe | grep -i "P word with.*89"
[16:13:04] <jepler> P word with no g4 g10 g64 g82 g86 g88 g89
[16:13:05] <SWPadnos> I'm sugegsting another alternative :)
[16:13:21] <cradek> yeah that's a terrible suggestion
[16:13:49] <SWPadnos> but I think I should put the instructions in the email, even if I do point him at the wiki
[16:14:24] <cradek> SWPadnos: I just meant to say that it doesn't matter if he's booted live or installed - the instructions are the same, and it's documented
[16:14:35] <SWPadnos> ok - I'll take a look there
[16:14:41] <cradek> I have no stake in how you communicate that :-)
[16:14:45] <SWPadnos> heh
[16:15:08] <cradek> jepler: mar 2006 is clearly gpl days
[16:17:20] <jepler> OK -- I request that the board make contact with oemtech.com to see how they will meet their GPL obligations.
[16:19:37] <SWPadnos> I can also ask in response to the CCED mail
[16:20:04] <SWPadnos> not in any official sense, of course
[16:22:29] <jepler> I dunno -- it might be best to go the private route first
[16:23:41] <SWPadnos> I was thinking of something liek "I'm curious to see the changes, but I can't find the source anywhere" ...
[16:24:43] <jepler> oh be all innocent-like? hah.
[16:32:51] <skunkworks> SWPadnos: you probably will get kicked off of the cced list ;)
[16:34:22] <SWPadnos> I think this kind of question has been raised before, but who knows
[16:35:28] <SWPadnos> Fred happened to mention the TP specifically as well - I suspect it's a bit more difficult to figure out what version that is (since it would be on the target device, and likely has no strings to browse)
[16:36:19] <jepler> yeah I haven't come up with any brilliant way to search for that
[16:36:43] <SWPadnos> I haven't eve looked enough to determine the architecture :)
[16:36:46] <SWPadnos> even
[16:39:43] <jepler> the firmware would seem to be in http://ncpod.oemtech.com/downloads/ncPODUpdater2022.zip but that just has a single ZIP inside it
[16:46:00] <jepler> haha nice visual design here too: http://emergent.unpy.net/files/sandbox/updater.png
[16:46:12] <jepler> (the scrollbar doesn't seem to do anything, but I suppose that could be wine's fault)
[16:48:01] <SWPadnos> eah - I just ran it too :)
[16:48:04] <SWPadnos> yeah
[16:48:37] <skunkworks> hmm - looks like something I wrote.
[17:12:22] <jepler> ./ncPOD SDK 0.3.1.1/ncPOD Controller/Library SharpUSBlib20041208 Modified/COPYING_LGPL.txt:[This is the first released version of the Lesser GPL. It also counts
[17:12:26] <jepler> ./ncPOD SDK 0.3.1.1/ncPOD Controller/Library SharpUSBlib20041208 Modified/UsbLibrary.cs: // This program is free software. It is dual licensed under GNU GPL and GNU LGPL.
[17:12:29] <jepler> ./ncPOD SDK 0.3.1.1/ncPOD Controller/Library SharpUSBlib20041208 Modified/UsbLibrary.cs: // See COPYING_GPL.txt and COPYING_LGPL.txt for details.
[17:16:19] <skunkworks> so... what does that mean?
[17:16:50] <jepler> they include the source for some GPL/LGPL software -- I hope it means they're not totally clueless
[17:19:22] <skunkworks> Good :)
[17:23:49] <SWPadnos> those strings are likely in a Sharp microcontroller USB library. I'm not sure if that indicates that the ncpod people are clueful
[17:58:39] <skunkworks> * skunkworks doesn't think hardware should be run when there is still latency issues with the computer.
[17:58:50] <skunkworks> anywho
[17:58:51] <SWPadnos> heh - ditto
[17:58:52] <skunkworks> http://www.eweek-digital.com/eweek/20070521_stnd/?sub_id=COdVs7ZCZzSaE
[17:58:56] <skunkworks> page 9
[18:00:38] <SWPadnos> the MS patent thing?
[18:01:29] <skunkworks> yes
[18:02:40] <skunkworks> 235 patent violations
[18:02:50] <skunkworks> according to MS
[18:02:58] <SWPadnos> blah blah blah
[18:03:01] <SWPadnos> according to MS
[18:03:26] <skunkworks> :) - you know what that means - linux is a threat
[18:04:07] <skunkworks> logger_dev: bookmark
[18:04:07] <skunkworks> Just this once .. here's the log: http://www.linuxcnc.org/irc/irc.freenode.net:6667/emcdevel/2007-05-23.txt
[18:09:16] <skunkworks> On that note - it just took me 2 days to get a scale to talk to access for wieghing product
[18:09:30] <skunkworks> serial
[18:11:28] <SWPadnos> bummer
[18:39:51] <jepler> maybe the "realtime" error should cause an estop
[18:40:28] <jepler> the pop-up isn't one app "stealing focus" from another, it's axis displaying an error message
[18:41:15] <jepler> but it's true that you can't do something else (like hit F1 to estop) while axis is showing an error message or other modal things
[18:41:37] <jepler> ("Open" and touch off come to mind, though at least you can't be running a program then)
[18:43:15] <cradek> I wonder if the messages could be something other than popup dialogs
[18:43:49] <cradek> I've had the "I wish I didn't have to acknowledge each of these damn windows" syndrome before
[18:45:37] <jepler> in mini they appear in a little box and scroll up as more show up
[18:46:44] <cradek> I'm torn: it might be easy to miss a new one with that scheme
[18:47:09] <cradek> but if I think about using a (debug,...) in a loop or something, it sounds great
[18:49:12] <jepler> there are different classes of errors
[18:49:12] <jepler> if kind in (emc.NML_ERROR, emc.OPERATOR_ERROR):
[18:49:19] <jepler> these should be displayed in an attention-getting way
[18:58:01] <cradek> jepler: my habit is to hit ESC when something is going wrong - will that work too?
[18:58:28] <jepler> cradek: no, my patch applies specifically to the F1 key
[18:58:38] <jepler> unfortunately, ESC has a special meaning in most pop-ups
[18:58:46] <jepler> (dismiss and take no action)
[18:58:48] <cradek> yeah
[19:00:08] <jepler> is there a reason beyond habit that you use ESC?
[19:00:36] <cradek> with steppers, if you hit F1 you lose position
[19:00:39] <cradek> (maybe)
[19:00:43] <cradek> choppers turn off
[19:00:53] <cradek> I think it also doesn't decel
[19:01:39] <jepler> -root_window.bind("<Key-F1>", commands.estop_clicked)
[19:01:39] <jepler> +root_window.bind_class("all", "<Key-F1>", commands.estop_clicked)
[19:01:43] <jepler> I wonder if this is a bug-fix
[19:02:19] <jepler> I wonder if it will turn out to cause some problem I won't realize 'till later
[19:02:30] <cradek> yeah that's the real question
[19:03:50] <jepler> ('til? or 'till?)
[19:04:02] <cradek> un'til
[19:04:52] <jepler> yeah I figured
[20:02:11] <alex_joni> 'til
[21:10:13] <SWPadnos> ok - I called this place about CDs: http://www.dup-tek.com/dup_blue_002.htm
[21:10:40] <SWPadnos> the guy said they have an FTP site but they don't use it very often (and he wanted to be sure it's still up :) )
[21:10:57] <SWPadnos> but he can download an ISO and check it instead of needing a master CD
[21:11:25] <alex_joni> good night all
[21:11:32] <cradek> alex_joni: goodnight
[21:11:38] <cradek> SWPadnos: nice find
[21:12:00] <SWPadnos> thanks
[22:50:56] <jepler> is the hal_link change (make linking an already-linked pin an error) a fix that should go in 2.1?
[23:41:34] <cradek> can anyone else get to wiki.linuxcnc.org?