@kuriousdesign/machine-sdk 1.0.90 → 1.0.97

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.
@@ -25,6 +25,22 @@ export interface MachineCfg {
25
25
  ethernetAdapterList: number[];
26
26
  }
27
27
  export declare const initialMachineCfg: MachineCfg;
28
+ export interface SettingsExpert {
29
+ overridesEnabled: boolean;
30
+ autoLogoutTime: number;
31
+ expertStaysLoggedIn: boolean;
32
+ dryCycle: boolean;
33
+ }
34
+ export declare const initialSettingsExpert: SettingsExpert;
35
+ export interface SettingsAllUsers {
36
+ placeholderBool: boolean;
37
+ }
38
+ export declare const initialSettingsAllUsers: SettingsAllUsers;
39
+ export interface Settings {
40
+ allUsers: SettingsAllUsers;
41
+ expert: SettingsExpert;
42
+ }
43
+ export declare const initialSettings: Settings;
28
44
  export interface Machine {
29
45
  estopCircuit_OK: boolean;
30
46
  estopCircuitDelayed_OK: boolean;
@@ -49,6 +65,7 @@ export interface Machine {
49
65
  currentTimeMs: number;
50
66
  activeUserId: number;
51
67
  activeRecipe: RecipeData;
68
+ settings: Settings;
52
69
  }
53
70
  export interface LogRecordData {
54
71
  list: DebugLogData[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialMachine = exports.initialLogRecordData = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
3
+ exports.initialMachine = exports.initialLogRecordData = exports.initialSettings = exports.initialSettingsAllUsers = exports.initialSettingsExpert = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
4
4
  const _1 = require(".");
5
5
  const Part_1 = require("./Part");
6
6
  const GlobalConstants_1 = require("./GlobalConstants");
@@ -21,6 +21,21 @@ exports.initialMachineCfg = {
21
21
  apiOpcuaDeviceId: -1,
22
22
  ethernetAdapterList: [],
23
23
  };
24
+ exports.initialSettingsExpert = {
25
+ overridesEnabled: false,
26
+ autoLogoutTime: 15, // default to 15 minutes
27
+ //skipDeburrBottom: false,
28
+ //skipDeburrTop: false,
29
+ expertStaysLoggedIn: false,
30
+ dryCycle: false,
31
+ };
32
+ exports.initialSettingsAllUsers = {
33
+ placeholderBool: false,
34
+ };
35
+ exports.initialSettings = {
36
+ allUsers: { ...exports.initialSettingsAllUsers },
37
+ expert: { ...exports.initialSettingsExpert },
38
+ };
24
39
  exports.initialLogRecordData = {
25
40
  list: Array(GlobalConstants_1.GCs.NUM_ENTRIES_MACHINE_LOG).fill(null).map(() => ({ ..._1.initialDebugLogData })),
26
41
  lastIndex: 0,
@@ -50,4 +65,5 @@ exports.initialMachine = ({
50
65
  currentTimeMs: 0,
51
66
  activeUserId: 0,
52
67
  activeRecipe: { ..._1.initialRecipe },
68
+ settings: { ...exports.initialSettings },
53
69
  });
@@ -2,7 +2,6 @@ export interface JobData {
2
2
  activeRecipeIndex: number;
3
3
  jobName: string;
4
4
  tubeTypeString: string;
5
- activeBatchNumber: number;
6
5
  lotQty: number;
7
6
  goodCnt: number;
8
7
  scrapCnt: number;
@@ -12,6 +11,16 @@ export interface JobData {
12
11
  jobStartTime: bigint;
13
12
  jobEndTime: bigint;
14
13
  jobComplete: boolean;
14
+ activeBatchNumber: number;
15
+ batchId: string;
16
+ workOrderId: string;
17
+ lotId: string;
18
+ salesOrderId: string;
19
+ assemblyName: string;
20
+ assemblyNumber: string;
21
+ workInstruction: string;
22
+ operationNumber: string;
23
+ operatorId: string;
15
24
  }
16
25
  export declare const initialJobData: JobData;
17
26
  export interface ApplicatorSetpoint {
@@ -5,9 +5,8 @@ exports.getTubeTypeString = getTubeTypeString;
5
5
  const GlobalConstants_1 = require("./GlobalConstants");
6
6
  exports.initialJobData = {
7
7
  activeRecipeIndex: 0,
8
- jobName: "",
9
- tubeTypeString: "",
10
- activeBatchNumber: 0,
8
+ jobName: '',
9
+ tubeTypeString: '',
11
10
  lotQty: 0,
12
11
  goodCnt: 0,
13
12
  scrapCnt: 0,
@@ -16,7 +15,18 @@ exports.initialJobData = {
16
15
  setupCompleted: false,
17
16
  jobStartTime: BigInt(0),
18
17
  jobEndTime: BigInt(0),
19
- jobComplete: false
18
+ jobComplete: false,
19
+ activeBatchNumber: 0,
20
+ //heatId: '',
21
+ batchId: '',
22
+ workOrderId: '',
23
+ lotId: '',
24
+ salesOrderId: '',
25
+ assemblyName: '',
26
+ assemblyNumber: '',
27
+ workInstruction: '',
28
+ operationNumber: '',
29
+ operatorId: '',
20
30
  };
21
31
  exports.initialApplicatorSetpoint = {
22
32
  speed: 0,
@@ -1,11 +1,11 @@
1
1
  export declare enum DeviceId {
2
- NONE = 0,
2
+ NONE = 0,// Represents no device selected or invalid state
3
3
  SYS = 1,
4
4
  HMI = 2,
5
5
  SFTY = 3,
6
6
  CON = 4,
7
7
  DIAG = 5,
8
- RC = 6,
8
+ UDP = 6,//Robot Controller
9
9
  ROB = 10,
10
10
  ABB = 11,
11
11
  EOAT = 12,
@@ -10,7 +10,8 @@ var DeviceId;
10
10
  DeviceId[DeviceId["SFTY"] = 3] = "SFTY";
11
11
  DeviceId[DeviceId["CON"] = 4] = "CON";
12
12
  DeviceId[DeviceId["DIAG"] = 5] = "DIAG";
13
- DeviceId[DeviceId["RC"] = 6] = "RC";
13
+ DeviceId[DeviceId["UDP"] = 6] = "UDP";
14
+ // 0 - 9 ARE RESERVED FOR SYSTEM LEVEL STUFF
14
15
  DeviceId[DeviceId["ROB"] = 10] = "ROB";
15
16
  DeviceId[DeviceId["ABB"] = 11] = "ABB";
16
17
  DeviceId[DeviceId["EOAT"] = 12] = "EOAT";
@@ -64,7 +65,7 @@ function deviceIdToString(deviceId) {
64
65
  case DeviceId.SFTY: return "SFTY";
65
66
  case DeviceId.CON: return "CON";
66
67
  case DeviceId.DIAG: return "DIAG";
67
- case DeviceId.RC: return "RC";
68
+ case DeviceId.UDP: return "UDP";
68
69
  case DeviceId.ROB: return "ROB";
69
70
  case DeviceId.ABB: return "ABB";
70
71
  case DeviceId.EOAT: return "EOAT";
@@ -25,6 +25,7 @@ export declare const MachineTags: {
25
25
  ethercatMaster_OK: string;
26
26
  ethercatSlaves_OK: string;
27
27
  currentTimeMs: string;
28
+ settings: string;
28
29
  };
29
30
  export declare const DeviceTags: {
30
31
  Cfg: string;
@@ -45,6 +45,7 @@ exports.MachineTags = {
45
45
  ethercatMaster_OK: 'EthercatMaster_OK',
46
46
  ethercatSlaves_OK: 'EthercatSlaves_OK',
47
47
  currentTimeMs: 'CurrentTimeMs',
48
+ settings: 'Settings',
48
49
  };
49
50
  exports.DeviceTags = {
50
51
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.90",
3
+ "version": "1.0.97",
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",
@@ -68,6 +68,45 @@ export const initialMachineCfg: MachineCfg = {
68
68
  ethernetAdapterList: [],
69
69
  };
70
70
 
71
+
72
+
73
+ export interface SettingsExpert {
74
+ overridesEnabled: boolean;
75
+ autoLogoutTime: number; // expert user will be automatically logged-out after this time
76
+ //skipDeburrBottom: boolean; // skip deburr bottom
77
+ //skipDeburrTop: boolean; // skip deburr top
78
+ expertStaysLoggedIn: boolean;
79
+ dryCycle: boolean; // when true, this will run the machine through the cycle without dispensing or curing to allow for testing and setup
80
+ }
81
+
82
+ export const initialSettingsExpert: SettingsExpert = {
83
+ overridesEnabled: false,
84
+ autoLogoutTime: 15, // default to 15 minutes
85
+ //skipDeburrBottom: false,
86
+ //skipDeburrTop: false,
87
+ expertStaysLoggedIn: false,
88
+ dryCycle: false,
89
+ };
90
+
91
+
92
+
93
+ export interface SettingsAllUsers {
94
+ placeholderBool: boolean;
95
+ }
96
+ export const initialSettingsAllUsers: SettingsAllUsers = {
97
+ placeholderBool: false,
98
+ };
99
+
100
+ export interface Settings {
101
+ allUsers: SettingsAllUsers;
102
+ expert: SettingsExpert;
103
+ }
104
+
105
+ export const initialSettings: Settings = {
106
+ allUsers: { ...initialSettingsAllUsers },
107
+ expert: { ...initialSettingsExpert },
108
+ };
109
+
71
110
  export interface Machine {
72
111
  estopCircuit_OK: boolean;
73
112
  estopCircuitDelayed_OK: boolean;
@@ -93,6 +132,7 @@ export interface Machine {
93
132
  currentTimeMs: number;
94
133
  activeUserId: number;
95
134
  activeRecipe: RecipeData;
135
+ settings: Settings;
96
136
  }
97
137
 
98
138
  // TYPE LogRecordData :
@@ -137,4 +177,5 @@ export const initialMachine: Machine = ({
137
177
  currentTimeMs: 0,
138
178
  activeUserId: 0,
139
179
  activeRecipe: { ...initialRecipe},
180
+ settings: { ...initialSettings },
140
181
  });
@@ -2,27 +2,35 @@ import { GCs } from "./GlobalConstants";
2
2
 
3
3
 
4
4
  export interface JobData {
5
- activeRecipeIndex: number;
6
- jobName: string;
5
+ activeRecipeIndex: number; //used with Machine.RecipeStore.Recipes array
6
+ jobName: string; //this is the identifier for the specific job
7
7
  tubeTypeString: string;
8
- activeBatchNumber: number;
9
-
10
- lotQty: number;
11
- goodCnt: number;
12
- scrapCnt: number;
13
- setupStartTime: bigint;
14
- setupEndTime: bigint;
15
- setupCompleted: boolean;
16
- jobStartTime: bigint;
17
- jobEndTime: bigint;
8
+ lotQty: number; //how many parts you are supposed to make per the job request
9
+ goodCnt: number; //how many good parts you've completed since starting the job
10
+ scrapCnt: number; //how many parts you've scrapped since starting the job
11
+ setupStartTime: bigint; //timestamp
12
+ setupEndTime: bigint;//timestamp
13
+ setupCompleted: boolean;//status
14
+ jobStartTime: bigint;//timestamp
15
+ jobEndTime: bigint;//timestamp
18
16
  jobComplete: boolean;
17
+ activeBatchNumber: number; //this probably needs to change to activeHeatId
18
+ //heatId: string;
19
+ batchId: string;
20
+ workOrderId: string;
21
+ lotId: string;
22
+ salesOrderId: string;
23
+ assemblyName : string;
24
+ assemblyNumber : string;
25
+ workInstruction : string;
26
+ operationNumber : string;
27
+ operatorId: string; //uses collins employeeId
19
28
  }
20
29
 
21
30
  export const initialJobData: JobData = {
22
31
  activeRecipeIndex: 0,
23
- jobName: "",
24
- tubeTypeString: "",
25
- activeBatchNumber: 0,
32
+ jobName: '',
33
+ tubeTypeString: '',
26
34
  lotQty: 0,
27
35
  goodCnt: 0,
28
36
  scrapCnt: 0,
@@ -31,7 +39,18 @@ export const initialJobData: JobData = {
31
39
  setupCompleted: false,
32
40
  jobStartTime: BigInt(0),
33
41
  jobEndTime: BigInt(0),
34
- jobComplete: false
42
+ jobComplete: false,
43
+ activeBatchNumber: 0,
44
+ //heatId: '',
45
+ batchId: '',
46
+ workOrderId: '',
47
+ lotId: '',
48
+ salesOrderId: '',
49
+ assemblyName : '',
50
+ assemblyNumber : '',
51
+ workInstruction : '',
52
+ operationNumber : '',
53
+ operatorId: '',
35
54
  };
36
55
 
37
56
  export interface ApplicatorSetpoint {
@@ -54,29 +73,37 @@ export const initialApplicatorSetpoint: ApplicatorSetpoint = {
54
73
  export const initialApplicatorSetpoints: ApplicatorSetpoint[] = Array.from({ length: GCs.MAX_APPLICATOR_SETPOINTS }, () => initialApplicatorSetpoint);
55
74
 
56
75
  export interface RecipeData {
57
- index: number;
58
- dbId: string;
59
- nickname: string;
60
- linerPotPressure: number;
61
- linerTypeString: string;
76
+ index: number; //same as index in Machine.RecipeStore.Recipes
77
+ dbId: string; //mongodb identifier for recipe
78
+ nickname: string; //unique nickname for the recipe
79
+
80
+ // LINER DATA
81
+ linerPotPressure: number; //psi
82
+ linerTypeString: string; //display purposes only
62
83
  linerWeightMin: number;
63
84
  linerWeightMax: number;
64
- tubeTypeId: number;
65
- tubeTypeString: string;
66
- tubeOuterDiameterMax: number;
67
- tubeHeightMax: number;
68
- tubeMassKg: number;
69
- falseBottomStaysOpen: boolean;
85
+
86
+ // TUBE DATA
87
+ tubeTypeId: number; //ROBOT
88
+ tubeTypeString: string; //display purposes only
89
+ tubeOuterDiameterMax: number; //mm, used for robot offsets in fixture <ROBOT>
90
+ tubeHeightMax: number; //mm, used for approach to tubes and the pick position for weighing <ROBOT>
91
+ tubeMassKg: number; //kg, used for payload adjustment when gripping tubes
92
+ falseBottomStaysOpen: boolean; //this also determines if only the tall fixture is used or not <ROBOT>
93
+
94
+ // APPLICATOR SETPOINTS
70
95
  applicatorHasVariableSqueegee: boolean;
71
- measuredSqueegeeDiaAtSetpoint1: number;
72
- applicatorSetpoints: ApplicatorSetpoint[];
73
- applicatorPreloadPauseDuration: number;
74
- applicatorToolId: number;
96
+ measuredSqueegeeDiaAtSetpoint1: number;//set after calibration
97
+ applicatorSetpoints: ApplicatorSetpoint[]; // <ROBOT>
98
+ applicatorPreloadPauseDuration: number; //pause it takes after opening ball valve for the first move
99
+
100
+ // TOOLS
101
+ applicatorToolId: number; // <ROBOT> --> this would link to TCP number in the ABB Code
75
102
  applicatorToolString: string;
76
- applicatorCollisionPayloadOffset: number;
77
- cleanerId: number;
103
+ applicatorCollisionPayloadOffset: number; //kg, used to set the collision detection sensitivity during liner application, gripLoad cmd used to add artificial payload
104
+ cleanerId: number; // <ROBOT>
78
105
  cleanerString: string;
79
- weighingFingerId: number;
106
+ weighingFingerId: number; // <ROBOT> --> this would link to TCP number in the ABB Code
80
107
  weighingFingerString: string;
81
108
  cameraId: number;
82
109
  cameraString: string;
@@ -1,24 +1,25 @@
1
1
  export enum DeviceId {
2
- NONE = 0,
3
- SYS = 1,
4
- HMI = 2,
5
- SFTY = 3,
6
- CON = 4,
7
- DIAG = 5,
8
- RC = 6,
9
-
10
- ROB = 10,
11
- ABB = 11,
12
- EOAT = 12,
13
- VIS = 13,
14
- FIX_T = 14,
15
- FIX_S = 15,
16
- CLAMP_T = 16,
17
- CLAMP_S = 17,
18
- FLSB_T = 18,
19
- FLSB_S = 19,
20
- POT = 20,
21
- SQUEE = 21,
2
+ NONE = 0, // Represents no device selected or invalid state
3
+ SYS = 1,
4
+ HMI = 2,
5
+ SFTY = 3,
6
+ CON = 4,
7
+ DIAG = 5,
8
+ UDP = 6, //Robot Controller
9
+ // 0 - 9 ARE RESERVED FOR SYSTEM LEVEL STUFF
10
+
11
+ ROB = 10,
12
+ ABB = 11,
13
+ EOAT = 12,
14
+ VIS = 13,
15
+ FIX_T = 14,
16
+ FIX_S = 15,
17
+ CLAMP_T = 16,
18
+ CLAMP_S = 17,
19
+ FLSB_T = 18,
20
+ FLSB_S = 19,
21
+ POT = 20,
22
+ SQUEE = 21,
22
23
  GRIP = 22,
23
24
  WEIGH = 23,
24
25
 
@@ -66,7 +67,7 @@ export function deviceIdToString(deviceId: DeviceId | number): string {
66
67
  case DeviceId.SFTY: return "SFTY";
67
68
  case DeviceId.CON: return "CON";
68
69
  case DeviceId.DIAG: return "DIAG";
69
- case DeviceId.RC: return "RC";
70
+ case DeviceId.UDP: return "UDP";
70
71
  case DeviceId.ROB: return "ROB";
71
72
  case DeviceId.ABB: return "ABB";
72
73
  case DeviceId.EOAT: return "EOAT";
@@ -30,6 +30,7 @@ export const MachineTags = {
30
30
  ethercatMaster_OK: 'EthercatMaster_OK',
31
31
  ethercatSlaves_OK: 'EthercatSlaves_OK',
32
32
  currentTimeMs: 'CurrentTimeMs',
33
+ settings: 'Settings',
33
34
  }
34
35
 
35
36
  export const DeviceTags = {