@kuriousdesign/machine-sdk 1.0.60 → 1.0.61

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, TaskQueue } from ".";
1
+ import { ComponentAnimation, DebugLogData, DeviceRegistration, RecipeStore, TaskQueue } from ".";
2
2
  import { PartDataStatus } from "./Part";
3
3
  export interface UserData {
4
4
  activeUser: number;
@@ -43,6 +43,7 @@ export interface Machine {
43
43
  heartbeatPlc: number;
44
44
  heartbeatHmi: number;
45
45
  machineLog: LogRecordData;
46
+ recipeStore: RecipeStore;
46
47
  }
47
48
  export interface LogRecordData {
48
49
  list: DebugLogData[];
@@ -43,5 +43,6 @@ exports.initialMachine = ({
43
43
  heartbeatPlc: 0,
44
44
  heartbeatHmi: 0,
45
45
  machineLog: { ...exports.initialLogRecordData },
46
+ recipeStore: { ..._1.initialRecipeStore },
46
47
  //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
47
48
  });
@@ -0,0 +1,70 @@
1
+ export interface JobData {
2
+ ActiveRecipeIndex: number;
3
+ JobName: string;
4
+ LotQty: number;
5
+ GoodCnt: number;
6
+ ScrapCnt: number;
7
+ SetupStartTime: bigint;
8
+ SetupEndTime: bigint;
9
+ SetupCompleted: boolean;
10
+ JobStartTime: bigint;
11
+ JobEndTime: bigint;
12
+ JobComplete: boolean;
13
+ }
14
+ export interface RecipeData {
15
+ linerType: string;
16
+ tubeOuterDiameterMax: number;
17
+ tubePartNumber: string;
18
+ setpointSpeeds: number[];
19
+ setpointDiameters: number[];
20
+ setpointDistances: number[];
21
+ applicatorToolColorId: ApplicatorTools;
22
+ applicatorToolColorString: string;
23
+ weighingFingerId: WeighingFingers;
24
+ weighingFingerString: string;
25
+ numCameras: number;
26
+ cameraIds: number[];
27
+ falseBottomStaysOpen: boolean;
28
+ }
29
+ export declare enum CameraIds {
30
+ NONE = 0,
31
+ CAMERA_1 = 1,
32
+ CAMERA_2 = 2,
33
+ CAMERA_3 = 3
34
+ }
35
+ export declare enum TubeTypes {
36
+ NONE = 0,
37
+ TYPE_11726650 = 1,
38
+ TYPE_1809_370 = 2,
39
+ TYPE_1809_126 = 3,
40
+ TYPE_1340_38 = 4,
41
+ TYPE_3811302 = 5,
42
+ TYPE_1755_037 = 6,
43
+ TYPE_1517_038 = 7
44
+ }
45
+ export declare const LinerTypes: string[];
46
+ export declare enum ApplicatorTools {
47
+ NONE = 0,
48
+ RED_37_INCH = 1,
49
+ ORANGE_LARGE = 2,
50
+ YELLOW_MEDIUM = 3,
51
+ GREEN_SMALL = 4,
52
+ BLUE_F16 = 5
53
+ }
54
+ export declare enum WeighingFingers {
55
+ NONE = 0,
56
+ RED_MEDIUM = 1,
57
+ ORANGE_LARGE = 2,
58
+ ORANGE_LARGE_2 = 3,
59
+ BLUE_SMALL = 4,
60
+ BLUE_SMALL_2 = 5,
61
+ BLUE_SMALL_3 = 6,
62
+ BLUE_SMALL_4 = 7
63
+ }
64
+ export declare const exampleRecipe: RecipeData;
65
+ export declare const initialRecipe: RecipeData;
66
+ export interface RecipeStore {
67
+ numRecipes: number;
68
+ recipes: RecipeData[];
69
+ }
70
+ export declare const initialRecipeStore: RecipeStore;
@@ -0,0 +1,83 @@
1
+ "use strict";
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
+ var CameraIds;
5
+ (function (CameraIds) {
6
+ CameraIds[CameraIds["NONE"] = 0] = "NONE";
7
+ CameraIds[CameraIds["CAMERA_1"] = 1] = "CAMERA_1";
8
+ CameraIds[CameraIds["CAMERA_2"] = 2] = "CAMERA_2";
9
+ CameraIds[CameraIds["CAMERA_3"] = 3] = "CAMERA_3";
10
+ })(CameraIds || (exports.CameraIds = CameraIds = {}));
11
+ var TubeTypes;
12
+ (function (TubeTypes) {
13
+ TubeTypes[TubeTypes["NONE"] = 0] = "NONE";
14
+ TubeTypes[TubeTypes["TYPE_11726650"] = 1] = "TYPE_11726650";
15
+ TubeTypes[TubeTypes["TYPE_1809_370"] = 2] = "TYPE_1809_370";
16
+ TubeTypes[TubeTypes["TYPE_1809_126"] = 3] = "TYPE_1809_126";
17
+ TubeTypes[TubeTypes["TYPE_1340_38"] = 4] = "TYPE_1340_38";
18
+ TubeTypes[TubeTypes["TYPE_3811302"] = 5] = "TYPE_3811302";
19
+ TubeTypes[TubeTypes["TYPE_1755_037"] = 6] = "TYPE_1755_037";
20
+ TubeTypes[TubeTypes["TYPE_1517_038"] = 7] = "TYPE_1517_038";
21
+ })(TubeTypes || (exports.TubeTypes = TubeTypes = {}));
22
+ exports.LinerTypes = [
23
+ "CKU",
24
+ "Tribrid",
25
+ "1755",
26
+ ];
27
+ var ApplicatorTools;
28
+ (function (ApplicatorTools) {
29
+ ApplicatorTools[ApplicatorTools["NONE"] = 0] = "NONE";
30
+ ApplicatorTools[ApplicatorTools["RED_37_INCH"] = 1] = "RED_37_INCH";
31
+ ApplicatorTools[ApplicatorTools["ORANGE_LARGE"] = 2] = "ORANGE_LARGE";
32
+ ApplicatorTools[ApplicatorTools["YELLOW_MEDIUM"] = 3] = "YELLOW_MEDIUM";
33
+ ApplicatorTools[ApplicatorTools["GREEN_SMALL"] = 4] = "GREEN_SMALL";
34
+ ApplicatorTools[ApplicatorTools["BLUE_F16"] = 5] = "BLUE_F16";
35
+ })(ApplicatorTools || (exports.ApplicatorTools = ApplicatorTools = {}));
36
+ var WeighingFingers;
37
+ (function (WeighingFingers) {
38
+ WeighingFingers[WeighingFingers["NONE"] = 0] = "NONE";
39
+ WeighingFingers[WeighingFingers["RED_MEDIUM"] = 1] = "RED_MEDIUM";
40
+ WeighingFingers[WeighingFingers["ORANGE_LARGE"] = 2] = "ORANGE_LARGE";
41
+ WeighingFingers[WeighingFingers["ORANGE_LARGE_2"] = 3] = "ORANGE_LARGE_2";
42
+ WeighingFingers[WeighingFingers["BLUE_SMALL"] = 4] = "BLUE_SMALL";
43
+ WeighingFingers[WeighingFingers["BLUE_SMALL_2"] = 5] = "BLUE_SMALL_2";
44
+ WeighingFingers[WeighingFingers["BLUE_SMALL_3"] = 6] = "BLUE_SMALL_3";
45
+ WeighingFingers[WeighingFingers["BLUE_SMALL_4"] = 7] = "BLUE_SMALL_4";
46
+ })(WeighingFingers || (exports.WeighingFingers = WeighingFingers = {}));
47
+ exports.exampleRecipe = {
48
+ linerType: "CKU",
49
+ tubeOuterDiameterMax: 38.1,
50
+ tubePartNumber: "11726650",
51
+ setpointSpeeds: [100, 150, 200],
52
+ setpointDiameters: [30.0, 28.5, 27.0],
53
+ setpointDistances: [100.0, 200.0, 300.0],
54
+ applicatorToolColorId: ApplicatorTools.RED_37_INCH,
55
+ applicatorToolColorString: "Red 3/7 Inch",
56
+ weighingFingerId: WeighingFingers.RED_MEDIUM,
57
+ weighingFingerString: "Red Medium",
58
+ numCameras: 2,
59
+ cameraIds: [CameraIds.CAMERA_1, CameraIds.CAMERA_2],
60
+ falseBottomStaysOpen: false,
61
+ };
62
+ const MAX_APPLICATOR_SETPOINTS = 10;
63
+ const MAX_CAMERAS = 3;
64
+ const MAX_NUM_RECIPES = 20;
65
+ exports.initialRecipe = {
66
+ linerType: "",
67
+ tubeOuterDiameterMax: 0.0,
68
+ tubePartNumber: "",
69
+ setpointSpeeds: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
70
+ setpointDiameters: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
71
+ setpointDistances: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
72
+ applicatorToolColorId: ApplicatorTools.NONE,
73
+ applicatorToolColorString: "",
74
+ weighingFingerId: WeighingFingers.NONE,
75
+ weighingFingerString: "",
76
+ numCameras: 0,
77
+ cameraIds: Array(MAX_CAMERAS).fill(CameraIds.NONE),
78
+ falseBottomStaysOpen: false,
79
+ };
80
+ exports.initialRecipeStore = {
81
+ numRecipes: 2,
82
+ recipes: Array(MAX_NUM_RECIPES).fill(exports.exampleRecipe),
83
+ };
@@ -5,7 +5,7 @@ export * from "./BaseDevice";
5
5
  export * from "./Machine";
6
6
  export * from "./RackData";
7
7
  export * from "./GlobalConstants";
8
- export * from "./RecipeData";
8
+ export * from "./Recipe";
9
9
  export * from "./RecipeManagerFB";
10
10
  export * from "./UserManagerFB";
11
11
  export * from "./TaskQueue";
@@ -21,7 +21,7 @@ __exportStar(require("./BaseDevice"), exports);
21
21
  __exportStar(require("./Machine"), exports);
22
22
  __exportStar(require("./RackData"), exports);
23
23
  __exportStar(require("./GlobalConstants"), exports);
24
- __exportStar(require("./RecipeData"), exports);
24
+ __exportStar(require("./Recipe"), exports);
25
25
  __exportStar(require("./RecipeManagerFB"), exports);
26
26
  __exportStar(require("./UserManagerFB"), exports);
27
27
  __exportStar(require("./TaskQueue"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
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,5 +1,5 @@
1
- import { ComponentAnimation, DebugLogData, DeviceConstants, DeviceLogData, DeviceRegistration, initialDebugLogData, initialDeviceLogData, initialDeviceRegistration, initialTaskQueue, TaskQueue } from ".";
2
- import { initialPartDataStatus, PartData, PartDataStatus } from "./Part";
1
+ import { ComponentAnimation, DebugLogData, DeviceConstants, DeviceRegistration, initialDebugLogData, initialRecipeStore, initialTaskQueue, RecipeStore, TaskQueue } from ".";
2
+ import { initialPartDataStatus, PartDataStatus } from "./Part";
3
3
  import { GCs } from "./GlobalConstants";
4
4
 
5
5
 
@@ -86,6 +86,7 @@ export interface Machine {
86
86
  heartbeatPlc: number;
87
87
  heartbeatHmi: number;
88
88
  machineLog: LogRecordData;
89
+ recipeStore: RecipeStore;
89
90
  //deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
90
91
  }
91
92
 
@@ -124,5 +125,6 @@ export const initialMachine: Machine = ({
124
125
  heartbeatPlc: 0,
125
126
  heartbeatHmi: 0,
126
127
  machineLog: { ...initialLogRecordData },
128
+ recipeStore: { ...initialRecipeStore },
127
129
  //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
128
130
  });
@@ -0,0 +1,121 @@
1
+ export interface JobData {
2
+ ActiveRecipeIndex: number; // used with Machine.RecipeStore.Recipes array
3
+ JobName: string; // this is the identifier for the specific job
4
+ LotQty: number; // how many parts you are supposed to make per the job request
5
+ GoodCnt: number; // how many good parts you've completed since starting the job
6
+ ScrapCnt: number; // how many parts you've scrapped since starting the job
7
+ SetupStartTime: bigint; // timestamp
8
+ SetupEndTime: bigint; // timestamp
9
+ SetupCompleted: boolean; // status
10
+ JobStartTime: bigint; // timestamp
11
+ JobEndTime: bigint; // timestamp
12
+ JobComplete: boolean;
13
+ }
14
+
15
+ export interface RecipeData {
16
+ linerType: string; // display purposes only
17
+ tubeOuterDiameterMax: number; // mm, used for robot offsets in fixture
18
+ tubePartNumber: string; // display purposes only
19
+ setpointSpeeds: number[]; // speed robot uses while applying liner
20
+ setpointDiameters: number[]; // mm of Inner Diameters
21
+ setpointDistances: number[]; // mm of Distances relative to false bottom
22
+ applicatorToolColorId: ApplicatorTools;
23
+ applicatorToolColorString: string;
24
+ weighingFingerId: WeighingFingers;
25
+ weighingFingerString: string;
26
+ numCameras: number; // number of cameras needed to take photos of a tube
27
+ cameraIds: number[]; // used with NumCameras to determine how photos are taken
28
+ falseBottomStaysOpen: boolean; // this also determines if only the tall fixture is used or not
29
+ }
30
+
31
+ export enum CameraIds {
32
+ NONE = 0,
33
+ CAMERA_1 = 1,
34
+ CAMERA_2 = 2,
35
+ CAMERA_3 = 3,
36
+ }
37
+
38
+ export enum TubeTypes {
39
+ NONE = 0,
40
+ TYPE_11726650 = 1,
41
+ TYPE_1809_370 = 2,
42
+ TYPE_1809_126 = 3,
43
+ TYPE_1340_38 = 4,
44
+ TYPE_3811302 = 5,
45
+ TYPE_1755_037 = 6,
46
+ TYPE_1517_038 = 7
47
+ }
48
+
49
+ export const LinerTypes: string[] = [
50
+ "CKU",
51
+ "Tribrid",
52
+ "1755",
53
+ ];
54
+
55
+ export enum ApplicatorTools {
56
+ NONE = 0,
57
+ RED_37_INCH = 1,
58
+ ORANGE_LARGE = 2,
59
+ YELLOW_MEDIUM = 3,
60
+ GREEN_SMALL = 4,
61
+ BLUE_F16 = 5
62
+ }
63
+
64
+
65
+ export enum WeighingFingers {
66
+ NONE = 0,
67
+ RED_MEDIUM = 1,
68
+ ORANGE_LARGE = 2,
69
+ ORANGE_LARGE_2 = 3,
70
+ BLUE_SMALL = 4,
71
+ BLUE_SMALL_2 = 5,
72
+ BLUE_SMALL_3 = 6,
73
+ BLUE_SMALL_4 = 7
74
+ }
75
+
76
+
77
+ export const exampleRecipe: RecipeData = {
78
+ linerType: "CKU",
79
+ tubeOuterDiameterMax: 38.1,
80
+ tubePartNumber: "11726650",
81
+ setpointSpeeds: [100, 150, 200],
82
+ setpointDiameters: [30.0, 28.5, 27.0],
83
+ setpointDistances: [100.0, 200.0, 300.0],
84
+ applicatorToolColorId: ApplicatorTools.RED_37_INCH,
85
+ applicatorToolColorString: "Red 3/7 Inch",
86
+ weighingFingerId: WeighingFingers.RED_MEDIUM,
87
+ weighingFingerString: "Red Medium",
88
+ numCameras: 2,
89
+ cameraIds: [CameraIds.CAMERA_1, CameraIds.CAMERA_2],
90
+ falseBottomStaysOpen: false,
91
+ };
92
+
93
+ const MAX_APPLICATOR_SETPOINTS = 10;
94
+ const MAX_CAMERAS = 3;
95
+ const MAX_NUM_RECIPES = 20;
96
+
97
+ export const initialRecipe: RecipeData = {
98
+ linerType: "",
99
+ tubeOuterDiameterMax: 0.0,
100
+ tubePartNumber: "",
101
+ setpointSpeeds: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
102
+ setpointDiameters: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
103
+ setpointDistances: Array(MAX_APPLICATOR_SETPOINTS).fill(0),
104
+ applicatorToolColorId: ApplicatorTools.NONE,
105
+ applicatorToolColorString: "",
106
+ weighingFingerId: WeighingFingers.NONE,
107
+ weighingFingerString: "",
108
+ numCameras: 0,
109
+ cameraIds: Array(MAX_CAMERAS).fill(CameraIds.NONE),
110
+ falseBottomStaysOpen: false,
111
+ };
112
+
113
+ export interface RecipeStore {
114
+ numRecipes: number;
115
+ recipes: RecipeData[];
116
+ }
117
+
118
+ export const initialRecipeStore: RecipeStore = {
119
+ numRecipes: 2,
120
+ recipes: Array(MAX_NUM_RECIPES).fill(exampleRecipe),
121
+ };
@@ -5,7 +5,7 @@ export * from "./BaseDevice";
5
5
  export * from "./Machine";
6
6
  export * from "./RackData";
7
7
  export * from "./GlobalConstants";
8
- export * from "./RecipeData";
8
+ export * from "./Recipe";
9
9
  export * from "./RecipeManagerFB";
10
10
  export * from "./UserManagerFB";
11
11
  export * from "./TaskQueue";
@@ -1,7 +0,0 @@
1
- export interface RecipeData {
2
- partName: string;
3
- extrusionType: number;
4
- extrusionLength_mm: number;
5
- ncProgramNumber: number;
6
- partWeight_kg: number;
7
- }