@kuriousdesign/machine-sdk 1.0.64 → 1.0.69
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/.github/workflows/publish.yml +28 -0
- package/README.md +28 -51
- package/dist/custom-types/BaseDevice/Device.d.ts +1 -1
- package/dist/custom-types/BaseDevice/Device.js +1 -1
- package/dist/custom-types/BaseDevice/index.d.ts +1 -0
- package/dist/custom-types/BaseDevice/index.js +1 -0
- package/dist/custom-types/Devices/index.d.ts +0 -2
- package/dist/custom-types/Devices/index.js +0 -2
- package/dist/custom-types/Recipe.d.ts +2 -0
- package/dist/custom-types/Recipe.js +9 -1
- package/package.json +1 -1
- package/src/abb/enums/GCs.mod +44 -44
- package/src/abb/enums/PartLocationIds.mod +13 -13
- package/src/abb/enums/RobTasks.mod +18 -18
- package/src/abb/enums/States.mod +20 -20
- package/src/abb/procs/MainModule.mod +188 -188
- package/src/abb/records/DeviceDataTypes.mod +35 -35
- package/src/custom-types/AppState.ts +115 -115
- package/src/custom-types/BaseDevice/Actions.ts +45 -45
- package/src/custom-types/BaseDevice/ApiOpcua.ts +71 -71
- package/src/custom-types/BaseDevice/Device.ts +224 -224
- package/src/custom-types/BaseDevice/DeviceCmds.ts +45 -45
- package/src/custom-types/BaseDevice/DeviceConstants.ts +9 -9
- package/src/custom-types/{Devices → BaseDevice}/DeviceTypes.ts +60 -60
- package/src/custom-types/BaseDevice/Processes.ts +38 -38
- package/src/custom-types/BaseDevice/index.ts +7 -6
- package/src/custom-types/Bridge.ts +8 -8
- package/src/custom-types/Com.ts +19 -19
- package/src/custom-types/Devices/Axis.ts +222 -222
- package/src/custom-types/Devices/Conductor.ts +14 -14
- package/src/custom-types/Devices/Pot.ts +24 -24
- package/src/custom-types/Devices/Robot.ts +208 -208
- package/src/custom-types/Devices/index.ts +3 -4
- package/src/custom-types/GlobalConstants.ts +98 -98
- package/src/custom-types/HMI.ts +52 -52
- package/src/custom-types/Machine.ts +130 -130
- package/src/custom-types/Part.ts +238 -238
- package/src/custom-types/RackData.ts +22 -22
- package/src/custom-types/Recipe.ts +250 -240
- package/src/custom-types/RecipeManagerFB.ts +10 -10
- package/src/custom-types/TaskQueue.ts +86 -86
- package/src/custom-types/UserManagerFB.ts +7 -7
- package/src/custom-types/index.ts +14 -14
- package/src/enums/Colors.ts +79 -79
- package/src/enums/DeviceId.ts +116 -116
- package/src/enums/ExtrusionType.ts +5 -5
- package/src/enums/OpcuaDatatype.ts +27 -27
- package/src/enums/Pages.ts +21 -21
- package/src/enums/States.ts +173 -173
- package/src/enums/TaskId.ts +37 -37
- package/src/enums/index.ts +9 -9
- package/src/functions/colorMapping.ts +43 -43
- package/src/functions/index.ts +2 -2
- package/src/functions/mqtt-helpers.ts +20 -20
- package/src/functions/topicMapping.ts +6 -6
- package/src/index.ts +3 -3
- package/src/plc-tags/index.ts +38 -38
- package/src/plc-tags/mqtt.ts +9 -9
- package/src/plc-tags/opcua.ts +3 -3
- package/src/styles/animations.css +15 -15
- package/tsconfig.json +13 -13
- package/dist/custom-types/Devices/Device.d.ts +0 -111
- package/dist/custom-types/Devices/Device.js +0 -108
- package/dist/custom-types/PartData.d.ts +0 -11
- package/dist/custom-types/PartData.js +0 -2
- package/dist/custom-types/RecipeData.d.ts +0 -7
- package/dist/custom-types/RecipeData.js +0 -2
- package/dist/enums/Errors.d.ts +0 -6
- package/dist/enums/Errors.js +0 -28
- package/dist/enums/Priorities.d.ts +0 -18
- package/dist/enums/Priorities.js +0 -24
- package/dist/enums/RobPositions.d.ts +0 -12
- package/dist/enums/RobPositions.js +0 -16
- package/dist/enums/Warnings.d.ts +0 -6
- package/dist/enums/Warnings.js +0 -18
- /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.d.ts +0 -0
- /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.js +0 -0
package/src/enums/Pages.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
export enum Page {
|
|
2
|
-
UNCONTROLLED = 0,
|
|
3
|
-
LOGIN = 1,
|
|
4
|
-
OPERATION = 2,
|
|
5
|
-
HOME = 3,
|
|
6
|
-
SETTINGS = 4,
|
|
7
|
-
|
|
8
|
-
RAW_SHELF = 5,
|
|
9
|
-
EDIT_RAW_SHELF = 6,
|
|
10
|
-
DONE_SHELF = 7,
|
|
11
|
-
EDIT_DONE_SHELF = 8,
|
|
12
|
-
|
|
13
|
-
RECIPES = 9,
|
|
14
|
-
EDIT_RECIPES = 10,
|
|
15
|
-
CHANGE_RECIPE = 11,
|
|
16
|
-
JOB_SETUP = 13,
|
|
17
|
-
|
|
18
|
-
ERRORS = 14,
|
|
19
|
-
WARNINGS = 15,
|
|
20
|
-
ROBOT = 16,
|
|
21
|
-
}
|
|
1
|
+
export enum Page {
|
|
2
|
+
UNCONTROLLED = 0,
|
|
3
|
+
LOGIN = 1,
|
|
4
|
+
OPERATION = 2,
|
|
5
|
+
HOME = 3,
|
|
6
|
+
SETTINGS = 4,
|
|
7
|
+
|
|
8
|
+
RAW_SHELF = 5,
|
|
9
|
+
EDIT_RAW_SHELF = 6,
|
|
10
|
+
DONE_SHELF = 7,
|
|
11
|
+
EDIT_DONE_SHELF = 8,
|
|
12
|
+
|
|
13
|
+
RECIPES = 9,
|
|
14
|
+
EDIT_RECIPES = 10,
|
|
15
|
+
CHANGE_RECIPE = 11,
|
|
16
|
+
JOB_SETUP = 13,
|
|
17
|
+
|
|
18
|
+
ERRORS = 14,
|
|
19
|
+
WARNINGS = 15,
|
|
20
|
+
ROBOT = 16,
|
|
21
|
+
}
|
package/src/enums/States.ts
CHANGED
|
@@ -1,173 +1,173 @@
|
|
|
1
|
-
export enum VisibilityState {
|
|
2
|
-
Invisible = 0,
|
|
3
|
-
Visible = 1,
|
|
4
|
-
FlashingFast = 2,
|
|
5
|
-
FlashingMed = 3,
|
|
6
|
-
FlashingSlow = 4,
|
|
7
|
-
StrobingFast = 5,
|
|
8
|
-
StrobingSlow = 6,
|
|
9
|
-
GrowingSlow = 7,
|
|
10
|
-
Disabled = 8
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export enum States {
|
|
14
|
-
ABORTING = -3,
|
|
15
|
-
ERROR = -2,
|
|
16
|
-
KILLED = -1,
|
|
17
|
-
INACTIVE = 0,
|
|
18
|
-
RESETTING = 50,
|
|
19
|
-
IDLE = 100,
|
|
20
|
-
RUNNING = 500,
|
|
21
|
-
STOPPING = 900,
|
|
22
|
-
PAUSED = 999,
|
|
23
|
-
DONE = 1000,
|
|
24
|
-
MANUAL = 1100,
|
|
25
|
-
UNKNOWN = 9999,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export function convertStateToString(state: States) {
|
|
29
|
-
switch (state) {
|
|
30
|
-
case States.ABORTING:
|
|
31
|
-
return "ABORTING";
|
|
32
|
-
case States.ERROR:
|
|
33
|
-
return "ERROR";
|
|
34
|
-
case States.KILLED:
|
|
35
|
-
return "KILLED";
|
|
36
|
-
case States.INACTIVE:
|
|
37
|
-
return "INACTIVE";
|
|
38
|
-
case States.RESETTING:
|
|
39
|
-
return "RESETTING";
|
|
40
|
-
case States.IDLE:
|
|
41
|
-
return "IDLE";
|
|
42
|
-
case States.RUNNING:
|
|
43
|
-
return "RUNNING";
|
|
44
|
-
case States.STOPPING:
|
|
45
|
-
return "STOPPING";
|
|
46
|
-
case States.PAUSED:
|
|
47
|
-
return "PAUSED";
|
|
48
|
-
case States.DONE:
|
|
49
|
-
return "DONE";
|
|
50
|
-
case States.MANUAL:
|
|
51
|
-
return "MANUAL";
|
|
52
|
-
case States.UNKNOWN:
|
|
53
|
-
return "UNKNOWN";
|
|
54
|
-
default:
|
|
55
|
-
return "UNKNOWN";
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export function convertStateToColor(state: States) {
|
|
60
|
-
|
|
61
|
-
switch (state) {
|
|
62
|
-
case States.ABORTING:
|
|
63
|
-
return "text-darkred-500";
|
|
64
|
-
case States.ERROR:
|
|
65
|
-
return "text-red-500";
|
|
66
|
-
case States.KILLED:
|
|
67
|
-
return "text-gray-500";
|
|
68
|
-
case States.INACTIVE:
|
|
69
|
-
return "text-white";
|
|
70
|
-
case States.RESETTING:
|
|
71
|
-
return "text-lightblue-500";
|
|
72
|
-
case States.IDLE:
|
|
73
|
-
return "text-blue-500";
|
|
74
|
-
case States.RUNNING:
|
|
75
|
-
return "text-green-500";
|
|
76
|
-
case States.STOPPING:
|
|
77
|
-
return "text-orange-500";
|
|
78
|
-
case States.MANUAL:
|
|
79
|
-
return "text-purple-500";
|
|
80
|
-
case States.UNKNOWN:
|
|
81
|
-
return "text-pink-500";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function getStateFromStep(step:number): States {
|
|
86
|
-
let state = States.UNKNOWN;
|
|
87
|
-
switch (step) {
|
|
88
|
-
case States.ABORTING:
|
|
89
|
-
state = States.ABORTING;
|
|
90
|
-
break;
|
|
91
|
-
case States.ERROR:
|
|
92
|
-
state = States.ERROR;
|
|
93
|
-
break;
|
|
94
|
-
case States.KILLED:
|
|
95
|
-
state = States.KILLED;
|
|
96
|
-
break;
|
|
97
|
-
case States.INACTIVE:
|
|
98
|
-
state = States.INACTIVE;
|
|
99
|
-
break;
|
|
100
|
-
case States.RESETTING:
|
|
101
|
-
state = States.RESETTING;
|
|
102
|
-
break;
|
|
103
|
-
case States.IDLE:
|
|
104
|
-
state = States.IDLE;
|
|
105
|
-
break;
|
|
106
|
-
case States.RUNNING:
|
|
107
|
-
state = States.RUNNING;
|
|
108
|
-
break;
|
|
109
|
-
case States.STOPPING:
|
|
110
|
-
state = States.STOPPING;
|
|
111
|
-
break;
|
|
112
|
-
case States.PAUSED:
|
|
113
|
-
state = States.PAUSED;
|
|
114
|
-
break;
|
|
115
|
-
case States.DONE:
|
|
116
|
-
state = States.DONE;
|
|
117
|
-
break;
|
|
118
|
-
case States.MANUAL:
|
|
119
|
-
state = States.MANUAL;
|
|
120
|
-
break;
|
|
121
|
-
case States.UNKNOWN:
|
|
122
|
-
state = States.UNKNOWN;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if(state === States.UNKNOWN){
|
|
127
|
-
if (state >= States.RESETTING && state < States.IDLE) {
|
|
128
|
-
state = States.RESETTING;
|
|
129
|
-
} else if (state > States.IDLE && state < States.STOPPING) {
|
|
130
|
-
state = States.RUNNING;
|
|
131
|
-
} else if (state >= States.STOPPING && state < States.PAUSED) {
|
|
132
|
-
state = States.STOPPING;
|
|
133
|
-
} else if (state >= States.MANUAL && state < States.UNKNOWN) {
|
|
134
|
-
state = States.MANUAL;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return state;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export enum PartStateDeprecated {
|
|
141
|
-
Empty = 0, //no part present
|
|
142
|
-
Raw = 10,
|
|
143
|
-
DeburrBottomStarted = 11,
|
|
144
|
-
DeburrBottomFinished = 12,
|
|
145
|
-
DeburrTopStarted = 15,
|
|
146
|
-
Deburred = 20, //completely deburred, both bottom and top
|
|
147
|
-
MachiningStarted = 45,
|
|
148
|
-
Machined = 50,
|
|
149
|
-
WashStarted = 55,
|
|
150
|
-
Washed = 60,
|
|
151
|
-
DryStarted = 65,
|
|
152
|
-
Dryed = 70,
|
|
153
|
-
Finished = 100,
|
|
154
|
-
Scrapped = 911,
|
|
155
|
-
Error = 999,
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export enum TaskItemState {
|
|
159
|
-
TaskDone = 48,
|
|
160
|
-
TaskActive = 49,
|
|
161
|
-
TaskFuture = 50,
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export enum StatusMsg {
|
|
165
|
-
Running = 0,
|
|
166
|
-
Faulted = 2,
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export enum BannerMode {
|
|
170
|
-
Good = 0,
|
|
171
|
-
Warning = 1,
|
|
172
|
-
Faulted = 2,
|
|
173
|
-
}
|
|
1
|
+
export enum VisibilityState {
|
|
2
|
+
Invisible = 0,
|
|
3
|
+
Visible = 1,
|
|
4
|
+
FlashingFast = 2,
|
|
5
|
+
FlashingMed = 3,
|
|
6
|
+
FlashingSlow = 4,
|
|
7
|
+
StrobingFast = 5,
|
|
8
|
+
StrobingSlow = 6,
|
|
9
|
+
GrowingSlow = 7,
|
|
10
|
+
Disabled = 8
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export enum States {
|
|
14
|
+
ABORTING = -3,
|
|
15
|
+
ERROR = -2,
|
|
16
|
+
KILLED = -1,
|
|
17
|
+
INACTIVE = 0,
|
|
18
|
+
RESETTING = 50,
|
|
19
|
+
IDLE = 100,
|
|
20
|
+
RUNNING = 500,
|
|
21
|
+
STOPPING = 900,
|
|
22
|
+
PAUSED = 999,
|
|
23
|
+
DONE = 1000,
|
|
24
|
+
MANUAL = 1100,
|
|
25
|
+
UNKNOWN = 9999,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export function convertStateToString(state: States) {
|
|
29
|
+
switch (state) {
|
|
30
|
+
case States.ABORTING:
|
|
31
|
+
return "ABORTING";
|
|
32
|
+
case States.ERROR:
|
|
33
|
+
return "ERROR";
|
|
34
|
+
case States.KILLED:
|
|
35
|
+
return "KILLED";
|
|
36
|
+
case States.INACTIVE:
|
|
37
|
+
return "INACTIVE";
|
|
38
|
+
case States.RESETTING:
|
|
39
|
+
return "RESETTING";
|
|
40
|
+
case States.IDLE:
|
|
41
|
+
return "IDLE";
|
|
42
|
+
case States.RUNNING:
|
|
43
|
+
return "RUNNING";
|
|
44
|
+
case States.STOPPING:
|
|
45
|
+
return "STOPPING";
|
|
46
|
+
case States.PAUSED:
|
|
47
|
+
return "PAUSED";
|
|
48
|
+
case States.DONE:
|
|
49
|
+
return "DONE";
|
|
50
|
+
case States.MANUAL:
|
|
51
|
+
return "MANUAL";
|
|
52
|
+
case States.UNKNOWN:
|
|
53
|
+
return "UNKNOWN";
|
|
54
|
+
default:
|
|
55
|
+
return "UNKNOWN";
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function convertStateToColor(state: States) {
|
|
60
|
+
|
|
61
|
+
switch (state) {
|
|
62
|
+
case States.ABORTING:
|
|
63
|
+
return "text-darkred-500";
|
|
64
|
+
case States.ERROR:
|
|
65
|
+
return "text-red-500";
|
|
66
|
+
case States.KILLED:
|
|
67
|
+
return "text-gray-500";
|
|
68
|
+
case States.INACTIVE:
|
|
69
|
+
return "text-white";
|
|
70
|
+
case States.RESETTING:
|
|
71
|
+
return "text-lightblue-500";
|
|
72
|
+
case States.IDLE:
|
|
73
|
+
return "text-blue-500";
|
|
74
|
+
case States.RUNNING:
|
|
75
|
+
return "text-green-500";
|
|
76
|
+
case States.STOPPING:
|
|
77
|
+
return "text-orange-500";
|
|
78
|
+
case States.MANUAL:
|
|
79
|
+
return "text-purple-500";
|
|
80
|
+
case States.UNKNOWN:
|
|
81
|
+
return "text-pink-500";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function getStateFromStep(step:number): States {
|
|
86
|
+
let state = States.UNKNOWN;
|
|
87
|
+
switch (step) {
|
|
88
|
+
case States.ABORTING:
|
|
89
|
+
state = States.ABORTING;
|
|
90
|
+
break;
|
|
91
|
+
case States.ERROR:
|
|
92
|
+
state = States.ERROR;
|
|
93
|
+
break;
|
|
94
|
+
case States.KILLED:
|
|
95
|
+
state = States.KILLED;
|
|
96
|
+
break;
|
|
97
|
+
case States.INACTIVE:
|
|
98
|
+
state = States.INACTIVE;
|
|
99
|
+
break;
|
|
100
|
+
case States.RESETTING:
|
|
101
|
+
state = States.RESETTING;
|
|
102
|
+
break;
|
|
103
|
+
case States.IDLE:
|
|
104
|
+
state = States.IDLE;
|
|
105
|
+
break;
|
|
106
|
+
case States.RUNNING:
|
|
107
|
+
state = States.RUNNING;
|
|
108
|
+
break;
|
|
109
|
+
case States.STOPPING:
|
|
110
|
+
state = States.STOPPING;
|
|
111
|
+
break;
|
|
112
|
+
case States.PAUSED:
|
|
113
|
+
state = States.PAUSED;
|
|
114
|
+
break;
|
|
115
|
+
case States.DONE:
|
|
116
|
+
state = States.DONE;
|
|
117
|
+
break;
|
|
118
|
+
case States.MANUAL:
|
|
119
|
+
state = States.MANUAL;
|
|
120
|
+
break;
|
|
121
|
+
case States.UNKNOWN:
|
|
122
|
+
state = States.UNKNOWN;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if(state === States.UNKNOWN){
|
|
127
|
+
if (state >= States.RESETTING && state < States.IDLE) {
|
|
128
|
+
state = States.RESETTING;
|
|
129
|
+
} else if (state > States.IDLE && state < States.STOPPING) {
|
|
130
|
+
state = States.RUNNING;
|
|
131
|
+
} else if (state >= States.STOPPING && state < States.PAUSED) {
|
|
132
|
+
state = States.STOPPING;
|
|
133
|
+
} else if (state >= States.MANUAL && state < States.UNKNOWN) {
|
|
134
|
+
state = States.MANUAL;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return state;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export enum PartStateDeprecated {
|
|
141
|
+
Empty = 0, //no part present
|
|
142
|
+
Raw = 10,
|
|
143
|
+
DeburrBottomStarted = 11,
|
|
144
|
+
DeburrBottomFinished = 12,
|
|
145
|
+
DeburrTopStarted = 15,
|
|
146
|
+
Deburred = 20, //completely deburred, both bottom and top
|
|
147
|
+
MachiningStarted = 45,
|
|
148
|
+
Machined = 50,
|
|
149
|
+
WashStarted = 55,
|
|
150
|
+
Washed = 60,
|
|
151
|
+
DryStarted = 65,
|
|
152
|
+
Dryed = 70,
|
|
153
|
+
Finished = 100,
|
|
154
|
+
Scrapped = 911,
|
|
155
|
+
Error = 999,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export enum TaskItemState {
|
|
159
|
+
TaskDone = 48,
|
|
160
|
+
TaskActive = 49,
|
|
161
|
+
TaskFuture = 50,
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export enum StatusMsg {
|
|
165
|
+
Running = 0,
|
|
166
|
+
Faulted = 2,
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export enum BannerMode {
|
|
170
|
+
Good = 0,
|
|
171
|
+
Warning = 1,
|
|
172
|
+
Faulted = 2,
|
|
173
|
+
}
|
package/src/enums/TaskId.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export enum TaskId {
|
|
2
|
-
NoTask = 0,
|
|
3
|
-
WayPointMove = 1, //use endPositionId as the destination to communicate to robot, all other parameters are useless.
|
|
4
|
-
PickRawShelf_R = 2, //pick raw shelf with Right Gripper, left gripper must be empty
|
|
5
|
-
DeburrBottom_R = 3, //Right Gripper Side Only, params(top/bottom/both
|
|
6
|
-
DeburrTop_R = 4, //Right Gripper Side Only, params(top/bottom/both
|
|
7
|
-
LoadPreOp2_L = 5, //rarely used (only be used if robot were ready to load cnc but had to abandon that to go wash parts or something like that), position 2 on pre op is on the right, left gripper must be empty
|
|
8
|
-
LoadPreOp2_R = 6, //position 2 on pre op is on the right, left gripper must be empty
|
|
9
|
-
LoadPreOp1_R = 7, //position 1 on pre op is on the left
|
|
10
|
-
PickPreOp1_R = 8, //position 1 on pre op is on the left
|
|
11
|
-
PickPreOp2_L = 9, //position 2 on pre op is on the right
|
|
12
|
-
LoadCnc2_L = 10,
|
|
13
|
-
LoadCnc1_R = 11,
|
|
14
|
-
PickCnc1_R = 12,
|
|
15
|
-
PickCnc2_L = 13,
|
|
16
|
-
LoadPostOp2_L = 14,
|
|
17
|
-
LoadPostOp1_R = 15,
|
|
18
|
-
PickPostOp1_R = 16,
|
|
19
|
-
PickPostOp2_L = 17,
|
|
20
|
-
PickPostOp2_R = 18, //left gripper must be empty
|
|
21
|
-
WashAndDry = 19,
|
|
22
|
-
LoadDoneShelf_R = 20, //uses a PLC PR offset for done shelf user frame
|
|
23
|
-
RejectPart_L = 21, //start and end at rack perch
|
|
24
|
-
RejectPart_R = 22, //start and end at rack perch
|
|
25
|
-
WaitToUnload = 23, //MARTIN WE WILL USE WayPointMove FOR THIS,
|
|
26
|
-
WaitToLoad = 24, //MARTIN WE WILL USE WayPointMove FOR THIS, wait in front of cnc with deburred parts in both robot gripppers, only used when cnc is empty and waiting to be filled, REPLACE WITH WAYPOINT MOVE?
|
|
27
|
-
ExitCnc = 25, //MARTIN WE WILL USE WayPointMove FOR THIS, move from cnc hover position to cnc perch position, REPLACE WITH WAYPOINT MOVE?
|
|
28
|
-
EnterCnc = 26, //MARTIN WE WILL USE WayPointMove FOR THIS, move to cnc hover position, MARTIN WE WILL USE WayPointMove FOR THIS
|
|
29
|
-
|
|
30
|
-
//non-robot tasks
|
|
31
|
-
ChangeCncProgram = 27,
|
|
32
|
-
StartCnc = 28,
|
|
33
|
-
StopCnc = 29,
|
|
34
|
-
ResetCnc = 30,
|
|
35
|
-
OpenCncDoor = 31,
|
|
36
|
-
CloseCncDoor = 32,
|
|
37
|
-
}
|
|
1
|
+
export enum TaskId {
|
|
2
|
+
NoTask = 0,
|
|
3
|
+
WayPointMove = 1, //use endPositionId as the destination to communicate to robot, all other parameters are useless.
|
|
4
|
+
PickRawShelf_R = 2, //pick raw shelf with Right Gripper, left gripper must be empty
|
|
5
|
+
DeburrBottom_R = 3, //Right Gripper Side Only, params(top/bottom/both
|
|
6
|
+
DeburrTop_R = 4, //Right Gripper Side Only, params(top/bottom/both
|
|
7
|
+
LoadPreOp2_L = 5, //rarely used (only be used if robot were ready to load cnc but had to abandon that to go wash parts or something like that), position 2 on pre op is on the right, left gripper must be empty
|
|
8
|
+
LoadPreOp2_R = 6, //position 2 on pre op is on the right, left gripper must be empty
|
|
9
|
+
LoadPreOp1_R = 7, //position 1 on pre op is on the left
|
|
10
|
+
PickPreOp1_R = 8, //position 1 on pre op is on the left
|
|
11
|
+
PickPreOp2_L = 9, //position 2 on pre op is on the right
|
|
12
|
+
LoadCnc2_L = 10,
|
|
13
|
+
LoadCnc1_R = 11,
|
|
14
|
+
PickCnc1_R = 12,
|
|
15
|
+
PickCnc2_L = 13,
|
|
16
|
+
LoadPostOp2_L = 14,
|
|
17
|
+
LoadPostOp1_R = 15,
|
|
18
|
+
PickPostOp1_R = 16,
|
|
19
|
+
PickPostOp2_L = 17,
|
|
20
|
+
PickPostOp2_R = 18, //left gripper must be empty
|
|
21
|
+
WashAndDry = 19,
|
|
22
|
+
LoadDoneShelf_R = 20, //uses a PLC PR offset for done shelf user frame
|
|
23
|
+
RejectPart_L = 21, //start and end at rack perch
|
|
24
|
+
RejectPart_R = 22, //start and end at rack perch
|
|
25
|
+
WaitToUnload = 23, //MARTIN WE WILL USE WayPointMove FOR THIS,
|
|
26
|
+
WaitToLoad = 24, //MARTIN WE WILL USE WayPointMove FOR THIS, wait in front of cnc with deburred parts in both robot gripppers, only used when cnc is empty and waiting to be filled, REPLACE WITH WAYPOINT MOVE?
|
|
27
|
+
ExitCnc = 25, //MARTIN WE WILL USE WayPointMove FOR THIS, move from cnc hover position to cnc perch position, REPLACE WITH WAYPOINT MOVE?
|
|
28
|
+
EnterCnc = 26, //MARTIN WE WILL USE WayPointMove FOR THIS, move to cnc hover position, MARTIN WE WILL USE WayPointMove FOR THIS
|
|
29
|
+
|
|
30
|
+
//non-robot tasks
|
|
31
|
+
ChangeCncProgram = 27,
|
|
32
|
+
StartCnc = 28,
|
|
33
|
+
StopCnc = 29,
|
|
34
|
+
ResetCnc = 30,
|
|
35
|
+
OpenCncDoor = 31,
|
|
36
|
+
CloseCncDoor = 32,
|
|
37
|
+
}
|
package/src/enums/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from "./Colors";
|
|
2
|
-
export * from "./States";
|
|
3
|
-
export * from "./OpcuaDatatype";
|
|
4
|
-
export * from "./ExtrusionType";
|
|
5
|
-
|
|
6
|
-
export * from "./DeviceId";
|
|
7
|
-
export * from "./TaskId";
|
|
8
|
-
|
|
9
|
-
export * from "./Pages";
|
|
1
|
+
export * from "./Colors";
|
|
2
|
+
export * from "./States";
|
|
3
|
+
export * from "./OpcuaDatatype";
|
|
4
|
+
export * from "./ExtrusionType";
|
|
5
|
+
|
|
6
|
+
export * from "./DeviceId";
|
|
7
|
+
export * from "./TaskId";
|
|
8
|
+
|
|
9
|
+
export * from "./Pages";
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { Color } from "../enums/Colors";
|
|
2
|
-
import { States, PartStateDeprecated } from "../enums/States";
|
|
3
|
-
|
|
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,
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
return colorMap[state];
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function partStateToColorMap(state: PartStateDeprecated): Color {
|
|
24
|
-
const colorMap: { [key in PartStateDeprecated]: Color } = {
|
|
25
|
-
[PartStateDeprecated.Empty]: Color.Empty,
|
|
26
|
-
[PartStateDeprecated.Raw]: Color.Raw,
|
|
27
|
-
[PartStateDeprecated.DeburrBottomStarted]: Color.Processing,
|
|
28
|
-
[PartStateDeprecated.DeburrBottomFinished]: Color.DeburrBottomFinished,
|
|
29
|
-
[PartStateDeprecated.DeburrTopStarted]: Color.Processing,
|
|
30
|
-
[PartStateDeprecated.Deburred]: Color.Deburred,
|
|
31
|
-
[PartStateDeprecated.MachiningStarted]: Color.Processing,
|
|
32
|
-
[PartStateDeprecated.Machined]: Color.Machined,
|
|
33
|
-
[PartStateDeprecated.WashStarted]: Color.Processing,
|
|
34
|
-
[PartStateDeprecated.Washed]: Color.Processing,
|
|
35
|
-
[PartStateDeprecated.DryStarted]: Color.Processing,
|
|
36
|
-
[PartStateDeprecated.Dryed]: Color.Dryed,
|
|
37
|
-
[PartStateDeprecated.Finished]: Color.Finished,
|
|
38
|
-
[PartStateDeprecated.Scrapped]: Color.Scrapped,
|
|
39
|
-
[PartStateDeprecated.Error]: Color.Error,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return colorMap[state];
|
|
43
|
-
}
|
|
1
|
+
import { Color } from "../enums/Colors";
|
|
2
|
+
import { States, PartStateDeprecated } from "../enums/States";
|
|
3
|
+
|
|
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,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return colorMap[state];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function partStateToColorMap(state: PartStateDeprecated): Color {
|
|
24
|
+
const colorMap: { [key in PartStateDeprecated]: Color } = {
|
|
25
|
+
[PartStateDeprecated.Empty]: Color.Empty,
|
|
26
|
+
[PartStateDeprecated.Raw]: Color.Raw,
|
|
27
|
+
[PartStateDeprecated.DeburrBottomStarted]: Color.Processing,
|
|
28
|
+
[PartStateDeprecated.DeburrBottomFinished]: Color.DeburrBottomFinished,
|
|
29
|
+
[PartStateDeprecated.DeburrTopStarted]: Color.Processing,
|
|
30
|
+
[PartStateDeprecated.Deburred]: Color.Deburred,
|
|
31
|
+
[PartStateDeprecated.MachiningStarted]: Color.Processing,
|
|
32
|
+
[PartStateDeprecated.Machined]: Color.Machined,
|
|
33
|
+
[PartStateDeprecated.WashStarted]: Color.Processing,
|
|
34
|
+
[PartStateDeprecated.Washed]: Color.Processing,
|
|
35
|
+
[PartStateDeprecated.DryStarted]: Color.Processing,
|
|
36
|
+
[PartStateDeprecated.Dryed]: Color.Dryed,
|
|
37
|
+
[PartStateDeprecated.Finished]: Color.Finished,
|
|
38
|
+
[PartStateDeprecated.Scrapped]: Color.Scrapped,
|
|
39
|
+
[PartStateDeprecated.Error]: Color.Error,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return colorMap[state];
|
|
43
|
+
}
|
package/src/functions/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./colorMapping";
|
|
2
|
-
export * from "./topicMapping";
|
|
1
|
+
export * from "./colorMapping";
|
|
2
|
+
export * from "./topicMapping";
|
|
3
3
|
export * from "./mqtt-helpers";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { DeviceRegistration } from "../custom-types";
|
|
2
|
-
|
|
3
|
-
export function buildFullTopicPath(device: DeviceRegistration, deviceMap: Map<number, DeviceRegistration>): string {
|
|
4
|
-
const parts: number[] = [];
|
|
5
|
-
let current: DeviceRegistration | undefined = device;
|
|
6
|
-
|
|
7
|
-
while (current) {
|
|
8
|
-
parts.unshift(current.id);
|
|
9
|
-
|
|
10
|
-
if (!current.parentId || current.parentId === 0) break;
|
|
11
|
-
|
|
12
|
-
const parent = deviceMap.get(current.parentId);
|
|
13
|
-
if (!parent) {
|
|
14
|
-
console.warn(`Parent device missing for device ${current.id}, parentId: ${current.parentId}`);
|
|
15
|
-
break;
|
|
16
|
-
}
|
|
17
|
-
current = parent;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
return 'machine/' + parts.join('/');
|
|
1
|
+
import { DeviceRegistration } from "../custom-types";
|
|
2
|
+
|
|
3
|
+
export function buildFullTopicPath(device: DeviceRegistration, deviceMap: Map<number, DeviceRegistration>): string {
|
|
4
|
+
const parts: number[] = [];
|
|
5
|
+
let current: DeviceRegistration | undefined = device;
|
|
6
|
+
|
|
7
|
+
while (current) {
|
|
8
|
+
parts.unshift(current.id);
|
|
9
|
+
|
|
10
|
+
if (!current.parentId || current.parentId === 0) break;
|
|
11
|
+
|
|
12
|
+
const parent = deviceMap.get(current.parentId);
|
|
13
|
+
if (!parent) {
|
|
14
|
+
console.warn(`Parent device missing for device ${current.id}, parentId: ${current.parentId}`);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
current = parent;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return 'machine/' + parts.join('/');
|
|
21
21
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export function machineIdToTopicMap(id: string): string {
|
|
2
|
-
const topicMap: { [key in string]: string } = {
|
|
3
|
-
"BendPro G2 Demo": "BendProG2/2286/198C/#",
|
|
4
|
-
};
|
|
5
|
-
return topicMap[id];
|
|
6
|
-
}
|
|
1
|
+
export function machineIdToTopicMap(id: string): string {
|
|
2
|
+
const topicMap: { [key in string]: string } = {
|
|
3
|
+
"BendPro G2 Demo": "BendProG2/2286/198C/#",
|
|
4
|
+
};
|
|
5
|
+
return topicMap[id];
|
|
6
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./custom-types";
|
|
2
|
-
export * from "./enums";
|
|
3
|
-
export * from "./functions";
|
|
1
|
+
export * from "./custom-types";
|
|
2
|
+
export * from "./enums";
|
|
3
|
+
export * from "./functions";
|
|
4
4
|
export * from "./plc-tags";
|