PRINTDECKDOCS

Architecture · Chapter 7

The print queue

Each deck keeps a queue of files. The queue never starts a print: at the end of each print, and when a file comes into the queue while the printer is free, the deck asks. A press on its touch screen starts the next file.

7.1 The queue of a deck

The deck keeps the queue in queue.json of its state folder (internal/queue), with at most 50 files. A file has its path, its name, its project, its material and color, the print time of the slicer, and where it came from: the deck, a slicer, or a build.

  • At the end of a print. When the printer goes from a print to no print and the queue has files, the deck asks on each screen: Next, with Start, Skip and Later. Start runs the same material check as Print, and puts the print in the project of the file. Skip takes the file out, and asks for the next one. The paired phones get the push message Next in the queue, with the name, the material, the time, and what to do before Start.
  • The Queue page. Machine has a Queue page: the files in their order with their material and time, and the total time. A tap on a file starts it, moves it to the front or up, or takes it out.
  • The file page. Queue adds the file to the end of the queue, also during a print.

7.2 Files from the slicers

  • Cura and the TAZ. A file that Cura sends with print during a print goes to the queue, and the upload gets 201 with no start. When the queue has files and the printer is free, the deck asks on its screens: print it now, add it to the queue, or start the queue.
  • ChiTuBox and the Phenom. A press on Print in ChiTuBox during a print adds the file to the queue, and ChiTuBox gets an answer that names the queue. With files in the queue, the deck asks on its screen. No start from ChiTuBox reaches the board then: only a press on the deck sends M6030. A queued resin file has the print time of its header.
  • Reprint on the Phenom uses the file on the board. The key of the history is not a file: with it, the deck says that it does not know the file.

7.3 Plates of the builds

On the build page, an approved plate (FDM or resin) has Send to for each printer of its process (POST …/plates/<n>/send). The service keeps an index entry in printers/<id>-plates/. Each minute, the deck of the printer reads its plates (GET printers/<id>/plates, presigned addresses of the bucket for one hour, because a deck has no cookies of the service), downloads each file, checks the size and the SHA-256, adds it to its queue with the names of its parts and its project, and says so (POST printers/<id>/plates/taken). An FDM deck keeps the file in builds/ of its G-code folder. A resin deck keeps the file (a .cbddlp of ChiTuBox) with its copies of the resin files, and sends it to the board in the background when no print runs. The board gets no start. The build page then says that the plate is in the queue.

7.4 What a project sees

The deck reports its queue at each change, and each 2 minutes while the queue has files (POST printers/<id>/queue): the files of projects of the service, each with its place and the estimate of its start after the print now and the files before it. The service keeps the files of each project in the project. A project sees its own files, their places and their starts, and not the other files. The owner can take a file of the project out of a queue with Remove on the project page (DELETE projects/<id>/queue/<printer>/<item>). The service keeps the removal in printers/<id>-remove/ for at most 7 days. Each minute, the deck reads its removals with its plates (GET printers/<id>/removes), takes each file out when the project matches, and says so (POST printers/<id>/removes/done). The file stays on the deck. The owner also gets the state of each printer, with a project or not (GET printers, live): the print, its progress and time left, the last result, and the count and the time of the files of the queue.

Back: 6 Builds from GitHubContentsNext: 8 The apps