Program Reload

More
7 years 2 months ago #142755 by phillc54
Program Reload was created by phillc54
Is there a way in Gmoccapy to reload the loaded program from an external source similar to what axis-remote can do for Axis.

Please Log in to join the conversation.

More
7 years 2 months ago #142785 by pl7i92
Replied by pl7i92 on topic Program Reload
gmoccapy uses the same task
so you can do a EMC_task to reload the g-code

Please Log in to join the conversation.

More
7 years 2 months ago #142853 by newbynobi
Replied by newbynobi on topic Program Reload
Or you use a small python code to send a reload command.

Norbert

Please Log in to join the conversation.

More
7 years 2 months ago #142907 by phillc54
Replied by phillc54 on topic Program Reload
Thanks Guys,

I don't think I can do what I want. My configuration uses a filter program specified in the INI file to parse the GCode file when it is first loaded. I see that Gmoccapy actually loads a temporary copy of the original GCode file, I tried the following code but it doesn't seem to apply the filter.
Code:
self.s = linuxcnc.stat() self.c = linuxcnc.command() self.s.poll() if self.s.file: print('FILE: {}'.format(self.s.file)) self.c.program_open(self.s.file)
What I am trying to achieve is shown in this video:

Please Log in to join the conversation.

More
7 years 2 months ago #142908 by cmorley
Replied by cmorley on topic Program Reload
gladevcp's hal_filechooser is the basis of loading filter programs.
You may be able to use that to create an external reload.

Maybe Norbert could add a way for users to tap into Gmoccapy's event loop to make this easier.

Chris

Please Log in to join the conversation.

More
7 years 2 months ago #143201 by newbynobi
Replied by newbynobi on topic Program Reload
Gmoccapy do use the widget hal action for this.
This is the code I use in the Key handling.
Code:
if (keyname == "R" or keyname == "r") and self.stat.interp_state == linuxcnc.INTERP_IDLE: if event.state & gtk.gdk.CONTROL_MASK: print("R und Control gedrückt") self.widgets.hal_action_reload.emit("activate") else: self.command.auto(linuxcnc.AUTO_RUN,0)

If you are in auto mode, using 2.8 branch gmoccapy3.0.8 you can use a hal pin for that purpose:
Code:
gmoccapy.h-button.button-1
As that button has also other functions, you need to check also for halui.mode.is-auto, and connect them with an and component.

something like this:
Code:
net mode-is-auto_1 and2.in0 <= halui.mode.is-auto net mode-is-auto_2 and2.in1 <= <your_input_signal> net reload and2.out => gmoccapy.h-button.button-1

Norbert

Please Log in to join the conversation.

More
7 years 2 months ago #143290 by phillc54
Replied by phillc54 on topic Program Reload
Thanks for that, I was able to use gmoccapy.h-button.button-1 and it did reload the program but unfortunately it only seems to reload the temp version of the program, not the original and it does not re-apply the filter program.

Please Log in to join the conversation.

More
7 years 2 months ago #143349 by newbynobi
Replied by newbynobi on topic Program Reload
OK so you do not want to reload a program, you want to load a new program! That is a big difference.
IMHO as long as you do use your cam to save the program under the same name and after that reload the program, the changes will take effect. If you need to pass your program before that through a helper program, you will need to add your own button using python script to load the program with the load command.

Please Log in to join the conversation.

More
7 years 2 months ago #143355 by rodw
Replied by rodw on topic Program Reload
Phill's not using CAM, his Plasmac system which runs on both Gmoccapy and Axis makes good use of Linuxcnc's filtering ability for plasma control.

It seems that Gmocappy is a bit out of step here. If filtering is a supported feature of Linuxcnc, the GUI (eg Gmocappy) should respect the feature and reapply any filter on a reload.

The thing is here is that Plasmac is a complete working system for Gmocappy. Plasmac is now part of the LinuxCNC core. The current Gmocappy plasma sim config that is an empty shell containing useless features for a modern plasma controller. and not including required features.

Plasmac deserves full support from the developers of the core LinuxCNC feature set. Its a very significant advance for Linuxcnc as it brings commercial quality control of a new class of machine to Linuxcnc. Furthermore, the way it build configs for new users sets a standard that other developers should adopt.

Please Log in to join the conversation.

More
7 years 2 months ago #143367 by phillc54
Replied by phillc54 on topic Program Reload

newbynobi wrote: OK so you do not want to reload a program, you want to load a new program! That is a big difference.
IMHO as long as you do use your cam to save the program under the same name and after that reload the program, the changes will take effect. If you need to pass your program before that through a helper program, you will need to add your own button using python script to load the program with the load command.

No, not a new program, I want to reload the program I selected in the filechooser so the original program passes through the filter program again.

Please Log in to join the conversation.

Time to create page: 4.197 seconds
Powered by Kunena Forum