qt_action.py ABORT() behavior/oWord Error

More
29 Aug 2021 23:40 #219131 by snowgoer540
I spent some time this morning tracing down an "unknown oWord error" encountered when aborting a "framing" operation in QtPlasmaC.

QtPlasmaC uses several ACTION.CALL_MDI calls in a row with pre-calculated X,Y movements in order to "frame" the current G-Code file and use the torch/a laser to draw a box around the area to be cut so the user can place the work to be cut on the material more easily.

This works great. The problem is that if the user clicks CYCLE STOP, which calls ACTION.ABORT() while motion is in progress, they will will receive an "Unknown oWord error".

After some digging, I believe this is due to the order of operations in this section of code from qt_action.py:
def ABORT(self):
    self.ensure_mode(linuxcnc.MODE_AUTO)
    self.cmd.abort()

It seems that ABORT is trying to set the mode to AUTO before aborting the movement.

In order to solve QtPlasmaC's problem, I've tried swapping the lines:
def ABORT(self):
    self.cmd.abort()
    self.ensure_mode(linuxcnc.MODE_AUTO)

as well as deleting the switch to AUTO entirely:
def ABORT(self):
    self.cmd.abort()

Both work to prevent the oWord error, and have no perceived ill-effects in QtPlasmaC.

I am happy to submit a pull request to do one of those options, but I am unsure why the order is the way it is in the first place. Further, I am not sure how either change may affect any of the other GUIs.

Alternatively, QtPlasmaC could just call linuxcnc.command().abort(), but it seemed prudent to bring to your attention either way as ABORT is a pretty important function :)

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

More
30 Aug 2021 01:38 #219136 by cmorley
Excellent work. I did a little testing and I think the mode change is not required. I removed it and time will tell.

Thank You!

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

More
30 Aug 2021 09:56 #219156 by snowgoer540

Excellent work. I did a little testing and I think the mode change is not required. I removed it and time will tell.

Thank You!

Happy to help!

Thanks for the quick reply, I see the commit is already made, so thanks again!

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

Moderators: cmorley
Time to create page: 0.067 seconds
Powered by Kunena Forum