Skip to content

Commit

Permalink
Add current print stage to job data
Browse files Browse the repository at this point in the history
  • Loading branch information
THE-SIMPLE-MARK committed Mar 29, 2024
1 parent aeed999 commit f308cdb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const FILE_EXT_REGEX = new RegExp(/\.[^/.]+$/)

/**
* Represents a single print job.
*
*/
export class Job {
private _jobData: JobData
Expand All @@ -30,6 +29,7 @@ export class Job {
totalLayerNumber: data.total_layer_num,
totalPrintTime: data.mc_remaining_time,
status: data.gcode_state,
stage: data.stg_cur,
percentDone: data.mc_percent,
layerNumber: data.layer_num,
remainingTime: data.mc_remaining_time,
Expand Down Expand Up @@ -150,6 +150,7 @@ export class Job {

const newData = {
status: data.gcode_state ?? existingData.status,
stage: data.stg_cur ?? existingData.stage,
percentDone: data.mc_percent ?? existingData.percentDone,
layerNumber: data.layer_num ?? existingData.layerNumber,
remainingTime: data.mc_remaining_time ?? existingData.remainingTime,
Expand Down Expand Up @@ -229,6 +230,10 @@ export interface JobData {
* The status of the job (printer).
*/
status: PushAllResponse["gcode_state"]
/**
* The current stage of the print job.
*/
stage: PrintStage
/**
* The % of the print done from the job.
*/
Expand Down

0 comments on commit f308cdb

Please sign in to comment.