Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FeatureRequest]: Allow M291 to set result to -1 when blocking modal "Cancel" clicked. #959

Open
benagricola opened this issue Feb 15, 2024 · 4 comments
Assignees
Labels
enhancement Additional functionality, performance or other feature request
Milestone

Comments

@benagricola
Copy link

benagricola commented Feb 15, 2024

Is your feature request related to a problem? Please describe.

Currently, the documentation for the result meta gcode variable states that on clicking the "Cancel" button of a blocking M291 modal, the result value should be set to -1 but this is not the case - the containing input stream is aborted and no code after the M291 call is evaluated.

This makes it difficult to give macros the option to abort at a particular location while also allowing some level of recovery from that within the macro (for example to reset speed limits or restart a probing sequence).

Describe the solution you propose.

As discussed in the forum thread linked below, @dc42 suggested adding a J2 parameter to M291 which would cause it to no longer abort if "Cancel" were clicked, but instead set the result variable to -1 as documented.

This would not break existing macros relying on the current J1 behaviour but would also allow more nuanced usage of M291 and recovery from cancelling user input.

Describe alternatives you've considered

For M291 ... S4 it is possible to add a "Cancel" input option and use the input variable to detect if the user clicked "Cancel", but this only works where the input is multiple-option, and cannot be used if the S-value is >= 5 or == 3.

Provide any additional context or information.

https://forum.duet3d.com/topic/34945/meta-gcode-result-variable-inconsistent-with-docs/4?_=1707983978818

@benagricola benagricola added the enhancement Additional functionality, performance or other feature request label Feb 15, 2024
@chrishamm
Copy link
Collaborator

When this is addressed the corresponding implementation in DSF needs to be changed again as well. Unlike in v3.4, in v3.5 result is evaluated by RRF which can be off if the result of potential custom G/M-codes diverges from the last result.

@droftarts droftarts assigned dc42 and unassigned x0rtrunks Mar 22, 2024
@T3P3
Copy link
Contributor

T3P3 commented May 8, 2024

https://forum.duet3d.com/topic/35663/m291-j2-1/3

Further request

@T3P3 T3P3 added this to the After 3.6 milestone May 17, 2024
@dc42 dc42 modified the milestones: After 3.6, 3.6.0 May 22, 2024
@dc42
Copy link
Collaborator

dc42 commented Aug 31, 2024

Related: set result to -1 if the message box times out. See https://forum.duet3d.com/topic/36445/m291-t-value-to-return-a-result/2.

@Tinchus2009
Copy link

Hi. I was directoed to read here after I posted: https://forum.duet3d.com/topic/36694/m291-message-non-blocking-execution/3?_=1727461179293

In J4 cancell the job/macro by pressing CCANCEL, why also cancell the macro/job if the message box is configured to time out? How I see it: timeout means no answer was given, lets continue. If you dont want to continue, you had the CANCEL BUTTOM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additional functionality, performance or other feature request
Projects
None yet
Development

No branches or pull requests

6 participants