Add support for page range from Core-v4
Closed this issue · 1 comments
evanugarte commented
Part of the printing page includes an input for page ranges. As of now, our backend the push a message to SQS for printing doesn't include page range (see Core-v4/api/peripheral_api/routes/Printer.js:48
)
How to fix this (at a high level)
This involves three parts:
- pushing page range to SQS from Core-v4, it should already be passed to the backend and accessible via
req.body.pageRanges
in the above link. - Reading data from SQS on the Quasar side. For printing we do this in
printer/PrintHandler.js:46
. You just need to extract the field for page ranges from SQS, the name of the field is up to you. - Adding support for page ranges in the
lp
command. The actual command is onprinter/PrintHandler.js:60
.
Ideal workflow
- Start by console logging
req.body
in the backend. Do we get the value that we specified from the frontend? If so, merely add it to the SQS queue under a field name of your choice and we can move on. - Next, run Quasar to read from SQS, console log
orderData
. do we get the field passed from core-v4? if so, next step!! - insert the page range into the
lp
command, i believe it is-o page-range
. We may need to be in the room to test this tough.
If there is anything confusing about how printing works, read this wiki page.
evanugarte commented
Shoutout to @jerrylee17 for coming up with a function to parse this input to be used in the backend for printing (Core-v4/src/APIFunctions/2DPrinting.js:44
)!