LinuxCNC Features - a kind of NGCGUI

More
05 Feb 2015 17:04 #55712 by Nick
Hi!

Great! I'll be looking forward for your subroutines!

My IDE is gedit :). In fact it's the best choice for me.
Python is interpreter so usually debuging is easy - i just add print into the code. Or if there are any syntax or dev nul errors - they are shown in the console.

Hi Nick,
1.) The issue with copying features and the #<self-id... FernV mentioned in another post,
2.) A grouping problem:

1. Can you explain this bug?
2. I've noticed that problem to, just have no time to get rid of this bug. Anyway I thought it is possible to remove the element from the group and move it to another.

Please Log in or Create an account to join the conversation.

More
05 Feb 2015 19:01 #55716 by turbospeedskater
Hi Nick,

to explain bug #1:

Start from scratch.
1.) Add "Tool->set cutting parameters"
2.) Add "Tool->set tool parameters"
3.) Add "Cutting->Circles->Circle from center"
4.) Add "Grouping->Array"
5.) Put the circle from step 3 inside the array
6.) Click "refresh" and you see 5 circles in side LinuxCNC. So far so good, but now it comes:

7.) Select the array and click on "copy".
8.) Now you have the array twice.
9.) Click "refresh" again. Now you see an error message inside LinuxCNC.

Root cause is (at least I think so): the unique-ID of an element is copied, so it is not unique anymore...

...I hope this helps locating the problem....

best regards,

Martin.

Please Log in or Create an account to join the conversation.

More
05 Feb 2015 21:05 #55718 by turbospeedskater
Hi Nick,

the Problem I have with bug #2 from my 1st post is, that the 2nd circle can
not be moved back into array #2....

To give you a bit support, I have attached a file "AAA-4.xml" (sorry for the strange name).
It contains two arrays, each having two circles inside. Exactly what I want.
I have made it by editing the xml output of your software with gedit.....

The strange thing is: if you open the file, everything looks fine as expected.
If you save it under another name, and open it again, the circles have all
moved to group #1....

So the problem should be somewhere in the XML handling??

I hope this helps....
best regards,

Martin.
Attachments:

Please Log in or Create an account to join the conversation.

More
06 Feb 2015 00:21 - 06 Feb 2015 00:26 #55724 by FernV
Hi Nick, Martin

I know 2 development tools that works very good

Anjuta is really good but no real debugger except "print". Very easy to use.

The very best I found is Eclipse with pydev plugin. Great IDE but takes sometime to get use to and pydev has a REAL debugger.

I made a lot of changes to the app: better exception handling, shortcuts that work and I use a menu instead of a (what is the name ? image box ?). The menu is defined in a 'XML' file. I also did code cleanup and corrected most typos. It can be loaded before LinuxCNC and will auto-refresh when loaded. I added validity check in script (NGC) files, tool compensation and it draws a reference line (disappears by toggling '/', do not forget to do it before milling). I added some icons, an ellipse, one 'feature' that will allow to temporarily swap units (usefull in North America) and anything that has corners can have them rounded, inverted round or chamfered. Since I was unable to make 'Draw' work, I removed it and am developping something similar that does not use python but all coding is in NGC file, it does not include arc yet but corners can be shaped including at the start/finish point.

I will post some screenshots when I have time (may take a few weeks)

If the copy issue can not be solved, I will simply remove the 'self_id' and use NGC files. That would solve the problem but I would rather see the ID changed just to make sure the order I want is right.

Regards
Last edit: 06 Feb 2015 00:26 by FernV.

Please Log in or Create an account to join the conversation.

More
06 Feb 2015 15:16 #55735 by turbospeedskater
Hi FernV,

thanks for the hints regarding the IDE for python.

I will check out Anjuta. I have already installed NetBeans and Eclipse.
But in both I could not really make the debugger working.
Single stepping through the features.py source code to find out how
everything works together simply does not work in both....
It seems, the debugger looses its link to the IDE if tracing the code.

But I will keep on trying...

If I have some time this weekend, I will write some words about the things I have
changed/added/improved on the features software.
I worked mostly on the ini, xml and ngc files, because I am not a great python expert...
And I had some subroutines written for ngcgui that I have ported to the feature software.

