QtVCP gcode file opening

More
23 Feb 2019 02:08 #126978 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
Lol I spoke too soon...I had added the code to the wrong clone... wow need ,more coffee or something..

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

More
23 Feb 2019 02:09 #126979 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening
haha, yep, I know how you feel...

Cheers, Phill.

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

More
23 Feb 2019 05:09 - 23 Feb 2019 05:31 #126982 by phillc54
Replied by phillc54 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.


I just pulled your latest commits and gave them a run...

DIALOGS:
The dialogs for the action button open and gcode editor are the same which is good but the save dialog is still the old one.

ACTION BUTTON:
If I load a file then try to load it again it does not reload it.
It also still gives this error:
File ended with no percent sign or program end
I can get this to work by changing the OPEN_PROGRAM function in qt_action.py like this:
    def OPEN_PROGRAM(self, fname):
        self.ensure_mode(linuxcnc.MODE_AUTO)
        flt = INFO.get_filter_program(str(fname))
        if not flt:
            STATUS.old['file'] = ''
            self.cmd.program_open(str(fname))
        else:
            self.open_filter_program(str(fname), flt)
        self.RELOAD_DISPLAY()
Then because I filter the gcode file I needed to do this:
    def OPEN_PROGRAM(self, fname):
        name, ext = fName.rsplit('.')
        self.ensure_mode(linuxcnc.MODE_AUTO)
        flt = INFO.get_filter_program(str(fname))
        if not flt:
            STATUS.old['file'] = ''
            self.cmd.program_open(str(fname))
        else:
            self.open_filter_program(str(fname), flt)
            if ext == 'ngc' or ext == 'nc':
                STATUS.old['file'] = ''
        self.RELOAD_DISPLAY()
This seems to work well (in my mind at least)

GCODE EDITOR:
When I load a file into the editor I like to also load it into linuxcnc.
To get this to work I changed the open function in gcode_editor.py to:
    def openCall(self):
        self.open()
    def open(self):
        STATUS.emit('load-file-request')
    def openReturn(self,f):
        self.editor.load_text(f)
        self.editor.setModified(False)
If you don't think this is the way it should function then I am happy to class_patch to the openCall to achieve my aims.

If there is anything I can help with, let me know.

Cheers, Phill.
Last edit: 23 Feb 2019 05:31 by phillc54.

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

More
23 Feb 2019 05:55 #126984 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
Yes I haven't addressed the error when loading the second time yet - I still haven't got your config to actually cause the error - though I got interrupted so didn't do much work on it. I wanted to understand what is actually happening before I incorporate your fix. Modifying STATUS's internal data (STATUS.old = '') from outside seems not good....

I agree the default behavior is surely to have the editor load the program into linuxcnc as well. Using the newer STATUS message way allows more flexibility in the future...

I think I'll use the new STATUS message way for now but adjust it to load the file into linuxcnc. Later we could add an option to load and edit files without loading into the machine controller if that is good utility. (i'm thinking in situations that you wish to edit/build a program while the machine is running a long program - but that may be unneeded complexity)


Your screen looks like it's had a lot of thought into it - nice!
I'm impressed that you have build so many different versions with different screen infrastructure - i look forward to further qtvcp critiques.

I did notice that your axis_tool_buttons for setting the axis origin are set to use the ENTRY dialog but the screenoptions widget does not load an ENTRY dialog.
the options are change the axis_tool_button to use the CALCULATOR dialog (because it looks like screenoptions does load a calculator entry dialog) or select the entry dialog option on the screenoptions widget. -it's fairly new code so I thought you might have missed the change.

Chris

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

More
23 Feb 2019 06:07 #126985 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening

I did notice that your axis_tool_buttons for setting the axis origin are set to use the ENTRY dialog but the screenoptions widget does not load an ENTRY dialog.
the options are change the axis_tool_button to use the CALCULATOR dialog (because it looks like screenoptions does load a calculator entry dialog) or select the entry dialog option on the screenoptions widget. -it's fairly new code so I thought you might have missed the change.


Possibly because I have no idea what I am doing here...

If I click a touchoff button a small popup appears, should I have done it some other way.

When I saw one of your recent commits mention calendar I checked the calendar but I didn't know where to go from there.

I think I need a bit of hand holding in this area...


Cheers, Phill.

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

More
23 Feb 2019 06:22 #126986 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
in the small pop up if you select 'set' a dialog should pop up - I don't think it does.
I would suggest to start with go to the screnoptions widget and under the properties select entry and calculator dialogs - then either option should work.
Later if you want to try the calculator as an entry for the touchoff button there is a property called 'dialog code' that you can change from ENTRY to CALCULATOR.

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

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

More
23 Feb 2019 06:41 #126987 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening

in the small pop up if you select 'set' a dialog should pop up - I don't think it does.
I would suggest to start with go to the screnoptions widget and under the properties select entry and calculator dialogs - then either option should work.
Later if you want to try the calculator as an entry for the touchoff button there is a property called 'dialog code' that you can change from ENTRY to CALCULATOR.


Ahah, yes, checking entry in the screenoptions does allow the set dialog.
Thank You

Cheers, Phill.

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

More
23 Feb 2019 07:46 #126989 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
I commented out your class patch for the file dialog, then load your program:
plasma_feed.ngc twice - I get no error.

can you help me get the loading error?

Thanks.

Chris M

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

More
24 Feb 2019 00:25 - 24 Feb 2019 05:02 #127030 by phillc54
Replied by phillc54 on topic QtVCP gcode file opening

I commented out your class patch for the file dialog, then load your program:
plasma_feed.ngc twice - I get no error.

can you help me get the loading error?


The attached config is the standard axis_mm sim config with a basic qtvcp gui and an unedited default handler file.
I have tested this on the latest master branch (not my plasmac branch).

1. Take machine out of estop.
2. Turn machine on.
3. Load line.ngc from the config directory.
4. Zoom the preview just to change the displayed size.
5. Edit and save line.ngc from an external editor.
6. Load line.ngc from the config directory.
7. Note that the file displayed in the editor is still the original and that the preview has also not changed.
I would expect that the editor should now show the modified file and the preview show the new modified file at the default zoom level

The above behaviour is the same on my plasmac config except:
1. When loading a file (after 2 and 6 above) the file name is printed to the terminal which doesn't happen above.
2. After 6 above, the error "File ended with no percent sign or program end" is also printed to the terminal.

Note that when I add the code from this post both the above behaviours disappear.

Cheers, Phill.

Edit:
I did a diff on lib/python/qtvcp on master and plasmac branches and there were no differences.

Edit:
In my plasmac branch I replaced the handler file with a copy of the default handler file used in the testing above, added the required callbacks (which are all just pass through) to enable the ui file to load and it shows the first behaviour above, not reloading the gcode file, which I did expect but it also shows the second behaviour, printing the file name and the error to the terminal.

Edit:
Next step was to make the screen preferences in the plasmac config identical to the basic one used above, this had no effect...

Edit:
OK... the printing to the terminal of the filename and the error is due to the filtering of the gcode file...
It is interesting though that if I get the file to reload correctly then this problem also disappears.
Also this printing to terminal does not happen in my other gui configs.
Attachments:
Last edit: 24 Feb 2019 05:02 by phillc54. Reason: more info

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

More
24 Feb 2019 06:16 #127034 by cmorley
Replied by cmorley on topic QtVCP gcode file opening
I pushed a fix for the problem presented by your test config ( Thank you very much! )

The problem there is that STATUS compares the old file name to linuxcnc's stat file name - if they are the same, it doesn't emit a 'file-loaded' message.

In your fix you cleared the old file name. in my fix I just checked to see if the file name to be loaded is the same as the one that status has, and if it's the same force an update.
It's really the same fix, but i prefer to not write to the internals of STATUS.

I have not tried with a filter program yet.

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

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

Time to create page: 0.199 seconds
Powered by Kunena Forum