Skip to content

Commit f9bc6c7

Browse files
committed
Tweak debug logs
1 parent ab042ca commit f9bc6c7

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/interpreter.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ export class Interpreter {
3333

3434
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
3535
// @ts-ignore
36-
public points = 0;
36+
public others = 0;
37+
38+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
39+
// @ts-ignore
40+
public points = 0; // for reference, how many points were added to the job
3741

3842
/**
3943
* Executes an array of G-code commands, updating the provided job
@@ -54,8 +58,6 @@ export class Interpreter {
5458
});
5559
job.finishPath();
5660

57-
58-
5961
return job;
6062
}
6163

@@ -79,10 +81,12 @@ export class Interpreter {
7981
} else if (e < 0) {
8082
this.deretractions++;
8183
}
82-
83-
if (f !== undefined) {
84+
else if (f !== undefined) {
8485
this.feedrateChanges++;
8586
}
87+
else {
88+
this.others++;
89+
}
8690

8791
return;
8892
}

src/webgl-preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,10 +624,11 @@ export class WebGLPreview {
624624
this.interpreter.execute(commands, this.job);
625625
}
626626

627+
console.debug(`out of ${this.interpreter.points} move commands, the following were pruned due to no actual movement:`);
627628
console.debug(this.interpreter.retractions, 'retractions');
628629
console.debug(this.interpreter.deretractions, 'deretractions');
629630
console.debug(this.interpreter.feedrateChanges, 'feedrateChanges');
630-
console.debug(this.interpreter.points, 'points');
631+
console.debug(this.interpreter.others, 'other');
631632

632633
if (render) {
633634
this.renderAnimated();

0 commit comments

Comments
 (0)