Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Request: Tweak/option to tweak queue logic. #44

Closed
Grntrenchman opened this issue Sep 11, 2021 · 1 comment
Closed

Request: Tweak/option to tweak queue logic. #44

Grntrenchman opened this issue Sep 11, 2021 · 1 comment

Comments

@Grntrenchman
Copy link

Grntrenchman commented Sep 11, 2021

I would like to use this as a way to queue prints so others can clear the plate and just hit "continue" or "print". I can't find a way to get the printer to send an unpause/continue unless there's a currently paused print, but I can send a host start.

Currently, after the print finishes, and during the in-between gcode, the old print is left loaded.

If you can make it (or make it an option/checkbox) so the next file to print is loaded before running between-print code, or when [PAUSE] is called, or a special [PREPARE] is called, this would work, as then after this is triggered (currently after a [PAUSE]), it could just be started with host start, and continue through the queue. Otherwise I'll be looking into a physical button for octoprint.

Edit: Alternatively, expose the resume function for this plugin (it has to be the resume in the continuous print tab, correct?) to action commands, so I can call it from a custom M118 menu option, easy enough in marlin.

Edit2: This seems simpler for you to implement? I'm only a script kiddie, but I'll try to contribute.

As an example..
to load the action receiver, in your init add to

388  global __plugin_hooks__ 
389 __plugin_hooks__ =  { 
390	"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information,
391	"octoprint.comm.protocol.action": __plugin_implementation__.resume_action_handler 
392   } 

and then add the handler:

def resume_action_handler(self, comm, line, action, *args, **kwargs):    # not sure if we need all of the args
        if not action == "queuego":    # listen for your command here
            return    # end if it doesn't match
        if self.paused == True:    # only run if we're actually paused
            self.paused = False    # unpause
            self.start_next_print()    # start the print

Then I can hopefully send a M118 //action:queuego from the printer and it'll start the next print.
I'd keep the command short, it seems some firmwares cut off the sent text after a certain length.

Edit3: looked more into it, cleaned up code above, and implemented it, while removing update section to prevent getting overwritten. plugin loads, will get back to you in morning (after first print finishes) to let you know if it's good as-is. Custom marlin command was easy to implement, I can probably make a section to add to your readme for it.

Edit4: That was easy, 8 line change! It works fine. Let me know if you implement, I'll delete my modified copy and get back on updates.

Marlin details: in Configuration_adv.h

// Custom Menu: Main Menu
#define CUSTOM_MENU_MAIN //enable custom menu
#if ENABLED(CUSTOM_MENU_MAIN)
  #define CUSTOM_MENU_MAIN_TITLE "ContinuousPrint" //something other than "custom commands"
  //#define CUSTOM_MENU_MAIN_SCRIPT_DONE "M117 User Script Done" //no feedback
  //#define CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK //NO AUDIO
  #define CUSTOM_MENU_MAIN_SCRIPT_RETURN   // Return to status screen after a script
  #define CUSTOM_MENU_MAIN_ONLY_IDLE         // Only show custom menu when the machine is idle

  #define MAIN_MENU_ITEM_1_DESC "Resume Queue" //name here
  #define MAIN_MENU_ITEM_1_GCODE "M118 //action:queuego" //command here

#endif 
@smartin015
Copy link

Hey @Grntrenchman - plugin ownership has changed, and I've opened a similar bug at smartin015/continuousprint#12.

I really appreciate the pointers on how to do this - and I think it'd be a great feature to add. If you have any lessons learned from using these changes for awhile, can you summarize them in that issue? Thanks!

@Zinc-OS Zinc-OS closed this as completed Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants