Skip to content

Commit 0440ea1

Browse files
committed
Rename Machine to Job
1 parent 3e83d28 commit 0440ea1

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/interpreter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Path, PathType } from './path';
22
import { Code, GCodeCommand } from './gcode-parser';
3-
import { Machine } from './machine';
3+
import { Machine } from './job';
44

55
export class Interpreter {
66
execute(commands: GCodeCommand[], machine = new Machine()): Machine {

src/machine.ts renamed to src/job.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class State {
1515
}
1616
}
1717

18-
export class Machine {
18+
export class Job {
1919
paths: Path[];
2020
state: State;
2121

src/webgl-preview.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Stats from 'three/examples/jsm/libs/stats.module.js';
66

77
import { DevGUI, DevModeOptions } from './dev-gui';
88
import { Interpreter } from './interpreter';
9-
import { Machine } from './machine';
9+
import { Job } from './job';
1010

1111
import {
1212
AmbientLight,
@@ -97,7 +97,7 @@ export class WebGLPreview {
9797
private animationFrameId?: number;
9898
private _geometries: Record<number, BufferGeometry[]> = {};
9999
interpreter: Interpreter = new Interpreter();
100-
virtualMachine: Machine = new Machine();
100+
job: Job = new Job();
101101

102102
// colors
103103
private _backgroundColor = new Color(0xe0e0e0);
@@ -237,7 +237,7 @@ export class WebGLPreview {
237237

238238
processGCode(gcode: string | string[]): void {
239239
const { commands } = this.parser.parseGCode(gcode);
240-
this.interpreter.execute(commands, this.virtualMachine);
240+
this.interpreter.execute(commands, this.job);
241241
this.render();
242242
}
243243

@@ -313,7 +313,7 @@ export class WebGLPreview {
313313
clear(): void {
314314
this.resetState();
315315
this.parser = new Parser();
316-
this.virtualMachine = new Machine();
316+
this.job = new Job();
317317
}
318318

319319
// reset processing state
@@ -353,7 +353,7 @@ export class WebGLPreview {
353353
const material = new LineBasicMaterial({ color: this._travelColor, linewidth: this.lineWidth });
354354
this.disposables.push(material);
355355

356-
this.virtualMachine.travels().forEach((path) => {
356+
this.job.travels().forEach((path) => {
357357
const geometry = path.line();
358358
const line = new LineSegments(geometry, material);
359359
this.group?.add(line);
@@ -374,7 +374,7 @@ export class WebGLPreview {
374374
});
375375
}
376376

377-
this.virtualMachine.extrusions().forEach((path) => {
377+
this.job.extrusions().forEach((path) => {
378378
const geometry = path.line();
379379
const line = new LineSegments(geometry, lineMaterials[path.tool]);
380380
this.group?.add(line);
@@ -386,7 +386,7 @@ export class WebGLPreview {
386386
this._geometries = {};
387387
if (Object.keys(this._geometries).length === 0 && this.renderTubes) {
388388
let color: number;
389-
this.virtualMachine.extrusions().forEach((path) => {
389+
this.job.extrusions().forEach((path) => {
390390
if (Array.isArray(this._extrusionColor)) {
391391
color = this._extrusionColor[path.tool].getHex();
392392
} else {

0 commit comments

Comments
 (0)