@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.
@@ -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
- nickname: string;
27
- linerPotPressure: number;
28
- linerTypeString: string;
29
- tubeTypeId: number;
30
- tubeTypeString: string;
31
- tubeOuterDiameterMax: number;
32
- tubeHeightMax: number;
33
- tubeMassKg: number;
34
- falseBottomStaysOpen: boolean;
35
- applicatorSetpoints: ApplicatorSetpoint[];
36
- applicatorToolId: number;
37
- applicatorToolString: string;
38
- applicatorCollisionPayloadOffset: number;
39
- cleanerId: number;
40
- cleanerString: string;
41
- weighingFingerId: number;
42
- weighingFingerString: string;
43
- cameraId: number;
44
- cameraString: string;
45
- cameraSpeed: number;
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
- CAMERA_1 = 1,
50
- CAMERA_2 = 2,
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.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 = exports.initialApplicatorSetpoint = void 0;
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.0,
9
- zOffset: 0.0,
10
- ballValveOn: false,
21
+ squeegeeDiameter: 0,
22
+ stepperPosition: 0,
23
+ zOffset: 0,
24
+ ballValveOn: false
11
25
  };
12
- exports.exampleApplicatorSetpoints = [
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["CAMERA_1"] = 1] = "CAMERA_1";
28
- CameraIds[CameraIds["CAMERA_2"] = 2] = "CAMERA_2";
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.CAMERA_1, "Camera 1"],
34
- [CameraIds.CAMERA_2, "Camera 2"],
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(([id, str]) => [str, id]));
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(([id, str]) => [str, id]));
60
+ exports.tubeTypeStringToIdMap = new Map(Array.from(exports.tubeTypeIdToStringMap.entries()).map(([key, value]) => [value, key]));
60
61
  function getTubeTypeString(tubeType) {
61
- switch (tubeType) {
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
- "Tribrid",
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.RED_37_INCH, "Red 3/7 Inch"],
97
- [ApplicatorTools.BLUE_F16, "Blue F16"],
98
- [ApplicatorTools.GREEN_SMALL, "Green Small"],
99
- [ApplicatorTools.ORANGE_LARGE, "Orange Large"],
100
- [ApplicatorTools.YELLOW_MEDIUM, "Yellow Medium"],
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(([id, str]) => [str, id]));
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(([id, str]) => [str, id]));
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
- exports.weighingFingerIdToStringMap = new Map([
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.weighingFingerStringToIdMap = new Map(Array.from(exports.weighingFingerIdToStringMap.entries()).map(([id, str]) => [str, id]));
131
- exports.exampleRecipe = {
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
- nickname: "",
160
- linerTypeString: "",
161
- tubeOuterDiameterMax: 0.0,
162
- tubeTypeId: TubeTypes.NONE,
163
- tubeTypeString: "",
164
- tubeHeightMax: 0, // example value in mm
165
- linerPotPressure: 0,
166
- applicatorSetpoints: exports.initialApplicatorSetpoints,
167
- applicatorToolId: ApplicatorTools.NONE,
168
- applicatorToolString: "",
169
- cleanerId: Cleaners.NONE,
170
- cleanerString: "",
171
- weighingFingerId: WeighingFingers.NONE,
172
- weighingFingerString: "",
173
- //numCameras: 0,
174
- cameraId: CameraIds.NONE,
175
- cameraString: "",
176
- cameraSpeed: 0,
177
- tubeMassKg: 0,
178
- applicatorCollisionPayloadOffset: 0,
179
- falseBottomStaysOpen: false,
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: 2,
183
- recipes: Array(GlobalConstants_1.GCs.MAX_NUM_RECIPES).fill(exports.exampleRecipe),
139
+ numRecipes: GlobalConstants_1.GCs.MAX_NUM_RECIPES,
140
+ recipes: Array(GlobalConstants_1.GCs.MAX_NUM_RECIPES).fill(exports.initialRecipe)
184
141
  };
@@ -14,6 +14,7 @@ export declare const MachineTags: {
14
14
  machineLog: string;
15
15
  deviceLogs: string;
16
16
  recipeStore: string;
17
+ job: string;
17
18
  errors: string;
18
19
  warnings: string;
19
20
  estopCircuitDelayed_OK: string;
@@ -33,6 +33,7 @@ exports.MachineTags = {
33
33
  machineLog: 'MachineLog',
34
34
  deviceLogs: 'DeviceLogs',
35
35
  recipeStore: 'RecipeStore',
36
+ job: 'Job',
36
37
  errors: 'Errors',
37
38
  warnings: 'Warnings',
38
39
  estopCircuitDelayed_OK: 'EstopCircuitDelayed_OK',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.81",
3
+ "version": "1.0.82",
4
4
  "description": "Shared data types and helpers for machine-related repositories",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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; // used with Machine.RecipeStore.Recipes array
5
- JobName: string; // this is the identifier for the specific job
6
- LotQty: number; // how many parts you are supposed to make per the job request
7
- GoodCnt: number; // how many good parts you've completed since starting the job
8
- ScrapCnt: number; // how many parts you've scrapped since starting the job
9
- SetupStartTime: bigint; // timestamp
10
- SetupEndTime: bigint; // timestamp
11
- SetupCompleted: boolean; // status
12
- JobStartTime: bigint; // timestamp
13
- JobEndTime: bigint; // timestamp
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; // 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
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.0,
27
- zOffset: 0.0,
28
- ballValveOn: false,
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).fill({
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
- index: number;
47
- dbId: string; // Added to match ST/MongoDB
48
- nickname: string;
49
-
50
- // LINER DATA
51
- linerPotPressure: number;
52
- linerTypeString: string;
53
-
54
- // TUBE DATA
55
- tubeTypeId: number;
56
- tubeTypeString: string;
57
- tubeOuterDiameterMax: number;
58
- tubeHeightMax: number;
59
- tubeMassKg: number; // Added: kg, used for payload adjustment
60
- falseBottomStaysOpen: boolean;
61
-
62
- // APPLICATOR SETPOINTS
63
- applicatorSetpoints: ApplicatorSetpoint[];
64
-
65
- // TOOLS
66
- applicatorToolId: number; // Note: Ensure this matches your ApplicatorTools enum
67
- applicatorToolString: string;
68
- applicatorCollisionPayloadOffset: number; // Added: kg, for collision sensitivity
69
-
70
- cleanerId: number;
71
- cleanerString: string;
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
- CAMERA_1 = 1,
86
- CAMERA_2 = 2,
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.CAMERA_1, "Camera 1"],
93
- [CameraIds.CAMERA_2, "Camera 2"],
94
- [CameraIds.CAMERA_3, "Camera 3"],
88
+ [CameraIds.STANDARD, "Standard"],
89
+ [CameraIds.LONG, "Long"]
95
90
  ]);
96
-
97
- export const cameraStringToIdMap = new Map<string, CameraIds>(Array.from(cameraIdToStringMap.entries()).map(([id, str]) => [str, id]));
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 const tubeTypeIdToStringMap = new Map<number, string>([
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>(Array.from(tubeTypeIdToStringMap.entries()).map(([id, str]) => [str, id]));
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
- switch (tubeType) {
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
- "Tribrid",
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.RED_37_INCH, "Red 3/7 Inch"],
164
- [ApplicatorTools.BLUE_F16, "Blue F16"],
165
- [ApplicatorTools.GREEN_SMALL, "Green Small"],
166
- [ApplicatorTools.ORANGE_LARGE, "Orange Large"],
167
- [ApplicatorTools.YELLOW_MEDIUM, "Yellow Medium"],
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
- export const applicatorToolStringToIdMap = new Map<string, ApplicatorTools>(Array.from(applicatorToolIdToStringMap.entries()).map(([id, str]) => [str, id]));
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
- export const cleanerStringToIdMap = new Map<string, Cleaners>(Array.from(cleanerIdToStringMap.entries()).map(([id, str]) => [str, id]));
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
- export const weighingFingerStringToIdMap = new Map(
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
- nickname: "",
239
- linerTypeString: "",
240
- tubeOuterDiameterMax: 0.0,
241
- tubeTypeId: TubeTypes.NONE,
242
- tubeTypeString: "",
243
- tubeHeightMax: 0, // example value in mm
244
- linerPotPressure: 0,
245
- applicatorSetpoints: initialApplicatorSetpoints,
246
- applicatorToolId: ApplicatorTools.NONE,
247
- applicatorToolString: "",
248
- cleanerId: Cleaners.NONE,
249
- cleanerString: "",
250
- weighingFingerId: WeighingFingers.NONE,
251
- weighingFingerString: "",
252
- //numCameras: 0,
253
- cameraId: CameraIds.NONE,
254
- cameraString: "",
255
- cameraSpeed: 0,
256
- tubeMassKg: 0,
257
- applicatorCollisionPayloadOffset: 0,
258
- falseBottomStaysOpen: false,
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: 2,
268
- recipes: Array(GCs.MAX_NUM_RECIPES).fill(exampleRecipe),
220
+ numRecipes: GCs.MAX_NUM_RECIPES,
221
+ recipes: Array(GCs.MAX_NUM_RECIPES).fill(initialRecipe)
269
222
  };
@@ -17,6 +17,7 @@ export const MachineTags = {
17
17
  machineLog: 'MachineLog',
18
18
  deviceLogs: 'DeviceLogs',
19
19
  recipeStore: 'RecipeStore',
20
+ job: 'Job',
20
21
  errors: 'Errors',
21
22
  warnings: 'Warnings',
22
23
  estopCircuitDelayed_OK: 'EstopCircuitDelayed_OK',