Improvement: Set system status to started when print timer started (M75) #335
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add an event to be sent to
systemservice
when a job is marked as started with M75.Motivation: Currently, when a print is started from octoprint (or anything not the HMI), the
SystemService.cur_status_
is not updated. This then causes us to not handle filament runout, since there's a conditional check that the status must beSYSTAT_WORK
: https://github.com/Snapmaker/Snapmaker2-Controller/blob/main/Marlin/src/feature/runout.h#L100Additionally, M75 and M77 are currently "unsupported". I'm assuming that this is just that they are not actually upgraded to work with Snapmaker's cusotmiztions.
We can use M75 and M77 to update the system service status so that runout detection is activated when a print job is "started".
This diff will add the necessary
SystemService
calls to make sure thatSystemService
status is set toSYSTAT_WORK
when a job is in progress (after M75) and back toSYSTAT_IDLE
when the job finishes.By itself, this will have no influence on the operation of the machine, since luban and the HMI do not ever use M75 or M77. However, in combination with some configuration in octoprint, this diff enables the ability for runout detection to be triggered when printing via octoprint.