@kuriousdesign/machine-sdk 1.0.62 → 1.0.64
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/GlobalConstants.d.ts +3 -0
- package/dist/custom-types/GlobalConstants.js +3 -0
- package/dist/custom-types/Recipe.d.ts +40 -16
- package/dist/custom-types/Recipe.js +92 -41
- package/package.json +1 -1
- package/src/custom-types/GlobalConstants.ts +3 -0
- package/src/custom-types/Recipe.ts +134 -48
|
@@ -11,20 +11,33 @@ export interface JobData {
|
|
|
11
11
|
JobEndTime: bigint;
|
|
12
12
|
JobComplete: boolean;
|
|
13
13
|
}
|
|
14
|
+
export interface ApplicatorSetpoint {
|
|
15
|
+
speed: number;
|
|
16
|
+
squeegeeDiameter: number;
|
|
17
|
+
zOffset: number;
|
|
18
|
+
ballValveOn: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare const exampleApplicatorSetpoints: ApplicatorSetpoint[];
|
|
21
|
+
export declare const initialApplicatorSetpoints: ApplicatorSetpoint[];
|
|
14
22
|
export interface RecipeData {
|
|
15
|
-
|
|
23
|
+
index: number;
|
|
24
|
+
nickname: string;
|
|
25
|
+
tubeTypeId: number;
|
|
26
|
+
tubeTypeString: string;
|
|
16
27
|
tubeOuterDiameterMax: number;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
falseBottomStaysOpen: boolean;
|
|
29
|
+
linerPotPressure: number;
|
|
30
|
+
linerTypeString: string;
|
|
31
|
+
applicatorSetpoints: ApplicatorSetpoint[];
|
|
32
|
+
applicatorToolId: ApplicatorTools;
|
|
33
|
+
applicatorToolString: string;
|
|
34
|
+
cleanerId: number;
|
|
35
|
+
cleanerString: string;
|
|
23
36
|
weighingFingerId: WeighingFingers;
|
|
24
37
|
weighingFingerString: string;
|
|
25
38
|
numCameras: number;
|
|
26
39
|
cameraIds: number[];
|
|
27
|
-
|
|
40
|
+
cameraSpeeds: number[];
|
|
28
41
|
}
|
|
29
42
|
export declare enum CameraIds {
|
|
30
43
|
NONE = 0,
|
|
@@ -32,7 +45,8 @@ export declare enum CameraIds {
|
|
|
32
45
|
CAMERA_2 = 2,
|
|
33
46
|
CAMERA_3 = 3
|
|
34
47
|
}
|
|
35
|
-
export declare
|
|
48
|
+
export declare const cameraIdToStringMap: Map<CameraIds, string>;
|
|
49
|
+
export declare const cameraStringToIdMap: Map<string, CameraIds>;
|
|
36
50
|
export declare enum TubeTypes {
|
|
37
51
|
NONE = 0,
|
|
38
52
|
TYPE_11726650 = 1,
|
|
@@ -43,6 +57,8 @@ export declare enum TubeTypes {
|
|
|
43
57
|
TYPE_1755_037 = 6,
|
|
44
58
|
TYPE_1517_038 = 7
|
|
45
59
|
}
|
|
60
|
+
export declare const tubeTypeIdToStringMap: Map<number, string>;
|
|
61
|
+
export declare const tubeTypeStringToIdMap: Map<string, number>;
|
|
46
62
|
export declare function getTubeTypeString(tubeType: TubeTypes): string;
|
|
47
63
|
export declare const LinerTypes: string[];
|
|
48
64
|
export declare enum ApplicatorTools {
|
|
@@ -53,16 +69,24 @@ export declare enum ApplicatorTools {
|
|
|
53
69
|
GREEN_SMALL = 4,
|
|
54
70
|
BLUE_F16 = 5
|
|
55
71
|
}
|
|
72
|
+
export declare const applicatorToolIdToStringMap: Map<ApplicatorTools, string>;
|
|
73
|
+
export declare const applicatorToolStringToIdMap: Map<string, ApplicatorTools>;
|
|
74
|
+
export declare enum Cleaners {
|
|
75
|
+
NONE = 0,
|
|
76
|
+
SMALL = 1,
|
|
77
|
+
MEDIUM = 2,
|
|
78
|
+
LARGE = 3
|
|
79
|
+
}
|
|
80
|
+
export declare const cleanerIdToStringMap: Map<Cleaners, string>;
|
|
81
|
+
export declare const cleanerStringToIdMap: Map<string, Cleaners>;
|
|
56
82
|
export declare enum WeighingFingers {
|
|
57
83
|
NONE = 0,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
BLUE_SMALL = 4,
|
|
62
|
-
BLUE_SMALL_2 = 5,
|
|
63
|
-
BLUE_SMALL_3 = 6,
|
|
64
|
-
BLUE_SMALL_4 = 7
|
|
84
|
+
BLUE_SMALL = 1,
|
|
85
|
+
RED_MEDIUM = 2,
|
|
86
|
+
ORANGE_LARGE = 3
|
|
65
87
|
}
|
|
88
|
+
export declare const weighingFingerIdToStringMap: Map<WeighingFingers, string>;
|
|
89
|
+
export declare const weighingFingerStringToIdMap: Map<string, WeighingFingers>;
|
|
66
90
|
export declare const exampleRecipe: RecipeData;
|
|
67
91
|
export declare const initialRecipe: RecipeData;
|
|
68
92
|
export interface RecipeStore {
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialRecipeStore = exports.initialRecipe = exports.exampleRecipe = exports.WeighingFingers = exports.ApplicatorTools = exports.LinerTypes = exports.TubeTypes = exports.CameraIds = void 0;
|
|
4
|
-
exports.getCameraIdString = getCameraIdString;
|
|
3
|
+
exports.initialRecipeStore = exports.initialRecipe = exports.exampleRecipe = exports.weighingFingerStringToIdMap = exports.weighingFingerIdToStringMap = exports.WeighingFingers = exports.cleanerStringToIdMap = exports.cleanerIdToStringMap = exports.Cleaners = exports.applicatorToolStringToIdMap = exports.applicatorToolIdToStringMap = exports.ApplicatorTools = exports.LinerTypes = exports.tubeTypeStringToIdMap = exports.tubeTypeIdToStringMap = exports.TubeTypes = exports.cameraStringToIdMap = exports.cameraIdToStringMap = exports.CameraIds = exports.initialApplicatorSetpoints = exports.exampleApplicatorSetpoints = void 0;
|
|
5
4
|
exports.getTubeTypeString = getTubeTypeString;
|
|
5
|
+
const GlobalConstants_1 = require("./GlobalConstants");
|
|
6
|
+
exports.exampleApplicatorSetpoints = [
|
|
7
|
+
{ speed: 100, squeegeeDiameter: 30.0, zOffset: -10.0, ballValveOn: true },
|
|
8
|
+
{ speed: 100, squeegeeDiameter: 30.0, zOffset: 100.0, ballValveOn: true },
|
|
9
|
+
{ speed: 150, squeegeeDiameter: 28.5, zOffset: 200.0, ballValveOn: true },
|
|
10
|
+
{ speed: 200, squeegeeDiameter: 27.0, zOffset: 300.0, ballValveOn: false },
|
|
11
|
+
];
|
|
12
|
+
exports.initialApplicatorSetpoints = Array(GlobalConstants_1.GCs.MAX_APPLICATOR_SETPOINTS).fill({
|
|
13
|
+
speed: 0,
|
|
14
|
+
squeegeeDiameter: 0.0,
|
|
15
|
+
zOffset: 0.0,
|
|
16
|
+
ballValveOn: false,
|
|
17
|
+
});
|
|
6
18
|
var CameraIds;
|
|
7
19
|
(function (CameraIds) {
|
|
8
20
|
CameraIds[CameraIds["NONE"] = 0] = "NONE";
|
|
@@ -10,18 +22,13 @@ var CameraIds;
|
|
|
10
22
|
CameraIds[CameraIds["CAMERA_2"] = 2] = "CAMERA_2";
|
|
11
23
|
CameraIds[CameraIds["CAMERA_3"] = 3] = "CAMERA_3";
|
|
12
24
|
})(CameraIds || (exports.CameraIds = CameraIds = {}));
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return "Camera 3";
|
|
21
|
-
default:
|
|
22
|
-
return "None";
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
+
exports.cameraIdToStringMap = new Map([
|
|
26
|
+
[CameraIds.NONE, "None"],
|
|
27
|
+
[CameraIds.CAMERA_1, "Camera 1"],
|
|
28
|
+
[CameraIds.CAMERA_2, "Camera 2"],
|
|
29
|
+
[CameraIds.CAMERA_3, "Camera 3"],
|
|
30
|
+
]);
|
|
31
|
+
exports.cameraStringToIdMap = new Map(Array.from(exports.cameraIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
25
32
|
var TubeTypes;
|
|
26
33
|
(function (TubeTypes) {
|
|
27
34
|
TubeTypes[TubeTypes["NONE"] = 0] = "NONE";
|
|
@@ -33,6 +40,17 @@ var TubeTypes;
|
|
|
33
40
|
TubeTypes[TubeTypes["TYPE_1755_037"] = 6] = "TYPE_1755_037";
|
|
34
41
|
TubeTypes[TubeTypes["TYPE_1517_038"] = 7] = "TYPE_1517_038";
|
|
35
42
|
})(TubeTypes || (exports.TubeTypes = TubeTypes = {}));
|
|
43
|
+
exports.tubeTypeIdToStringMap = new Map([
|
|
44
|
+
[TubeTypes.NONE, "None"],
|
|
45
|
+
[TubeTypes.TYPE_11726650, "11726650"],
|
|
46
|
+
[TubeTypes.TYPE_1809_370, "1809-370"],
|
|
47
|
+
[TubeTypes.TYPE_1809_126, "1809-126"],
|
|
48
|
+
[TubeTypes.TYPE_1340_38, "1340-38"],
|
|
49
|
+
[TubeTypes.TYPE_3811302, "3811302"],
|
|
50
|
+
[TubeTypes.TYPE_1755_037, "1755-037"],
|
|
51
|
+
[TubeTypes.TYPE_1517_038, "1517-038"],
|
|
52
|
+
]);
|
|
53
|
+
exports.tubeTypeStringToIdMap = new Map(Array.from(exports.tubeTypeIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
36
54
|
function getTubeTypeString(tubeType) {
|
|
37
55
|
switch (tubeType) {
|
|
38
56
|
case TubeTypes.TYPE_11726650:
|
|
@@ -67,51 +85,84 @@ var ApplicatorTools;
|
|
|
67
85
|
ApplicatorTools[ApplicatorTools["GREEN_SMALL"] = 4] = "GREEN_SMALL";
|
|
68
86
|
ApplicatorTools[ApplicatorTools["BLUE_F16"] = 5] = "BLUE_F16";
|
|
69
87
|
})(ApplicatorTools || (exports.ApplicatorTools = ApplicatorTools = {}));
|
|
88
|
+
exports.applicatorToolIdToStringMap = new Map([
|
|
89
|
+
[ApplicatorTools.NONE, "None"],
|
|
90
|
+
[ApplicatorTools.RED_37_INCH, "Red 3/7 Inch"],
|
|
91
|
+
[ApplicatorTools.BLUE_F16, "Blue F16"],
|
|
92
|
+
[ApplicatorTools.GREEN_SMALL, "Green Small"],
|
|
93
|
+
[ApplicatorTools.ORANGE_LARGE, "Orange Large"],
|
|
94
|
+
[ApplicatorTools.YELLOW_MEDIUM, "Yellow Medium"],
|
|
95
|
+
]);
|
|
96
|
+
exports.applicatorToolStringToIdMap = new Map(Array.from(exports.applicatorToolIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
97
|
+
var Cleaners;
|
|
98
|
+
(function (Cleaners) {
|
|
99
|
+
Cleaners[Cleaners["NONE"] = 0] = "NONE";
|
|
100
|
+
Cleaners[Cleaners["SMALL"] = 1] = "SMALL";
|
|
101
|
+
Cleaners[Cleaners["MEDIUM"] = 2] = "MEDIUM";
|
|
102
|
+
Cleaners[Cleaners["LARGE"] = 3] = "LARGE";
|
|
103
|
+
})(Cleaners || (exports.Cleaners = Cleaners = {}));
|
|
104
|
+
exports.cleanerIdToStringMap = new Map([
|
|
105
|
+
[Cleaners.NONE, "None"],
|
|
106
|
+
[Cleaners.SMALL, "Small"],
|
|
107
|
+
[Cleaners.MEDIUM, "Medium"],
|
|
108
|
+
[Cleaners.LARGE, "Large"],
|
|
109
|
+
]);
|
|
110
|
+
exports.cleanerStringToIdMap = new Map(Array.from(exports.cleanerIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
70
111
|
var WeighingFingers;
|
|
71
112
|
(function (WeighingFingers) {
|
|
72
113
|
WeighingFingers[WeighingFingers["NONE"] = 0] = "NONE";
|
|
73
|
-
WeighingFingers[WeighingFingers["
|
|
74
|
-
WeighingFingers[WeighingFingers["
|
|
75
|
-
WeighingFingers[WeighingFingers["
|
|
76
|
-
WeighingFingers[WeighingFingers["BLUE_SMALL"] = 4] = "BLUE_SMALL";
|
|
77
|
-
WeighingFingers[WeighingFingers["BLUE_SMALL_2"] = 5] = "BLUE_SMALL_2";
|
|
78
|
-
WeighingFingers[WeighingFingers["BLUE_SMALL_3"] = 6] = "BLUE_SMALL_3";
|
|
79
|
-
WeighingFingers[WeighingFingers["BLUE_SMALL_4"] = 7] = "BLUE_SMALL_4";
|
|
114
|
+
WeighingFingers[WeighingFingers["BLUE_SMALL"] = 1] = "BLUE_SMALL";
|
|
115
|
+
WeighingFingers[WeighingFingers["RED_MEDIUM"] = 2] = "RED_MEDIUM";
|
|
116
|
+
WeighingFingers[WeighingFingers["ORANGE_LARGE"] = 3] = "ORANGE_LARGE";
|
|
80
117
|
})(WeighingFingers || (exports.WeighingFingers = WeighingFingers = {}));
|
|
118
|
+
exports.weighingFingerIdToStringMap = new Map([
|
|
119
|
+
[WeighingFingers.NONE, "None"],
|
|
120
|
+
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
121
|
+
[WeighingFingers.ORANGE_LARGE, "Orange Large"],
|
|
122
|
+
[WeighingFingers.BLUE_SMALL, "Blue Small"],
|
|
123
|
+
]);
|
|
124
|
+
exports.weighingFingerStringToIdMap = new Map(Array.from(exports.weighingFingerIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
81
125
|
exports.exampleRecipe = {
|
|
82
|
-
|
|
126
|
+
index: 1,
|
|
127
|
+
nickname: "Example Recipe",
|
|
128
|
+
linerTypeString: "CKU",
|
|
129
|
+
linerPotPressure: 50,
|
|
130
|
+
tubeTypeId: TubeTypes.TYPE_1340_38,
|
|
131
|
+
tubeTypeString: "1340-38",
|
|
83
132
|
tubeOuterDiameterMax: 38.1,
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
133
|
+
falseBottomStaysOpen: false,
|
|
134
|
+
applicatorSetpoints: exports.exampleApplicatorSetpoints,
|
|
135
|
+
applicatorToolId: ApplicatorTools.RED_37_INCH,
|
|
136
|
+
applicatorToolString: "Red 3/7 Inch",
|
|
137
|
+
cleanerId: Cleaners.MEDIUM,
|
|
138
|
+
cleanerString: "Medium",
|
|
90
139
|
weighingFingerId: WeighingFingers.RED_MEDIUM,
|
|
91
140
|
weighingFingerString: "Red Medium",
|
|
92
141
|
numCameras: 2,
|
|
93
142
|
cameraIds: [CameraIds.CAMERA_1, CameraIds.CAMERA_2],
|
|
94
|
-
|
|
143
|
+
cameraSpeeds: [50, 75],
|
|
95
144
|
};
|
|
96
|
-
const MAX_APPLICATOR_SETPOINTS = 10;
|
|
97
|
-
const MAX_CAMERAS = 3;
|
|
98
|
-
const MAX_NUM_RECIPES = 20;
|
|
99
145
|
exports.initialRecipe = {
|
|
100
|
-
|
|
146
|
+
index: 0,
|
|
147
|
+
nickname: "",
|
|
148
|
+
linerTypeString: "",
|
|
101
149
|
tubeOuterDiameterMax: 0.0,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
150
|
+
tubeTypeId: TubeTypes.NONE,
|
|
151
|
+
tubeTypeString: "",
|
|
152
|
+
linerPotPressure: 0,
|
|
153
|
+
applicatorSetpoints: exports.initialApplicatorSetpoints,
|
|
154
|
+
applicatorToolId: ApplicatorTools.NONE,
|
|
155
|
+
applicatorToolString: "",
|
|
156
|
+
cleanerId: Cleaners.NONE,
|
|
157
|
+
cleanerString: "",
|
|
108
158
|
weighingFingerId: WeighingFingers.NONE,
|
|
109
159
|
weighingFingerString: "",
|
|
110
160
|
numCameras: 0,
|
|
111
|
-
cameraIds: Array(
|
|
161
|
+
cameraIds: Array(GlobalConstants_1.GCs.MAX_NUM_CAMERAS).fill(CameraIds.NONE),
|
|
162
|
+
cameraSpeeds: Array(GlobalConstants_1.GCs.MAX_NUM_CAMERAS).fill(0),
|
|
112
163
|
falseBottomStaysOpen: false,
|
|
113
164
|
};
|
|
114
165
|
exports.initialRecipeStore = {
|
|
115
166
|
numRecipes: 2,
|
|
116
|
-
recipes: Array(MAX_NUM_RECIPES).fill(exports.exampleRecipe),
|
|
167
|
+
recipes: Array(GlobalConstants_1.GCs.MAX_NUM_RECIPES).fill(exports.exampleRecipe),
|
|
117
168
|
};
|
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { GCs } from "./GlobalConstants";
|
|
2
|
+
|
|
1
3
|
export interface JobData {
|
|
2
4
|
ActiveRecipeIndex: number; // used with Machine.RecipeStore.Recipes array
|
|
3
5
|
JobName: string; // this is the identifier for the specific job
|
|
@@ -12,20 +14,51 @@ export interface JobData {
|
|
|
12
14
|
JobComplete: boolean;
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
export interface ApplicatorSetpoint {
|
|
18
|
+
speed: number; // speed robot uses while applying liner
|
|
19
|
+
squeegeeDiameter: number; // mm of Inner Diameter
|
|
20
|
+
zOffset: number; // mm of Distance relative to false bottom
|
|
21
|
+
ballValveOn: boolean; // whether ball valve is on or off at this setpoint
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const exampleApplicatorSetpoints: ApplicatorSetpoint[] = [
|
|
25
|
+
{ speed: 100, squeegeeDiameter: 30.0, zOffset: -10.0, ballValveOn: true },
|
|
26
|
+
{ speed: 100, squeegeeDiameter: 30.0, zOffset: 100.0, ballValveOn: true },
|
|
27
|
+
{ speed: 150, squeegeeDiameter: 28.5, zOffset: 200.0, ballValveOn: true },
|
|
28
|
+
{ speed: 200, squeegeeDiameter: 27.0, zOffset: 300.0, ballValveOn: false },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
export const initialApplicatorSetpoints: ApplicatorSetpoint[] = Array(GCs.MAX_APPLICATOR_SETPOINTS).fill({
|
|
32
|
+
speed: 0,
|
|
33
|
+
squeegeeDiameter: 0.0,
|
|
34
|
+
zOffset: 0.0,
|
|
35
|
+
ballValveOn: false,
|
|
36
|
+
});
|
|
37
|
+
|
|
15
38
|
export interface RecipeData {
|
|
16
|
-
|
|
39
|
+
index: number; // index in RecipeStore.Recipes array
|
|
40
|
+
nickname: string; // user defined nickname for recipe
|
|
41
|
+
|
|
42
|
+
tubeTypeId: number;
|
|
43
|
+
tubeTypeString: string; // display purposes only
|
|
17
44
|
tubeOuterDiameterMax: number; // mm, used for robot offsets in fixture
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
falseBottomStaysOpen: boolean; // this also determines if only the tall fixture is used or not
|
|
46
|
+
|
|
47
|
+
linerPotPressure: number; // PSI
|
|
48
|
+
linerTypeString: string; // display purposes only
|
|
49
|
+
|
|
50
|
+
applicatorSetpoints: ApplicatorSetpoint[]; // speed robot uses while applying liner
|
|
51
|
+
applicatorToolId: ApplicatorTools;
|
|
52
|
+
applicatorToolString: string;
|
|
53
|
+
cleanerId: number; // cleaner tool used before applying liner
|
|
54
|
+
cleanerString: string;
|
|
55
|
+
|
|
24
56
|
weighingFingerId: WeighingFingers;
|
|
25
57
|
weighingFingerString: string;
|
|
58
|
+
|
|
26
59
|
numCameras: number; // number of cameras needed to take photos of a tube
|
|
27
60
|
cameraIds: number[]; // used with NumCameras to determine how photos are taken
|
|
28
|
-
|
|
61
|
+
cameraSpeeds: number[]; // speed settings for robot for each camera
|
|
29
62
|
}
|
|
30
63
|
|
|
31
64
|
export enum CameraIds {
|
|
@@ -35,18 +68,14 @@ export enum CameraIds {
|
|
|
35
68
|
CAMERA_3 = 3,
|
|
36
69
|
}
|
|
37
70
|
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
default:
|
|
47
|
-
return "None";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
71
|
+
export const cameraIdToStringMap = new Map<CameraIds, string>([
|
|
72
|
+
[CameraIds.NONE, "None"],
|
|
73
|
+
[CameraIds.CAMERA_1, "Camera 1"],
|
|
74
|
+
[CameraIds.CAMERA_2, "Camera 2"],
|
|
75
|
+
[CameraIds.CAMERA_3, "Camera 3"],
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
export const cameraStringToIdMap = new Map<string, CameraIds>(Array.from(cameraIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
50
79
|
|
|
51
80
|
export enum TubeTypes {
|
|
52
81
|
NONE = 0,
|
|
@@ -59,6 +88,19 @@ export enum TubeTypes {
|
|
|
59
88
|
TYPE_1517_038 = 7
|
|
60
89
|
}
|
|
61
90
|
|
|
91
|
+
export const tubeTypeIdToStringMap = new Map<number, string>([
|
|
92
|
+
[TubeTypes.NONE, "None"],
|
|
93
|
+
[TubeTypes.TYPE_11726650, "11726650"],
|
|
94
|
+
[TubeTypes.TYPE_1809_370, "1809-370"],
|
|
95
|
+
[TubeTypes.TYPE_1809_126, "1809-126"],
|
|
96
|
+
[TubeTypes.TYPE_1340_38, "1340-38"],
|
|
97
|
+
[TubeTypes.TYPE_3811302, "3811302"],
|
|
98
|
+
[TubeTypes.TYPE_1755_037, "1755-037"],
|
|
99
|
+
[TubeTypes.TYPE_1517_038, "1517-038"],
|
|
100
|
+
]);
|
|
101
|
+
|
|
102
|
+
export const tubeTypeStringToIdMap = new Map<string, number>(Array.from(tubeTypeIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
103
|
+
|
|
62
104
|
export function getTubeTypeString(tubeType: TubeTypes): string {
|
|
63
105
|
switch (tubeType) {
|
|
64
106
|
case TubeTypes.TYPE_11726650:
|
|
@@ -96,51 +138,95 @@ export enum ApplicatorTools {
|
|
|
96
138
|
}
|
|
97
139
|
|
|
98
140
|
|
|
141
|
+
|
|
142
|
+
export const applicatorToolIdToStringMap = new Map<ApplicatorTools, string>([
|
|
143
|
+
[ApplicatorTools.NONE, "None"],
|
|
144
|
+
[ApplicatorTools.RED_37_INCH, "Red 3/7 Inch"],
|
|
145
|
+
[ApplicatorTools.BLUE_F16, "Blue F16"],
|
|
146
|
+
[ApplicatorTools.GREEN_SMALL, "Green Small"],
|
|
147
|
+
[ApplicatorTools.ORANGE_LARGE, "Orange Large"],
|
|
148
|
+
[ApplicatorTools.YELLOW_MEDIUM, "Yellow Medium"],
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
export const applicatorToolStringToIdMap = new Map<string, ApplicatorTools>(Array.from(applicatorToolIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
152
|
+
|
|
153
|
+
export enum Cleaners {
|
|
154
|
+
NONE = 0,
|
|
155
|
+
SMALL = 1,
|
|
156
|
+
MEDIUM = 2,
|
|
157
|
+
LARGE = 3
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export const cleanerIdToStringMap = new Map<Cleaners, string>([
|
|
161
|
+
[Cleaners.NONE, "None"],
|
|
162
|
+
[Cleaners.SMALL, "Small"],
|
|
163
|
+
[Cleaners.MEDIUM, "Medium"],
|
|
164
|
+
[Cleaners.LARGE, "Large"],
|
|
165
|
+
]);
|
|
166
|
+
|
|
167
|
+
export const cleanerStringToIdMap = new Map<string, Cleaners>(Array.from(cleanerIdToStringMap.entries()).map(([id, str]) => [str, id]));
|
|
168
|
+
|
|
99
169
|
export enum WeighingFingers {
|
|
100
170
|
NONE = 0,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
BLUE_SMALL = 4,
|
|
105
|
-
BLUE_SMALL_2 = 5,
|
|
106
|
-
BLUE_SMALL_3 = 6,
|
|
107
|
-
BLUE_SMALL_4 = 7
|
|
171
|
+
BLUE_SMALL = 1,
|
|
172
|
+
RED_MEDIUM = 2,
|
|
173
|
+
ORANGE_LARGE = 3,
|
|
108
174
|
}
|
|
109
175
|
|
|
176
|
+
export const weighingFingerIdToStringMap = new Map<WeighingFingers, string>([
|
|
177
|
+
[WeighingFingers.NONE, "None"],
|
|
178
|
+
[WeighingFingers.RED_MEDIUM, "Red Medium"],
|
|
179
|
+
[WeighingFingers.ORANGE_LARGE, "Orange Large"],
|
|
180
|
+
[WeighingFingers.BLUE_SMALL, "Blue Small"],
|
|
181
|
+
]);
|
|
182
|
+
|
|
183
|
+
export const weighingFingerStringToIdMap = new Map(
|
|
184
|
+
Array.from(weighingFingerIdToStringMap.entries()).map(([id, str]) => [str, id])
|
|
185
|
+
);
|
|
186
|
+
|
|
110
187
|
|
|
111
188
|
export const exampleRecipe: RecipeData = {
|
|
112
|
-
|
|
189
|
+
index: 1,
|
|
190
|
+
nickname: "Example Recipe",
|
|
191
|
+
linerTypeString: "CKU",
|
|
192
|
+
linerPotPressure: 50,
|
|
193
|
+
|
|
194
|
+
tubeTypeId: TubeTypes.TYPE_1340_38,
|
|
195
|
+
tubeTypeString: "1340-38",
|
|
113
196
|
tubeOuterDiameterMax: 38.1,
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
197
|
+
falseBottomStaysOpen: false,
|
|
198
|
+
|
|
199
|
+
applicatorSetpoints: exampleApplicatorSetpoints,
|
|
200
|
+
applicatorToolId: ApplicatorTools.RED_37_INCH,
|
|
201
|
+
applicatorToolString: "Red 3/7 Inch",
|
|
202
|
+
cleanerId: Cleaners.MEDIUM,
|
|
203
|
+
cleanerString: "Medium",
|
|
120
204
|
weighingFingerId: WeighingFingers.RED_MEDIUM,
|
|
121
205
|
weighingFingerString: "Red Medium",
|
|
122
206
|
numCameras: 2,
|
|
123
207
|
cameraIds: [CameraIds.CAMERA_1, CameraIds.CAMERA_2],
|
|
124
|
-
|
|
208
|
+
cameraSpeeds: [50, 75],
|
|
209
|
+
|
|
125
210
|
};
|
|
126
211
|
|
|
127
|
-
const MAX_APPLICATOR_SETPOINTS = 10;
|
|
128
|
-
const MAX_CAMERAS = 3;
|
|
129
|
-
const MAX_NUM_RECIPES = 20;
|
|
130
|
-
|
|
131
212
|
export const initialRecipe: RecipeData = {
|
|
132
|
-
|
|
213
|
+
index: 0,
|
|
214
|
+
nickname: "",
|
|
215
|
+
linerTypeString: "",
|
|
133
216
|
tubeOuterDiameterMax: 0.0,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
217
|
+
tubeTypeId: TubeTypes.NONE,
|
|
218
|
+
tubeTypeString: "",
|
|
219
|
+
linerPotPressure: 0,
|
|
220
|
+
applicatorSetpoints: initialApplicatorSetpoints,
|
|
221
|
+
applicatorToolId: ApplicatorTools.NONE,
|
|
222
|
+
applicatorToolString: "",
|
|
223
|
+
cleanerId: Cleaners.NONE,
|
|
224
|
+
cleanerString: "",
|
|
140
225
|
weighingFingerId: WeighingFingers.NONE,
|
|
141
226
|
weighingFingerString: "",
|
|
142
227
|
numCameras: 0,
|
|
143
|
-
cameraIds: Array(
|
|
228
|
+
cameraIds: Array(GCs.MAX_NUM_CAMERAS).fill(CameraIds.NONE),
|
|
229
|
+
cameraSpeeds: Array(GCs.MAX_NUM_CAMERAS).fill(0),
|
|
144
230
|
falseBottomStaysOpen: false,
|
|
145
231
|
};
|
|
146
232
|
|
|
@@ -151,5 +237,5 @@ export interface RecipeStore {
|
|
|
151
237
|
|
|
152
238
|
export const initialRecipeStore: RecipeStore = {
|
|
153
239
|
numRecipes: 2,
|
|
154
|
-
recipes: Array(MAX_NUM_RECIPES).fill(exampleRecipe),
|
|
240
|
+
recipes: Array(GCs.MAX_NUM_RECIPES).fill(exampleRecipe),
|
|
155
241
|
};
|