>> There are a lot other things I am doing that might be interesting to you I don't know.
Pete - we'll never know unless you spill the beans, now will we?
_______________________________________________________________
OK - this is what I've got as a data model so far...
http://www.rattlesnakehillsoftworks.com/stuff/model2.jpg
Lessseee now... a few comments and clarifications:
The top level class, SWItem, abstracts a data-storage extension facility for plug-ins (tags is a NSMutableDictionary, if that means anything to you...)
Both the Tool and the Operation classes have feed and speed fields. If left blank on any specific operation, the codegen will get the feed and speed from the tool, otherwise what you specified in the operation will apply.
All operations have names, and they don't have to be unique.
The project has a notes field, which can be printed out along with a list of tools required. The notes can be included in the program if you wish.
The project has a projectID field, which the G-Code codegen outputs as an O number, and the Mohave codegen uses as the resource name. This field is a string.
All operations have user-defined prologs and epilogs, which are inserted by the codegen just before and after the auto-generated code. This can be any text - it doesn't have to conform to any language expectations. Also, the entire project has prolog and epilog fields.
The tool ID is a string - so if you are using a tooling management system that takes non-numeric tool identifiers, you can put that in here. Also, you can have multiple tools with different parameters, but the same tool ID - enabling you to use any particular physical tool in multiple ways. The tool info is also output with the tool change command as a comment. And - not shown, as I just added it after uploading the jpeg of the data model - tools also have prolog and epilog fields.
Custom operations output the contents of the text field, and may be attached to a locus object. The x and y position of the locus object can be inserted into the code with a text substitution.
The codegen scans all inline text for certain variables, and substitutes the correct values for them. Codegen variables are prefixed with a ! symbol - something that I don't use in Mohave, and that I've never seen used in G-Code (now, if your machine
does use it, please let me know, and I'll find something else to use as a prefix).
Also not shown (again - added after I uploaded the jpeg) is that the order of operations is user-specified, so you can have it do things any which-way-round you want.
_______________________________________________________________
What I was going to do for post-processing is just provide the ability to run any command-line program, with parameters generated in the same manner as the inline-text is handled (i.e., with variable values being substituted into the command-line string before it's executed). Thus, you can write the post-processor in just about anything - C, Objective-C (i.e., Cocoa), AppleScript, Perl, Python, Awk, or any of the shell languages (although, if you're gonna' use a shell script, you're probably gonna want to use other support tools written in other languages to help it out) - heck, even RealBASIC should work, if you've got it...
Pete - I'm still thinking about how best to implement the feed multipliers... I'd like to integrate operation and tool specific overrides for comp factors as well as feed and speed, so that you could tweak a variable on the control for it... (not all controls will support this properly, and it's exact format is control dependent, so it's going to involve post-processor intervention)...
P.s. - some of you might not be familiar with the text-file light-sabers lurking in your Mac...
http://www.vectorsite.net/tsawk.html
http://www.grymoire.com/Unix/Sed.html
http://www.uccs.edu/~ahitchco/grep/
http://gnosis.cx/publish/programming/regular_expressions.html