@kuriousdesign/machine-sdk 1.0.81 → 1.0.82
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/Machine.d.ts +2 -1
- package/dist/custom-types/Machine.js +1 -0
- package/dist/custom-types/Recipe.d.ts +40 -34
- package/dist/custom-types/Recipe.js +71 -114
- package/dist/plc-tags/index.d.ts +1 -0
- package/dist/plc-tags/index.js +1 -0
- package/package.json +1 -1
- package/src/custom-types/Machine.ts +3 -1
- package/src/custom-types/Recipe.ts +139 -186
- package/src/plc-tags/index.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, RecipeStore, TaskQueue } from ".";
|
|
1
|
+
import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, JobData, RecipeStore, TaskQueue } from ".";
|
|
2
2
|
import { PartDataStatus } from "./Part";
|
|
3
3
|
export interface UserData {
|
|
4
4
|
activeUser: number;
|
|
@@ -45,6 +45,7 @@ export interface Machine {
|
|
|
45
45
|
heartbeatHmi: number;
|
|
46
46
|
machineLog: LogRecordData;
|
|
47
47
|
recipeStore: RecipeStore;
|
|
48
|
+
job: JobData;
|
|
48
49
|
}
|
|
49
50
|
export interface LogRecordData {
|
|
50
51
|
list: DebugLogData[];
|
|
@@ -45,5 +45,6 @@ exports.initialMachine = ({
|
|
|
45
45
|
heartbeatHmi: 0,
|
|
46
46
|
machineLog: { ...exports.initialLogRecordData },
|
|
47
47
|
recipeStore: { ..._1.initialRecipeStore },
|
|
48
|
+
job: { ..._1.initialJobData },
|
|
48
49
|
//deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
|
|
49
50
|
});
|
|
@@ -11,44 +11,49 @@ export interface JobData {
|
|
|
11
11
|
JobEndTime: bigint;
|
|
12
12
|
JobComplete: boolean;
|
|
13
13
|
}
|
|
14
|
+
export declare const initialJobData: JobData;
|
|
14
15
|
export interface ApplicatorSetpoint {
|
|
15
16
|
speed: number;
|
|
16
17
|
squeegeeDiameter: number;
|
|
18
|
+
stepperPosition: number;
|
|
17
19
|
zOffset: number;
|
|
18
20
|
ballValveOn: boolean;
|
|
19
21
|
}
|
|
20
22
|
export declare const initialApplicatorSetpoint: ApplicatorSetpoint;
|
|
21
|
-
export declare const exampleApplicatorSetpoints: ApplicatorSetpoint[];
|
|
22
23
|
export declare const initialApplicatorSetpoints: ApplicatorSetpoint[];
|
|
23
24
|
export interface RecipeData {
|
|
24
25
|
index: number;
|
|
25
26
|
dbId: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
Nickname: string;
|
|
28
|
+
LinerPotPressure: number;
|
|
29
|
+
LinerTypeString: string;
|
|
30
|
+
LinerWeightMin: number;
|
|
31
|
+
LinerWeightMax: number;
|
|
32
|
+
TubeTypeId: number;
|
|
33
|
+
TubeTypeString: string;
|
|
34
|
+
TubeOuterDiameterMax: number;
|
|
35
|
+
TubeHeightMax: number;
|
|
36
|
+
TubeMassKg: number;
|
|
37
|
+
FalseBottomStaysOpen: boolean;
|
|
38
|
+
ApplicatorHasVariableSqueegee: boolean;
|
|
39
|
+
MeasuredSqueegeeDiaAtSetpoint1: number;
|
|
40
|
+
ApplicatorSetpoints: ApplicatorSetpoint[];
|
|
41
|
+
ApplicatorPreloadPauseDuration: number;
|
|
42
|
+
ApplicatorToolId: number;
|
|
43
|
+
ApplicatorToolString: string;
|
|
44
|
+
ApplicatorCollisionPayloadOffset: number;
|
|
45
|
+
CleanerId: number;
|
|
46
|
+
CleanerString: string;
|
|
47
|
+
WeighingFingerId: number;
|
|
48
|
+
WeighingFingerString: string;
|
|
49
|
+
CameraId: number;
|
|
50
|
+
CameraString: string;
|
|
51
|
+
CameraSpeed: number;
|
|
46
52
|
}
|
|
47
53
|
export declare enum CameraIds {
|
|
48
54
|
NONE = 0,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
CAMERA_3 = 3
|
|
55
|
+
STANDARD = 1,//typical camera
|
|
56
|
+
LONG = 2
|
|
52
57
|
}
|
|
53
58
|
export declare const cameraIdToStringMap: Map<CameraIds, string>;
|
|
54
59
|
export declare const cameraStringToIdMap: Map<string, CameraIds>;
|
|
@@ -62,18 +67,20 @@ export declare enum TubeTypes {
|
|
|
62
67
|
TYPE_1755_037 = 6,
|
|
63
68
|
TYPE_1517_038 = 7
|
|
64
69
|
}
|
|
70
|
+
export declare enum ApplicatorTools {
|
|
71
|
+
NONE = 0,
|
|
72
|
+
RED = 1,
|
|
73
|
+
PURPLE = 2,
|
|
74
|
+
ORANGE = 3,
|
|
75
|
+
YELLOW = 4,
|
|
76
|
+
WHITE = 5,
|
|
77
|
+
GREEN = 6,
|
|
78
|
+
BLUE = 7
|
|
79
|
+
}
|
|
65
80
|
export declare const tubeTypeIdToStringMap: Map<number, string>;
|
|
66
81
|
export declare const tubeTypeStringToIdMap: Map<string, number>;
|
|
67
82
|
export declare function getTubeTypeString(tubeType: TubeTypes): string;
|
|
68
83
|
export declare const LinerTypes: string[];
|
|
69
|
-
export declare enum ApplicatorTools {
|
|
70
|
-
NONE = 0,
|
|
71
|
-
RED_37_INCH = 1,
|
|
72
|
-
ORANGE_LARGE = 2,
|
|
73
|
-
YELLOW_MEDIUM = 3,
|
|
74
|
-
GREEN_SMALL = 4,
|
|
75
|
-
BLUE_F16 = 5
|
|
76
|
-
}
|
|
77
84
|
export declare const applicatorToolIdToStringMap: Map<ApplicatorTools, string>;
|
|
78
85
|
export declare const applicatorToolStringToIdMap: Map<string, ApplicatorTools>;
|
|
79
86
|
export declare enum Cleaners {
|
|
@@ -90,9 +97,8 @@ export declare enum WeighingFingers {
|
|
|
90
97
|
RED_MEDIUM = 2,
|
|
91
98
|
ORANGE_LARGE = 3
|
|
92
99
|
}
|
|
93
|
-
export declare const weighingFingerIdToStringMap: Map<WeighingFingers, string>;
|
|
100
|
+
export declare const weighingFingerIdToStringMap: () => Map<WeighingFingers, string>;
|
|
94
101
|
export declare const weighingFingerStringToIdMap: Map<string, WeighingFingers>;
|
|
95
|
-
export declare const exampleRecipe: RecipeData;
|
|
96
102
|
export declare const initialRecipe: RecipeData;
|
|
97
103
|
export interface RecipeStore {
|
|
98
104
|
numRecipes: number;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialRecipeStore = exports.initialRecipe = exports.
|
|
3
|
+
exports.initialRecipeStore = exports.initialRecipe = exports.weighingFingerStringToIdMap = exports.weighingFingerIdToStringMap = exports.WeighingFingers = exports.cleanerStringToIdMap = exports.cleanerIdToStringMap = exports.Cleaners = exports.applicatorToolStringToIdMap = exports.applicatorToolIdToStringMap = exports.LinerTypes = exports.tubeTypeStringToIdMap = exports.tubeTypeIdToStringMap = exports.TubeTypes = exports.cameraStringToIdMap = exports.cameraIdToStringMap = exports.CameraIds = exports.initialApplicatorSetpoints = exports.initialApplicatorSetpoint = exports.initialJobData = void 0;
|
|
4
4
|
exports.getTubeTypeString = getTubeTypeString;
|
|
5
5
|
const GlobalConstants_1 = require("./GlobalConstants");
|
|
6
|
+
exports.initialJobData = {
|
|
7
|
+
ActiveRecipeIndex: 0,
|
|
8
|
+
JobName: "",
|
|
9
|
+
LotQty: 0,
|
|
10
|
+
GoodCnt: 0,
|
|
11
|
+
ScrapCnt: 0,
|
|
12
|
+
SetupStartTime: BigInt(0),
|
|
13
|
+
SetupEndTime: BigInt(0),
|
|
14
|
+
SetupCompleted: false,
|
|
15
|
+
JobStartTime: BigInt(0),
|
|
16
|
+
JobEndTime: BigInt(0),
|
|
17
|
+
JobComplete: false
|
|
18
|
+
};
|
|
6
19
|
exports.initialApplicatorSetpoint = {
|
|
7
20
|
speed: 0,
|
|
8
|
-
squeegeeDiameter: 0
|
|
9
|
-
|
|
10
|
-
|
|
21
|
+
squeegeeDiameter: 0,
|
|
22
|
+
stepperPosition: 0,
|
|
23
|
+
zOffset: 0,
|
|
24
|
+
ballValveOn: false
|
|
11
25
|
};
|
|
12
|
-
exports.
|
|
13
|
-
{ speed: 100, squeegeeDiameter: 30.0, zOffset: -10.0, ballValveOn: true },
|
|
14
|
-
{ speed: 100, squeegeeDiameter: 30.0, zOffset: 100.0, ballValveOn: true },
|
|
15
|
-
{ speed: 150, squeegeeDiameter: 28.5, zOffset: 200.0, ballValveOn: true },
|
|
16
|
-
{ speed: 200, squeegeeDiameter: 27.0, zOffset: 300.0, ballValveOn: false },
|
|
17
|
-
];
|
|
18
|
-
exports.initialApplicatorSetpoints = Array(GlobalConstants_1.GCs.MAX_APPLICATOR_SETPOINTS).fill({
|
|
19
|
-
speed: 0,
|
|
20
|
-
squeegeeDiameter: 0.0,
|
|
21
|
-
zOffset: 0.0,
|
|
22
|
-
ballValveOn: false,
|
|
23
|
-
});
|
|
26
|
+
exports.initialApplicatorSetpoints = Array.from({ length: GlobalConstants_1.GCs.MAX_APPLICATOR_SETPOINTS }, () => exports.initialApplicatorSetpoint);
|
|
24
27
|
var CameraIds;
|
|
25
28
|
(function (CameraIds) {
|
|
26
29
|
CameraIds[CameraIds["NONE"] = 0] = "NONE";
|
|
27
|
-
CameraIds[CameraIds["
|
|
28
|
-
CameraIds[CameraIds["
|
|
29
|
-
CameraIds[CameraIds["CAMERA_3"] = 3] = "CAMERA_3";
|
|
30
|
+
CameraIds[CameraIds["STANDARD"] = 1] = "STANDARD";
|
|
31
|
+
CameraIds[CameraIds["LONG"] = 2] = "LONG";
|
|
30
32
|
})(CameraIds || (exports.CameraIds = CameraIds = {}));
|
|
31
33
|
exports.cameraIdToStringMap = new Map([
|
|
32
34
|
[CameraIds.NONE, "None"],
|
|
33
|
-
[CameraIds.
|
|
34
|
-
[CameraIds.
|
|
35
|
-
[CameraIds.CAMERA_3, "Camera 3"],
|
|
35
|
+
[CameraIds.STANDARD, "Standard"],
|
|
36
|
+
[CameraIds.LONG, "Long"]
|
|
36
37
|
]);
|
|
37
|
-
exports.cameraStringToIdMap = new Map(Array.from(exports.cameraIdToStringMap.entries()).map(([
|
|
38
|
+
exports.cameraStringToIdMap = new Map(Array.from(exports.cameraIdToStringMap.entries()).map(([key, value]) => [value, key]));
|
|
38
39
|
var TubeTypes;
|
|
39
40
|
(function (TubeTypes) {
|
|
40
41
|
TubeTypes[TubeTypes["NONE"] = 0] = "NONE";
|
|
@@ -54,52 +55,28 @@ exports.tubeTypeIdToStringMap = new Map([
|
|
|
54
55
|
[TubeTypes.TYPE_1340_38, "1340-38"],
|
|
55
56
|
[TubeTypes.TYPE_3811302, "3811302"],
|
|
56
57
|
[TubeTypes.TYPE_1755_037, "1755-037"],
|
|
57
|
-
[TubeTypes.TYPE_1517_038, "1517-038"]
|
|
58
|
+
[TubeTypes.TYPE_1517_038, "1517-038"]
|
|
58
59
|
]);
|
|
59
|
-
exports.tubeTypeStringToIdMap = new Map(Array.from(exports.tubeTypeIdToStringMap.entries()).map(([
|
|
60
|
+
exports.tubeTypeStringToIdMap = new Map(Array.from(exports.tubeTypeIdToStringMap.entries()).map(([key, value]) => [value, key]));
|
|
60
61
|
function getTubeTypeString(tubeType) {
|
|
61
|
-
|
|
62
|
-
case TubeTypes.TYPE_11726650:
|
|
63
|
-
return "11726650";
|
|
64
|
-
case TubeTypes.TYPE_1809_370:
|
|
65
|
-
return "1809-370";
|
|
66
|
-
case TubeTypes.TYPE_1809_126:
|
|
67
|
-
return "1809-126";
|
|
68
|
-
case TubeTypes.TYPE_1340_38:
|
|
69
|
-
return "1340-38";
|
|
70
|
-
case TubeTypes.TYPE_3811302:
|
|
71
|
-
return "3811302";
|
|
72
|
-
case TubeTypes.TYPE_1755_037:
|
|
73
|
-
return "1755-037";
|
|
74
|
-
case TubeTypes.TYPE_1517_038:
|
|
75
|
-
return "1517-038";
|
|
76
|
-
default:
|
|
77
|
-
return "None";
|
|
78
|
-
}
|
|
62
|
+
return exports.tubeTypeIdToStringMap.get(tubeType) || "Unknown";
|
|
79
63
|
}
|
|
80
64
|
exports.LinerTypes = [
|
|
81
65
|
"CKU",
|
|
82
|
-
"
|
|
83
|
-
"1755",
|
|
66
|
+
"TRIBRID",
|
|
67
|
+
"1755 LINER",
|
|
84
68
|
];
|
|
85
|
-
var ApplicatorTools;
|
|
86
|
-
(function (ApplicatorTools) {
|
|
87
|
-
ApplicatorTools[ApplicatorTools["NONE"] = 0] = "NONE";
|
|
88
|
-
ApplicatorTools[ApplicatorTools["RED_37_INCH"] = 1] = "RED_37_INCH";
|
|
89
|
-
ApplicatorTools[ApplicatorTools["ORANGE_LARGE"] = 2] = "ORANGE_LARGE";
|
|
90
|
-
ApplicatorTools[ApplicatorTools["YELLOW_MEDIUM"] = 3] = "YELLOW_MEDIUM";
|
|
91
|
-
ApplicatorTools[ApplicatorTools["GREEN_SMALL"] = 4] = "GREEN_SMALL";
|
|
92
|
-
ApplicatorTools[ApplicatorTools["BLUE_F16"] = 5] = "BLUE_F16";
|
|
93
|
-
})(ApplicatorTools || (exports.ApplicatorTools = ApplicatorTools = {}));
|
|
94
69
|
exports.applicatorToolIdToStringMap = new Map([
|
|
95
70
|
[ApplicatorTools.NONE, "None"],
|
|
96
|
-
[ApplicatorTools.
|
|
97
|
-
[ApplicatorTools.
|
|
98
|
-
[ApplicatorTools.
|
|
99
|
-
[ApplicatorTools.
|
|
100
|
-
[ApplicatorTools.
|
|
71
|
+
[ApplicatorTools.RED, "Red"],
|
|
72
|
+
[ApplicatorTools.PURPLE, "Purple"],
|
|
73
|
+
[ApplicatorTools.ORANGE, "Orange"],
|
|
74
|
+
[ApplicatorTools.YELLOW, "Yellow"],
|
|
75
|
+
[ApplicatorTools.WHITE, "White"],
|
|
76
|
+
[ApplicatorTools.GREEN, "Green"],
|
|
77
|
+
[ApplicatorTools.BLUE, "Blue"],
|
|
101
78
|
]);
|
|
102
|
-
exports.applicatorToolStringToIdMap = new Map(Array.from(exports.applicatorToolIdToStringMap.entries()).map(([
|
|
79
|
+
exports.applicatorToolStringToIdMap = new Map(Array.from(exports.applicatorToolIdToStringMap.entries()).map(([key, value]) => [value, key]));
|
|
103
80
|
var Cleaners;
|
|
104
81
|
(function (Cleaners) {
|
|
105
82
|
Cleaners[Cleaners["NONE"] = 0] = "NONE";
|
|
@@ -111,9 +88,9 @@ exports.cleanerIdToStringMap = new Map([
|
|
|
111
88
|
[Cleaners.NONE, "None"],
|
|
112
89
|
[Cleaners.SMALL, "Small"],
|
|
113
90
|
[Cleaners.MEDIUM, "Medium"],
|
|
114
|
-
[Cleaners.LARGE, "Large"]
|
|
91
|
+
[Cleaners.LARGE, "Large"]
|
|
115
92
|
]);
|
|
116
|
-
exports.cleanerStringToIdMap = new Map(Array.from(exports.cleanerIdToStringMap.entries()).map(([
|
|
93
|
+
exports.cleanerStringToIdMap = new Map(Array.from(exports.cleanerIdToStringMap.entries()).map(([key, value]) => [value, key]));
|
|
117
94
|
var WeighingFingers;
|
|
118
95
|
(function (WeighingFingers) {
|
|
119
96
|
WeighingFingers[WeighingFingers["NONE"] = 0] = "NONE";
|
|
@@ -121,64 +98,44 @@ var WeighingFingers;
|
|
|
121
98
|
WeighingFingers[WeighingFingers["RED_MEDIUM"] = 2] = "RED_MEDIUM";
|
|
122
99
|
WeighingFingers[WeighingFingers["ORANGE_LARGE"] = 3] = "ORANGE_LARGE";
|
|
123
100
|
})(WeighingFingers || (exports.WeighingFingers = WeighingFingers = {}));
|
|
124
|
-
|
|
101
|
+
const weighingFingerIdToStringMap = () => new Map([
|
|
125
102
|
[WeighingFingers.NONE, "None"],
|
|
126
|
-
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
127
|
-
[WeighingFingers.ORANGE_LARGE, "Orange Large"],
|
|
128
103
|
[WeighingFingers.BLUE_SMALL, "Blue Small"],
|
|
104
|
+
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
105
|
+
[WeighingFingers.ORANGE_LARGE, "Orange Large"]
|
|
129
106
|
]);
|
|
130
|
-
exports.
|
|
131
|
-
exports.
|
|
132
|
-
index: 1,
|
|
133
|
-
nickname: "Example Recipe",
|
|
134
|
-
linerTypeString: "CKU",
|
|
135
|
-
linerPotPressure: 50,
|
|
136
|
-
dbId: "",
|
|
137
|
-
tubeTypeId: TubeTypes.TYPE_1340_38,
|
|
138
|
-
tubeTypeString: "1340-38",
|
|
139
|
-
tubeOuterDiameterMax: 38.1,
|
|
140
|
-
tubeHeightMax: 100, // example value in mm
|
|
141
|
-
tubeMassKg: 0.5,
|
|
142
|
-
applicatorCollisionPayloadOffset: 1.0,
|
|
143
|
-
falseBottomStaysOpen: false,
|
|
144
|
-
applicatorSetpoints: exports.exampleApplicatorSetpoints,
|
|
145
|
-
applicatorToolId: ApplicatorTools.RED_37_INCH,
|
|
146
|
-
applicatorToolString: "Red 3/7 Inch",
|
|
147
|
-
cleanerId: Cleaners.MEDIUM,
|
|
148
|
-
cleanerString: "Medium",
|
|
149
|
-
weighingFingerId: WeighingFingers.RED_MEDIUM,
|
|
150
|
-
weighingFingerString: "Red Medium",
|
|
151
|
-
//numCameras: 2,
|
|
152
|
-
cameraId: CameraIds.CAMERA_1,
|
|
153
|
-
cameraString: "Camera 1",
|
|
154
|
-
cameraSpeed: 50,
|
|
155
|
-
};
|
|
107
|
+
exports.weighingFingerIdToStringMap = weighingFingerIdToStringMap;
|
|
108
|
+
exports.weighingFingerStringToIdMap = new Map(Array.from((0, exports.weighingFingerIdToStringMap)().entries()).map(([key, value]) => [value, key]));
|
|
156
109
|
exports.initialRecipe = {
|
|
157
110
|
index: 0,
|
|
158
111
|
dbId: "",
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
112
|
+
Nickname: "",
|
|
113
|
+
LinerPotPressure: 0,
|
|
114
|
+
LinerTypeString: "",
|
|
115
|
+
LinerWeightMin: 0,
|
|
116
|
+
LinerWeightMax: 0,
|
|
117
|
+
TubeTypeId: TubeTypes.NONE,
|
|
118
|
+
TubeTypeString: exports.tubeTypeIdToStringMap.get(TubeTypes.NONE) || "",
|
|
119
|
+
TubeOuterDiameterMax: 0,
|
|
120
|
+
TubeHeightMax: 0,
|
|
121
|
+
TubeMassKg: 0,
|
|
122
|
+
FalseBottomStaysOpen: false,
|
|
123
|
+
ApplicatorHasVariableSqueegee: false,
|
|
124
|
+
MeasuredSqueegeeDiaAtSetpoint1: 0,
|
|
125
|
+
ApplicatorSetpoints: exports.initialApplicatorSetpoints,
|
|
126
|
+
ApplicatorPreloadPauseDuration: 0,
|
|
127
|
+
ApplicatorToolId: ApplicatorTools.NONE,
|
|
128
|
+
ApplicatorToolString: exports.applicatorToolIdToStringMap.get(ApplicatorTools.NONE) || "",
|
|
129
|
+
ApplicatorCollisionPayloadOffset: 0,
|
|
130
|
+
CleanerId: Cleaners.NONE,
|
|
131
|
+
CleanerString: exports.cleanerIdToStringMap.get(Cleaners.NONE) || "",
|
|
132
|
+
WeighingFingerId: WeighingFingers.NONE,
|
|
133
|
+
WeighingFingerString: (0, exports.weighingFingerIdToStringMap)().get(WeighingFingers.NONE) || "",
|
|
134
|
+
CameraId: CameraIds.NONE,
|
|
135
|
+
CameraString: exports.cameraIdToStringMap.get(CameraIds.NONE) || "",
|
|
136
|
+
CameraSpeed: 0
|
|
180
137
|
};
|
|
181
138
|
exports.initialRecipeStore = {
|
|
182
|
-
numRecipes:
|
|
183
|
-
recipes: Array(GlobalConstants_1.GCs.MAX_NUM_RECIPES).fill(exports.
|
|
139
|
+
numRecipes: GlobalConstants_1.GCs.MAX_NUM_RECIPES,
|
|
140
|
+
recipes: Array(GlobalConstants_1.GCs.MAX_NUM_RECIPES).fill(exports.initialRecipe)
|
|
184
141
|
};
|
package/dist/plc-tags/index.d.ts
CHANGED
package/dist/plc-tags/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, initialDebugLogData, initialFaultData, initialRecipeStore, initialTaskQueue, RecipeStore, TaskQueue } from ".";
|
|
1
|
+
import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, initialDebugLogData, initialFaultData, initialJobData, initialRecipeStore, initialTaskQueue, JobData, RecipeStore, TaskQueue } from ".";
|
|
2
2
|
import { initialPartDataStatus, PartDataStatus } from "./Part";
|
|
3
3
|
import { GCs } from "./GlobalConstants";
|
|
4
4
|
|
|
@@ -88,6 +88,7 @@ export interface Machine {
|
|
|
88
88
|
heartbeatHmi: number;
|
|
89
89
|
machineLog: LogRecordData;
|
|
90
90
|
recipeStore: RecipeStore;
|
|
91
|
+
job: JobData;
|
|
91
92
|
//deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
|
|
92
93
|
}
|
|
93
94
|
|
|
@@ -128,5 +129,6 @@ export const initialMachine: Machine = ({
|
|
|
128
129
|
heartbeatHmi: 0,
|
|
129
130
|
machineLog: { ...initialLogRecordData },
|
|
130
131
|
recipeStore: { ...initialRecipeStore },
|
|
132
|
+
job: { ...initialJobData },
|
|
131
133
|
//deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
|
|
132
134
|
});
|
|
@@ -1,100 +1,96 @@
|
|
|
1
1
|
import { GCs } from "./GlobalConstants";
|
|
2
2
|
|
|
3
3
|
export interface JobData {
|
|
4
|
-
ActiveRecipeIndex: number;
|
|
5
|
-
JobName: string;
|
|
6
|
-
LotQty: number;
|
|
7
|
-
GoodCnt: number;
|
|
8
|
-
ScrapCnt: number;
|
|
9
|
-
SetupStartTime: bigint;
|
|
10
|
-
SetupEndTime: bigint;
|
|
11
|
-
SetupCompleted: boolean;
|
|
12
|
-
JobStartTime: bigint;
|
|
13
|
-
JobEndTime: bigint;
|
|
4
|
+
ActiveRecipeIndex: number;
|
|
5
|
+
JobName: string;
|
|
6
|
+
LotQty: number;
|
|
7
|
+
GoodCnt: number;
|
|
8
|
+
ScrapCnt: number;
|
|
9
|
+
SetupStartTime: bigint;
|
|
10
|
+
SetupEndTime: bigint;
|
|
11
|
+
SetupCompleted: boolean;
|
|
12
|
+
JobStartTime: bigint;
|
|
13
|
+
JobEndTime: bigint;
|
|
14
14
|
JobComplete: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
export const initialJobData: JobData = {
|
|
18
|
+
ActiveRecipeIndex: 0,
|
|
19
|
+
JobName: "",
|
|
20
|
+
LotQty: 0,
|
|
21
|
+
GoodCnt: 0,
|
|
22
|
+
ScrapCnt: 0,
|
|
23
|
+
SetupStartTime: BigInt(0),
|
|
24
|
+
SetupEndTime: BigInt(0),
|
|
25
|
+
SetupCompleted: false,
|
|
26
|
+
JobStartTime: BigInt(0),
|
|
27
|
+
JobEndTime: BigInt(0),
|
|
28
|
+
JobComplete: false
|
|
29
|
+
};
|
|
30
|
+
|
|
17
31
|
export interface ApplicatorSetpoint {
|
|
18
|
-
speed: number;
|
|
19
|
-
squeegeeDiameter: number;
|
|
20
|
-
|
|
21
|
-
|
|
32
|
+
speed: number;
|
|
33
|
+
squeegeeDiameter: number;
|
|
34
|
+
stepperPosition: number;
|
|
35
|
+
zOffset: number;
|
|
36
|
+
ballValveOn: boolean;
|
|
22
37
|
}
|
|
23
38
|
|
|
24
39
|
export const initialApplicatorSetpoint: ApplicatorSetpoint = {
|
|
25
40
|
speed: 0,
|
|
26
|
-
squeegeeDiameter: 0
|
|
27
|
-
|
|
28
|
-
|
|
41
|
+
squeegeeDiameter: 0,
|
|
42
|
+
stepperPosition: 0,
|
|
43
|
+
zOffset: 0,
|
|
44
|
+
ballValveOn: false
|
|
29
45
|
};
|
|
30
46
|
|
|
31
|
-
export const exampleApplicatorSetpoints: ApplicatorSetpoint[] = [
|
|
32
|
-
{ speed: 100, squeegeeDiameter: 30.0, zOffset: -10.0, ballValveOn: true },
|
|
33
|
-
{ speed: 100, squeegeeDiameter: 30.0, zOffset: 100.0, ballValveOn: true },
|
|
34
|
-
{ speed: 150, squeegeeDiameter: 28.5, zOffset: 200.0, ballValveOn: true },
|
|
35
|
-
{ speed: 200, squeegeeDiameter: 27.0, zOffset: 300.0, ballValveOn: false },
|
|
36
|
-
];
|
|
37
47
|
|
|
38
|
-
export const initialApplicatorSetpoints: ApplicatorSetpoint[] = Array(GCs.MAX_APPLICATOR_SETPOINTS)
|
|
39
|
-
speed: 0,
|
|
40
|
-
squeegeeDiameter: 0.0,
|
|
41
|
-
zOffset: 0.0,
|
|
42
|
-
ballValveOn: false,
|
|
43
|
-
});
|
|
48
|
+
export const initialApplicatorSetpoints: ApplicatorSetpoint[] = Array.from({ length: GCs.MAX_APPLICATOR_SETPOINTS }, () => initialApplicatorSetpoint);
|
|
44
49
|
|
|
45
50
|
export interface RecipeData {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
weighingFingerId: number; // Note: Ensure this matches your WeighingFingers enum
|
|
74
|
-
weighingFingerString: string;
|
|
75
|
-
|
|
76
|
-
// CAMERA DATA (New fields from ST)
|
|
77
|
-
cameraId: number;
|
|
78
|
-
cameraString: string;
|
|
79
|
-
cameraSpeed: number;
|
|
51
|
+
index: number;
|
|
52
|
+
dbId: string;
|
|
53
|
+
Nickname: string;
|
|
54
|
+
LinerPotPressure: number;
|
|
55
|
+
LinerTypeString: string;
|
|
56
|
+
LinerWeightMin: number;
|
|
57
|
+
LinerWeightMax: number;
|
|
58
|
+
TubeTypeId: number;
|
|
59
|
+
TubeTypeString: string;
|
|
60
|
+
TubeOuterDiameterMax: number;
|
|
61
|
+
TubeHeightMax: number;
|
|
62
|
+
TubeMassKg: number;
|
|
63
|
+
FalseBottomStaysOpen: boolean;
|
|
64
|
+
ApplicatorHasVariableSqueegee: boolean;
|
|
65
|
+
MeasuredSqueegeeDiaAtSetpoint1: number;
|
|
66
|
+
ApplicatorSetpoints: ApplicatorSetpoint[];
|
|
67
|
+
ApplicatorPreloadPauseDuration: number;
|
|
68
|
+
ApplicatorToolId: number;
|
|
69
|
+
ApplicatorToolString: string;
|
|
70
|
+
ApplicatorCollisionPayloadOffset: number;
|
|
71
|
+
CleanerId: number;
|
|
72
|
+
CleanerString: string;
|
|
73
|
+
WeighingFingerId: number;
|
|
74
|
+
WeighingFingerString: string;
|
|
75
|
+
CameraId: number;
|
|
76
|
+
CameraString: string;
|
|
77
|
+
CameraSpeed: number;
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
|
|
83
80
|
export enum CameraIds {
|
|
84
81
|
NONE = 0,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
CAMERA_3 = 3,
|
|
82
|
+
STANDARD = 1, //typical camera
|
|
83
|
+
LONG = 2, //only used for really long tubes
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
export const cameraIdToStringMap = new Map<CameraIds, string>([
|
|
86
|
+
export const cameraIdToStringMap: Map<CameraIds, string> = new Map<CameraIds, string>([
|
|
91
87
|
[CameraIds.NONE, "None"],
|
|
92
|
-
[CameraIds.
|
|
93
|
-
[CameraIds.
|
|
94
|
-
[CameraIds.CAMERA_3, "Camera 3"],
|
|
88
|
+
[CameraIds.STANDARD, "Standard"],
|
|
89
|
+
[CameraIds.LONG, "Long"]
|
|
95
90
|
]);
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
export const cameraStringToIdMap: Map<string, CameraIds> = new Map<string, CameraIds>(
|
|
92
|
+
Array.from(cameraIdToStringMap.entries()).map(([key, value]) => [value, key])
|
|
93
|
+
);
|
|
98
94
|
|
|
99
95
|
export enum TubeTypes {
|
|
100
96
|
NONE = 0,
|
|
@@ -107,7 +103,18 @@ export enum TubeTypes {
|
|
|
107
103
|
TYPE_1517_038 = 7
|
|
108
104
|
}
|
|
109
105
|
|
|
110
|
-
export
|
|
106
|
+
export declare enum ApplicatorTools {
|
|
107
|
+
NONE = 0,
|
|
108
|
+
RED = 1,
|
|
109
|
+
PURPLE = 2,
|
|
110
|
+
ORANGE = 3,
|
|
111
|
+
YELLOW = 4,
|
|
112
|
+
WHITE = 5,
|
|
113
|
+
GREEN = 6,
|
|
114
|
+
BLUE = 7,
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const tubeTypeIdToStringMap: Map<number, string> = new Map<number, string>([
|
|
111
118
|
[TubeTypes.NONE, "None"],
|
|
112
119
|
[TubeTypes.TYPE_11726650, "11726650"],
|
|
113
120
|
[TubeTypes.TYPE_1809_370, "1809-370"],
|
|
@@ -115,155 +122,101 @@ export const tubeTypeIdToStringMap = new Map<number, string>([
|
|
|
115
122
|
[TubeTypes.TYPE_1340_38, "1340-38"],
|
|
116
123
|
[TubeTypes.TYPE_3811302, "3811302"],
|
|
117
124
|
[TubeTypes.TYPE_1755_037, "1755-037"],
|
|
118
|
-
[TubeTypes.TYPE_1517_038, "1517-038"]
|
|
125
|
+
[TubeTypes.TYPE_1517_038, "1517-038"]
|
|
119
126
|
]);
|
|
120
127
|
|
|
121
|
-
export const tubeTypeStringToIdMap = new Map<string, number>(
|
|
122
|
-
|
|
128
|
+
export const tubeTypeStringToIdMap: Map<string, number> = new Map<string, number>(
|
|
129
|
+
Array.from(tubeTypeIdToStringMap.entries()).map(([key, value]) => [value, key])
|
|
130
|
+
);
|
|
123
131
|
export function getTubeTypeString(tubeType: TubeTypes): string {
|
|
124
|
-
|
|
125
|
-
case TubeTypes.TYPE_11726650:
|
|
126
|
-
return "11726650";
|
|
127
|
-
case TubeTypes.TYPE_1809_370:
|
|
128
|
-
return "1809-370";
|
|
129
|
-
case TubeTypes.TYPE_1809_126:
|
|
130
|
-
return "1809-126";
|
|
131
|
-
case TubeTypes.TYPE_1340_38:
|
|
132
|
-
return "1340-38";
|
|
133
|
-
case TubeTypes.TYPE_3811302:
|
|
134
|
-
return "3811302";
|
|
135
|
-
case TubeTypes.TYPE_1755_037:
|
|
136
|
-
return "1755-037";
|
|
137
|
-
case TubeTypes.TYPE_1517_038:
|
|
138
|
-
return "1517-038";
|
|
139
|
-
default:
|
|
140
|
-
return "None";
|
|
141
|
-
}
|
|
132
|
+
return tubeTypeIdToStringMap.get(tubeType) || "Unknown";
|
|
142
133
|
}
|
|
143
|
-
|
|
144
134
|
export const LinerTypes: string[] = [
|
|
145
135
|
"CKU",
|
|
146
|
-
"
|
|
147
|
-
"1755",
|
|
148
|
-
]
|
|
149
|
-
|
|
150
|
-
export enum ApplicatorTools {
|
|
151
|
-
NONE = 0,
|
|
152
|
-
RED_37_INCH = 1,
|
|
153
|
-
ORANGE_LARGE = 2,
|
|
154
|
-
YELLOW_MEDIUM = 3,
|
|
155
|
-
GREEN_SMALL = 4,
|
|
156
|
-
BLUE_F16 = 5
|
|
157
|
-
}
|
|
158
|
-
|
|
136
|
+
"TRIBRID",
|
|
137
|
+
"1755 LINER",
|
|
138
|
+
]
|
|
159
139
|
|
|
160
|
-
|
|
161
|
-
export const applicatorToolIdToStringMap = new Map<ApplicatorTools, string>([
|
|
140
|
+
export const applicatorToolIdToStringMap: Map<ApplicatorTools, string> = new Map<ApplicatorTools, string>([
|
|
162
141
|
[ApplicatorTools.NONE, "None"],
|
|
163
|
-
[ApplicatorTools.
|
|
164
|
-
[ApplicatorTools.
|
|
165
|
-
[ApplicatorTools.
|
|
166
|
-
[ApplicatorTools.
|
|
167
|
-
[ApplicatorTools.
|
|
142
|
+
[ApplicatorTools.RED, "Red"],
|
|
143
|
+
[ApplicatorTools.PURPLE, "Purple"],
|
|
144
|
+
[ApplicatorTools.ORANGE, "Orange"],
|
|
145
|
+
[ApplicatorTools.YELLOW, "Yellow"],
|
|
146
|
+
[ApplicatorTools.WHITE, "White"],
|
|
147
|
+
[ApplicatorTools.GREEN, "Green"],
|
|
148
|
+
[ApplicatorTools.BLUE, "Blue"],
|
|
168
149
|
]);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
150
|
+
export const applicatorToolStringToIdMap: Map<string, ApplicatorTools> = new Map<string, ApplicatorTools>(
|
|
151
|
+
Array.from(applicatorToolIdToStringMap.entries()).map(([key, value]) => [value, key])
|
|
152
|
+
);
|
|
172
153
|
export enum Cleaners {
|
|
173
154
|
NONE = 0,
|
|
174
155
|
SMALL = 1,
|
|
175
156
|
MEDIUM = 2,
|
|
176
157
|
LARGE = 3
|
|
177
158
|
}
|
|
178
|
-
|
|
179
|
-
export const cleanerIdToStringMap = new Map<Cleaners, string>([
|
|
159
|
+
export const cleanerIdToStringMap: Map<Cleaners, string> = new Map<Cleaners, string>([
|
|
180
160
|
[Cleaners.NONE, "None"],
|
|
181
161
|
[Cleaners.SMALL, "Small"],
|
|
182
162
|
[Cleaners.MEDIUM, "Medium"],
|
|
183
|
-
[Cleaners.LARGE, "Large"]
|
|
163
|
+
[Cleaners.LARGE, "Large"]
|
|
184
164
|
]);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
165
|
+
export const cleanerStringToIdMap: Map<string, Cleaners> = new Map<string, Cleaners>(
|
|
166
|
+
Array.from(cleanerIdToStringMap.entries()).map(([key, value]) => [value, key])
|
|
167
|
+
);
|
|
188
168
|
export enum WeighingFingers {
|
|
189
169
|
NONE = 0,
|
|
190
170
|
BLUE_SMALL = 1,
|
|
191
171
|
RED_MEDIUM = 2,
|
|
192
|
-
ORANGE_LARGE = 3
|
|
172
|
+
ORANGE_LARGE = 3
|
|
193
173
|
}
|
|
194
|
-
|
|
195
|
-
export const weighingFingerIdToStringMap = new Map<WeighingFingers, string>([
|
|
174
|
+
export const weighingFingerIdToStringMap = (): Map<WeighingFingers, string> => new Map<WeighingFingers, string>([
|
|
196
175
|
[WeighingFingers.NONE, "None"],
|
|
197
|
-
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
198
|
-
[WeighingFingers.ORANGE_LARGE, "Orange Large"],
|
|
199
176
|
[WeighingFingers.BLUE_SMALL, "Blue Small"],
|
|
177
|
+
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
178
|
+
[WeighingFingers.ORANGE_LARGE, "Orange Large"]
|
|
200
179
|
]);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
Array.from(weighingFingerIdToStringMap.entries()).map(([id, str]) => [str, id])
|
|
180
|
+
export const weighingFingerStringToIdMap: Map<string, WeighingFingers> = new Map<string, WeighingFingers>(
|
|
181
|
+
Array.from(weighingFingerIdToStringMap().entries()).map(([key, value]) => [value, key])
|
|
204
182
|
);
|
|
205
183
|
|
|
206
|
-
|
|
207
|
-
export const exampleRecipe: RecipeData = {
|
|
208
|
-
index: 1,
|
|
209
|
-
nickname: "Example Recipe",
|
|
210
|
-
linerTypeString: "CKU",
|
|
211
|
-
linerPotPressure: 50,
|
|
212
|
-
dbId: "",
|
|
213
|
-
tubeTypeId: TubeTypes.TYPE_1340_38,
|
|
214
|
-
tubeTypeString: "1340-38",
|
|
215
|
-
tubeOuterDiameterMax: 38.1,
|
|
216
|
-
tubeHeightMax: 100, // example value in mm
|
|
217
|
-
tubeMassKg: 0.5,
|
|
218
|
-
applicatorCollisionPayloadOffset: 1.0,
|
|
219
|
-
falseBottomStaysOpen: false,
|
|
220
|
-
|
|
221
|
-
applicatorSetpoints: exampleApplicatorSetpoints,
|
|
222
|
-
applicatorToolId: ApplicatorTools.RED_37_INCH,
|
|
223
|
-
applicatorToolString: "Red 3/7 Inch",
|
|
224
|
-
cleanerId: Cleaners.MEDIUM,
|
|
225
|
-
cleanerString: "Medium",
|
|
226
|
-
weighingFingerId: WeighingFingers.RED_MEDIUM,
|
|
227
|
-
weighingFingerString: "Red Medium",
|
|
228
|
-
//numCameras: 2,
|
|
229
|
-
cameraId: CameraIds.CAMERA_1,
|
|
230
|
-
cameraString: "Camera 1",
|
|
231
|
-
cameraSpeed: 50,
|
|
232
|
-
|
|
233
|
-
};
|
|
234
|
-
|
|
235
184
|
export const initialRecipe: RecipeData = {
|
|
236
185
|
index: 0,
|
|
237
186
|
dbId: "",
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
187
|
+
Nickname: "",
|
|
188
|
+
LinerPotPressure: 0,
|
|
189
|
+
LinerTypeString: "",
|
|
190
|
+
LinerWeightMin: 0,
|
|
191
|
+
LinerWeightMax: 0,
|
|
192
|
+
TubeTypeId: TubeTypes.NONE,
|
|
193
|
+
TubeTypeString: tubeTypeIdToStringMap.get(TubeTypes.NONE) || "",
|
|
194
|
+
TubeOuterDiameterMax: 0,
|
|
195
|
+
TubeHeightMax: 0,
|
|
196
|
+
TubeMassKg: 0,
|
|
197
|
+
FalseBottomStaysOpen: false,
|
|
198
|
+
ApplicatorHasVariableSqueegee: false,
|
|
199
|
+
MeasuredSqueegeeDiaAtSetpoint1: 0,
|
|
200
|
+
ApplicatorSetpoints: initialApplicatorSetpoints,
|
|
201
|
+
ApplicatorPreloadPauseDuration: 0,
|
|
202
|
+
ApplicatorToolId: ApplicatorTools.NONE,
|
|
203
|
+
ApplicatorToolString: applicatorToolIdToStringMap.get(ApplicatorTools.NONE) || "",
|
|
204
|
+
ApplicatorCollisionPayloadOffset: 0,
|
|
205
|
+
CleanerId: Cleaners.NONE,
|
|
206
|
+
CleanerString: cleanerIdToStringMap.get(Cleaners.NONE) || "",
|
|
207
|
+
WeighingFingerId: WeighingFingers.NONE,
|
|
208
|
+
WeighingFingerString: weighingFingerIdToStringMap().get(WeighingFingers.NONE) || "",
|
|
209
|
+
CameraId: CameraIds.NONE,
|
|
210
|
+
CameraString: cameraIdToStringMap.get(CameraIds.NONE) || "",
|
|
211
|
+
CameraSpeed: 0
|
|
259
212
|
};
|
|
260
213
|
|
|
214
|
+
|
|
261
215
|
export interface RecipeStore {
|
|
262
216
|
numRecipes: number;
|
|
263
217
|
recipes: RecipeData[];
|
|
264
218
|
}
|
|
265
|
-
|
|
266
219
|
export const initialRecipeStore: RecipeStore = {
|
|
267
|
-
numRecipes:
|
|
268
|
-
recipes: Array(GCs.MAX_NUM_RECIPES).fill(
|
|
220
|
+
numRecipes: GCs.MAX_NUM_RECIPES,
|
|
221
|
+
recipes: Array(GCs.MAX_NUM_RECIPES).fill(initialRecipe)
|
|
269
222
|
};
|
package/src/plc-tags/index.ts
CHANGED