@duet3d/objectmodel 3.4.0 → 3.5.0-b2
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/README.md +10 -0
- package/{lib → dist}/ModelCollection.d.ts +13 -1
- package/{lib → dist}/ModelCollection.js +26 -1
- package/{lib → dist}/ModelDictionary.d.ts +13 -0
- package/{lib → dist}/ModelDictionary.js +24 -1
- package/{lib → dist}/ModelObject.d.ts +13 -1
- package/{lib → dist}/ModelObject.js +70 -2
- package/{lib/index.d.ts → dist/ObjectModel.d.ts} +12 -8
- package/{lib/index.js → dist/ObjectModel.js} +11 -15
- package/{lib → dist}/boards/index.d.ts +3 -1
- package/{lib → dist}/boards/index.js +4 -2
- package/{lib → dist}/directories/index.d.ts +2 -1
- package/{lib → dist}/directories/index.js +2 -0
- package/{lib → dist}/fans/index.d.ts +3 -1
- package/{lib → dist}/fans/index.js +4 -2
- package/{lib → dist}/heat/Heater.d.ts +5 -1
- package/{lib → dist}/heat/Heater.js +5 -1
- package/{lib → dist}/heat/HeaterModel.d.ts +3 -2
- package/{lib → dist}/heat/HeaterModel.js +3 -2
- package/{lib → dist}/heat/HeaterMonitor.d.ts +4 -3
- package/{lib → dist}/heat/HeaterMonitor.js +4 -3
- package/{lib → dist}/heat/index.d.ts +7 -3
- package/dist/heat/index.js +35 -0
- package/{lib → dist}/httpEndpoints/index.d.ts +2 -1
- package/{lib → dist}/httpEndpoints/index.js +2 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.js +55 -0
- package/{lib → dist}/inputs/CodeChannel.d.ts +1 -0
- package/{lib → dist}/inputs/CodeChannel.js +1 -0
- package/{lib → dist}/inputs/Compatibility.d.ts +1 -0
- package/{lib → dist}/inputs/Compatibility.js +1 -0
- package/{lib → dist}/inputs/InputChannel.d.ts +7 -4
- package/{lib → dist}/inputs/InputChannel.js +8 -5
- package/dist/inputs/index.d.ts +3 -0
- package/dist/inputs/index.js +19 -0
- package/{lib → dist}/job/Build.d.ts +3 -2
- package/{lib → dist}/job/Build.js +3 -2
- package/{lib → dist}/job/GCodeFileInfo.d.ts +6 -5
- package/{lib → dist}/job/GCodeFileInfo.js +4 -2
- package/{lib → dist}/job/ThumbnailInfo.d.ts +3 -2
- package/{lib → dist}/job/ThumbnailInfo.js +3 -2
- package/{lib → dist}/job/index.d.ts +7 -3
- package/{lib → dist}/job/index.js +20 -2
- package/{lib → dist}/limits/index.d.ts +2 -1
- package/{lib → dist}/limits/index.js +2 -0
- package/{lib → dist}/messages/index.d.ts +2 -1
- package/{lib → dist}/messages/index.js +2 -1
- package/{lib → dist}/move/Axis.d.ts +2 -1
- package/{lib → dist}/move/Axis.js +2 -1
- package/dist/move/DriverId.d.ts +10 -0
- package/dist/move/DriverId.js +49 -0
- package/{lib → dist}/move/Extruder.d.ts +3 -1
- package/{lib → dist}/move/Extruder.js +3 -1
- package/{lib → dist}/move/InputShaping.d.ts +4 -2
- package/{lib → dist}/move/InputShaping.js +4 -2
- package/dist/move/Microstepping.d.ts +6 -0
- package/{lib → dist}/move/Microstepping.js +2 -0
- package/{lib → dist}/move/MoveCalibration.d.ts +2 -1
- package/{lib → dist}/move/MoveCalibration.js +2 -1
- package/{lib → dist}/move/MoveCompensation.d.ts +2 -1
- package/{lib → dist}/move/MoveCompensation.js +2 -1
- package/{lib → dist}/move/index.d.ts +10 -1
- package/{lib → dist}/move/index.js +24 -1
- package/{lib → dist}/move/kinematics/CoreKinematics.d.ts +2 -1
- package/{lib → dist}/move/kinematics/CoreKinematics.js +2 -0
- package/{lib → dist}/move/kinematics/DeltaKinematics.d.ts +2 -1
- package/{lib → dist}/move/kinematics/DeltaKinematics.js +3 -2
- package/{lib → dist}/move/kinematics/HangprinterKinematics.d.ts +2 -1
- package/{lib → dist}/move/kinematics/HangprinterKinematics.js +3 -0
- package/{lib → dist}/move/kinematics/KinematicsBase.d.ts +2 -1
- package/{lib → dist}/move/kinematics/KinematicsBase.js +2 -1
- package/{lib → dist}/move/kinematics/PolarKinematics.d.ts +2 -1
- package/{lib → dist}/move/kinematics/PolarKinematics.js +2 -0
- package/{lib → dist}/move/kinematics/ScaraKinematics.d.ts +2 -1
- package/{lib → dist}/move/kinematics/ScaraKinematics.js +2 -0
- package/dist/move/kinematics/index.d.ts +14 -0
- package/{lib → dist}/move/kinematics/index.js +26 -4
- package/{lib → dist}/network/NetworkInterface.d.ts +14 -1
- package/{lib → dist}/network/NetworkInterface.js +15 -1
- package/{lib → dist}/network/index.d.ts +3 -1
- package/dist/network/index.js +35 -0
- package/{lib → dist}/plugins/PluginManifest.d.ts +4 -2
- package/{lib → dist}/plugins/PluginManifest.js +5 -3
- package/{lib → dist}/plugins/index.d.ts +3 -1
- package/dist/plugins/index.js +30 -0
- package/{lib → dist}/scanner/index.d.ts +2 -1
- package/{lib → dist}/scanner/index.js +2 -1
- package/{lib → dist}/sensors/AnalogSensor.d.ts +2 -2
- package/{lib → dist}/sensors/AnalogSensor.js +2 -2
- package/{lib → dist}/sensors/Endstop.d.ts +2 -1
- package/{lib → dist}/sensors/Endstop.js +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/FilamentMonitorBase.d.ts +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/FilamentMonitorBase.js +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/LaserFilamentMonitor.d.ts +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/LaserFilamentMonitor.js +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/PulsedFilamentMonitor.d.ts +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/PulsedFilamentMonitor.js +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.d.ts +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.js +2 -1
- package/{lib → dist}/sensors/FilamentMonitors/index.d.ts +6 -1
- package/{lib → dist}/sensors/FilamentMonitors/index.js +20 -1
- package/{lib → dist}/sensors/Probe.d.ts +2 -1
- package/{lib → dist}/sensors/Probe.js +2 -1
- package/dist/sensors/index.d.ts +21 -0
- package/{lib → dist}/sensors/index.js +20 -1
- package/{lib → dist}/spindles/index.d.ts +2 -1
- package/{lib → dist}/spindles/index.js +2 -1
- package/{lib → dist}/state/MachineStatus.d.ts +4 -3
- package/{lib → dist}/state/MachineStatus.js +4 -3
- package/dist/state/MessageBox.d.ts +25 -0
- package/{lib → dist}/state/MessageBox.js +12 -2
- package/{lib → dist}/state/RestorePoint.d.ts +2 -1
- package/{lib → dist}/state/RestorePoint.js +2 -0
- package/{lib → dist}/state/index.d.ts +6 -2
- package/{lib → dist}/state/index.js +19 -1
- package/{lib → dist}/tools/index.d.ts +2 -1
- package/{lib → dist}/tools/index.js +2 -1
- package/{lib → dist}/userSessions/index.d.ts +2 -1
- package/{lib → dist}/userSessions/index.js +2 -1
- package/{lib → dist}/volumes/index.d.ts +4 -3
- package/{lib → dist}/volumes/index.js +2 -0
- package/package.json +12 -9
- package/lib/heat/index.js +0 -16
- package/lib/move/DriverId.d.ts +0 -7
- package/lib/move/DriverId.js +0 -29
- package/lib/move/Microstepping.d.ts +0 -5
- package/lib/move/kinematics/index.d.ts +0 -7
- package/lib/network/index.js +0 -19
- package/lib/plugins/index.js +0 -13
- package/lib/sensors/index.d.ts +0 -16
- package/lib/state/MessageBox.d.ts +0 -15
package/README.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript implementation of the Duet3D Object Model.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install via `npm install @duet3d/objectmodel`. Users of Vue 2 must also run this command after the first import:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
globalThis._duetModelSetArray = (array, index, value) => Vue.set(array, index, value);
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This is required to make sure that change events for arrays are correctly fired.
|
|
14
|
+
|
|
5
15
|
## Bug reports
|
|
6
16
|
|
|
7
17
|
Please use the [forum](https://forum.duet3d.com) for support requests or the [DuetWebControl](https://github.com/Duet3D/DuetWebControl) GitHub repository for feature requests and bug reports.
|
|
@@ -2,7 +2,7 @@ import { IModelObject } from "./ModelObject";
|
|
|
2
2
|
/**
|
|
3
3
|
* Class for storing model object items in an array
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export declare class ModelCollection<T extends IModelObject | null> extends Array<T> implements IModelObject {
|
|
6
6
|
private readonly itemConstructor;
|
|
7
7
|
/**
|
|
8
8
|
* Constructor of this class
|
|
@@ -23,3 +23,15 @@ export default class ModelCollection<T extends IModelObject> extends Array<T> im
|
|
|
23
23
|
*/
|
|
24
24
|
update(jsonElement: any): IModelObject | null;
|
|
25
25
|
}
|
|
26
|
+
export default ModelCollection;
|
|
27
|
+
/**
|
|
28
|
+
* Initialize a model collection from the given data
|
|
29
|
+
* @param itemType Item type to create
|
|
30
|
+
* @param data Data to assign
|
|
31
|
+
* @returns Initialized model collection
|
|
32
|
+
*/
|
|
33
|
+
export declare function initCollection<T extends IModelObject>(itemType: {
|
|
34
|
+
new (): T;
|
|
35
|
+
}, data: Array<{
|
|
36
|
+
[Property in keyof T]?: T[Property];
|
|
37
|
+
}>): ModelCollection<T>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initCollection = exports.ModelCollection = void 0;
|
|
3
4
|
const ModelObject_1 = require("./ModelObject");
|
|
4
5
|
const index_1 = require("./index");
|
|
5
6
|
/**
|
|
@@ -71,9 +72,33 @@ class ModelCollection extends Array {
|
|
|
71
72
|
}
|
|
72
73
|
// Add new items
|
|
73
74
|
for (let i = this.length; i < jsonElement.length; i++) {
|
|
74
|
-
|
|
75
|
+
const itemToAdd = jsonElement[i];
|
|
76
|
+
if (itemToAdd === null) {
|
|
77
|
+
super.push(itemToAdd);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
const newItem = new this.itemConstructor();
|
|
81
|
+
super.push(newItem.update(itemToAdd));
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
84
|
return this;
|
|
77
85
|
}
|
|
78
86
|
}
|
|
87
|
+
exports.ModelCollection = ModelCollection;
|
|
79
88
|
exports.default = ModelCollection;
|
|
89
|
+
/**
|
|
90
|
+
* Initialize a model collection from the given data
|
|
91
|
+
* @param itemType Item type to create
|
|
92
|
+
* @param data Data to assign
|
|
93
|
+
* @returns Initialized model collection
|
|
94
|
+
*/
|
|
95
|
+
function initCollection(itemType, data) {
|
|
96
|
+
const result = new ModelCollection(itemType);
|
|
97
|
+
for (let presetItem of data) {
|
|
98
|
+
const item = new itemType();
|
|
99
|
+
item.update(presetItem);
|
|
100
|
+
result.push(item);
|
|
101
|
+
}
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
exports.initCollection = initCollection;
|
|
@@ -26,3 +26,16 @@ export declare class ModelDictionary<T> extends Map<string, T | null> implements
|
|
|
26
26
|
*/
|
|
27
27
|
update(jsonElement: any): IModelObject | null;
|
|
28
28
|
}
|
|
29
|
+
export default ModelDictionary;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize a model dictionary from the given data
|
|
32
|
+
* @param nullDeletesKeys Defines whether setting values to null deletes the corresponding key
|
|
33
|
+
* @param itemConstructor Item constructor
|
|
34
|
+
* @param data Data to assign
|
|
35
|
+
* @returns Initialized model dictionary
|
|
36
|
+
*/
|
|
37
|
+
export declare function initDictionary<T>(nullDeletesKeys: boolean, itemConstructor: {
|
|
38
|
+
new (): T;
|
|
39
|
+
}, data: Record<string, {
|
|
40
|
+
[Property in keyof T]?: T[Property];
|
|
41
|
+
}>): ModelDictionary<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ModelDictionary = void 0;
|
|
3
|
+
exports.initDictionary = exports.ModelDictionary = void 0;
|
|
4
4
|
const ModelObject_1 = require("./ModelObject");
|
|
5
5
|
/**
|
|
6
6
|
* Dictionary class to map object model data
|
|
@@ -66,3 +66,26 @@ class ModelDictionary extends Map {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
exports.ModelDictionary = ModelDictionary;
|
|
69
|
+
exports.default = ModelDictionary;
|
|
70
|
+
/**
|
|
71
|
+
* Initialize a model dictionary from the given data
|
|
72
|
+
* @param nullDeletesKeys Defines whether setting values to null deletes the corresponding key
|
|
73
|
+
* @param itemConstructor Item constructor
|
|
74
|
+
* @param data Data to assign
|
|
75
|
+
* @returns Initialized model dictionary
|
|
76
|
+
*/
|
|
77
|
+
function initDictionary(nullDeletesKeys, itemConstructor, data) {
|
|
78
|
+
const result = new ModelDictionary(nullDeletesKeys, itemConstructor);
|
|
79
|
+
for (let key in data) {
|
|
80
|
+
const item = new itemConstructor();
|
|
81
|
+
if ((0, ModelObject_1.isModelObject)(item)) {
|
|
82
|
+
item.update(data[key]);
|
|
83
|
+
result.set(key, item);
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
result.set(key, data[key]);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
exports.initDictionary = initDictionary;
|
|
@@ -17,7 +17,7 @@ export declare function isModelObject(value: any): value is IModelObject;
|
|
|
17
17
|
/**
|
|
18
18
|
* Base class for object model classes
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export declare abstract class ModelObject implements IModelObject {
|
|
21
21
|
/**
|
|
22
22
|
* Update this instance from the given data
|
|
23
23
|
* @param jsonElement JSON data to upgrade this instance from
|
|
@@ -33,3 +33,15 @@ export default abstract class ModelObject implements IModelObject {
|
|
|
33
33
|
new (): T;
|
|
34
34
|
}): void;
|
|
35
35
|
}
|
|
36
|
+
export default ModelObject;
|
|
37
|
+
/**
|
|
38
|
+
* Initialize a model object from the given data
|
|
39
|
+
* @param itemType Model type to create
|
|
40
|
+
* @param data Data to assign
|
|
41
|
+
* @returns Initialized model instance
|
|
42
|
+
*/
|
|
43
|
+
export declare function initObject<T>(itemType: {
|
|
44
|
+
new (): T;
|
|
45
|
+
}, data: {
|
|
46
|
+
[Property in keyof T]?: T[Property];
|
|
47
|
+
}): T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isModelObject = void 0;
|
|
3
|
+
exports.initObject = exports.ModelObject = exports.isModelObject = void 0;
|
|
4
4
|
const index_1 = require("./index");
|
|
5
5
|
/**
|
|
6
6
|
* Check whether a given value provides model update functionality
|
|
@@ -43,6 +43,9 @@ class ModelObject {
|
|
|
43
43
|
console.warn(`Model object ${key} changed but it could not be set due to missing setter`);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
47
|
+
console.warn(`Model object ${key} changed but it lacks the property descriptor`);
|
|
48
|
+
}
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
else if (prop instanceof Array) {
|
|
@@ -71,6 +74,25 @@ class ModelObject {
|
|
|
71
74
|
console.warn(`Model array ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
72
75
|
}
|
|
73
76
|
}
|
|
77
|
+
else if (prop instanceof Set) {
|
|
78
|
+
if (value instanceof Array || value instanceof Set) {
|
|
79
|
+
// Remove deleted items
|
|
80
|
+
for (let item of new Set(prop)) {
|
|
81
|
+
if (!prop.has(item)) {
|
|
82
|
+
prop.delete(item);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Add new items
|
|
86
|
+
for (let item of value) {
|
|
87
|
+
if (!prop.has(item)) {
|
|
88
|
+
prop.add(item);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
93
|
+
console.warn(`Model set ${key} could not be changed because the target type ${typeof value} is invalid`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
74
96
|
else if (prop === null || value === null) {
|
|
75
97
|
// Unfortunately we cannot do type checks during runtime without excessive extra work and possibly
|
|
76
98
|
// third-party libraries, so skip them for null values until there is a better solution.
|
|
@@ -92,7 +114,7 @@ class ModelObject {
|
|
|
92
114
|
}
|
|
93
115
|
}
|
|
94
116
|
else if (propType === "number") {
|
|
95
|
-
if (typeof value === "number") {
|
|
117
|
+
if (typeof value === "number" || typeof value === "bigint") {
|
|
96
118
|
this[ownKey] = value;
|
|
97
119
|
}
|
|
98
120
|
else if (process.env.NODE_ENV !== "production") {
|
|
@@ -115,6 +137,14 @@ class ModelObject {
|
|
|
115
137
|
console.warn(`Incompatible string target type ${typeof value} for property ${key}`);
|
|
116
138
|
}
|
|
117
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
|
+
}
|
|
118
148
|
else if (process.env.NODE_ENV !== "production") {
|
|
119
149
|
console.warn(`Incompatible type ${propType} for property ${key} (${typeof value})`);
|
|
120
150
|
}
|
|
@@ -152,4 +182,42 @@ class ModelObject {
|
|
|
152
182
|
});
|
|
153
183
|
}
|
|
154
184
|
}
|
|
185
|
+
exports.ModelObject = ModelObject;
|
|
155
186
|
exports.default = ModelObject;
|
|
187
|
+
/**
|
|
188
|
+
* Initialize a model object from the given data
|
|
189
|
+
* @param itemType Model type to create
|
|
190
|
+
* @param data Data to assign
|
|
191
|
+
* @returns Initialized model instance
|
|
192
|
+
*/
|
|
193
|
+
function initObject(itemType, data) {
|
|
194
|
+
const result = new itemType();
|
|
195
|
+
for (let key in data) {
|
|
196
|
+
const resultKey = result[key];
|
|
197
|
+
if (isModelObject(resultKey)) {
|
|
198
|
+
const updatedObject = resultKey.update(data[key]);
|
|
199
|
+
if (resultKey !== updatedObject) {
|
|
200
|
+
const propDescriptor = Object.getOwnPropertyDescriptor(result, key);
|
|
201
|
+
if (propDescriptor !== undefined) {
|
|
202
|
+
if (propDescriptor.writable) {
|
|
203
|
+
result[key] = updatedObject;
|
|
204
|
+
}
|
|
205
|
+
else if (propDescriptor.set !== undefined) {
|
|
206
|
+
propDescriptor.set(updatedObject);
|
|
207
|
+
}
|
|
208
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
209
|
+
console.warn(`Model object ${key} changed but it could not be set due to missing setter`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
else if (process.env.NODE_ENV !== "production") {
|
|
213
|
+
console.warn(`Model object ${key} changed but it lacks the property descriptor`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
result[key] = data[key];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
exports.initObject = initObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import ModelCollection from "./ModelCollection";
|
|
2
|
+
import ModelDictionary from "./ModelDictionary";
|
|
1
3
|
import ModelObject from "./ModelObject";
|
|
2
4
|
import Board from "./boards";
|
|
3
|
-
import State from "./state";
|
|
4
|
-
import ModelCollection from "./ModelCollection";
|
|
5
5
|
import Directories from "./directories";
|
|
6
6
|
import Fan from "./fans";
|
|
7
7
|
import Heat from "./heat";
|
|
@@ -11,34 +11,38 @@ import Job from "./job";
|
|
|
11
11
|
import Limits from "./limits";
|
|
12
12
|
import Message from "./messages";
|
|
13
13
|
import Move from "./move";
|
|
14
|
+
import Network from "./network";
|
|
14
15
|
import Plugin from "./plugins";
|
|
15
16
|
import Scanner from "./scanner";
|
|
16
17
|
import Sensors from "./sensors";
|
|
17
18
|
import Spindle from "./spindles";
|
|
19
|
+
import State from "./state";
|
|
20
|
+
import Tool from "./tools";
|
|
18
21
|
import UserSession from "./userSessions";
|
|
19
22
|
import Volume from "./volumes";
|
|
20
|
-
import { ModelDictionary } from "./ModelDictionary";
|
|
21
|
-
export declare function setArrayItem(array: Array<any>, index: number, value: any): void;
|
|
22
23
|
/**
|
|
23
24
|
* Refer to the DSF/RRF documentation for descriptions of the object model fields
|
|
24
25
|
*/
|
|
25
|
-
export
|
|
26
|
+
export declare class ObjectModel extends ModelObject {
|
|
26
27
|
readonly boards: ModelCollection<Board>;
|
|
27
28
|
readonly directories: Directories;
|
|
28
|
-
readonly fans: ModelCollection<Fan>;
|
|
29
|
+
readonly fans: ModelCollection<Fan | null>;
|
|
29
30
|
readonly global: ModelDictionary<any>;
|
|
30
31
|
readonly heat: Heat;
|
|
31
32
|
readonly httpEndpoints: ModelCollection<HttpEndpoint>;
|
|
32
|
-
readonly inputs: ModelCollection<InputChannel>;
|
|
33
|
+
readonly inputs: ModelCollection<InputChannel | null>;
|
|
33
34
|
readonly job: Job;
|
|
34
35
|
readonly limits: Limits;
|
|
35
36
|
readonly messages: ModelCollection<Message>;
|
|
36
37
|
readonly move: Move;
|
|
38
|
+
readonly network: Network;
|
|
37
39
|
readonly plugins: ModelDictionary<Plugin>;
|
|
38
40
|
readonly scanner: Scanner;
|
|
39
41
|
readonly sensors: Sensors;
|
|
40
|
-
readonly spindles: ModelCollection<Spindle>;
|
|
42
|
+
readonly spindles: ModelCollection<Spindle | null>;
|
|
41
43
|
readonly state: State;
|
|
44
|
+
readonly tools: ModelCollection<Tool | null>;
|
|
42
45
|
readonly userSessions: ModelCollection<UserSession>;
|
|
43
46
|
readonly volumes: ModelCollection<Volume>;
|
|
44
47
|
}
|
|
48
|
+
export default ObjectModel;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ObjectModel = void 0;
|
|
4
|
+
const ModelCollection_1 = require("./ModelCollection");
|
|
5
|
+
const ModelDictionary_1 = require("./ModelDictionary");
|
|
4
6
|
const ModelObject_1 = require("./ModelObject");
|
|
5
7
|
const boards_1 = require("./boards");
|
|
6
|
-
const state_1 = require("./state");
|
|
7
|
-
const ModelCollection_1 = require("./ModelCollection");
|
|
8
8
|
const directories_1 = require("./directories");
|
|
9
9
|
const fans_1 = require("./fans");
|
|
10
10
|
const heat_1 = require("./heat");
|
|
@@ -14,22 +14,15 @@ const job_1 = require("./job");
|
|
|
14
14
|
const limits_1 = require("./limits");
|
|
15
15
|
const messages_1 = require("./messages");
|
|
16
16
|
const move_1 = require("./move");
|
|
17
|
+
const network_1 = require("./network");
|
|
17
18
|
const plugins_1 = require("./plugins");
|
|
18
19
|
const scanner_1 = require("./scanner");
|
|
19
20
|
const sensors_1 = require("./sensors");
|
|
20
21
|
const spindles_1 = require("./spindles");
|
|
22
|
+
const state_1 = require("./state");
|
|
23
|
+
const tools_1 = require("./tools");
|
|
21
24
|
const userSessions_1 = require("./userSessions");
|
|
22
25
|
const volumes_1 = require("./volumes");
|
|
23
|
-
const ModelDictionary_1 = require("./ModelDictionary");
|
|
24
|
-
// Unfortunately we need to define a way to update arrays to remain compatible with Vue 2 (due to IE11).
|
|
25
|
-
// This will become obsolete as soon as DWC is upgraded to Vue 3, but that isn't going to happen anytime soon.
|
|
26
|
-
// Until then a Vue 2 user would have to call something like this on initialization to work around this limitation:
|
|
27
|
-
// globalThis._duetModelSetArray = (array, index, value) => Vue.set(array, index, value);
|
|
28
|
-
globalThis._duetModelSetArray = (array, index, value) => array[index] = value;
|
|
29
|
-
function setArrayItem(array, index, value) {
|
|
30
|
-
globalThis._duetModelSetArray(array, index, value);
|
|
31
|
-
}
|
|
32
|
-
exports.setArrayItem = setArrayItem;
|
|
33
26
|
/**
|
|
34
27
|
* Refer to the DSF/RRF documentation for descriptions of the object model fields
|
|
35
28
|
*/
|
|
@@ -39,7 +32,7 @@ class ObjectModel extends ModelObject_1.default {
|
|
|
39
32
|
this.boards = new ModelCollection_1.default(boards_1.default);
|
|
40
33
|
this.directories = new directories_1.default();
|
|
41
34
|
this.fans = new ModelCollection_1.default(fans_1.default);
|
|
42
|
-
this.global = new ModelDictionary_1.
|
|
35
|
+
this.global = new ModelDictionary_1.default(false);
|
|
43
36
|
this.heat = new heat_1.default();
|
|
44
37
|
this.httpEndpoints = new ModelCollection_1.default(httpEndpoints_1.default);
|
|
45
38
|
this.inputs = new ModelCollection_1.default(InputChannel_1.default);
|
|
@@ -47,13 +40,16 @@ class ObjectModel extends ModelObject_1.default {
|
|
|
47
40
|
this.limits = new limits_1.default();
|
|
48
41
|
this.messages = new ModelCollection_1.default(messages_1.default); // must be manually cleared after updates
|
|
49
42
|
this.move = new move_1.default();
|
|
50
|
-
this.
|
|
43
|
+
this.network = new network_1.default();
|
|
44
|
+
this.plugins = new ModelDictionary_1.default(true, plugins_1.default);
|
|
51
45
|
this.scanner = new scanner_1.default();
|
|
52
46
|
this.sensors = new sensors_1.default();
|
|
53
47
|
this.spindles = new ModelCollection_1.default(spindles_1.default);
|
|
54
48
|
this.state = new state_1.default();
|
|
49
|
+
this.tools = new ModelCollection_1.default(tools_1.default);
|
|
55
50
|
this.userSessions = new ModelCollection_1.default(userSessions_1.default);
|
|
56
51
|
this.volumes = new ModelCollection_1.default(volumes_1.default);
|
|
57
52
|
}
|
|
58
53
|
}
|
|
54
|
+
exports.ObjectModel = ObjectModel;
|
|
59
55
|
exports.default = ObjectModel;
|
|
@@ -24,7 +24,7 @@ export declare class DirectDisplay extends ModelObject {
|
|
|
24
24
|
spiFreq: number;
|
|
25
25
|
typeName: string;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export declare class Board extends ModelObject {
|
|
28
28
|
constructor();
|
|
29
29
|
accelerometer: Accelerometer | null;
|
|
30
30
|
bootloaderFileName: string | null;
|
|
@@ -46,4 +46,6 @@ export default class Board extends ModelObject {
|
|
|
46
46
|
uniqueId: string | null;
|
|
47
47
|
v12: MinMaxCurrent | null;
|
|
48
48
|
vIn: MinMaxCurrent | null;
|
|
49
|
+
wifiFirmwareFileName: string | null;
|
|
49
50
|
}
|
|
51
|
+
export default Board;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DirectDisplay = exports.MinMaxCurrent = exports.ClosedLoop = exports.BoardState = exports.Accelerometer = void 0;
|
|
3
|
+
exports.Board = exports.DirectDisplay = exports.MinMaxCurrent = exports.ClosedLoop = exports.BoardState = exports.Accelerometer = void 0;
|
|
4
4
|
const ModelObject_1 = require("../ModelObject");
|
|
5
5
|
class Accelerometer extends ModelObject_1.default {
|
|
6
6
|
constructor() {
|
|
@@ -49,7 +49,7 @@ class Board extends ModelObject_1.default {
|
|
|
49
49
|
super();
|
|
50
50
|
this.accelerometer = null;
|
|
51
51
|
this.bootloaderFileName = null;
|
|
52
|
-
this.canAddress =
|
|
52
|
+
this.canAddress = null;
|
|
53
53
|
this.closedLoop = null;
|
|
54
54
|
this.directDisplay = null;
|
|
55
55
|
this.firmwareDate = "";
|
|
@@ -67,6 +67,7 @@ class Board extends ModelObject_1.default {
|
|
|
67
67
|
this.uniqueId = null;
|
|
68
68
|
this.v12 = null;
|
|
69
69
|
this.vIn = null;
|
|
70
|
+
this.wifiFirmwareFileName = null;
|
|
70
71
|
this.wrapModelProperty("accelerometer", Accelerometer);
|
|
71
72
|
this.wrapModelProperty("closedLoop", ClosedLoop);
|
|
72
73
|
this.wrapModelProperty("directDisplay", DirectDisplay);
|
|
@@ -75,4 +76,5 @@ class Board extends ModelObject_1.default {
|
|
|
75
76
|
this.wrapModelProperty("vIn", MinMaxCurrent);
|
|
76
77
|
}
|
|
77
78
|
}
|
|
79
|
+
exports.Board = Board;
|
|
78
80
|
exports.default = Board;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ModelObject from "../ModelObject";
|
|
2
|
-
export
|
|
2
|
+
export declare class Directories extends ModelObject {
|
|
3
3
|
filaments: string;
|
|
4
4
|
firmware: string;
|
|
5
5
|
gCodes: string;
|
|
@@ -9,3 +9,4 @@ export default class Directories extends ModelObject {
|
|
|
9
9
|
system: string;
|
|
10
10
|
web: string;
|
|
11
11
|
}
|
|
12
|
+
export default Directories;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Directories = void 0;
|
|
3
4
|
const ModelObject_1 = require("../ModelObject");
|
|
4
5
|
class Directories extends ModelObject_1.default {
|
|
5
6
|
constructor() {
|
|
@@ -14,4 +15,5 @@ class Directories extends ModelObject_1.default {
|
|
|
14
15
|
this.web = "0:/www";
|
|
15
16
|
}
|
|
16
17
|
}
|
|
18
|
+
exports.Directories = Directories;
|
|
17
19
|
exports.default = Directories;
|
|
@@ -3,8 +3,9 @@ export declare class FanThermostaticControl extends ModelObject {
|
|
|
3
3
|
heaters: Array<number>;
|
|
4
4
|
highTemperature: number | null;
|
|
5
5
|
lowTemperature: number | null;
|
|
6
|
+
sensors: Array<number>;
|
|
6
7
|
}
|
|
7
|
-
export
|
|
8
|
+
export declare class Fan extends ModelObject {
|
|
8
9
|
actualValue: number;
|
|
9
10
|
blip: number;
|
|
10
11
|
frequency: number;
|
|
@@ -15,3 +16,4 @@ export default class Fan extends ModelObject {
|
|
|
15
16
|
rpm: number;
|
|
16
17
|
readonly thermostatic: FanThermostaticControl;
|
|
17
18
|
}
|
|
19
|
+
export default Fan;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FanThermostaticControl = void 0;
|
|
3
|
+
exports.Fan = exports.FanThermostaticControl = void 0;
|
|
4
4
|
const ModelObject_1 = require("../ModelObject");
|
|
5
5
|
class FanThermostaticControl extends ModelObject_1.default {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
this.heaters =
|
|
8
|
+
this.heaters = []; // *** deprecated as of v3.5, use sensors instead
|
|
9
9
|
this.highTemperature = null;
|
|
10
10
|
this.lowTemperature = null;
|
|
11
|
+
this.sensors = [];
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.FanThermostaticControl = FanThermostaticControl;
|
|
@@ -25,4 +26,5 @@ class Fan extends ModelObject_1.default {
|
|
|
25
26
|
this.thermostatic = new FanThermostaticControl();
|
|
26
27
|
}
|
|
27
28
|
}
|
|
29
|
+
exports.Fan = Fan;
|
|
28
30
|
exports.default = Fan;
|
|
@@ -10,11 +10,14 @@ export declare enum HeaterState {
|
|
|
10
10
|
tuning = "tuning",
|
|
11
11
|
offline = "offline"
|
|
12
12
|
}
|
|
13
|
-
export
|
|
13
|
+
export declare class Heater extends ModelObject {
|
|
14
14
|
active: number;
|
|
15
15
|
avgPwm: number;
|
|
16
16
|
current: number;
|
|
17
17
|
max: number;
|
|
18
|
+
maxBadReadings: number;
|
|
19
|
+
maxHeatingFaultTime: number;
|
|
20
|
+
maxTempExcursion: number;
|
|
18
21
|
min: number;
|
|
19
22
|
readonly model: HeaterModel;
|
|
20
23
|
readonly monitors: ModelCollection<HeaterMonitor>;
|
|
@@ -22,3 +25,4 @@ export default class Heater extends ModelObject {
|
|
|
22
25
|
standby: number;
|
|
23
26
|
state: HeaterState;
|
|
24
27
|
}
|
|
28
|
+
export default Heater;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HeaterState = void 0;
|
|
3
|
+
exports.Heater = exports.HeaterState = void 0;
|
|
4
4
|
const ModelCollection_1 = require("../ModelCollection");
|
|
5
5
|
const HeaterModel_1 = require("./HeaterModel");
|
|
6
6
|
const ModelObject_1 = require("../ModelObject");
|
|
@@ -21,6 +21,9 @@ class Heater extends ModelObject_1.default {
|
|
|
21
21
|
this.avgPwm = 0;
|
|
22
22
|
this.current = -273.15;
|
|
23
23
|
this.max = 285;
|
|
24
|
+
this.maxBadReadings = 3;
|
|
25
|
+
this.maxHeatingFaultTime = 5;
|
|
26
|
+
this.maxTempExcursion = 15;
|
|
24
27
|
this.min = -10;
|
|
25
28
|
this.model = new HeaterModel_1.default();
|
|
26
29
|
this.monitors = new ModelCollection_1.default(HeaterMonitor_1.default);
|
|
@@ -29,4 +32,5 @@ class Heater extends ModelObject_1.default {
|
|
|
29
32
|
this.state = HeaterState.off;
|
|
30
33
|
}
|
|
31
34
|
}
|
|
35
|
+
exports.Heater = Heater;
|
|
32
36
|
exports.default = Heater;
|
|
@@ -6,7 +6,7 @@ export declare class HeaterModelPID extends ModelObject {
|
|
|
6
6
|
p: number;
|
|
7
7
|
used: boolean;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export declare class HeaterModel extends ModelObject {
|
|
10
10
|
coolingExp: number;
|
|
11
11
|
coolingRate: number;
|
|
12
12
|
deadTime: number;
|
|
@@ -16,5 +16,6 @@ export default class HeaterModel extends ModelObject {
|
|
|
16
16
|
inverted: boolean;
|
|
17
17
|
maxPwm: number;
|
|
18
18
|
readonly pid: HeaterModelPID;
|
|
19
|
-
standardVoltage: number
|
|
19
|
+
standardVoltage: number;
|
|
20
20
|
}
|
|
21
|
+
export default HeaterModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HeaterModelPID = void 0;
|
|
3
|
+
exports.HeaterModel = exports.HeaterModelPID = void 0;
|
|
4
4
|
const ModelObject_1 = require("../ModelObject");
|
|
5
5
|
class HeaterModelPID extends ModelObject_1.default {
|
|
6
6
|
constructor() {
|
|
@@ -25,7 +25,8 @@ class HeaterModel extends ModelObject_1.default {
|
|
|
25
25
|
this.inverted = false;
|
|
26
26
|
this.maxPwm = 1;
|
|
27
27
|
this.pid = new HeaterModelPID();
|
|
28
|
-
this.standardVoltage =
|
|
28
|
+
this.standardVoltage = 0;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
+
exports.HeaterModel = HeaterModel;
|
|
31
32
|
exports.default = HeaterModel;
|
|
@@ -10,8 +10,9 @@ export declare enum HeaterMonitorCondition {
|
|
|
10
10
|
tooHigh = "tooHigh",
|
|
11
11
|
tooLow = "tooLow"
|
|
12
12
|
}
|
|
13
|
-
export
|
|
14
|
-
action: HeaterMonitorAction;
|
|
13
|
+
export declare class HeaterMonitor extends ModelObject {
|
|
14
|
+
action: HeaterMonitorAction | null;
|
|
15
15
|
condition: HeaterMonitorCondition;
|
|
16
|
-
limit: number;
|
|
16
|
+
limit: number | null;
|
|
17
17
|
}
|
|
18
|
+
export default HeaterMonitor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HeaterMonitorCondition = exports.HeaterMonitorAction = void 0;
|
|
3
|
+
exports.HeaterMonitor = exports.HeaterMonitorCondition = exports.HeaterMonitorAction = void 0;
|
|
4
4
|
const ModelObject_1 = require("../ModelObject");
|
|
5
5
|
var HeaterMonitorAction;
|
|
6
6
|
(function (HeaterMonitorAction) {
|
|
@@ -18,9 +18,10 @@ var HeaterMonitorCondition;
|
|
|
18
18
|
class HeaterMonitor extends ModelObject_1.default {
|
|
19
19
|
constructor() {
|
|
20
20
|
super(...arguments);
|
|
21
|
-
this.action =
|
|
21
|
+
this.action = null;
|
|
22
22
|
this.condition = HeaterMonitorCondition.disabled;
|
|
23
|
-
this.limit =
|
|
23
|
+
this.limit = null;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
exports.HeaterMonitor = HeaterMonitor;
|
|
26
27
|
exports.default = HeaterMonitor;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import ModelCollection from "../ModelCollection";
|
|
2
|
-
import Heater from "./Heater";
|
|
3
2
|
import ModelObject from "../ModelObject";
|
|
4
|
-
|
|
3
|
+
import Heater from "./Heater";
|
|
4
|
+
export declare class Heat extends ModelObject {
|
|
5
5
|
bedHeaters: Array<number>;
|
|
6
6
|
chamberHeaters: Array<number>;
|
|
7
7
|
coldExtrudeTemperature: number;
|
|
8
8
|
coldRetractTemperature: number;
|
|
9
|
-
readonly heaters: ModelCollection<Heater>;
|
|
9
|
+
readonly heaters: ModelCollection<Heater | null>;
|
|
10
10
|
}
|
|
11
|
+
export default Heat;
|
|
12
|
+
export * from "./Heater";
|
|
13
|
+
export * from "./HeaterModel";
|
|
14
|
+
export * from "./HeaterMonitor";
|