I will keep you informed,

best regards,

Martin.

Please Log in or Create an account to join the conversation.

More
06 Feb 2015 21:28 #55744 by FernV
Hi Martin,

You will find info on how to install pydev here
pydev.org/manual_101_root.html
find "Installing with the update site"
and follow instructions

or for a complete set-up
www.liclipse.com/

You can not debug python with only the debugger from Eclipse

Regards
Fern

Please Log in or Create an account to join the conversation.

More
06 Feb 2015 22:06 #55747 by turbospeedskater
Hi Fern,

I had installed dydev according to the instructions from the site you mention.
But somehow during my 1st tests, the debugger crashed from time to time....

But today (after installing, but not using Anjuta, and making my weekly software update),
everything works as expected. No idea why..... But now I can trace through the code
and inspect the variables.

Hopefully I will find the time for understanding the internal functions and
finding the problem with more than one groups....

Thanks, and best regards,

Martin

Please Log in or Create an account to join the conversation.

More
12 Feb 2015 20:09 #55912 by turbospeedskater
Hi Fern,

in the meantime I have some success with eclipse and PyDev.
From time to time the debugger still crashes, but it is usable.

I traced the code down to some function dealing with the conversion
of data ( treestore / xml / file etc ). The problem I have now is:

The debugger does not know about the internal definitions of these data
objects, because they are defined somewher external in the gtk interfacing.
So I can not view the contents of the data objects. I can see the pointer
address only.

Do you know what to do to give the python debugger inside eclipse the knowledge
about these data objects, so that their contents can be seen?

I tried to find these infos with google and inside the eclipse and pydev handbook,
but up to now without success.:-( So i am stuck now....

any hints are welcome,

thanks in advance and best regards,

Martin.

Please Log in or Create an account to join the conversation.

More
12 Feb 2015 20:28 #55913 by FernV
Hi Martin

Pydev needs Java 7 to work well, so I guess you already have it installed and see the pydev perspective.

Python is not typed like C, C++ or Delphi and this is why we do not know what the variable is all about. You just declare a variable name. I like language where we declare :
integer newvar;
or
newvar: Integer;

Python makes it much more difficult to debug.

This issue prevents from creating important scripts.
I was thinking this morning that it could be easier to manipulate the treestore directly instead of converting first to XML and convert back to treestore.

What do you think ?

Fern
The following user(s) said Thank You: turbospeedskater

Please Log in or Create an account to join the conversation.

More
13 Feb 2015 20:14 #55944 by turbospeedskater
Hi Fern,

yes: not permanently converting between two formats sounds easier .
And: I also like variable declarations :-)

But I don't now if all utility functions (element handling inside a treestore object) are available.
...and in every case saving the files in XML is a good feature.

As I said earlier: I am not a python programmer, and normally I don't ever write software
running under graphical environment. So I have no experience about the available routines
in all those toolkits and libraries that are used nowadays.

I feel more comfortable in microcontroller environments, where I can measure voltages, currents,
temperatures etc. and the bits I switch control coils/motors and things like that.
So even object oriented programming is not a thing I do every day.
Sometimes I still write assembler if there is something time critical....

But this software is something that is exactly what I need, so I am willing to spend some time
to understand and optimize it. And I already have ported my old ngcgui-subroutines to it, because
it looks much nicer and can also be used by my colleagues without too much CNC knowledge.

BTW: I have done some more testing in the meantime to find out, where the items in groups (if
there is more than one) move from one group to another. I have made a xml file (externally, with gedit)
containing two groups, each having two items (posted before). When I load it, the 1st display is ok.
Each group is still having two items. When I do any change to the xml program with the features software
e.g. add a hole or whatever, the items move from the 2nd group to the 1st.

So I guess, the problem is in converting treestore back to xml.
It can not be in the xml to treestore, because then also the 1st display of the new loaded xml should be wrong....

This weekend I have to finish a big milling job in stainless steel, so I don't think I will have time to put into
this problem. But I will try :-)

best regards,

Martin.

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Powered by Kunena Forum