QtVCP gcode file opening

More
21 Feb 2019 02:57 #126843 by phillc54
When I first open a file from an ActionButton it opens ok, although it seems to open a temp file.
If I try to open the same file again I get:
temp /tmp/emcflt-9CjmtY.d/metric_line.ngc
G-Code error in metric_line.ngc
Near line 1 of
/tmp/emcflt-9CjmtY.d/metric_line.ngc
File ended with no percent sign or program end
This happens consistently.

I then set up a QPushButton to open a specific file as follows:
    def open_clicked(self, w):
        STATUS.old['file'] = ''
        self.cmnd.program_open('/home/phill/linuxcnc/nc_files/plasmac/metric_line.ngc')
This opens the file correctly. I can then edit/save the file then open it again from this button consistently.
I can also edit the file externally (with Geany) while the file is opened in LinuxCNC, save it and press the button and it reopens the new version correctly.

It seems:
1. that a file opened in LinuxCNC (master branch at least) may be edited while loaded.
2. there is some sort of issue with opening a file via the ActionButton.

Cheers, Phill.

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

More
21 Feb 2019 07:28 #126847 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
1) I'm not sure what you mean - you are editing a file then reloading it - you are not actually editing the file in linuxcnc's motion controller. Are you wishing to not be able to edit the same file that is currently loaded into the machine controller?

2) action button loading checks to see if the loaded program is a filter program such as a python program - Maybe you are missing the INI entry for setting the type of filter program allowed - Of course it shouldn't fail because of that - as soon as I am back from my work trip - i'll look into it.

Chris M
The following user(s) said Thank You: phillc54

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

More
21 Feb 2019 08:30 - 22 Feb 2019 05:47 #126850 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening
1. This was just an observation that it seems possible to edit and save a file that is also loaded in the machine controller without it being a temp copy.

2. Open a file via the action button, it loads into the machine controller and the gcode display/editor.
Edit the file in the gcode display/editor.
Save the file.
Load the file again via the action button.
It errors as described before and does not load the file into the machine controller.
To get it to load into the machine controller you need to open a different file then load the original file.

Cheers, Phill.
Last edit: 22 Feb 2019 05:47 by phillc54. Reason: Incomplete...

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

More
22 Feb 2019 05:43 - 22 Feb 2019 05:45 #126885 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening
I have played around a bit and have it working how I would like it to with a bit of a hack.

I wanted to keep the file open and file save dialogs consistent so I put a 'class patch' call in dialog_widget.py to bypass the FileDialog widget and use the standard QFileDialog as is used in the GcodeEditor.

Everything else was done in the handler file.

I have attached the changes I did to dialog_widget.py and also the relevant code from my handler file to give you an idea of what I was trying to do.

Cheers, Phill.
Attachments:
Last edit: 22 Feb 2019 05:45 by phillc54.

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

More
22 Feb 2019 06:42 #126886 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
hey Phill

The file didn't attach.

Chris

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

More
22 Feb 2019 06:50 #126887 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
Just thinking out loud - I would prefer to use the STATUS message called dialog system for the gcode file, so that in principle it would be easy to make a different dialog widget and have the action button or the gcode button use the same dialog.
When i hack together the edit mode i just used the code i found on line to flesh it out.
Thoughts?

I am happy the class patching is useful - I like to give integrator as much power as practical.

By the way what kind of screen you building ? got any sneak peeks? :)

Chris

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

More
22 Feb 2019 07:43 #126889 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening
Sorry Chris, here they are...

There is a pic in this thread, very much a work in progress...

You could also clone my repo and give it a run...

Cheers, Phill

PS. I will check out your suggestion later.
Attachments:

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

More
22 Feb 2019 12:53 #126904 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
Phill - I was wondering why i was not observing the problem you have reported and i have noticed you have .ngc in your INI FILTER entry.

I haven't actually tested filters I guess. Anyways i can't see the problem yet.
I cloned your repo but it won't load error:
'NoneType' object has no attribute 'setCurrentIndex'

Which seems to have something to do with one of these:
self.plasmac_settings_tabs.setCurrentIndex(1)
self.materials.setCurrentIndex(-1)

Maybe you haven't push some work yet?

Chris M
The following user(s) said Thank You: phillc54

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

More
22 Feb 2019 13:59 #126907 by tommylight
Replied by tommylight on topic QtVCP gcode file opening
There is a plasmac.comp somewhere that needs to be compiled.
Not sure if that is what you are missing.
The following user(s) said Thank You: phillc54

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

More
22 Feb 2019 23:13 #126963 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening

cmorely wrote:
I cloned your repo but it won't load error:
'NoneType' object has no attribute 'setCurrentIndex'


Well, I cloned the repo and have the same problem...
It is only the qtvcp config that is not working.
It works from my original local copy so I pushed again, pulled again to the new clone and it has the same problem :(

I guess I know what I am doing today...

Cheers, Phill.

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

Time to create page: 0.097 seconds
Powered by Kunena Forum