PrintLater
Main Concepts #
- PrintLater Object
- Liminal scheduled print list
- Print Watcher background task
PrintLater objects are added to the schedule, and then monitored by PrintWatcher to be executed in the background
PrintLater #
Variables #
Time Date #
- Time to execute print
FileContents String #
- String of file contents to execute (stored in memory)
Printer Printer #
- Printer object to print on
BGCODE Bool #
- If the file is a BGCODE or not
Preheating Bool #
- If the printer is currently preheating due to being ready to print
Methods #
Preheat #
- It will fetch the printer type
- If Mk3 or has serial connection
- Will preheat printer through appropriate method
- If printer is Mk3, will display message on display Developer note: As of writing, 7/29/2024, the Mk4 cannot display messages on the LCD through the API
- Can’t preheat but will acknowledge it tried
- If Mk3 or has serial connection
Ready2Print #
-
Determines the printer type
- Mk4 (PrusaLink)
- Get current state, check if printing (or paused printing)
- Prints the file already uploaded to USB Developer note: The reason why Mk4 has additional logic is due to Mk4 file uploads historically taking a long time, this was fixed in a later patch
- Mk3 (Octoprint)
In the event of any of any of these failing, it will stand down and cooldown - Mk4 (PrusaLink)
Liminal Scheduled Print List [PrintLater] #
- List on the main class of objects to print later
PrintWatcher #
- Threaded background process
- Fetches current time
- Cycles through every scheduled print
- If 5 minutes before, call preheat method
- If current time, call ready2print & remove from scheduled prints
- Sleeps for 10 seconds
Website Appearance #
Main Page GET #
Togglable through button on the top, adding a flag to the page, when toggled it modifies the page adding a date picker
/printLater POST #
- Determines which printer to print on based off of user form
- Cycles through printers, if user selected printer doesn’t exist it safely exits and returns an error
- Goes through attached print data and creates a PrintLater object
- Adds PrintLater object to Liminal scheduled prints list