QtVCP reading error message

More
07 Feb 2019 23:44 #125962 by phillc54
I have a ScreenOptions widget and have catch_errors_option checked, how do I then capture any/all error messages to display in another widget.

Cheers, Phill.

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

More
08 Feb 2019 09:11 #125984 by cmorley
Replied by cmorley on topic QtVCP reading error message
Currently only the Notify library gets the error messages, so only the desktop notify widget and/or a statusbar widget can get the error messages unless you do some coding.

Can you give me details of what you want to do and i figue out the best way to do it.

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

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

More
08 Feb 2019 09:46 #125986 by phillc54
I would like to be able to display and clear any linuxcnc errors.

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

More
08 Feb 2019 09:55 #125987 by cmorley
Replied by cmorley on topic QtVCP reading error message
i was think more on what mechanism - text widget and button or dialog etc.

i actually misspoke:
in the handler file, If you add to the initialized__ function:
STATUS.connect('error', self.error__)

then add the function:

def error__(self, w, kind ,error):
print 'ERROR',error

Then it will print the messages to the terminal

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

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

More
08 Feb 2019 10:03 #125988 by phillc54
Thank you, I think those two bits of code will enable me to do what I want.

Another question.
Am I able test for when the exit button is activated in the gcode editor.

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

More
08 Feb 2019 11:11 #125995 by cmorley
Replied by cmorley on topic QtVCP reading error message
Let me work on that.

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

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

More
09 Feb 2019 10:36 #126041 by cmorley
Replied by cmorley on topic QtVCP reading error message
ok we can do it with class patch tricks...
i have pushed some work to make this easier.

in your handler file:
In the import section add (may already be there):
from qtvcp.widgets.gcode_editor import GcodeEditor as GCODE

in the Special Functions area
    def class_patch__(self):
        GCODE.exitCall = self.editor_exit

then in the general functions area (basically any where in the handlerclass)
    def editor_exit(self):
        print 'editor exit pressed'
        # now still call the original functionality
        self.w.gcodeeditor.exit()

Most other buttons should be equally class patched.
Let me know if this helps you.
In fact the whole gcode editor is really just fleshed out and i would like some feedback to make it better/user friendlier.

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

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

More
09 Feb 2019 10:48 #126042 by phillc54
Thanks Chris, I will give it a shot tomorrow.
BTW the error messaging worked great, I have the errors appending to a read only QPlainTextEdit.

Cheers, Phill.

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

More
10 Feb 2019 07:15 #126128 by phillc54
Thanks again Chris,

The gcode editor trick worked great, did exactly as I wished.

A couple of things with the gcode editor...

1. on opening the first file the following error always appears:
[QTvcp.QTVCP.WIDGETS.GCODE_EDITOR][ERROR]  File path is not valid:  (gcode_editor.py:372)

2. when exiting the editor the following dialog appears whether the file was changed or not:
This file has changed since loading...Still want to proceed?
this even happens if ~/.machine_log_history is still loaded and no other files have been loaded.

Cheers, Phill

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

More
11 Feb 2019 00:04 #126183 by cmorley
Replied by cmorley on topic QtVCP reading error message
The first error is not a real problem - It may be when you switch to AUTO mode without a program loaded.
The gcode editor has multiple uses, eg displying gcode, MDI history and Message Logs - so it must reload on each mode change.
I could (should) expose those options so ou can turn them off.


The whole editing process surely needs some more thought.
In linuxcnc one can't actually edit the in-memory program.
The gcode editor is actually displaying it's own copy of the program in memory.
Linuxcnc just tells us what line it is on (and it's not always exactly right!)

It's entirely possible to be running a program and edit another - if we program it that way. So the check behind the dialog probably needs to be more sophisticated to detect these conditions.

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.110 seconds
Powered by Kunena Forum