prdatur / heekscnc

Automatically exported from code.google.com/p/heekscnc
Other
0 stars 0 forks source link

is there a way of streamlining the Objects panel method? #119

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is there a shortcut to inserting machining ops into the Objects panel? I am
not a C++ programmer (I am trying to learn though), but I am fairly
proficient with python. I have hacked a new machining op called
'TestMe.cpp' and have gotten as far as creating the dialogue box for the
Properties panel. I am stuck trying to get my settings inserted into the
Objects panel. I wonder if there is an easier way-like making a wxPython
dialogue and copying it into the Objects panel directly. I have been
playing with copying and pasting the xml data from the Objects panel back
and forth with an editor and it works for already established methods.

Thanks for reading,
Dan

Original issue reported on code.google.com by ddfalck2...@yahoo.com on 27 Jun 2009 at 4:17

GoogleCodeExporter commented 8 years ago
What I did was to take an existing machine operation class and duplicate it.  
You can
use the Drilling class as an example.  Duplicate the cpp and h files and rename 
the
files to something new.  Open each file and replace the word 'Drilling' with 
the new
operation name.  The operations classes all inherit from the COp class which, in
turn, inherits from the HeeksObj class.

The next trick is to insert your new operation class into the project.  Add it 
to the
Makefile (again duplicate the Drilling references).  In order to get it added 
to the
main menus so that your new code can be invoked from HeeksCAD, add it to the
HeeksCNC.cpp file.  Again, search for Drilling and duplicate/modify what you 
find.

It's much easier to use an existing module as a template and modify it from 
there
than to create a new class from scratch.  Once you have a starting point, you 
can
begin removing/renaming parameters and methods incrementally so that you know 
what
you've done if something stops working.

Good luck.

Original comment by David.Ni...@gmail.com on 27 Jun 2009 at 10:35

GoogleCodeExporter commented 8 years ago
thanks David. I am proceeding cautiously -I made a new directory to play in. As 
I
edit, I build again and check for errors. 

Original comment by ddfalck2...@yahoo.com on 27 Jun 2009 at 10:39

GoogleCodeExporter commented 8 years ago
I should also have mentioned the additions to HeeksCNCTypes.h to define a data 
type
for your new operation.

Similarly, adding a reference into Program.cpp allows this new machining 
operation to
generate the Python code that, in turn, generates GCode.  The Python generation 
stuff
starts in Program.cpp within a RewritePythonProgram() method.  This method, in 
turn,
calls the various AppendTextToProgram() methods that can be found within the 
various
machine operations classes.

Original comment by David.Ni...@gmail.com on 27 Jun 2009 at 10:51

GoogleCodeExporter commented 8 years ago
I think this question has been answered ok now.

Original comment by danhe...@gmail.com on 17 Jul 2009 at 11:21