@kuriousdesign/machine-sdk 1.0.65 → 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 +1 -0
- package/dist/custom-types/Recipe.js +2 -0
- 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 -247
- 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/custom-types/Part.ts
CHANGED
|
@@ -1,238 +1,238 @@
|
|
|
1
|
-
import { PartStateDeprecated as PartStateDeprecated } from "../enums";
|
|
2
|
-
import { GCs } from "./GlobalConstants";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// TYPE PartValidationData :
|
|
7
|
-
// STRUCT
|
|
8
|
-
// State:INT;
|
|
9
|
-
// PreWeightKg:LREAL;
|
|
10
|
-
// PostWeightKg:LREAL;
|
|
11
|
-
// LinerWeightKg:LREAL;
|
|
12
|
-
// END_STRUCT
|
|
13
|
-
// END_TYPE
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// TYPE PartLocationIds :
|
|
17
|
-
// (
|
|
18
|
-
// None:=0,
|
|
19
|
-
// LeftFixture_P1 :=1,
|
|
20
|
-
// RightFixture_P9:=LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
21
|
-
// RobotGripper:=RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
22
|
-
// Lost:=RobotGripper + 1
|
|
23
|
-
// );
|
|
24
|
-
// END_TYPE
|
|
25
|
-
|
|
26
|
-
export enum PartLocationIds {
|
|
27
|
-
None = 0,
|
|
28
|
-
LeftFixture_P1 = 1,
|
|
29
|
-
RightFixture_P9 = LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
30
|
-
RobotGripper = RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
31
|
-
Lost = RobotGripper + 1
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export function partLocationIdToString(locationId: PartLocationIds): string {
|
|
35
|
-
switch (locationId) {
|
|
36
|
-
case PartLocationIds.None: return "None";
|
|
37
|
-
case PartLocationIds.RobotGripper: return "Robot Gripper";
|
|
38
|
-
case PartLocationIds.LeftFixture_P1: return "Left Fixture - P" + locationId.toString();
|
|
39
|
-
case PartLocationIds.RightFixture_P9: return "Right Fixture - P" + locationId.toString();
|
|
40
|
-
case PartLocationIds.Lost: return "Lost";
|
|
41
|
-
default:
|
|
42
|
-
return "Unknown";
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
// TYPE PartStates :
|
|
46
|
-
// (
|
|
47
|
-
// Empty:=0,//no part present
|
|
48
|
-
// //BadSensorEmpty:=1, //used if sensors give false positive
|
|
49
|
-
|
|
50
|
-
// UnvalidatedRaw:=10, //used if registered by sensor, but not approved by operator
|
|
51
|
-
|
|
52
|
-
// Raw:=20,
|
|
53
|
-
// //BadSensorRaw:=21, //used if loaded by sensor didn't work
|
|
54
|
-
|
|
55
|
-
// StartedPreWeighing:=29,
|
|
56
|
-
// PreWeighed:=30,
|
|
57
|
-
|
|
58
|
-
// StartedApplying:=31,
|
|
59
|
-
// Applied:=40,
|
|
60
|
-
|
|
61
|
-
// StartedPhotographing:=61,
|
|
62
|
-
// Photographed:=70,
|
|
63
|
-
|
|
64
|
-
// StartedPostWeighing:=71,
|
|
65
|
-
// PostWeighed:=80,
|
|
66
|
-
|
|
67
|
-
// Failed:=911,
|
|
68
|
-
// Passed:=1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// );
|
|
72
|
-
// END_TYPE
|
|
73
|
-
|
|
74
|
-
export enum PartStates {
|
|
75
|
-
Empty = 0,//no part present
|
|
76
|
-
//BadSensorEmpty = 1, //used if sensors give false positive
|
|
77
|
-
UnvalidatedRaw = 10, //used if registered by sensor, but not approved by operator
|
|
78
|
-
Raw = 20,
|
|
79
|
-
//BadSensorRaw = 21, //used if loaded by sensor didn't work
|
|
80
|
-
StartedPreWeighing = 29,
|
|
81
|
-
PreWeighed = 30,
|
|
82
|
-
StartedApplying = 31,
|
|
83
|
-
Applied = 40,
|
|
84
|
-
StartedPhotographing = 61,
|
|
85
|
-
Photographed = 70,
|
|
86
|
-
StartedPostWeighing = 71,
|
|
87
|
-
PostWeighed = 80,
|
|
88
|
-
Failed = 911,
|
|
89
|
-
Passed = 1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export function partStateToString(state: PartStates): string {
|
|
93
|
-
switch (state) {
|
|
94
|
-
case PartStates.Empty: return "Empty";
|
|
95
|
-
case PartStates.UnvalidatedRaw: return "Unvalidated Raw";
|
|
96
|
-
case PartStates.Raw: return "Raw";
|
|
97
|
-
case PartStates.StartedPreWeighing: return "Started Pre-Weighing";
|
|
98
|
-
case PartStates.PreWeighed: return "Pre-Weighed";
|
|
99
|
-
case PartStates.StartedApplying: return "Started Applying";
|
|
100
|
-
case PartStates.Applied: return "Applied";
|
|
101
|
-
case PartStates.StartedPhotographing: return "Started Photographing";
|
|
102
|
-
case PartStates.Photographed: return "Photographed";
|
|
103
|
-
case PartStates.StartedPostWeighing: return "Started Post-Weighing";
|
|
104
|
-
case PartStates.PostWeighed: return "Post-Weighed";
|
|
105
|
-
case PartStates.Failed: return "Failed";
|
|
106
|
-
case PartStates.Passed: return "Passed";
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface PartData {
|
|
111
|
-
processSts: PartStates; // PartStates enum
|
|
112
|
-
validation: PartValidationData;
|
|
113
|
-
loadedBadSensor: boolean; // marks if loaded into system with bad part present sensor
|
|
114
|
-
fixtureLocationWhenLoaded: number; // LocationIds enum, where this part was loaced
|
|
115
|
-
currentLocation: number; // LocationIds enum, this is also the same as the partIndex of the Machine.PartData[partIndex]
|
|
116
|
-
inFixture: boolean; // CurrentLocation = FixtureLocationWhenLoaded
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface PartValidationData {
|
|
120
|
-
state: number; // PartStates enum
|
|
121
|
-
preWeightKg: number; // LREAL
|
|
122
|
-
postWeightKg: number; // LREAL
|
|
123
|
-
linerWeightKg: number; // LREAL
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export const initialPartValidationData: PartValidationData = {
|
|
127
|
-
state: -1,
|
|
128
|
-
preWeightKg: -1,
|
|
129
|
-
postWeightKg: -1,
|
|
130
|
-
linerWeightKg: -1,
|
|
131
|
-
};
|
|
132
|
-
export const initialPartData: PartData = {
|
|
133
|
-
processSts: PartStates.Empty,
|
|
134
|
-
validation: { ...initialPartValidationData },
|
|
135
|
-
loadedBadSensor: false,
|
|
136
|
-
fixtureLocationWhenLoaded: -1,
|
|
137
|
-
currentLocation: -1,
|
|
138
|
-
inFixture: false,
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// TYPE PartDataStatus :
|
|
142
|
-
// STRUCT
|
|
143
|
-
// Parts: ARRAY[0..GCs.PARTDATA_COUNT-1] OF PartData; //uses PartLocationIds, but lost parts get added to the end of known locations
|
|
144
|
-
// AllStationsAreEmpty:BOOL;
|
|
145
|
-
// RawShelfIsEmpty:BOOL;
|
|
146
|
-
// DoneShelfIsEmpty:BOOL;
|
|
147
|
-
// DoneShelfIsFull:BOOL;
|
|
148
|
-
// DoneShelfSpacesLeftCnt:INT;
|
|
149
|
-
// RawShelfPartsLeftCnt:INT;
|
|
150
|
-
// AllFixturesAreEmpty:BOOL;
|
|
151
|
-
// LeftFixtureIsEmpty:BOOL;
|
|
152
|
-
// RightFixtureIsEmpty:BOOL;
|
|
153
|
-
|
|
154
|
-
// RobotIsEmpty:BOOL;
|
|
155
|
-
// RobotHasNoPostOpParts:BOOL; //robot isn't holding any parts that are machined or washing/dryed or finished
|
|
156
|
-
// RobotHasMachinedParts:BOOL; //robot is holding at least one machined part
|
|
157
|
-
// RobotHasOnePreTopDeburring:BOOL;
|
|
158
|
-
// RobotHasOnePreMachining:BOOL;
|
|
159
|
-
// RobotHasTwoPreMachining:BOOL;
|
|
160
|
-
// RobotHasOneRaw:BOOL;
|
|
161
|
-
|
|
162
|
-
// OneOrMoreRejectPartsInCell:BOOL;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
|
|
163
|
-
// OneOrMoreRejectPartsInRobot:BOOL;
|
|
164
|
-
|
|
165
|
-
// RobotHasOneFinishedPart:BOOL;
|
|
166
|
-
// FinishedCnt:INT;//amount of finished parts either in post op or in robot
|
|
167
|
-
// ActiveCnt:INT;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
|
|
168
|
-
// BatchCntFlag:BOOL; //prevent more parts from being picked by raw
|
|
169
|
-
// END_STRUCT
|
|
170
|
-
// END_TYPE
|
|
171
|
-
export interface PartDataStatus {
|
|
172
|
-
parts: PartData[];
|
|
173
|
-
allStationsAreEmpty: boolean;
|
|
174
|
-
rawShelfIsEmpty: boolean;
|
|
175
|
-
doneShelfIsEmpty: boolean;
|
|
176
|
-
doneShelfIsFull: boolean;
|
|
177
|
-
doneShelfSpacesLeftCnt: number;
|
|
178
|
-
rawShelfPartsLeftCnt: number;
|
|
179
|
-
allFixturesAreEmpty: boolean;
|
|
180
|
-
leftFixtureIsEmpty: boolean;
|
|
181
|
-
rightFixtureIsEmpty: boolean;
|
|
182
|
-
|
|
183
|
-
robotIsEmpty: boolean;
|
|
184
|
-
robotHasNoPostOpParts: boolean; //robot isn't holding any parts that are machined or washing/dryed or finished
|
|
185
|
-
robotHasMachinedParts: boolean; //robot is holding at least one machined part
|
|
186
|
-
robotHasOnePreTopDeburring: boolean;
|
|
187
|
-
robotHasOnePreMachining: boolean;
|
|
188
|
-
robotHasTwoPreMachining: boolean;
|
|
189
|
-
robotHasOneRaw: boolean;
|
|
190
|
-
|
|
191
|
-
oneOrMoreRejectPartsInCell: boolean;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
|
|
192
|
-
oneOrMoreRejectPartsInRobot: boolean;
|
|
193
|
-
|
|
194
|
-
robotHasOneFinishedPart: boolean;
|
|
195
|
-
finishedCnt: number;//amount of finished parts either in post op or in robot
|
|
196
|
-
activeCnt: number;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
|
|
197
|
-
batchCntFlag: boolean; //prevent more parts from being picked by raw
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export const initialPartDataStatus: PartDataStatus = {
|
|
201
|
-
parts: Array(GCs.PARTDATA_COUNT).fill(null).map(() => ({ ...initialPartData })),
|
|
202
|
-
allStationsAreEmpty: false,
|
|
203
|
-
rawShelfIsEmpty: false,
|
|
204
|
-
doneShelfIsEmpty: false,
|
|
205
|
-
doneShelfIsFull: false,
|
|
206
|
-
doneShelfSpacesLeftCnt: 0,
|
|
207
|
-
rawShelfPartsLeftCnt: 0,
|
|
208
|
-
allFixturesAreEmpty: false,
|
|
209
|
-
leftFixtureIsEmpty: false,
|
|
210
|
-
rightFixtureIsEmpty: false,
|
|
211
|
-
|
|
212
|
-
robotIsEmpty: false,
|
|
213
|
-
robotHasNoPostOpParts: false,
|
|
214
|
-
robotHasMachinedParts: false,
|
|
215
|
-
robotHasOnePreTopDeburring: false,
|
|
216
|
-
robotHasOnePreMachining: false,
|
|
217
|
-
robotHasTwoPreMachining: false,
|
|
218
|
-
robotHasOneRaw: false,
|
|
219
|
-
|
|
220
|
-
oneOrMoreRejectPartsInCell: false,
|
|
221
|
-
oneOrMoreRejectPartsInRobot: false,
|
|
222
|
-
|
|
223
|
-
robotHasOneFinishedPart: false,
|
|
224
|
-
finishedCnt: 0,
|
|
225
|
-
activeCnt: 0,
|
|
226
|
-
batchCntFlag: false,
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
export interface PartDataDeprecated {
|
|
230
|
-
cncPreOp: [PartStateDeprecated, PartStateDeprecated];
|
|
231
|
-
cnc: [PartStateDeprecated, PartStateDeprecated];
|
|
232
|
-
cncPostOp: [PartStateDeprecated, PartStateDeprecated];
|
|
233
|
-
doneShelf: PartStateDeprecated[];
|
|
234
|
-
rawShelf: PartStateDeprecated[];
|
|
235
|
-
robot: [PartStateDeprecated, PartStateDeprecated];
|
|
236
|
-
washer: [PartStateDeprecated, PartStateDeprecated];
|
|
237
|
-
hmiEditingAllowed: boolean;
|
|
238
|
-
}
|
|
1
|
+
import { PartStateDeprecated as PartStateDeprecated } from "../enums";
|
|
2
|
+
import { GCs } from "./GlobalConstants";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
// TYPE PartValidationData :
|
|
7
|
+
// STRUCT
|
|
8
|
+
// State:INT;
|
|
9
|
+
// PreWeightKg:LREAL;
|
|
10
|
+
// PostWeightKg:LREAL;
|
|
11
|
+
// LinerWeightKg:LREAL;
|
|
12
|
+
// END_STRUCT
|
|
13
|
+
// END_TYPE
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
// TYPE PartLocationIds :
|
|
17
|
+
// (
|
|
18
|
+
// None:=0,
|
|
19
|
+
// LeftFixture_P1 :=1,
|
|
20
|
+
// RightFixture_P9:=LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
21
|
+
// RobotGripper:=RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
22
|
+
// Lost:=RobotGripper + 1
|
|
23
|
+
// );
|
|
24
|
+
// END_TYPE
|
|
25
|
+
|
|
26
|
+
export enum PartLocationIds {
|
|
27
|
+
None = 0,
|
|
28
|
+
LeftFixture_P1 = 1,
|
|
29
|
+
RightFixture_P9 = LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
30
|
+
RobotGripper = RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
|
|
31
|
+
Lost = RobotGripper + 1
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function partLocationIdToString(locationId: PartLocationIds): string {
|
|
35
|
+
switch (locationId) {
|
|
36
|
+
case PartLocationIds.None: return "None";
|
|
37
|
+
case PartLocationIds.RobotGripper: return "Robot Gripper";
|
|
38
|
+
case PartLocationIds.LeftFixture_P1: return "Left Fixture - P" + locationId.toString();
|
|
39
|
+
case PartLocationIds.RightFixture_P9: return "Right Fixture - P" + locationId.toString();
|
|
40
|
+
case PartLocationIds.Lost: return "Lost";
|
|
41
|
+
default:
|
|
42
|
+
return "Unknown";
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// TYPE PartStates :
|
|
46
|
+
// (
|
|
47
|
+
// Empty:=0,//no part present
|
|
48
|
+
// //BadSensorEmpty:=1, //used if sensors give false positive
|
|
49
|
+
|
|
50
|
+
// UnvalidatedRaw:=10, //used if registered by sensor, but not approved by operator
|
|
51
|
+
|
|
52
|
+
// Raw:=20,
|
|
53
|
+
// //BadSensorRaw:=21, //used if loaded by sensor didn't work
|
|
54
|
+
|
|
55
|
+
// StartedPreWeighing:=29,
|
|
56
|
+
// PreWeighed:=30,
|
|
57
|
+
|
|
58
|
+
// StartedApplying:=31,
|
|
59
|
+
// Applied:=40,
|
|
60
|
+
|
|
61
|
+
// StartedPhotographing:=61,
|
|
62
|
+
// Photographed:=70,
|
|
63
|
+
|
|
64
|
+
// StartedPostWeighing:=71,
|
|
65
|
+
// PostWeighed:=80,
|
|
66
|
+
|
|
67
|
+
// Failed:=911,
|
|
68
|
+
// Passed:=1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// );
|
|
72
|
+
// END_TYPE
|
|
73
|
+
|
|
74
|
+
export enum PartStates {
|
|
75
|
+
Empty = 0,//no part present
|
|
76
|
+
//BadSensorEmpty = 1, //used if sensors give false positive
|
|
77
|
+
UnvalidatedRaw = 10, //used if registered by sensor, but not approved by operator
|
|
78
|
+
Raw = 20,
|
|
79
|
+
//BadSensorRaw = 21, //used if loaded by sensor didn't work
|
|
80
|
+
StartedPreWeighing = 29,
|
|
81
|
+
PreWeighed = 30,
|
|
82
|
+
StartedApplying = 31,
|
|
83
|
+
Applied = 40,
|
|
84
|
+
StartedPhotographing = 61,
|
|
85
|
+
Photographed = 70,
|
|
86
|
+
StartedPostWeighing = 71,
|
|
87
|
+
PostWeighed = 80,
|
|
88
|
+
Failed = 911,
|
|
89
|
+
Passed = 1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export function partStateToString(state: PartStates): string {
|
|
93
|
+
switch (state) {
|
|
94
|
+
case PartStates.Empty: return "Empty";
|
|
95
|
+
case PartStates.UnvalidatedRaw: return "Unvalidated Raw";
|
|
96
|
+
case PartStates.Raw: return "Raw";
|
|
97
|
+
case PartStates.StartedPreWeighing: return "Started Pre-Weighing";
|
|
98
|
+
case PartStates.PreWeighed: return "Pre-Weighed";
|
|
99
|
+
case PartStates.StartedApplying: return "Started Applying";
|
|
100
|
+
case PartStates.Applied: return "Applied";
|
|
101
|
+
case PartStates.StartedPhotographing: return "Started Photographing";
|
|
102
|
+
case PartStates.Photographed: return "Photographed";
|
|
103
|
+
case PartStates.StartedPostWeighing: return "Started Post-Weighing";
|
|
104
|
+
case PartStates.PostWeighed: return "Post-Weighed";
|
|
105
|
+
case PartStates.Failed: return "Failed";
|
|
106
|
+
case PartStates.Passed: return "Passed";
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface PartData {
|
|
111
|
+
processSts: PartStates; // PartStates enum
|
|
112
|
+
validation: PartValidationData;
|
|
113
|
+
loadedBadSensor: boolean; // marks if loaded into system with bad part present sensor
|
|
114
|
+
fixtureLocationWhenLoaded: number; // LocationIds enum, where this part was loaced
|
|
115
|
+
currentLocation: number; // LocationIds enum, this is also the same as the partIndex of the Machine.PartData[partIndex]
|
|
116
|
+
inFixture: boolean; // CurrentLocation = FixtureLocationWhenLoaded
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface PartValidationData {
|
|
120
|
+
state: number; // PartStates enum
|
|
121
|
+
preWeightKg: number; // LREAL
|
|
122
|
+
postWeightKg: number; // LREAL
|
|
123
|
+
linerWeightKg: number; // LREAL
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export const initialPartValidationData: PartValidationData = {
|
|
127
|
+
state: -1,
|
|
128
|
+
preWeightKg: -1,
|
|
129
|
+
postWeightKg: -1,
|
|
130
|
+
linerWeightKg: -1,
|
|
131
|
+
};
|
|
132
|
+
export const initialPartData: PartData = {
|
|
133
|
+
processSts: PartStates.Empty,
|
|
134
|
+
validation: { ...initialPartValidationData },
|
|
135
|
+
loadedBadSensor: false,
|
|
136
|
+
fixtureLocationWhenLoaded: -1,
|
|
137
|
+
currentLocation: -1,
|
|
138
|
+
inFixture: false,
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
// TYPE PartDataStatus :
|
|
142
|
+
// STRUCT
|
|
143
|
+
// Parts: ARRAY[0..GCs.PARTDATA_COUNT-1] OF PartData; //uses PartLocationIds, but lost parts get added to the end of known locations
|
|
144
|
+
// AllStationsAreEmpty:BOOL;
|
|
145
|
+
// RawShelfIsEmpty:BOOL;
|
|
146
|
+
// DoneShelfIsEmpty:BOOL;
|
|
147
|
+
// DoneShelfIsFull:BOOL;
|
|
148
|
+
// DoneShelfSpacesLeftCnt:INT;
|
|
149
|
+
// RawShelfPartsLeftCnt:INT;
|
|
150
|
+
// AllFixturesAreEmpty:BOOL;
|
|
151
|
+
// LeftFixtureIsEmpty:BOOL;
|
|
152
|
+
// RightFixtureIsEmpty:BOOL;
|
|
153
|
+
|
|
154
|
+
// RobotIsEmpty:BOOL;
|
|
155
|
+
// RobotHasNoPostOpParts:BOOL; //robot isn't holding any parts that are machined or washing/dryed or finished
|
|
156
|
+
// RobotHasMachinedParts:BOOL; //robot is holding at least one machined part
|
|
157
|
+
// RobotHasOnePreTopDeburring:BOOL;
|
|
158
|
+
// RobotHasOnePreMachining:BOOL;
|
|
159
|
+
// RobotHasTwoPreMachining:BOOL;
|
|
160
|
+
// RobotHasOneRaw:BOOL;
|
|
161
|
+
|
|
162
|
+
// OneOrMoreRejectPartsInCell:BOOL;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
|
|
163
|
+
// OneOrMoreRejectPartsInRobot:BOOL;
|
|
164
|
+
|
|
165
|
+
// RobotHasOneFinishedPart:BOOL;
|
|
166
|
+
// FinishedCnt:INT;//amount of finished parts either in post op or in robot
|
|
167
|
+
// ActiveCnt:INT;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
|
|
168
|
+
// BatchCntFlag:BOOL; //prevent more parts from being picked by raw
|
|
169
|
+
// END_STRUCT
|
|
170
|
+
// END_TYPE
|
|
171
|
+
export interface PartDataStatus {
|
|
172
|
+
parts: PartData[];
|
|
173
|
+
allStationsAreEmpty: boolean;
|
|
174
|
+
rawShelfIsEmpty: boolean;
|
|
175
|
+
doneShelfIsEmpty: boolean;
|
|
176
|
+
doneShelfIsFull: boolean;
|
|
177
|
+
doneShelfSpacesLeftCnt: number;
|
|
178
|
+
rawShelfPartsLeftCnt: number;
|
|
179
|
+
allFixturesAreEmpty: boolean;
|
|
180
|
+
leftFixtureIsEmpty: boolean;
|
|
181
|
+
rightFixtureIsEmpty: boolean;
|
|
182
|
+
|
|
183
|
+
robotIsEmpty: boolean;
|
|
184
|
+
robotHasNoPostOpParts: boolean; //robot isn't holding any parts that are machined or washing/dryed or finished
|
|
185
|
+
robotHasMachinedParts: boolean; //robot is holding at least one machined part
|
|
186
|
+
robotHasOnePreTopDeburring: boolean;
|
|
187
|
+
robotHasOnePreMachining: boolean;
|
|
188
|
+
robotHasTwoPreMachining: boolean;
|
|
189
|
+
robotHasOneRaw: boolean;
|
|
190
|
+
|
|
191
|
+
oneOrMoreRejectPartsInCell: boolean;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
|
|
192
|
+
oneOrMoreRejectPartsInRobot: boolean;
|
|
193
|
+
|
|
194
|
+
robotHasOneFinishedPart: boolean;
|
|
195
|
+
finishedCnt: number;//amount of finished parts either in post op or in robot
|
|
196
|
+
activeCnt: number;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
|
|
197
|
+
batchCntFlag: boolean; //prevent more parts from being picked by raw
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const initialPartDataStatus: PartDataStatus = {
|
|
201
|
+
parts: Array(GCs.PARTDATA_COUNT).fill(null).map(() => ({ ...initialPartData })),
|
|
202
|
+
allStationsAreEmpty: false,
|
|
203
|
+
rawShelfIsEmpty: false,
|
|
204
|
+
doneShelfIsEmpty: false,
|
|
205
|
+
doneShelfIsFull: false,
|
|
206
|
+
doneShelfSpacesLeftCnt: 0,
|
|
207
|
+
rawShelfPartsLeftCnt: 0,
|
|
208
|
+
allFixturesAreEmpty: false,
|
|
209
|
+
leftFixtureIsEmpty: false,
|
|
210
|
+
rightFixtureIsEmpty: false,
|
|
211
|
+
|
|
212
|
+
robotIsEmpty: false,
|
|
213
|
+
robotHasNoPostOpParts: false,
|
|
214
|
+
robotHasMachinedParts: false,
|
|
215
|
+
robotHasOnePreTopDeburring: false,
|
|
216
|
+
robotHasOnePreMachining: false,
|
|
217
|
+
robotHasTwoPreMachining: false,
|
|
218
|
+
robotHasOneRaw: false,
|
|
219
|
+
|
|
220
|
+
oneOrMoreRejectPartsInCell: false,
|
|
221
|
+
oneOrMoreRejectPartsInRobot: false,
|
|
222
|
+
|
|
223
|
+
robotHasOneFinishedPart: false,
|
|
224
|
+
finishedCnt: 0,
|
|
225
|
+
activeCnt: 0,
|
|
226
|
+
batchCntFlag: false,
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export interface PartDataDeprecated {
|
|
230
|
+
cncPreOp: [PartStateDeprecated, PartStateDeprecated];
|
|
231
|
+
cnc: [PartStateDeprecated, PartStateDeprecated];
|
|
232
|
+
cncPostOp: [PartStateDeprecated, PartStateDeprecated];
|
|
233
|
+
doneShelf: PartStateDeprecated[];
|
|
234
|
+
rawShelf: PartStateDeprecated[];
|
|
235
|
+
robot: [PartStateDeprecated, PartStateDeprecated];
|
|
236
|
+
washer: [PartStateDeprecated, PartStateDeprecated];
|
|
237
|
+
hmiEditingAllowed: boolean;
|
|
238
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { RobPositionData } from "./Devices/Robot";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export interface ShelfPartPositionData {
|
|
5
|
-
index: number;
|
|
6
|
-
colNum: number;
|
|
7
|
-
posLetter: number;
|
|
8
|
-
offest: RobPositionData;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface RackShelfData {
|
|
12
|
-
nextPart: ShelfPartPositionData;
|
|
13
|
-
lastPart: ShelfPartPositionData;
|
|
14
|
-
isEmpty: boolean;
|
|
15
|
-
isFull: boolean;
|
|
16
|
-
isEditMode: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface RackData {
|
|
20
|
-
raw: RackShelfData;
|
|
21
|
-
done: RackShelfData;
|
|
22
|
-
}
|
|
1
|
+
import { RobPositionData } from "./Devices/Robot";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export interface ShelfPartPositionData {
|
|
5
|
+
index: number;
|
|
6
|
+
colNum: number;
|
|
7
|
+
posLetter: number;
|
|
8
|
+
offest: RobPositionData;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface RackShelfData {
|
|
12
|
+
nextPart: ShelfPartPositionData;
|
|
13
|
+
lastPart: ShelfPartPositionData;
|
|
14
|
+
isEmpty: boolean;
|
|
15
|
+
isFull: boolean;
|
|
16
|
+
isEditMode: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface RackData {
|
|
20
|
+
raw: RackShelfData;
|
|
21
|
+
done: RackShelfData;
|
|
22
|
+
}
|