@duet3d/objectmodel 3.5.0-b1 → 3.5.0-b11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ModelDictionary.js +5 -0
- package/dist/ModelObject.js +16 -0
- package/dist/ObjectModel.d.ts +0 -2
- package/dist/ObjectModel.js +0 -2
- package/dist/boards/index.d.ts +1 -0
- package/dist/boards/index.js +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +3 -2
- package/dist/inputs/CodeChannel.d.ts +3 -1
- package/dist/inputs/CodeChannel.js +3 -1
- package/dist/job/index.d.ts +0 -1
- package/dist/job/index.js +0 -1
- package/dist/move/index.d.ts +2 -0
- package/dist/move/index.js +2 -0
- package/dist/move/kinematics/KinematicsBase.d.ts +10 -10
- package/dist/move/kinematics/KinematicsBase.js +10 -10
- package/dist/sensors/AnalogSensor.d.ts +22 -0
- package/dist/sensors/AnalogSensor.js +24 -1
- package/dist/spindles/index.d.ts +3 -0
- package/dist/spindles/index.js +3 -0
- package/package.json +1 -1
package/dist/ModelDictionary.js
CHANGED
|
@@ -57,6 +57,11 @@ class ModelDictionary extends Map {
|
|
|
57
57
|
if (jsonElement === null) {
|
|
58
58
|
this.clear();
|
|
59
59
|
}
|
|
60
|
+
else if (jsonElement instanceof Map) {
|
|
61
|
+
for (const [key, value] of jsonElement.entries()) {
|
|
62
|
+
this.set(key, value);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
60
65
|
else {
|
|
61
66
|
for (const [key, value] of Object.entries(jsonElement)) {
|
|
62
67
|
this.set(key, value);
|
package/dist/ModelObject.js
CHANGED
|
@@ -137,6 +137,22 @@ class ModelObject {
|
|
|
137
137
|
console.warn(`Incompatible string target type ${typeof value} for property ${key}`);
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
+
else if (propType === "function") {
|
|
141
|
+
if (typeof value === "function") {
|
|
142
|
+
this[ownKey] = value;
|
|
143
|
+
}
|
|
144
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
145
|
+
console.warn(`Incompatible function target type ${typeof value} for property ${key}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else if (propType === "object") {
|
|
149
|
+
if (typeof value === "object") {
|
|
150
|
+
this[ownKey] = value;
|
|
151
|
+
}
|
|
152
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
153
|
+
console.warn(`Incompatible object target type ${typeof value} for property ${key}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
140
156
|
else if (process.env.NODE_ENV !== "production") {
|
|
141
157
|
console.warn(`Incompatible type ${propType} for property ${key} (${typeof value})`);
|
|
142
158
|
}
|
package/dist/ObjectModel.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ import Message from "./messages";
|
|
|
13
13
|
import Move from "./move";
|
|
14
14
|
import Network from "./network";
|
|
15
15
|
import Plugin from "./plugins";
|
|
16
|
-
import Scanner from "./scanner";
|
|
17
16
|
import Sensors from "./sensors";
|
|
18
17
|
import Spindle from "./spindles";
|
|
19
18
|
import State from "./state";
|
|
@@ -37,7 +36,6 @@ export declare class ObjectModel extends ModelObject {
|
|
|
37
36
|
readonly move: Move;
|
|
38
37
|
readonly network: Network;
|
|
39
38
|
readonly plugins: ModelDictionary<Plugin>;
|
|
40
|
-
readonly scanner: Scanner;
|
|
41
39
|
readonly sensors: Sensors;
|
|
42
40
|
readonly spindles: ModelCollection<Spindle | null>;
|
|
43
41
|
readonly state: State;
|
package/dist/ObjectModel.js
CHANGED
|
@@ -16,7 +16,6 @@ const messages_1 = require("./messages");
|
|
|
16
16
|
const move_1 = require("./move");
|
|
17
17
|
const network_1 = require("./network");
|
|
18
18
|
const plugins_1 = require("./plugins");
|
|
19
|
-
const scanner_1 = require("./scanner");
|
|
20
19
|
const sensors_1 = require("./sensors");
|
|
21
20
|
const spindles_1 = require("./spindles");
|
|
22
21
|
const state_1 = require("./state");
|
|
@@ -42,7 +41,6 @@ class ObjectModel extends ModelObject_1.default {
|
|
|
42
41
|
this.move = new move_1.default();
|
|
43
42
|
this.network = new network_1.default();
|
|
44
43
|
this.plugins = new ModelDictionary_1.default(true, plugins_1.default);
|
|
45
|
-
this.scanner = new scanner_1.default();
|
|
46
44
|
this.sensors = new sensors_1.default();
|
|
47
45
|
this.spindles = new ModelCollection_1.default(spindles_1.default);
|
|
48
46
|
this.state = new state_1.default();
|
package/dist/boards/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export declare class Board extends ModelObject {
|
|
|
33
33
|
directDisplay: DirectDisplay | null;
|
|
34
34
|
firmwareDate: string;
|
|
35
35
|
firmwareFileName: string;
|
|
36
|
+
firmwareName: string;
|
|
36
37
|
firmwareVersion: string;
|
|
37
38
|
iapFileNameSBC: string | null;
|
|
38
39
|
iapFileNameSD: string | null;
|
package/dist/boards/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export * from "./ModelCollection";
|
|
|
2
2
|
export * from "./ModelDictionary";
|
|
3
3
|
export * from "./ModelObject";
|
|
4
4
|
export * from "./boards";
|
|
5
|
-
export * from "./state";
|
|
6
5
|
export * from "./directories";
|
|
7
6
|
export * from "./fans";
|
|
8
7
|
export * from "./heat";
|
|
@@ -14,9 +13,9 @@ export * from "./messages";
|
|
|
14
13
|
export * from "./move";
|
|
15
14
|
export * from "./network";
|
|
16
15
|
export * from "./plugins";
|
|
17
|
-
export * from "./scanner";
|
|
18
16
|
export * from "./sensors";
|
|
19
17
|
export * from "./spindles";
|
|
18
|
+
export * from "./state";
|
|
20
19
|
export * from "./tools";
|
|
21
20
|
export * from "./userSessions";
|
|
22
21
|
export * from "./volumes";
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,6 @@ __exportStar(require("./ModelCollection"), exports);
|
|
|
20
20
|
__exportStar(require("./ModelDictionary"), exports);
|
|
21
21
|
__exportStar(require("./ModelObject"), exports);
|
|
22
22
|
__exportStar(require("./boards"), exports);
|
|
23
|
-
__exportStar(require("./state"), exports);
|
|
24
23
|
__exportStar(require("./directories"), exports);
|
|
25
24
|
__exportStar(require("./fans"), exports);
|
|
26
25
|
__exportStar(require("./heat"), exports);
|
|
@@ -32,9 +31,9 @@ __exportStar(require("./messages"), exports);
|
|
|
32
31
|
__exportStar(require("./move"), exports);
|
|
33
32
|
__exportStar(require("./network"), exports);
|
|
34
33
|
__exportStar(require("./plugins"), exports);
|
|
35
|
-
__exportStar(require("./scanner"), exports);
|
|
36
34
|
__exportStar(require("./sensors"), exports);
|
|
37
35
|
__exportStar(require("./spindles"), exports);
|
|
36
|
+
__exportStar(require("./state"), exports);
|
|
38
37
|
__exportStar(require("./tools"), exports);
|
|
39
38
|
__exportStar(require("./userSessions"), exports);
|
|
40
39
|
__exportStar(require("./volumes"), exports);
|
|
@@ -46,6 +45,8 @@ exports.default = ObjectModel_1.default;
|
|
|
46
45
|
// This will become obsolete as soon as DWC is upgraded to Vue 3, but that isn't going to happen anytime soon.
|
|
47
46
|
// Until then a Vue 2 user would have to call something like this on initialization to work around this limitation:
|
|
48
47
|
// globalThis._duetModelSetArray = (array, index, value) => Vue.set(array, index, value);
|
|
48
|
+
// or in TypeScript
|
|
49
|
+
// (globalThis as any)._duetModelSetArray = (array: object, index: string | number, value: any) => Vue.set(array, index, value);
|
|
49
50
|
globalThis._duetModelSetArray = (array, index, value) => array[index] = value;
|
|
50
51
|
function setArrayItem(array, index, value) {
|
|
51
52
|
globalThis._duetModelSetArray(array, index, value);
|
|
@@ -15,6 +15,8 @@ var CodeChannel;
|
|
|
15
15
|
CodeChannel[CodeChannel["daemon"] = 9] = "daemon";
|
|
16
16
|
CodeChannel[CodeChannel["aux2"] = 10] = "aux2";
|
|
17
17
|
CodeChannel[CodeChannel["autopause"] = 11] = "autopause";
|
|
18
|
-
CodeChannel[CodeChannel["
|
|
18
|
+
CodeChannel[CodeChannel["file2"] = 12] = "file2";
|
|
19
|
+
CodeChannel[CodeChannel["queue2"] = 13] = "queue2";
|
|
20
|
+
CodeChannel[CodeChannel["unknown"] = 14] = "unknown";
|
|
19
21
|
})(CodeChannel = exports.CodeChannel || (exports.CodeChannel = {}));
|
|
20
22
|
exports.default = CodeChannel;
|
package/dist/job/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export declare class Layer extends ModelObject {
|
|
|
12
12
|
export declare class TimesLeft extends ModelObject {
|
|
13
13
|
filament: number | null;
|
|
14
14
|
file: number | null;
|
|
15
|
-
layer: number | null;
|
|
16
15
|
slicer: number | null;
|
|
17
16
|
}
|
|
18
17
|
export declare class Job extends ModelObject {
|
package/dist/job/index.js
CHANGED
package/dist/move/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import Kinematics from "./kinematics";
|
|
|
9
9
|
export declare class CurrentMove extends ModelObject {
|
|
10
10
|
acceleration: number;
|
|
11
11
|
deceleration: number;
|
|
12
|
+
extrusionRate: number;
|
|
12
13
|
laserPwm: number | null;
|
|
13
14
|
requestedSpeed: number;
|
|
14
15
|
topSpeed: number;
|
|
@@ -30,6 +31,7 @@ export declare class Move extends ModelObject {
|
|
|
30
31
|
readonly calibration: MoveCalibration;
|
|
31
32
|
readonly compensation: MoveCompensation;
|
|
32
33
|
readonly currentMove: CurrentMove;
|
|
34
|
+
currentZHop: number;
|
|
33
35
|
readonly extruders: ModelCollection<Extruder>;
|
|
34
36
|
readonly idle: MotorsIdleControl;
|
|
35
37
|
kinematics: Kinematics;
|
package/dist/move/index.js
CHANGED
|
@@ -28,6 +28,7 @@ class CurrentMove extends ModelObject_1.default {
|
|
|
28
28
|
super(...arguments);
|
|
29
29
|
this.acceleration = 0;
|
|
30
30
|
this.deceleration = 0;
|
|
31
|
+
this.extrusionRate = 0;
|
|
31
32
|
this.laserPwm = null;
|
|
32
33
|
this.requestedSpeed = 0;
|
|
33
34
|
this.topSpeed = 0;
|
|
@@ -65,6 +66,7 @@ class Move extends ModelObject_1.default {
|
|
|
65
66
|
this.calibration = new MoveCalibration_1.default();
|
|
66
67
|
this.compensation = new MoveCompensation_1.default();
|
|
67
68
|
this.currentMove = new CurrentMove();
|
|
69
|
+
this.currentZHop = 0;
|
|
68
70
|
this.extruders = new ModelCollection_1.default(Extruder_1.default);
|
|
69
71
|
this.idle = new MotorsIdleControl();
|
|
70
72
|
this.kinematics = new kinematics_1.default();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import ModelObject from "../../ModelObject";
|
|
2
2
|
export declare enum KinematicsName {
|
|
3
3
|
cartesian = "cartesian",
|
|
4
|
-
coreXY = "
|
|
5
|
-
coreXYU = "
|
|
6
|
-
coreXYUV = "
|
|
7
|
-
coreXZ = "
|
|
8
|
-
markForged = "
|
|
9
|
-
fiveBarScara = "
|
|
10
|
-
hangprinter = "
|
|
4
|
+
coreXY = "coreXY",
|
|
5
|
+
coreXYU = "coreXYU",
|
|
6
|
+
coreXYUV = "coreXYUV",
|
|
7
|
+
coreXZ = "coreXZ",
|
|
8
|
+
markForged = "markForged",
|
|
9
|
+
fiveBarScara = "FiveBarScara",
|
|
10
|
+
hangprinter = "Hangprinter",
|
|
11
11
|
delta = "delta",
|
|
12
|
-
polar = "
|
|
13
|
-
rotaryDelta = "
|
|
14
|
-
scara = "
|
|
12
|
+
polar = "Polar",
|
|
13
|
+
rotaryDelta = "Rotary delta",
|
|
14
|
+
scara = "Scara",
|
|
15
15
|
unknown = "unknown"
|
|
16
16
|
}
|
|
17
17
|
export declare class MoveSegmentation extends ModelObject {
|
|
@@ -5,17 +5,17 @@ const ModelObject_1 = require("../../ModelObject");
|
|
|
5
5
|
var KinematicsName;
|
|
6
6
|
(function (KinematicsName) {
|
|
7
7
|
KinematicsName["cartesian"] = "cartesian";
|
|
8
|
-
KinematicsName["coreXY"] = "
|
|
9
|
-
KinematicsName["coreXYU"] = "
|
|
10
|
-
KinematicsName["coreXYUV"] = "
|
|
11
|
-
KinematicsName["coreXZ"] = "
|
|
12
|
-
KinematicsName["markForged"] = "
|
|
13
|
-
KinematicsName["fiveBarScara"] = "
|
|
14
|
-
KinematicsName["hangprinter"] = "
|
|
8
|
+
KinematicsName["coreXY"] = "coreXY";
|
|
9
|
+
KinematicsName["coreXYU"] = "coreXYU";
|
|
10
|
+
KinematicsName["coreXYUV"] = "coreXYUV";
|
|
11
|
+
KinematicsName["coreXZ"] = "coreXZ";
|
|
12
|
+
KinematicsName["markForged"] = "markForged";
|
|
13
|
+
KinematicsName["fiveBarScara"] = "FiveBarScara";
|
|
14
|
+
KinematicsName["hangprinter"] = "Hangprinter";
|
|
15
15
|
KinematicsName["delta"] = "delta";
|
|
16
|
-
KinematicsName["polar"] = "
|
|
17
|
-
KinematicsName["rotaryDelta"] = "
|
|
18
|
-
KinematicsName["scara"] = "
|
|
16
|
+
KinematicsName["polar"] = "Polar";
|
|
17
|
+
KinematicsName["rotaryDelta"] = "Rotary delta";
|
|
18
|
+
KinematicsName["scara"] = "Scara";
|
|
19
19
|
KinematicsName["unknown"] = "unknown";
|
|
20
20
|
})(KinematicsName = exports.KinematicsName || (exports.KinematicsName = {}));
|
|
21
21
|
class MoveSegmentation extends ModelObject_1.default {
|
|
@@ -15,9 +15,31 @@ export declare enum AnalogSensorType {
|
|
|
15
15
|
driversDuex = "driversduex",
|
|
16
16
|
unknown = "unknown"
|
|
17
17
|
}
|
|
18
|
+
export declare enum TemperatureError {
|
|
19
|
+
ok = "ok",
|
|
20
|
+
shortCircuit = "shortCircuit",
|
|
21
|
+
shortToVcc = "shortToVcc",
|
|
22
|
+
shortToGround = "shortToGround",
|
|
23
|
+
openCircuit = "openCircuit",
|
|
24
|
+
timeout = "timeout",
|
|
25
|
+
ioError = "ioError",
|
|
26
|
+
hardwareError = "hardwareError",
|
|
27
|
+
notReady = "notReady",
|
|
28
|
+
invalidOutputNumber = "invalidOutputNumber",
|
|
29
|
+
busBusy = "busBusy",
|
|
30
|
+
badResponse = "badResponse",
|
|
31
|
+
unknownPort = "unknownPort",
|
|
32
|
+
notInitialised = "notInitialised",
|
|
33
|
+
unknownSensor = "unknownSensor",
|
|
34
|
+
overOrUnderVoltage = "overOrUnderVoltage",
|
|
35
|
+
badVref = "badVref",
|
|
36
|
+
badVssa = "badVssa",
|
|
37
|
+
unknownError = "unknownError"
|
|
38
|
+
}
|
|
18
39
|
export declare class AnalogSensor extends ModelObject {
|
|
19
40
|
lastReading: number | null;
|
|
20
41
|
name: string | null;
|
|
42
|
+
state: TemperatureError;
|
|
21
43
|
type: AnalogSensorType;
|
|
22
44
|
}
|
|
23
45
|
export default AnalogSensor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AnalogSensor = exports.AnalogSensorType = void 0;
|
|
3
|
+
exports.AnalogSensor = exports.TemperatureError = exports.AnalogSensorType = void 0;
|
|
4
4
|
const ModelObject_1 = require("../ModelObject");
|
|
5
5
|
var AnalogSensorType;
|
|
6
6
|
(function (AnalogSensorType) {
|
|
@@ -19,11 +19,34 @@ var AnalogSensorType;
|
|
|
19
19
|
AnalogSensorType["driversDuex"] = "driversduex";
|
|
20
20
|
AnalogSensorType["unknown"] = "unknown";
|
|
21
21
|
})(AnalogSensorType = exports.AnalogSensorType || (exports.AnalogSensorType = {}));
|
|
22
|
+
var TemperatureError;
|
|
23
|
+
(function (TemperatureError) {
|
|
24
|
+
TemperatureError["ok"] = "ok";
|
|
25
|
+
TemperatureError["shortCircuit"] = "shortCircuit";
|
|
26
|
+
TemperatureError["shortToVcc"] = "shortToVcc";
|
|
27
|
+
TemperatureError["shortToGround"] = "shortToGround";
|
|
28
|
+
TemperatureError["openCircuit"] = "openCircuit";
|
|
29
|
+
TemperatureError["timeout"] = "timeout";
|
|
30
|
+
TemperatureError["ioError"] = "ioError";
|
|
31
|
+
TemperatureError["hardwareError"] = "hardwareError";
|
|
32
|
+
TemperatureError["notReady"] = "notReady";
|
|
33
|
+
TemperatureError["invalidOutputNumber"] = "invalidOutputNumber";
|
|
34
|
+
TemperatureError["busBusy"] = "busBusy";
|
|
35
|
+
TemperatureError["badResponse"] = "badResponse";
|
|
36
|
+
TemperatureError["unknownPort"] = "unknownPort";
|
|
37
|
+
TemperatureError["notInitialised"] = "notInitialised";
|
|
38
|
+
TemperatureError["unknownSensor"] = "unknownSensor";
|
|
39
|
+
TemperatureError["overOrUnderVoltage"] = "overOrUnderVoltage";
|
|
40
|
+
TemperatureError["badVref"] = "badVref";
|
|
41
|
+
TemperatureError["badVssa"] = "badVssa";
|
|
42
|
+
TemperatureError["unknownError"] = "unknownError";
|
|
43
|
+
})(TemperatureError = exports.TemperatureError || (exports.TemperatureError = {}));
|
|
22
44
|
class AnalogSensor extends ModelObject_1.default {
|
|
23
45
|
constructor() {
|
|
24
46
|
super(...arguments);
|
|
25
47
|
this.lastReading = null;
|
|
26
48
|
this.name = null;
|
|
49
|
+
this.state = TemperatureError.ok;
|
|
27
50
|
this.type = AnalogSensorType.unknown;
|
|
28
51
|
}
|
|
29
52
|
}
|
package/dist/spindles/index.d.ts
CHANGED
|
@@ -10,8 +10,11 @@ export declare class Spindle extends ModelObject {
|
|
|
10
10
|
canReverse: boolean;
|
|
11
11
|
current: number;
|
|
12
12
|
frequency: number;
|
|
13
|
+
idlePwm: number;
|
|
13
14
|
min: number;
|
|
15
|
+
minPwm: number;
|
|
14
16
|
max: number;
|
|
17
|
+
maxPwm: number;
|
|
15
18
|
state: SpindleState;
|
|
16
19
|
}
|
|
17
20
|
export default Spindle;
|
package/dist/spindles/index.js
CHANGED
|
@@ -16,8 +16,11 @@ class Spindle extends ModelObject_1.default {
|
|
|
16
16
|
this.canReverse = false;
|
|
17
17
|
this.current = 0;
|
|
18
18
|
this.frequency = 0;
|
|
19
|
+
this.idlePwm = 0;
|
|
19
20
|
this.min = 60;
|
|
21
|
+
this.minPwm = 0;
|
|
20
22
|
this.max = 10000;
|
|
23
|
+
this.maxPwm = 1;
|
|
21
24
|
this.state = SpindleState.unconfigured;
|
|
22
25
|
}
|
|
23
26
|
}
|