Gcode from select list

More
12 May 2014 22:43 - 12 May 2014 22:46 #46843 by pauliq
Hello, this is my first cnc project and i have a few problem . I develop program which have list with @ 800-1000 products in 100-200category. In GUI after select product from lists, user can click run button and cnc machine cut selected shape. End user mustn't see raw gcode files becouse is our knowhow. The best will be when program automatic download list of shapes from outside source like web or ftp becouse our base of prodcuts is still growing.

I based on linuxcnc 2.5
I used glide to make interface.
We have about 900g code file.


Now i have program where i must select file with gcode (button with hal_action_open) and after click button machine cut the shape.

I try build this solution : select firstcategory, after second cat and select product with name ex. product111
This run phyton script which download gcode http://....product11.gcode.
and cut it

But I dont know how to connect this tree things : select list, button run and outside source.
Phyton script with download file is not a problem but i don't know what to connect with hal or something?

any idea or tip ? :)
Last edit: 12 May 2014 22:46 by pauliq.

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

More
13 May 2014 07:24 #46858 by andypugh
Replied by andypugh on topic Gcode from select list
If you require the user not to be able to see the G-code then you might need to do something clever with permissions, and then set the default file path in the INI to point to a hidden directory.
You would then copy the g-code to that directory, and then tell LinuxCNC to run it with a simple action-button.

I did something vaguely similar with my lathe macros, though in that case the files all live in the config folder, rather than somewhere hidden, so I am not sure if it is possible to create a directory that LinuxCNC can read a file from, but that users can't see. (removing the execute bit from a directory means that it can't be viewed with ls, but that probably also means that programs can't find the file:

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

More
13 May 2014 13:29 #46866 by pauliq
Replied by pauliq on topic Gcode from select list
Thank you for replay.
But I think better will be use phyton script but i don't know where exaclly search variable where program are storing gcodes after loaded gcode files.
For example : Now i have 2 buttons, one is with open file, second run the machine.
In my idea You have one button with run machine, after open program python script open a file and load gcode.
The gui files contein 2 files gui(python) and gui.glide.
It's possible to edit first file to do it?

In other programmer langugage i will be something like that:
1variable = openfile ('gdode.txt);
if button clicked (
run 1variable)

more or less

I base on phyton file from gnipsel.com/linuxcnc/gui/gui03b.html

But i don't know where put my py script with open file and where assign to variable that program open it where i click button run.

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

More
13 May 2014 13:35 #46868 by ArcEye
Replied by ArcEye on topic Gcode from select list
Hi

Your file chooser can be a stand alone program, accessing a source that only it knows,
then it can just send the chosen file to Axis with axis-remote.

Would make things a lot simpler

regards

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

More
14 May 2014 15:52 #46910 by newbynobi
Replied by newbynobi on topic Gcode from select list
Hi,

In your GUI just place a normal button. This button need the signal "on_button_clicked. Connect your python script to that signal as usual. Your code may save the gcode in the temp dir and than call this file and start it. You can do that very easy using the linuxcnc python binding. It is very well documented on linuxcnc.org/docs/html/common/python-interface.html

And after finishing the cut, you delete the temp file. So it is "hidden" to the user.
You may also generate the code lines on the fly using python and send the commands as MDI commands.

Norbert
The following user(s) said Thank You: pauliq

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

More
14 May 2014 16:55 - 14 May 2014 16:57 #46912 by pauliq
Replied by pauliq on topic Gcode from select list
Thx for replays! guys!

Norbert, I had some problem with connect my script with my machine but now it's working more or less ;) .

I load phyton script before gui load

Open file decode in base64, encode it write in temporary file, after that program open this file and after cut when user click x is remove from disk.

Now i must build interface user because this will be touchy display.

Thx :)
Last edit: 14 May 2014 16:57 by pauliq.

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

More
15 May 2014 03:41 #46942 by newbynobi
Replied by newbynobi on topic Gcode from select list
Glad if I could help.

Norbert

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

Time to create page: 0.083 seconds
Powered by Kunena Forum