@duet3d/objectmodel 3.7.0-beta.10 → 3.7.0-beta.12
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/ModelCollection.d.ts +6 -1
- package/dist/ModelCollection.js +17 -4
- package/dist/ObjectModel.js +2 -2
- package/dist/boards/directDisplay/DirectDisplayScreen.d.ts +1 -1
- package/dist/boards/directDisplay/DirectDisplayScreen.js +3 -3
- package/dist/boards/directDisplay/DirectDisplayScreenST7567.d.ts +1 -1
- package/dist/boards/directDisplay/DirectDisplayScreenST7567.js +3 -3
- package/dist/boards/index.d.ts +23 -10
- package/dist/boards/index.js +33 -14
- package/dist/documentation.json +4 -9
- package/dist/enums.json +2 -1
- package/dist/move/kinematics/CoreKinematics.d.ts +1 -1
- package/dist/move/kinematics/CoreKinematics.js +3 -3
- package/dist/move/kinematics/DeltaKinematics.d.ts +1 -1
- package/dist/move/kinematics/DeltaKinematics.js +3 -3
- package/dist/move/kinematics/HangprinterKinematics.d.ts +1 -1
- package/dist/move/kinematics/HangprinterKinematics.js +3 -3
- package/dist/move/kinematics/PolarKinematics.d.ts +1 -1
- package/dist/move/kinematics/PolarKinematics.js +3 -3
- package/dist/move/kinematics/ScaraKinematics.d.ts +1 -1
- package/dist/move/kinematics/ScaraKinematics.js +3 -3
- package/dist/move/kinematics/index.d.ts +1 -1
- package/dist/move/kinematics/index.js +3 -3
- package/dist/plugins/PluginManifest.d.ts +1 -1
- package/dist/plugins/PluginManifest.js +2 -2
- package/dist/sensors/FilamentMonitors/LaserFilamentMonitor.d.ts +1 -1
- package/dist/sensors/FilamentMonitors/LaserFilamentMonitor.js +3 -3
- package/dist/sensors/FilamentMonitors/PulsedFilamentMonitor.d.ts +1 -1
- package/dist/sensors/FilamentMonitors/PulsedFilamentMonitor.js +3 -3
- package/dist/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.d.ts +1 -1
- package/dist/sensors/FilamentMonitors/RotatingMagnetFilamentMonitor.js +3 -3
- package/dist/sensors/FilamentMonitors/index.d.ts +1 -1
- package/dist/sensors/FilamentMonitors/index.js +3 -3
- package/dist/sensors/Probe.d.ts +4 -1
- package/dist/sensors/Probe.js +3 -0
- package/dist/state/MessageBox.d.ts +1 -1
- package/dist/state/MessageBox.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { IModelObject } from "./ModelObject";
|
|
2
|
+
/**
|
|
3
|
+
* Factory creating the item for a given index
|
|
4
|
+
*/
|
|
5
|
+
export type ItemFactory<T> = (index: number) => T;
|
|
2
6
|
/**
|
|
3
7
|
* Class for storing model object items in an array
|
|
4
8
|
*/
|
|
@@ -6,10 +10,11 @@ export declare class ModelCollection<T extends IModelObject | null> extends Arra
|
|
|
6
10
|
/**
|
|
7
11
|
* Constructor of this class
|
|
8
12
|
* @param itemConstructor Item constructor type that items must derive from
|
|
13
|
+
* @param itemFactory Factory to use for collections whose item class depends on the position, e.g. boards
|
|
9
14
|
*/
|
|
10
15
|
constructor(itemConstructor: {
|
|
11
16
|
new (): T;
|
|
12
|
-
});
|
|
17
|
+
}, itemFactory?: ItemFactory<T> | null);
|
|
13
18
|
/**
|
|
14
19
|
* Overridden push method to perform better type checks
|
|
15
20
|
* @param items Items to add
|
package/dist/ModelCollection.js
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { isModelObject } from "./ModelObject";
|
|
2
|
+
/**
|
|
3
|
+
* Create the item for a given index. This is deliberately not a method of the collection because
|
|
4
|
+
* a non-public member would make the class nominally typed, which breaks assignability of the
|
|
5
|
+
* reactive proxies consumers wrap the object model in
|
|
6
|
+
* @param collection Collection the item is created for
|
|
7
|
+
* @param index Index the new item is going to be stored at
|
|
8
|
+
* @returns New item
|
|
9
|
+
*/
|
|
10
|
+
function createItem(collection, index) {
|
|
11
|
+
return (collection.$itemFactory !== null) ? collection.$itemFactory(index) : new collection.$itemConstructor();
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Class for storing model object items in an array
|
|
4
15
|
*/
|
|
@@ -6,11 +17,13 @@ export class ModelCollection extends Array {
|
|
|
6
17
|
/**
|
|
7
18
|
* Constructor of this class
|
|
8
19
|
* @param itemConstructor Item constructor type that items must derive from
|
|
20
|
+
* @param itemFactory Factory to use for collections whose item class depends on the position, e.g. boards
|
|
9
21
|
*/
|
|
10
|
-
constructor(itemConstructor) {
|
|
22
|
+
constructor(itemConstructor, itemFactory = null) {
|
|
11
23
|
super();
|
|
12
24
|
Object.setPrototypeOf(this, ModelCollection.prototype);
|
|
13
25
|
Object.defineProperty(this, "$itemConstructor", { enumerable: false, value: itemConstructor });
|
|
26
|
+
Object.defineProperty(this, "$itemFactory", { enumerable: false, value: itemFactory });
|
|
14
27
|
}
|
|
15
28
|
// Unfortunately it isn't possible to override index operators in JS/TS
|
|
16
29
|
/**
|
|
@@ -24,7 +37,7 @@ export class ModelCollection extends Array {
|
|
|
24
37
|
super.push(item);
|
|
25
38
|
}
|
|
26
39
|
else {
|
|
27
|
-
const newItem =
|
|
40
|
+
const newItem = createItem(that, this.length);
|
|
28
41
|
super.push(newItem.update(item));
|
|
29
42
|
}
|
|
30
43
|
}
|
|
@@ -55,7 +68,7 @@ export class ModelCollection extends Array {
|
|
|
55
68
|
this[i] = jsonElement[i];
|
|
56
69
|
}
|
|
57
70
|
else {
|
|
58
|
-
const refItem =
|
|
71
|
+
const refItem = createItem(that, i);
|
|
59
72
|
this[i] = refItem.update(newItem, authoritative);
|
|
60
73
|
}
|
|
61
74
|
}
|
|
@@ -79,7 +92,7 @@ export class ModelCollection extends Array {
|
|
|
79
92
|
super.push(itemToAdd);
|
|
80
93
|
}
|
|
81
94
|
else {
|
|
82
|
-
const newItem =
|
|
95
|
+
const newItem = createItem(that, i);
|
|
83
96
|
super.push(newItem.update(itemToAdd, authoritative));
|
|
84
97
|
}
|
|
85
98
|
}
|
package/dist/ObjectModel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import ModelCollection from "./ModelCollection";
|
|
2
2
|
import ModelDictionary from "./ModelDictionary";
|
|
3
3
|
import ModelObject from "./ModelObject";
|
|
4
|
-
import Board from "./boards";
|
|
4
|
+
import Board, { getBoard } from "./boards";
|
|
5
5
|
import Directories from "./directories";
|
|
6
6
|
import Fan from "./fans";
|
|
7
7
|
import Heat from "./heat";
|
|
@@ -25,7 +25,7 @@ import LedStrip from "./ledStrips";
|
|
|
25
25
|
export class ObjectModel extends ModelObject {
|
|
26
26
|
constructor() {
|
|
27
27
|
super();
|
|
28
|
-
this.boards = new ModelCollection(Board);
|
|
28
|
+
this.boards = new ModelCollection(Board, getBoard);
|
|
29
29
|
this.directories = new Directories();
|
|
30
30
|
this.fans = new ModelCollection(Fan);
|
|
31
31
|
this.global = new ModelDictionary(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IModelObject } from "../../ModelObject";
|
|
2
2
|
import DirectDisplayScreenBase from "./DirectDisplayScreenBase";
|
|
3
3
|
export declare class DirectDisplayScreen extends DirectDisplayScreenBase {
|
|
4
|
-
update(jsonElement: any): IModelObject | null;
|
|
4
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
5
5
|
}
|
|
6
6
|
export default DirectDisplayScreen;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { getDirectDisplayScreen } from ".";
|
|
2
2
|
import DirectDisplayScreenBase from "./DirectDisplayScreenBase";
|
|
3
3
|
export class DirectDisplayScreen extends DirectDisplayScreenBase {
|
|
4
|
-
update(jsonElement) {
|
|
4
|
+
update(jsonElement, authoritative = false) {
|
|
5
5
|
if (jsonElement === null) {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
8
|
if (typeof jsonElement.controller === "string" && jsonElement.controller !== this.controller) {
|
|
9
|
-
return getDirectDisplayScreen(jsonElement.controller).update(jsonElement);
|
|
9
|
+
return getDirectDisplayScreen(jsonElement.controller).update(jsonElement, authoritative);
|
|
10
10
|
}
|
|
11
|
-
return super.update(jsonElement);
|
|
11
|
+
return super.update(jsonElement, authoritative);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
export default DirectDisplayScreen;
|
|
@@ -4,6 +4,6 @@ export declare class DirectDisplayScreenST7567 extends DirectDisplayScreenBase {
|
|
|
4
4
|
constructor();
|
|
5
5
|
contrast: number;
|
|
6
6
|
resistorRatio: number;
|
|
7
|
-
update(jsonElement: any): IModelObject | null;
|
|
7
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
8
8
|
}
|
|
9
9
|
export default DirectDisplayScreenST7567;
|
|
@@ -6,14 +6,14 @@ export class DirectDisplayScreenST7567 extends DirectDisplayScreenBase {
|
|
|
6
6
|
this.contrast = 30;
|
|
7
7
|
this.resistorRatio = 6;
|
|
8
8
|
}
|
|
9
|
-
update(jsonElement) {
|
|
9
|
+
update(jsonElement, authoritative = false) {
|
|
10
10
|
if (jsonElement === null) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
if (typeof jsonElement.controller === "string" && jsonElement.controller !== this.controller) {
|
|
14
|
-
return getDirectDisplayScreen(jsonElement.controller).update(jsonElement);
|
|
14
|
+
return getDirectDisplayScreen(jsonElement.controller).update(jsonElement, authoritative);
|
|
15
15
|
}
|
|
16
|
-
return super.update(jsonElement);
|
|
16
|
+
return super.update(jsonElement, authoritative);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
export default DirectDisplayScreenST7567;
|
package/dist/boards/index.d.ts
CHANGED
|
@@ -30,30 +30,43 @@ export declare class Board extends ModelObject {
|
|
|
30
30
|
constructor();
|
|
31
31
|
accelerometer: Accelerometer | null;
|
|
32
32
|
canAddress: number | null;
|
|
33
|
-
closedLoop: BoardClosedLoop | null;
|
|
34
|
-
directDisplay: DirectDisplay | null;
|
|
35
33
|
drivers: ModelCollection<Driver> | null;
|
|
36
34
|
firmwareDate: string;
|
|
37
35
|
firmwareFileName: string;
|
|
38
|
-
firmwareName: string;
|
|
39
36
|
firmwareVersion: string;
|
|
40
37
|
freeRam: number | null;
|
|
41
|
-
iapFileNameSBC: string | null;
|
|
42
|
-
iapFileNameSD: string | null;
|
|
43
|
-
inductiveSensor: InductiveSensor | null;
|
|
44
|
-
maxHeaters: number;
|
|
45
38
|
maxMotors: number;
|
|
46
39
|
mcuTemp: MinMaxCurrent | null;
|
|
47
40
|
name: string;
|
|
48
41
|
shortName: string;
|
|
49
|
-
state: BoardState;
|
|
50
|
-
supportsDirectDisplay: boolean;
|
|
51
|
-
timeout: number;
|
|
52
42
|
uniqueId: string | null;
|
|
53
43
|
v12: MinMaxCurrent | null;
|
|
54
44
|
vIn: MinMaxCurrent | null;
|
|
45
|
+
}
|
|
46
|
+
export declare class MainBoard extends Board {
|
|
47
|
+
constructor();
|
|
48
|
+
directDisplay: DirectDisplay | null;
|
|
49
|
+
firmwareName: string;
|
|
50
|
+
iapFileNameSBC: string | null;
|
|
51
|
+
iapFileNameSD: string | null;
|
|
52
|
+
maxHeaters: number;
|
|
53
|
+
supportsDirectDisplay: boolean;
|
|
55
54
|
wifiFirmwareFileName: string | null;
|
|
56
55
|
}
|
|
56
|
+
export declare class ExpansionBoard extends Board {
|
|
57
|
+
constructor();
|
|
58
|
+
closedLoop: BoardClosedLoop | null;
|
|
59
|
+
inductiveSensor: InductiveSensor | null;
|
|
60
|
+
state: BoardState;
|
|
61
|
+
timeout: number;
|
|
62
|
+
}
|
|
57
63
|
export default Board;
|
|
64
|
+
/**
|
|
65
|
+
* Create the board instance for a given index. The first item is always the mainboard,
|
|
66
|
+
* every other item is an expansion board connected over CAN
|
|
67
|
+
* @param index Index in the boards array
|
|
68
|
+
* @returns New board instance
|
|
69
|
+
*/
|
|
70
|
+
export declare function getBoard(index: number): Board;
|
|
58
71
|
export * from "./directDisplay";
|
|
59
72
|
export * from "./Driver";
|
package/dist/boards/index.js
CHANGED
|
@@ -41,39 +41,58 @@ export class Board extends ModelObject {
|
|
|
41
41
|
super();
|
|
42
42
|
this.accelerometer = null;
|
|
43
43
|
this.canAddress = null;
|
|
44
|
-
this.closedLoop = null;
|
|
45
|
-
this.directDisplay = null;
|
|
46
44
|
this.drivers = null;
|
|
47
45
|
this.firmwareDate = "";
|
|
48
46
|
this.firmwareFileName = "";
|
|
49
|
-
this.firmwareName = "";
|
|
50
47
|
this.firmwareVersion = "";
|
|
51
48
|
this.freeRam = null;
|
|
52
|
-
this.iapFileNameSBC = null;
|
|
53
|
-
this.iapFileNameSD = null;
|
|
54
|
-
this.inductiveSensor = null;
|
|
55
|
-
this.maxHeaters = 0;
|
|
56
49
|
this.maxMotors = 0;
|
|
57
50
|
this.mcuTemp = null;
|
|
58
51
|
this.name = "";
|
|
59
52
|
this.shortName = "";
|
|
60
|
-
this.state = BoardState.unknown;
|
|
61
|
-
this.supportsDirectDisplay = false;
|
|
62
|
-
this.timeout = 10;
|
|
63
53
|
this.uniqueId = null;
|
|
64
54
|
this.v12 = null;
|
|
65
55
|
this.vIn = null;
|
|
66
|
-
this.wifiFirmwareFileName = null;
|
|
67
56
|
ModelObject.wrapModelProperty(this, "accelerometer", Accelerometer);
|
|
68
|
-
ModelObject.wrapModelProperty(this, "closedLoop", BoardClosedLoop);
|
|
69
|
-
ModelObject.wrapModelProperty(this, "directDisplay", DirectDisplay);
|
|
70
57
|
ModelObject.wrapModelCollectionProperty(this, "drivers", Driver);
|
|
71
|
-
ModelObject.wrapModelProperty(this, "inductiveSensor", InductiveSensor);
|
|
72
58
|
ModelObject.wrapModelProperty(this, "mcuTemp", MinMaxCurrent);
|
|
73
59
|
ModelObject.wrapModelProperty(this, "v12", MinMaxCurrent);
|
|
74
60
|
ModelObject.wrapModelProperty(this, "vIn", MinMaxCurrent);
|
|
75
61
|
}
|
|
76
62
|
}
|
|
63
|
+
export class MainBoard extends Board {
|
|
64
|
+
constructor() {
|
|
65
|
+
super();
|
|
66
|
+
this.directDisplay = null;
|
|
67
|
+
this.firmwareName = "";
|
|
68
|
+
this.iapFileNameSBC = null;
|
|
69
|
+
this.iapFileNameSD = null;
|
|
70
|
+
this.maxHeaters = 0;
|
|
71
|
+
this.supportsDirectDisplay = false;
|
|
72
|
+
this.wifiFirmwareFileName = null;
|
|
73
|
+
ModelObject.wrapModelProperty(this, "directDisplay", DirectDisplay);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export class ExpansionBoard extends Board {
|
|
77
|
+
constructor() {
|
|
78
|
+
super();
|
|
79
|
+
this.closedLoop = null;
|
|
80
|
+
this.inductiveSensor = null;
|
|
81
|
+
this.state = BoardState.unknown;
|
|
82
|
+
this.timeout = 10;
|
|
83
|
+
ModelObject.wrapModelProperty(this, "closedLoop", BoardClosedLoop);
|
|
84
|
+
ModelObject.wrapModelProperty(this, "inductiveSensor", InductiveSensor);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
77
87
|
export default Board;
|
|
88
|
+
/**
|
|
89
|
+
* Create the board instance for a given index. The first item is always the mainboard,
|
|
90
|
+
* every other item is an expansion board connected over CAN
|
|
91
|
+
* @param index Index in the boards array
|
|
92
|
+
* @returns New board instance
|
|
93
|
+
*/
|
|
94
|
+
export function getBoard(index) {
|
|
95
|
+
return (index === 0) ? new MainBoard() : new ExpansionBoard();
|
|
96
|
+
}
|
|
78
97
|
export * from "./directDisplay";
|
|
79
98
|
export * from "./Driver";
|
package/dist/documentation.json
CHANGED
|
@@ -47,14 +47,8 @@
|
|
|
47
47
|
"boards[].firmwareName": "Name of the firmware build",
|
|
48
48
|
"boards[].firmwareVersion": "Version of the firmware build",
|
|
49
49
|
"boards[].freeRam": "Amount of free RAM on this board (in bytes or null if unknown)",
|
|
50
|
-
"boards[].iapFileNameSBC":
|
|
51
|
-
|
|
52
|
-
"remarks": "This is only available for the mainboard (first board item)"
|
|
53
|
-
},
|
|
54
|
-
"boards[].iapFileNameSD": {
|
|
55
|
-
"summary": "Filename of the IAP binary that is used for updates from the SD card or null if unsupported",
|
|
56
|
-
"remarks": "This is only available for the mainboard (first board item)"
|
|
57
|
-
},
|
|
50
|
+
"boards[].iapFileNameSBC": "Filename of the IAP binary that is used for updates from the SBC or null if unsupported",
|
|
51
|
+
"boards[].iapFileNameSD": "Filename of the IAP binary that is used for updates from the SD card or null if unsupported",
|
|
58
52
|
"boards[].inductiveSensor": "Information about an inductive sensor or null if not present",
|
|
59
53
|
"boards[].maxHeaters": "Maximum number of heaters this board can control",
|
|
60
54
|
"boards[].maxMotors": "Maximum number of motors this board can drive",
|
|
@@ -1010,7 +1004,8 @@
|
|
|
1010
1004
|
"8": "A switch that is triggered when the probe is activated (unfiltered)",
|
|
1011
1005
|
"9": "A BLTouch probe",
|
|
1012
1006
|
"10": "Z motor stall detection",
|
|
1013
|
-
"11": "Analog scanning probe"
|
|
1007
|
+
"11": "Analog scanning probe",
|
|
1008
|
+
"12": null
|
|
1014
1009
|
}
|
|
1015
1010
|
},
|
|
1016
1011
|
"sensors.probes[].value": "Current analog values of the probe",
|
package/dist/enums.json
CHANGED
|
@@ -4,6 +4,6 @@ export declare class CoreKinematics extends ZLeadscrewKinematics {
|
|
|
4
4
|
constructor(name: KinematicsName);
|
|
5
5
|
forwardMatrix: Array<Array<number>>;
|
|
6
6
|
inverseMatrix: Array<Array<number>>;
|
|
7
|
-
update(jsonElement: any): IModelObject | null;
|
|
7
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
8
8
|
}
|
|
9
9
|
export default CoreKinematics;
|
|
@@ -14,14 +14,14 @@ export class CoreKinematics extends ZLeadscrewKinematics {
|
|
|
14
14
|
[0, 0, 1]
|
|
15
15
|
];
|
|
16
16
|
}
|
|
17
|
-
update(jsonElement) {
|
|
17
|
+
update(jsonElement, authoritative = false) {
|
|
18
18
|
if (jsonElement === null) {
|
|
19
19
|
throw new Error("Kinematics must not be null");
|
|
20
20
|
}
|
|
21
21
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
22
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
22
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
23
23
|
}
|
|
24
|
-
return super.update(jsonElement);
|
|
24
|
+
return super.update(jsonElement, authoritative);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
export default CoreKinematics;
|
|
@@ -16,6 +16,6 @@ export declare class DeltaKinematics extends KinematicsBase {
|
|
|
16
16
|
readonly towers: ModelCollection<DeltaTower>;
|
|
17
17
|
xTilt: number;
|
|
18
18
|
yTilt: number;
|
|
19
|
-
update(jsonElement: any): IModelObject | null;
|
|
19
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
20
20
|
}
|
|
21
21
|
export default DeltaKinematics;
|
|
@@ -22,14 +22,14 @@ export class DeltaKinematics extends KinematicsBase {
|
|
|
22
22
|
this.xTilt = 0;
|
|
23
23
|
this.yTilt = 0;
|
|
24
24
|
}
|
|
25
|
-
update(jsonElement) {
|
|
25
|
+
update(jsonElement, authoritative = false) {
|
|
26
26
|
if (jsonElement === null) {
|
|
27
27
|
throw new Error("Kinematics must not be null");
|
|
28
28
|
}
|
|
29
29
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
30
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
30
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
31
31
|
}
|
|
32
|
-
return super.update(jsonElement);
|
|
32
|
+
return super.update(jsonElement, authoritative);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export default DeltaKinematics;
|
|
@@ -4,6 +4,6 @@ export declare class HangprinterKinematics extends KinematicsBase {
|
|
|
4
4
|
anchors: Array<Array<number>>;
|
|
5
5
|
printRadius: number;
|
|
6
6
|
constructor();
|
|
7
|
-
update(jsonElement: any): IModelObject | null;
|
|
7
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
8
8
|
}
|
|
9
9
|
export default HangprinterKinematics;
|
|
@@ -11,14 +11,14 @@ export class HangprinterKinematics extends KinematicsBase {
|
|
|
11
11
|
];
|
|
12
12
|
this.printRadius = 1500;
|
|
13
13
|
}
|
|
14
|
-
update(jsonElement) {
|
|
14
|
+
update(jsonElement, authoritative = false) {
|
|
15
15
|
if (jsonElement === null) {
|
|
16
16
|
throw new Error("Kinematics must not be null");
|
|
17
17
|
}
|
|
18
18
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
19
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
19
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
20
20
|
}
|
|
21
|
-
return super.update(jsonElement);
|
|
21
|
+
return super.update(jsonElement, authoritative);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
export default HangprinterKinematics;
|
|
@@ -7,6 +7,6 @@ export declare class PolarKinematics extends KinematicsBase {
|
|
|
7
7
|
radiusMin: number;
|
|
8
8
|
ttAccMax: number;
|
|
9
9
|
ttSpeedMax: number;
|
|
10
|
-
update(jsonElement: any): IModelObject | null;
|
|
10
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
11
11
|
}
|
|
12
12
|
export default PolarKinematics;
|
|
@@ -9,14 +9,14 @@ export class PolarKinematics extends KinematicsBase {
|
|
|
9
9
|
this.ttAccMax = 0;
|
|
10
10
|
this.ttSpeedMax = 0;
|
|
11
11
|
}
|
|
12
|
-
update(jsonElement) {
|
|
12
|
+
update(jsonElement, authoritative = false) {
|
|
13
13
|
if (jsonElement === null) {
|
|
14
14
|
throw new Error("Kinematics must not be null");
|
|
15
15
|
}
|
|
16
16
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
17
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
17
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
18
18
|
}
|
|
19
|
-
return super.update(jsonElement);
|
|
19
|
+
return super.update(jsonElement, authoritative);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
export default PolarKinematics;
|
|
@@ -9,6 +9,6 @@ export declare class ScaraKinematics extends ZLeadscrewKinematics {
|
|
|
9
9
|
thetaLimits: number[];
|
|
10
10
|
xOffset: number;
|
|
11
11
|
yOffset: number;
|
|
12
|
-
update(jsonElement: any): IModelObject | null;
|
|
12
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
13
13
|
}
|
|
14
14
|
export default ScaraKinematics;
|
|
@@ -12,14 +12,14 @@ export class ScaraKinematics extends ZLeadscrewKinematics {
|
|
|
12
12
|
this.xOffset = 0;
|
|
13
13
|
this.yOffset = 0;
|
|
14
14
|
}
|
|
15
|
-
update(jsonElement) {
|
|
15
|
+
update(jsonElement, authoritative = false) {
|
|
16
16
|
if (jsonElement === null) {
|
|
17
17
|
throw new Error("Kinematics must not be null");
|
|
18
18
|
}
|
|
19
19
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
20
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
20
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
21
21
|
}
|
|
22
|
-
return super.update(jsonElement);
|
|
22
|
+
return super.update(jsonElement, authoritative);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export default ScaraKinematics;
|
|
@@ -2,7 +2,7 @@ import type { IModelObject } from "../../ModelObject";
|
|
|
2
2
|
import KinematicsBase, { KinematicsName } from "./KinematicsBase";
|
|
3
3
|
export declare class Kinematics extends KinematicsBase {
|
|
4
4
|
constructor(name?: KinematicsName);
|
|
5
|
-
update(jsonElement: any): IModelObject | null;
|
|
5
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
6
6
|
}
|
|
7
7
|
export default Kinematics;
|
|
8
8
|
export declare function getKinematics(name: KinematicsName): KinematicsBase;
|
|
@@ -8,14 +8,14 @@ export class Kinematics extends KinematicsBase {
|
|
|
8
8
|
constructor(name = KinematicsName.cartesian) {
|
|
9
9
|
super(name);
|
|
10
10
|
}
|
|
11
|
-
update(jsonElement) {
|
|
11
|
+
update(jsonElement, authoritative = false) {
|
|
12
12
|
if (jsonElement === null) {
|
|
13
13
|
throw new Error("Kinematics must not be null");
|
|
14
14
|
}
|
|
15
15
|
if (typeof jsonElement.name === "string" && this.name !== jsonElement.name) {
|
|
16
|
-
return getKinematics(jsonElement.name).update(jsonElement);
|
|
16
|
+
return getKinematics(jsonElement.name).update(jsonElement, authoritative);
|
|
17
17
|
}
|
|
18
|
-
return super.update(jsonElement);
|
|
18
|
+
return super.update(jsonElement, authoritative);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
export default Kinematics;
|
|
@@ -64,6 +64,6 @@ export declare class PluginManifest extends ModelObject {
|
|
|
64
64
|
rrfVersion: string | null;
|
|
65
65
|
data: Map<string, any>;
|
|
66
66
|
static checkVersion(actual: string, required: string): boolean;
|
|
67
|
-
update(jsonElement: any): IModelObject | null;
|
|
67
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
68
68
|
}
|
|
69
69
|
export default PluginManifest;
|
|
@@ -109,14 +109,14 @@ export class PluginManifest extends ModelObject {
|
|
|
109
109
|
}
|
|
110
110
|
return true;
|
|
111
111
|
}
|
|
112
|
-
update(jsonElement) {
|
|
112
|
+
update(jsonElement, authoritative = false) {
|
|
113
113
|
if (typeof jsonElement.data === "object") {
|
|
114
114
|
for (const key in jsonElement.data) {
|
|
115
115
|
this.data.set(key, jsonElement.data[key]);
|
|
116
116
|
}
|
|
117
117
|
delete jsonElement.data;
|
|
118
118
|
}
|
|
119
|
-
return super.update(jsonElement);
|
|
119
|
+
return super.update(jsonElement, authoritative);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
export default PluginManifest;
|
|
@@ -18,6 +18,6 @@ export declare class LaserFilamentMonitor extends Duet3DFilamentMonitor {
|
|
|
18
18
|
constructor();
|
|
19
19
|
calibrated: LaserFilamentMonitorCalibrated | null;
|
|
20
20
|
readonly configured: LaserFilamentMonitorConfigured;
|
|
21
|
-
update(jsonElement: any): IModelObject | null;
|
|
21
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
22
22
|
}
|
|
23
23
|
export default LaserFilamentMonitor;
|
|
@@ -28,14 +28,14 @@ export class LaserFilamentMonitor extends Duet3DFilamentMonitor {
|
|
|
28
28
|
this.configured = new LaserFilamentMonitorConfigured();
|
|
29
29
|
ModelObject.wrapModelProperty(this, "calibrated", LaserFilamentMonitorCalibrated);
|
|
30
30
|
}
|
|
31
|
-
update(jsonElement) {
|
|
31
|
+
update(jsonElement, authoritative = false) {
|
|
32
32
|
if (jsonElement === null) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
if (typeof jsonElement.type === "string" && jsonElement.type !== this.type) {
|
|
36
|
-
return getFilamentMonitor(jsonElement.type).update(jsonElement);
|
|
36
|
+
return getFilamentMonitor(jsonElement.type).update(jsonElement, authoritative);
|
|
37
37
|
}
|
|
38
|
-
return super.update(jsonElement);
|
|
38
|
+
return super.update(jsonElement, authoritative);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
export default LaserFilamentMonitor;
|
|
@@ -18,6 +18,6 @@ export declare class PulsedFilamentMonitor extends FilamentMonitorBase {
|
|
|
18
18
|
calibrated: PulsedFilamentMonitorCalibrated | null;
|
|
19
19
|
readonly configured: PulsedFilamentMonitorConfigured;
|
|
20
20
|
position: number;
|
|
21
|
-
update(jsonElement: any): IModelObject | null;
|
|
21
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
22
22
|
}
|
|
23
23
|
export default PulsedFilamentMonitor;
|
|
@@ -27,14 +27,14 @@ export class PulsedFilamentMonitor extends FilamentMonitorBase {
|
|
|
27
27
|
this.position = 0;
|
|
28
28
|
ModelObject.wrapModelProperty(this, "calibrated", PulsedFilamentMonitorCalibrated);
|
|
29
29
|
}
|
|
30
|
-
update(jsonElement) {
|
|
30
|
+
update(jsonElement, authoritative = false) {
|
|
31
31
|
if (jsonElement === null) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
34
|
if (typeof jsonElement.type === "string" && jsonElement.type !== this.type) {
|
|
35
|
-
return getFilamentMonitor(jsonElement.type).update(jsonElement);
|
|
35
|
+
return getFilamentMonitor(jsonElement.type).update(jsonElement, authoritative);
|
|
36
36
|
}
|
|
37
|
-
return super.update(jsonElement);
|
|
37
|
+
return super.update(jsonElement, authoritative);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
export default PulsedFilamentMonitor;
|
|
@@ -19,6 +19,6 @@ export declare class RotatingMagnetFilamentMonitor extends Duet3DFilamentMonitor
|
|
|
19
19
|
agc: number | null;
|
|
20
20
|
calibrated: RotatingMagnetFilamentMonitorCalibrated | null;
|
|
21
21
|
readonly configured: RotatingMagnetFilamentMonitorConfigured;
|
|
22
|
-
update(jsonElement: any): IModelObject | null;
|
|
22
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
23
23
|
}
|
|
24
24
|
export default RotatingMagnetFilamentMonitor;
|
|
@@ -29,14 +29,14 @@ export class RotatingMagnetFilamentMonitor extends Duet3DFilamentMonitor {
|
|
|
29
29
|
this.configured = new RotatingMagnetFilamentMonitorConfigured();
|
|
30
30
|
ModelObject.wrapModelProperty(this, "calibrated", RotatingMagnetFilamentMonitorCalibrated);
|
|
31
31
|
}
|
|
32
|
-
update(jsonElement) {
|
|
32
|
+
update(jsonElement, authoritative = false) {
|
|
33
33
|
if (jsonElement === null) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
if (typeof jsonElement.type === "string" && jsonElement.type !== this.type) {
|
|
37
|
-
return getFilamentMonitor(jsonElement.type).update(jsonElement);
|
|
37
|
+
return getFilamentMonitor(jsonElement.type).update(jsonElement, authoritative);
|
|
38
38
|
}
|
|
39
|
-
return super.update(jsonElement);
|
|
39
|
+
return super.update(jsonElement, authoritative);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
export default RotatingMagnetFilamentMonitor;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IModelObject } from "../../ModelObject";
|
|
2
2
|
import FilamentMonitorBase, { FilamentMonitorType } from "./FilamentMonitorBase";
|
|
3
3
|
export declare class FilamentMonitor extends FilamentMonitorBase {
|
|
4
|
-
update(jsonElement: any): IModelObject | null;
|
|
4
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
5
5
|
}
|
|
6
6
|
export default FilamentMonitor;
|
|
7
7
|
export declare function getFilamentMonitor(type: FilamentMonitorType): FilamentMonitorBase;
|
|
@@ -3,14 +3,14 @@ import LaserFilamentMonitor from "./LaserFilamentMonitor";
|
|
|
3
3
|
import PulsedFilamentMonitor from "./PulsedFilamentMonitor";
|
|
4
4
|
import RotatingMagnetFilamentMonitor from "./RotatingMagnetFilamentMonitor";
|
|
5
5
|
export class FilamentMonitor extends FilamentMonitorBase {
|
|
6
|
-
update(jsonElement) {
|
|
6
|
+
update(jsonElement, authoritative = false) {
|
|
7
7
|
if (jsonElement === null) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
if (typeof jsonElement.type === "string" && jsonElement.type !== this.type) {
|
|
11
|
-
return getFilamentMonitor(jsonElement.type).update(jsonElement);
|
|
11
|
+
return getFilamentMonitor(jsonElement.type).update(jsonElement, authoritative);
|
|
12
12
|
}
|
|
13
|
-
return super.update(jsonElement);
|
|
13
|
+
return super.update(jsonElement, authoritative);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
export default FilamentMonitor;
|
package/dist/sensors/Probe.d.ts
CHANGED
|
@@ -11,7 +11,8 @@ export declare enum ProbeType {
|
|
|
11
11
|
unfilteredDigital = 8,
|
|
12
12
|
blTouch = 9,
|
|
13
13
|
zMotorStall = 10,
|
|
14
|
-
scanningAnalog = 11
|
|
14
|
+
scanningAnalog = 11,
|
|
15
|
+
loadCell = 12
|
|
15
16
|
}
|
|
16
17
|
export declare class ProbeTouchMode extends ModelObject {
|
|
17
18
|
active: boolean;
|
|
@@ -29,6 +30,8 @@ export declare class Probe extends ModelObject {
|
|
|
29
30
|
*/
|
|
30
31
|
diveHeight: number;
|
|
31
32
|
diveHeights: Array<number>;
|
|
33
|
+
force: number | null;
|
|
34
|
+
gramsPerCount: number | null;
|
|
32
35
|
isCalibrated: boolean | null;
|
|
33
36
|
lastStopHeight: number;
|
|
34
37
|
maxProbeCount: number;
|
package/dist/sensors/Probe.js
CHANGED
|
@@ -13,6 +13,7 @@ export var ProbeType;
|
|
|
13
13
|
ProbeType[ProbeType["blTouch"] = 9] = "blTouch";
|
|
14
14
|
ProbeType[ProbeType["zMotorStall"] = 10] = "zMotorStall";
|
|
15
15
|
ProbeType[ProbeType["scanningAnalog"] = 11] = "scanningAnalog";
|
|
16
|
+
ProbeType[ProbeType["loadCell"] = 12] = "loadCell";
|
|
16
17
|
})(ProbeType || (ProbeType = {}));
|
|
17
18
|
export class ProbeTouchMode extends ModelObject {
|
|
18
19
|
constructor() {
|
|
@@ -34,6 +35,8 @@ export class Probe extends ModelObject {
|
|
|
34
35
|
*/
|
|
35
36
|
this.diveHeight = 5;
|
|
36
37
|
this.diveHeights = [0, 0];
|
|
38
|
+
this.force = null;
|
|
39
|
+
this.gramsPerCount = null;
|
|
37
40
|
this.isCalibrated = null;
|
|
38
41
|
this.lastStopHeight = 0;
|
|
39
42
|
this.maxProbeCount = 1;
|
|
@@ -22,6 +22,6 @@ export declare class MessageBox extends ModelObject {
|
|
|
22
22
|
seq: number;
|
|
23
23
|
timeout: number;
|
|
24
24
|
title: string;
|
|
25
|
-
update(jsonElement: any): IModelObject | null;
|
|
25
|
+
update(jsonElement: any, authoritative?: boolean): IModelObject | null;
|
|
26
26
|
}
|
|
27
27
|
export default MessageBox;
|
package/dist/state/MessageBox.js
CHANGED
|
@@ -25,11 +25,11 @@ export class MessageBox extends ModelObject {
|
|
|
25
25
|
this.timeout = 0;
|
|
26
26
|
this.title = "";
|
|
27
27
|
}
|
|
28
|
-
update(jsonElement) {
|
|
28
|
+
update(jsonElement, authoritative = false) {
|
|
29
29
|
if (jsonElement instanceof Object && (typeof jsonElement.default === "number" || typeof jsonElement.default === "string")) {
|
|
30
30
|
this.default = jsonElement.default;
|
|
31
31
|
}
|
|
32
|
-
return super.update(jsonElement);
|
|
32
|
+
return super.update(jsonElement, authoritative);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export default MessageBox;
|