@kuriousdesign/machine-sdk 1.0.10 → 1.0.11
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/custom-types/Bridge.d.ts +8 -0
- package/dist/custom-types/Bridge.js +9 -0
- package/dist/custom-types/Devices/Device.d.ts +37 -0
- package/dist/custom-types/Devices/Device.js +38 -1
- package/dist/custom-types/Devices/deviceTypes.d.ts +5 -1
- package/dist/custom-types/Devices/deviceTypes.js +28 -0
- package/dist/custom-types/Devices/index.d.ts +2 -1
- package/dist/custom-types/Devices/index.js +2 -1
- package/dist/custom-types/HMI.d.ts +2 -2
- package/dist/custom-types/index.d.ts +1 -0
- package/dist/custom-types/index.js +1 -0
- package/dist/enums/States.d.ts +16 -12
- package/dist/enums/States.js +131 -15
- package/dist/functions/colorMapping.d.ts +2 -2
- package/dist/functions/colorMapping.js +12 -11
- package/dist/plc-tags/mqtt.d.ts +0 -4
- package/dist/plc-tags/mqtt.js +1 -5
- package/package.json +1 -1
- package/src/custom-types/HMI.ts +2 -2
- package/src/functions/colorMapping.ts +15 -14
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeCmds = void 0;
|
|
4
|
+
var BridgeCmds;
|
|
5
|
+
(function (BridgeCmds) {
|
|
6
|
+
BridgeCmds[BridgeCmds["NONE"] = 1] = "NONE";
|
|
7
|
+
BridgeCmds[BridgeCmds["CONNECT"] = 2] = "CONNECT";
|
|
8
|
+
BridgeCmds[BridgeCmds["DISCONNECT"] = 3] = "DISCONNECT";
|
|
9
|
+
})(BridgeCmds || (exports.BridgeCmds = BridgeCmds = {}));
|
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { DeviceTypes } from './DeviceTypes';
|
|
2
|
+
export declare const DeviceConstants: {
|
|
3
|
+
DEVICE_CHILDREN_ARRAY_LEN: number;
|
|
4
|
+
DEVICE_FAULTCODEARRAY_LEN: number;
|
|
5
|
+
MAX_NUM_PARAMS: number;
|
|
6
|
+
NUM_ACTION_TYPES: number;
|
|
7
|
+
NUM_LOG_ENTRIES: number;
|
|
8
|
+
MAX_NUM_OUTBOUND_AXIS_INTERLOCKS: number;
|
|
9
|
+
UNIT_TEST_PROCESS_ID: number;
|
|
10
|
+
TIME_MS_AUTOCLEAR_DONE_BIT_TASK_OR_PROCESS: number;
|
|
11
|
+
};
|
|
12
|
+
export interface DebugLogData {
|
|
13
|
+
Msg: string;
|
|
14
|
+
TimeStamp: Date;
|
|
15
|
+
Id: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const initialDebugLogData: DebugLogData;
|
|
18
|
+
export interface DeviceLogData {
|
|
19
|
+
List: DebugLogData[];
|
|
20
|
+
LastIndex: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const initialDeviceLogData: DeviceLogData;
|
|
2
23
|
export interface DeviceRegistration {
|
|
3
24
|
mnemonic: string;
|
|
4
25
|
id: number;
|
|
@@ -6,6 +27,13 @@ export interface DeviceRegistration {
|
|
|
6
27
|
parentId: number;
|
|
7
28
|
deviceType: DeviceTypes;
|
|
8
29
|
}
|
|
30
|
+
export interface DeviceActionRequestData {
|
|
31
|
+
SenderId: number;
|
|
32
|
+
ActionType: number;
|
|
33
|
+
ActionId: number;
|
|
34
|
+
ParamArray: number[];
|
|
35
|
+
}
|
|
36
|
+
export declare const initialDeviceActionRequestData: DeviceActionRequestData;
|
|
9
37
|
export declare const initialDeviceRegistration: DeviceRegistration;
|
|
10
38
|
export interface DeviceCfg {
|
|
11
39
|
safetyZoneId: number;
|
|
@@ -63,6 +91,15 @@ export interface DeviceStatus {
|
|
|
63
91
|
recordingLogs: boolean;
|
|
64
92
|
}
|
|
65
93
|
export declare const initialDeviceStatus: DeviceStatus;
|
|
94
|
+
export declare enum ActionTypes {
|
|
95
|
+
MISSION = 0,
|
|
96
|
+
CMD = 1,
|
|
97
|
+
TASK = 2,
|
|
98
|
+
PROCESS = 3,
|
|
99
|
+
EXEC_METHOD = 4,
|
|
100
|
+
SCRIPT = 5,
|
|
101
|
+
COUNT = 6
|
|
102
|
+
}
|
|
66
103
|
export interface Device {
|
|
67
104
|
is: DeviceStatus;
|
|
68
105
|
errors: DeviceFaultData;
|
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialDevice = exports.initialDeviceStatus = exports.initialDeviceFaultData = exports.initialFaultData = exports.initialDeviceCfg = exports.initialDeviceRegistration = void 0;
|
|
3
|
+
exports.initialDevice = exports.ActionTypes = exports.initialDeviceStatus = exports.initialDeviceFaultData = exports.initialFaultData = exports.initialDeviceCfg = exports.initialDeviceRegistration = exports.initialDeviceActionRequestData = exports.initialDeviceLogData = exports.initialDebugLogData = exports.DeviceConstants = void 0;
|
|
4
4
|
const DeviceTypes_1 = require("./DeviceTypes");
|
|
5
|
+
exports.DeviceConstants = {
|
|
6
|
+
DEVICE_CHILDREN_ARRAY_LEN: 10,
|
|
7
|
+
DEVICE_FAULTCODEARRAY_LEN: 10, //this value should be greater than equal to children array len
|
|
8
|
+
MAX_NUM_PARAMS: 10, //used for tasks and processes
|
|
9
|
+
NUM_ACTION_TYPES: 6, //this includes NONE
|
|
10
|
+
NUM_LOG_ENTRIES: 50,
|
|
11
|
+
MAX_NUM_OUTBOUND_AXIS_INTERLOCKS: 10,
|
|
12
|
+
UNIT_TEST_PROCESS_ID: 1100,
|
|
13
|
+
TIME_MS_AUTOCLEAR_DONE_BIT_TASK_OR_PROCESS: 250
|
|
14
|
+
};
|
|
15
|
+
exports.initialDebugLogData = {
|
|
16
|
+
Msg: '',
|
|
17
|
+
TimeStamp: new Date(),
|
|
18
|
+
Id: 0
|
|
19
|
+
};
|
|
20
|
+
exports.initialDeviceLogData = {
|
|
21
|
+
List: new Array(exports.DeviceConstants.NUM_LOG_ENTRIES).fill(null),
|
|
22
|
+
LastIndex: 0
|
|
23
|
+
};
|
|
24
|
+
;
|
|
25
|
+
;
|
|
26
|
+
exports.initialDeviceActionRequestData = {
|
|
27
|
+
SenderId: 0,
|
|
28
|
+
ActionType: 0,
|
|
29
|
+
ActionId: 0,
|
|
30
|
+
ParamArray: new Array(exports.DeviceConstants.MAX_NUM_PARAMS).fill(0)
|
|
31
|
+
};
|
|
5
32
|
exports.initialDeviceRegistration = {
|
|
6
33
|
mnemonic: '',
|
|
7
34
|
id: 0,
|
|
@@ -61,6 +88,16 @@ exports.initialDeviceStatus = {
|
|
|
61
88
|
commanderId: 0,
|
|
62
89
|
recordingLogs: false
|
|
63
90
|
};
|
|
91
|
+
var ActionTypes;
|
|
92
|
+
(function (ActionTypes) {
|
|
93
|
+
ActionTypes[ActionTypes["MISSION"] = 0] = "MISSION";
|
|
94
|
+
ActionTypes[ActionTypes["CMD"] = 1] = "CMD";
|
|
95
|
+
ActionTypes[ActionTypes["TASK"] = 2] = "TASK";
|
|
96
|
+
ActionTypes[ActionTypes["PROCESS"] = 3] = "PROCESS";
|
|
97
|
+
ActionTypes[ActionTypes["EXEC_METHOD"] = 4] = "EXEC_METHOD";
|
|
98
|
+
ActionTypes[ActionTypes["SCRIPT"] = 5] = "SCRIPT";
|
|
99
|
+
ActionTypes[ActionTypes["COUNT"] = 6] = "COUNT"; // Update this value to match the number of action types
|
|
100
|
+
})(ActionTypes || (exports.ActionTypes = ActionTypes = {}));
|
|
64
101
|
exports.initialDevice = {
|
|
65
102
|
is: exports.initialDeviceStatus,
|
|
66
103
|
errors: exports.initialDeviceFaultData,
|
|
@@ -3,5 +3,9 @@ export declare enum DeviceTypes {
|
|
|
3
3
|
Axis = 1,
|
|
4
4
|
BoschAxis = 2,//need to deprecate this soon
|
|
5
5
|
DualAxis = 3,
|
|
6
|
-
Gantry = 4
|
|
6
|
+
Gantry = 4,
|
|
7
|
+
Bridge = 5,//used for communication
|
|
8
|
+
Machine = 6,
|
|
9
|
+
Robot = 7
|
|
7
10
|
}
|
|
11
|
+
export declare function deviceTypeToString(deviceType: DeviceTypes): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeviceTypes = void 0;
|
|
4
|
+
exports.deviceTypeToString = deviceTypeToString;
|
|
4
5
|
var DeviceTypes;
|
|
5
6
|
(function (DeviceTypes) {
|
|
6
7
|
DeviceTypes[DeviceTypes["Base"] = 0] = "Base";
|
|
@@ -8,4 +9,31 @@ var DeviceTypes;
|
|
|
8
9
|
DeviceTypes[DeviceTypes["BoschAxis"] = 2] = "BoschAxis";
|
|
9
10
|
DeviceTypes[DeviceTypes["DualAxis"] = 3] = "DualAxis";
|
|
10
11
|
DeviceTypes[DeviceTypes["Gantry"] = 4] = "Gantry";
|
|
12
|
+
DeviceTypes[DeviceTypes["Bridge"] = 5] = "Bridge";
|
|
13
|
+
DeviceTypes[DeviceTypes["Machine"] = 6] = "Machine";
|
|
14
|
+
DeviceTypes[DeviceTypes["Robot"] = 7] = "Robot";
|
|
11
15
|
})(DeviceTypes || (exports.DeviceTypes = DeviceTypes = {}));
|
|
16
|
+
;
|
|
17
|
+
function deviceTypeToString(deviceType) {
|
|
18
|
+
switch (deviceType) {
|
|
19
|
+
case DeviceTypes.Base:
|
|
20
|
+
return 'Base';
|
|
21
|
+
case DeviceTypes.Axis:
|
|
22
|
+
return 'Axis';
|
|
23
|
+
case DeviceTypes.BoschAxis:
|
|
24
|
+
return 'Bosch Axis';
|
|
25
|
+
case DeviceTypes.DualAxis:
|
|
26
|
+
return 'Dual Axis';
|
|
27
|
+
case DeviceTypes.Gantry:
|
|
28
|
+
return 'Gantry';
|
|
29
|
+
case DeviceTypes.Bridge:
|
|
30
|
+
return 'Bridge';
|
|
31
|
+
case DeviceTypes.Machine:
|
|
32
|
+
return 'Machine';
|
|
33
|
+
case DeviceTypes.Robot:
|
|
34
|
+
return 'Robot';
|
|
35
|
+
default:
|
|
36
|
+
return 'Unknown';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
;
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Device"), exports);
|
|
18
17
|
__exportStar(require("./Axis"), exports);
|
|
18
|
+
__exportStar(require("./Device"), exports);
|
|
19
|
+
__exportStar(require("./DeviceTypes"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FaultCodeData } from "./Machine";
|
|
2
|
-
import { BannerMode, Color,
|
|
2
|
+
import { BannerMode, Color, States, VisibilityState } from "..";
|
|
3
3
|
export interface ComponentAnimation {
|
|
4
4
|
visibility: VisibilityState;
|
|
5
5
|
needsExpertUser: boolean;
|
|
@@ -22,7 +22,7 @@ export interface ButtonBar {
|
|
|
22
22
|
}
|
|
23
23
|
export interface StatusBar {
|
|
24
24
|
jobName: string;
|
|
25
|
-
statusMsg:
|
|
25
|
+
statusMsg: States;
|
|
26
26
|
status: number;
|
|
27
27
|
cncTimeLeft: number[];
|
|
28
28
|
goodCnt: number;
|
package/dist/enums/States.d.ts
CHANGED
|
@@ -8,19 +8,23 @@ export declare enum VisibilityState {
|
|
|
8
8
|
StrobingSlow = 6,
|
|
9
9
|
GrowingSlow = 7
|
|
10
10
|
}
|
|
11
|
-
export declare enum
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
export declare enum States {
|
|
12
|
+
ABORTING = -3,
|
|
13
|
+
ERROR = -2,
|
|
14
|
+
KILLED = -1,
|
|
15
|
+
INACTIVE = 0,
|
|
16
|
+
RESETTING = 50,
|
|
17
|
+
IDLE = 100,
|
|
18
|
+
RUNNING = 500,
|
|
19
|
+
STOPPING = 900,
|
|
20
|
+
PAUSED = 999,
|
|
21
|
+
DONE = 1000,
|
|
22
|
+
MANUAL = 1100,
|
|
23
|
+
UNKNOWN = 9999
|
|
23
24
|
}
|
|
25
|
+
export declare function convertStateToString(state: States): "ABORTING" | "ERROR" | "KILLED" | "INACTIVE" | "RESETTING" | "IDLE" | "RUNNING" | "STOPPING" | "PAUSED" | "DONE" | "MANUAL" | "UNKNOWN";
|
|
26
|
+
export declare function convertStateToColor(state: States): "text-darkred-500" | "text-red-500" | "text-gray-500" | "text-white" | "text-lightblue-500" | "text-blue-500" | "text-green-500" | "text-orange-500" | "text-purple-500" | "text-pink-500" | undefined;
|
|
27
|
+
export declare function getStateFromStep(step: number): States;
|
|
24
28
|
export declare enum PartState {
|
|
25
29
|
Empty = 0,//no part present
|
|
26
30
|
Raw = 10,
|
package/dist/enums/States.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BannerMode = exports.StatusMsg = exports.TaskItemState = exports.PartState = exports.
|
|
3
|
+
exports.BannerMode = exports.StatusMsg = exports.TaskItemState = exports.PartState = exports.States = exports.VisibilityState = void 0;
|
|
4
|
+
exports.convertStateToString = convertStateToString;
|
|
5
|
+
exports.convertStateToColor = convertStateToColor;
|
|
6
|
+
exports.getStateFromStep = getStateFromStep;
|
|
4
7
|
var VisibilityState;
|
|
5
8
|
(function (VisibilityState) {
|
|
6
9
|
VisibilityState[VisibilityState["Invisible"] = 0] = "Invisible";
|
|
@@ -12,20 +15,133 @@ var VisibilityState;
|
|
|
12
15
|
VisibilityState[VisibilityState["StrobingSlow"] = 6] = "StrobingSlow";
|
|
13
16
|
VisibilityState[VisibilityState["GrowingSlow"] = 7] = "GrowingSlow";
|
|
14
17
|
})(VisibilityState || (exports.VisibilityState = VisibilityState = {}));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
;
|
|
19
|
+
var States;
|
|
20
|
+
(function (States) {
|
|
21
|
+
States[States["ABORTING"] = -3] = "ABORTING";
|
|
22
|
+
States[States["ERROR"] = -2] = "ERROR";
|
|
23
|
+
States[States["KILLED"] = -1] = "KILLED";
|
|
24
|
+
States[States["INACTIVE"] = 0] = "INACTIVE";
|
|
25
|
+
States[States["RESETTING"] = 50] = "RESETTING";
|
|
26
|
+
States[States["IDLE"] = 100] = "IDLE";
|
|
27
|
+
States[States["RUNNING"] = 500] = "RUNNING";
|
|
28
|
+
States[States["STOPPING"] = 900] = "STOPPING";
|
|
29
|
+
States[States["PAUSED"] = 999] = "PAUSED";
|
|
30
|
+
States[States["DONE"] = 1000] = "DONE";
|
|
31
|
+
States[States["MANUAL"] = 1100] = "MANUAL";
|
|
32
|
+
States[States["UNKNOWN"] = 9999] = "UNKNOWN";
|
|
33
|
+
})(States || (exports.States = States = {}));
|
|
34
|
+
;
|
|
35
|
+
function convertStateToString(state) {
|
|
36
|
+
switch (state) {
|
|
37
|
+
case States.ABORTING:
|
|
38
|
+
return "ABORTING";
|
|
39
|
+
case States.ERROR:
|
|
40
|
+
return "ERROR";
|
|
41
|
+
case States.KILLED:
|
|
42
|
+
return "KILLED";
|
|
43
|
+
case States.INACTIVE:
|
|
44
|
+
return "INACTIVE";
|
|
45
|
+
case States.RESETTING:
|
|
46
|
+
return "RESETTING";
|
|
47
|
+
case States.IDLE:
|
|
48
|
+
return "IDLE";
|
|
49
|
+
case States.RUNNING:
|
|
50
|
+
return "RUNNING";
|
|
51
|
+
case States.STOPPING:
|
|
52
|
+
return "STOPPING";
|
|
53
|
+
case States.PAUSED:
|
|
54
|
+
return "PAUSED";
|
|
55
|
+
case States.DONE:
|
|
56
|
+
return "DONE";
|
|
57
|
+
case States.MANUAL:
|
|
58
|
+
return "MANUAL";
|
|
59
|
+
case States.UNKNOWN:
|
|
60
|
+
return "UNKNOWN";
|
|
61
|
+
default:
|
|
62
|
+
return "UNKNOWN";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function convertStateToColor(state) {
|
|
66
|
+
switch (state) {
|
|
67
|
+
case States.ABORTING:
|
|
68
|
+
return "text-darkred-500";
|
|
69
|
+
case States.ERROR:
|
|
70
|
+
return "text-red-500";
|
|
71
|
+
case States.KILLED:
|
|
72
|
+
return "text-gray-500";
|
|
73
|
+
case States.INACTIVE:
|
|
74
|
+
return "text-white";
|
|
75
|
+
case States.RESETTING:
|
|
76
|
+
return "text-lightblue-500";
|
|
77
|
+
case States.IDLE:
|
|
78
|
+
return "text-blue-500";
|
|
79
|
+
case States.RUNNING:
|
|
80
|
+
return "text-green-500";
|
|
81
|
+
case States.STOPPING:
|
|
82
|
+
return "text-orange-500";
|
|
83
|
+
case States.MANUAL:
|
|
84
|
+
return "text-purple-500";
|
|
85
|
+
case States.UNKNOWN:
|
|
86
|
+
return "text-pink-500";
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function getStateFromStep(step) {
|
|
90
|
+
let state = States.UNKNOWN;
|
|
91
|
+
switch (step) {
|
|
92
|
+
case States.ABORTING:
|
|
93
|
+
state = States.ABORTING;
|
|
94
|
+
break;
|
|
95
|
+
case States.ERROR:
|
|
96
|
+
state = States.ERROR;
|
|
97
|
+
break;
|
|
98
|
+
case States.KILLED:
|
|
99
|
+
state = States.KILLED;
|
|
100
|
+
break;
|
|
101
|
+
case States.INACTIVE:
|
|
102
|
+
state = States.INACTIVE;
|
|
103
|
+
break;
|
|
104
|
+
case States.RESETTING:
|
|
105
|
+
state = States.RESETTING;
|
|
106
|
+
break;
|
|
107
|
+
case States.IDLE:
|
|
108
|
+
state = States.IDLE;
|
|
109
|
+
break;
|
|
110
|
+
case States.RUNNING:
|
|
111
|
+
state = States.RUNNING;
|
|
112
|
+
break;
|
|
113
|
+
case States.STOPPING:
|
|
114
|
+
state = States.STOPPING;
|
|
115
|
+
break;
|
|
116
|
+
case States.PAUSED:
|
|
117
|
+
state = States.PAUSED;
|
|
118
|
+
break;
|
|
119
|
+
case States.DONE:
|
|
120
|
+
state = States.DONE;
|
|
121
|
+
break;
|
|
122
|
+
case States.MANUAL:
|
|
123
|
+
state = States.MANUAL;
|
|
124
|
+
break;
|
|
125
|
+
case States.UNKNOWN:
|
|
126
|
+
state = States.UNKNOWN;
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
if (state === States.UNKNOWN) {
|
|
130
|
+
if (state >= States.RESETTING && state < States.IDLE) {
|
|
131
|
+
state = States.RESETTING;
|
|
132
|
+
}
|
|
133
|
+
else if (state > States.IDLE && state < States.STOPPING) {
|
|
134
|
+
state = States.RUNNING;
|
|
135
|
+
}
|
|
136
|
+
else if (state >= States.STOPPING && state < States.PAUSED) {
|
|
137
|
+
state = States.STOPPING;
|
|
138
|
+
}
|
|
139
|
+
else if (state >= States.MANUAL && state < States.UNKNOWN) {
|
|
140
|
+
state = States.MANUAL;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return state;
|
|
144
|
+
}
|
|
29
145
|
var PartState;
|
|
30
146
|
(function (PartState) {
|
|
31
147
|
PartState[PartState["Empty"] = 0] = "Empty";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Color } from "../enums/Colors";
|
|
2
|
-
import {
|
|
3
|
-
export declare function deviceStateToColorMap(state:
|
|
2
|
+
import { States, PartState } from "../enums/States";
|
|
3
|
+
export declare function deviceStateToColorMap(state: States): Color;
|
|
4
4
|
export declare function partStateToColorMap(state: PartState): Color;
|
|
@@ -6,17 +6,18 @@ const Colors_1 = require("../enums/Colors");
|
|
|
6
6
|
const States_1 = require("../enums/States");
|
|
7
7
|
function deviceStateToColorMap(state) {
|
|
8
8
|
const colorMap = {
|
|
9
|
-
[States_1.
|
|
10
|
-
[States_1.
|
|
11
|
-
[States_1.
|
|
12
|
-
[States_1.
|
|
13
|
-
[States_1.
|
|
14
|
-
[States_1.
|
|
15
|
-
[States_1.
|
|
16
|
-
[States_1.
|
|
17
|
-
[States_1.
|
|
18
|
-
[States_1.
|
|
19
|
-
[States_1.
|
|
9
|
+
[States_1.States.KILLED]: Colors_1.Color.Black,
|
|
10
|
+
[States_1.States.INACTIVE]: Colors_1.Color.Inactive,
|
|
11
|
+
[States_1.States.RESETTING]: Colors_1.Color.Resetting,
|
|
12
|
+
[States_1.States.IDLE]: Colors_1.Color.Idle,
|
|
13
|
+
[States_1.States.RUNNING]: Colors_1.Color.Running,
|
|
14
|
+
[States_1.States.STOPPING]: Colors_1.Color.Processing,
|
|
15
|
+
[States_1.States.DONE]: Colors_1.Color.Done,
|
|
16
|
+
[States_1.States.ABORTING]: Colors_1.Color.Error,
|
|
17
|
+
[States_1.States.MANUAL]: Colors_1.Color.Manual,
|
|
18
|
+
[States_1.States.PAUSED]: Colors_1.Color.Processing,
|
|
19
|
+
[States_1.States.ERROR]: Colors_1.Color.Error,
|
|
20
|
+
[States_1.States.UNKNOWN]: Colors_1.Color.Error,
|
|
20
21
|
};
|
|
21
22
|
return colorMap[state];
|
|
22
23
|
}
|
package/dist/plc-tags/mqtt.d.ts
CHANGED
package/dist/plc-tags/mqtt.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MqttTopics = void 0;
|
|
4
4
|
exports.MqttTopics = {
|
|
5
5
|
BRIDGE_STATUS: 'bridge/status',
|
|
6
6
|
BRIDGE_CMD: 'bridge/cmd',
|
|
7
7
|
DEVICE_MAP: 'deviceMap',
|
|
8
8
|
};
|
|
9
|
-
exports.BridgeCmds = {
|
|
10
|
-
CONNECT: 'connect',
|
|
11
|
-
DISCONNECT: 'disconnect'
|
|
12
|
-
};
|
package/package.json
CHANGED
package/src/custom-types/HMI.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FaultCodeData } from "./Machine";
|
|
2
|
-
import { BannerMode, Color,
|
|
2
|
+
import { BannerMode, Color, States, VisibilityState } from "..";
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export interface ComponentAnimation {
|
|
@@ -26,7 +26,7 @@ export interface ButtonBar {
|
|
|
26
26
|
|
|
27
27
|
export interface StatusBar {
|
|
28
28
|
jobName: string;
|
|
29
|
-
statusMsg:
|
|
29
|
+
statusMsg: States;
|
|
30
30
|
status: number;
|
|
31
31
|
cncTimeLeft: number[]; // get the second element in the array
|
|
32
32
|
goodCnt: number;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { Color } from "../enums/Colors";
|
|
2
|
-
import {
|
|
2
|
+
import { States, PartState } from "../enums/States";
|
|
3
3
|
|
|
4
|
-
export function deviceStateToColorMap(state:
|
|
5
|
-
const colorMap: { [key in
|
|
6
|
-
[
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
4
|
+
export function deviceStateToColorMap(state: States): Color {
|
|
5
|
+
const colorMap: { [key in States]: Color } = {
|
|
6
|
+
[States.KILLED]: Color.Black,
|
|
7
|
+
[States.INACTIVE]: Color.Inactive,
|
|
8
|
+
[States.RESETTING]: Color.Resetting,
|
|
9
|
+
[States.IDLE]: Color.Idle,
|
|
10
|
+
[States.RUNNING]: Color.Running,
|
|
11
|
+
[States.STOPPING]: Color.Processing,
|
|
12
|
+
[States.DONE]: Color.Done,
|
|
13
|
+
[States.ABORTING]: Color.Error,
|
|
14
|
+
[States.MANUAL]: Color.Manual,
|
|
15
|
+
[States.PAUSED]: Color.Processing,
|
|
16
|
+
[States.ERROR]: Color.Error,
|
|
17
|
+
[States.UNKNOWN]: Color.Error,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
return colorMap[state];
|