@kuriousdesign/machine-sdk 1.0.65 → 1.0.70

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.
Files changed (78) hide show
  1. package/.github/workflows/publish.yml +28 -0
  2. package/README.md +28 -51
  3. package/dist/custom-types/BaseDevice/Device.d.ts +1 -1
  4. package/dist/custom-types/BaseDevice/Device.js +1 -1
  5. package/dist/custom-types/BaseDevice/index.d.ts +1 -0
  6. package/dist/custom-types/BaseDevice/index.js +1 -0
  7. package/dist/custom-types/Devices/Conductor.js +0 -1
  8. package/dist/custom-types/Devices/index.d.ts +0 -2
  9. package/dist/custom-types/Devices/index.js +0 -2
  10. package/dist/custom-types/Recipe.d.ts +1 -0
  11. package/dist/custom-types/Recipe.js +2 -0
  12. package/package.json +1 -1
  13. package/src/abb/enums/GCs.mod +44 -44
  14. package/src/abb/enums/PartLocationIds.mod +13 -13
  15. package/src/abb/enums/RobTasks.mod +18 -18
  16. package/src/abb/enums/States.mod +20 -20
  17. package/src/abb/procs/MainModule.mod +188 -188
  18. package/src/abb/records/DeviceDataTypes.mod +35 -35
  19. package/src/custom-types/AppState.ts +115 -115
  20. package/src/custom-types/BaseDevice/Actions.ts +45 -45
  21. package/src/custom-types/BaseDevice/ApiOpcua.ts +71 -71
  22. package/src/custom-types/BaseDevice/Device.ts +224 -224
  23. package/src/custom-types/BaseDevice/DeviceCmds.ts +45 -45
  24. package/src/custom-types/BaseDevice/DeviceConstants.ts +9 -9
  25. package/src/custom-types/{Devices → BaseDevice}/DeviceTypes.ts +60 -60
  26. package/src/custom-types/BaseDevice/Processes.ts +38 -38
  27. package/src/custom-types/BaseDevice/index.ts +7 -6
  28. package/src/custom-types/Bridge.ts +8 -8
  29. package/src/custom-types/Com.ts +19 -19
  30. package/src/custom-types/Devices/Axis.ts +222 -222
  31. package/src/custom-types/Devices/Conductor.ts +14 -14
  32. package/src/custom-types/Devices/Pot.ts +24 -24
  33. package/src/custom-types/Devices/Robot.ts +208 -208
  34. package/src/custom-types/Devices/index.ts +3 -4
  35. package/src/custom-types/GlobalConstants.ts +98 -98
  36. package/src/custom-types/HMI.ts +52 -52
  37. package/src/custom-types/Machine.ts +130 -130
  38. package/src/custom-types/Part.ts +238 -238
  39. package/src/custom-types/RackData.ts +22 -22
  40. package/src/custom-types/Recipe.ts +250 -247
  41. package/src/custom-types/RecipeManagerFB.ts +10 -10
  42. package/src/custom-types/TaskQueue.ts +86 -86
  43. package/src/custom-types/UserManagerFB.ts +7 -7
  44. package/src/custom-types/index.ts +14 -14
  45. package/src/enums/Colors.ts +79 -79
  46. package/src/enums/DeviceId.ts +116 -116
  47. package/src/enums/ExtrusionType.ts +5 -5
  48. package/src/enums/OpcuaDatatype.ts +27 -27
  49. package/src/enums/Pages.ts +21 -21
  50. package/src/enums/States.ts +173 -173
  51. package/src/enums/TaskId.ts +37 -37
  52. package/src/enums/index.ts +9 -9
  53. package/src/functions/colorMapping.ts +43 -43
  54. package/src/functions/index.ts +2 -2
  55. package/src/functions/mqtt-helpers.ts +20 -20
  56. package/src/functions/topicMapping.ts +6 -6
  57. package/src/index.ts +3 -3
  58. package/src/plc-tags/index.ts +38 -38
  59. package/src/plc-tags/mqtt.ts +9 -9
  60. package/src/plc-tags/opcua.ts +3 -3
  61. package/src/styles/animations.css +15 -15
  62. package/tsconfig.json +13 -13
  63. package/dist/custom-types/Devices/Device.d.ts +0 -111
  64. package/dist/custom-types/Devices/Device.js +0 -108
  65. package/dist/custom-types/PartData.d.ts +0 -11
  66. package/dist/custom-types/PartData.js +0 -2
  67. package/dist/custom-types/RecipeData.d.ts +0 -7
  68. package/dist/custom-types/RecipeData.js +0 -2
  69. package/dist/enums/Errors.d.ts +0 -6
  70. package/dist/enums/Errors.js +0 -28
  71. package/dist/enums/Priorities.d.ts +0 -18
  72. package/dist/enums/Priorities.js +0 -24
  73. package/dist/enums/RobPositions.d.ts +0 -12
  74. package/dist/enums/RobPositions.js +0 -16
  75. package/dist/enums/Warnings.d.ts +0 -6
  76. package/dist/enums/Warnings.js +0 -18
  77. /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.d.ts +0 -0
  78. /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.js +0 -0
@@ -1,52 +1,52 @@
1
- import { FaultCodeData } from "./Machine";
2
- import { BannerMode, Color, States, VisibilityState } from "..";
3
-
4
-
5
- export interface ComponentAnimation {
6
- visibility: VisibilityState; //enum
7
- needsExpertUser: boolean; //requires expert user to be active user in order to function
8
- backgroundColor: Color; //enum
9
- accentColor: Color; //enum
10
- fontColor: Color; //enum
11
- wasClicked: boolean; //this is set by the UI and reset by the PLC
12
- }
13
-
14
- export interface ButtonBar {
15
- stopBtn: ComponentAnimation;
16
- unloadBtn: ComponentAnimation;
17
- loadBtn: ComponentAnimation;
18
- unlockBtn: ComponentAnimation;
19
- startBtn: ComponentAnimation;
20
- lockBtn: ComponentAnimation;
21
- resetBtn: ComponentAnimation;
22
- jobChangeBtn: ComponentAnimation;
23
- clearFaultsBtn: ComponentAnimation;
24
- energizeBtn: ComponentAnimation;
25
- }
26
-
27
- export interface StatusBar {
28
- jobName: string;
29
- statusMsg: States;
30
- status: number;
31
- cncTimeLeft: number[]; // get the second element in the array
32
- goodCnt: number;
33
- batchQty: number;
34
- dateAndTime: string; //format : 1970-01-01T00:00:00.000Z
35
- bannerMode: BannerMode;
36
- faultCodeData: FaultCodeData;
37
- }
38
-
39
- export interface RackHmiPbs {
40
- editRawShelfBtn: ComponentAnimation;
41
- editDoneShelfBtn: ComponentAnimation;
42
- cancelBtn: ComponentAnimation;
43
- saveBtn: ComponentAnimation;
44
- }
45
-
46
- export interface HmiData {
47
- buttonBar: ButtonBar;
48
- statusBar: StatusBar;
49
- rackPbs: RackHmiPbs;
50
- heartbeatPLC: number;
51
- heartbeatHMI: number;
52
- }
1
+ import { FaultCodeData } from "./Machine";
2
+ import { BannerMode, Color, States, VisibilityState } from "..";
3
+
4
+
5
+ export interface ComponentAnimation {
6
+ visibility: VisibilityState; //enum
7
+ needsExpertUser: boolean; //requires expert user to be active user in order to function
8
+ backgroundColor: Color; //enum
9
+ accentColor: Color; //enum
10
+ fontColor: Color; //enum
11
+ wasClicked: boolean; //this is set by the UI and reset by the PLC
12
+ }
13
+
14
+ export interface ButtonBar {
15
+ stopBtn: ComponentAnimation;
16
+ unloadBtn: ComponentAnimation;
17
+ loadBtn: ComponentAnimation;
18
+ unlockBtn: ComponentAnimation;
19
+ startBtn: ComponentAnimation;
20
+ lockBtn: ComponentAnimation;
21
+ resetBtn: ComponentAnimation;
22
+ jobChangeBtn: ComponentAnimation;
23
+ clearFaultsBtn: ComponentAnimation;
24
+ energizeBtn: ComponentAnimation;
25
+ }
26
+
27
+ export interface StatusBar {
28
+ jobName: string;
29
+ statusMsg: States;
30
+ status: number;
31
+ cncTimeLeft: number[]; // get the second element in the array
32
+ goodCnt: number;
33
+ batchQty: number;
34
+ dateAndTime: string; //format : 1970-01-01T00:00:00.000Z
35
+ bannerMode: BannerMode;
36
+ faultCodeData: FaultCodeData;
37
+ }
38
+
39
+ export interface RackHmiPbs {
40
+ editRawShelfBtn: ComponentAnimation;
41
+ editDoneShelfBtn: ComponentAnimation;
42
+ cancelBtn: ComponentAnimation;
43
+ saveBtn: ComponentAnimation;
44
+ }
45
+
46
+ export interface HmiData {
47
+ buttonBar: ButtonBar;
48
+ statusBar: StatusBar;
49
+ rackPbs: RackHmiPbs;
50
+ heartbeatPLC: number;
51
+ heartbeatHMI: number;
52
+ }
@@ -1,130 +1,130 @@
1
- import { ComponentAnimation, DebugLogData, DeviceConstants, DeviceRegistration, initialDebugLogData, initialRecipeStore, initialTaskQueue, RecipeStore, TaskQueue } from ".";
2
- import { initialPartDataStatus, PartDataStatus } from "./Part";
3
- import { GCs } from "./GlobalConstants";
4
-
5
-
6
- export interface UserData {
7
- activeUser: number;
8
- hmiLoginBtn: ComponentAnimation;
9
- hmiLogoutBtn: ComponentAnimation;
10
- }
11
-
12
- export interface FaultCodeData {
13
- deviceId: number;
14
- code: number;
15
- }
16
-
17
- export const initialFaultCodeData: FaultCodeData = {
18
- deviceId: 0,
19
- code: 0,
20
- };
21
-
22
- export interface SystemFaultData {
23
- list: FaultCodeData[];
24
- present: boolean;
25
- }
26
-
27
- export const initialSystemFaultData: SystemFaultData = {
28
- list: Array(DeviceConstants.DEVICE_FAULTCODEARRAY_LEN).fill(null).map(() => ({ ...initialFaultCodeData })),
29
- present: false,
30
- };
31
-
32
-
33
-
34
- // TYPE MachineCfg :
35
- // STRUCT
36
- // FirmwareVersion: STRING;
37
- // CellType: CellTypes;
38
- // SoftwareMode: SoftwareModes;
39
- // AllowAnonymousControl: BOOL;
40
- // DeviceIsBypassed: ARRAY[0..(GCs.NUM_DEVICES-1)] OF BOOL; //used to set devices to be bypassed or not
41
- // ApiOpcuaDeviceId:INT; //designates which device is using the opcua api
42
- // EthernetAdapterList: ARRAY[0..4] OF INT;
43
- // //SerialNumber: STRING(255); moved to ControllerInstanceData
44
- // //Name: STRING; moved to ControllerInstanceData
45
- // //Location: STRING; moved to ControllerInstanceData
46
-
47
- // END_STRUCT
48
- // END_TYPE
49
-
50
-
51
- export interface MachineCfg {
52
- firmwareVersion: string;
53
- cellType: string;
54
- softwareMode: string;
55
- allowAnonymousControl: boolean;
56
- deviceIsBypassed: boolean[];
57
- apiOpcuaDeviceId: number;
58
- ethernetAdapterList: number[];
59
- }
60
-
61
- export const initialMachineCfg: MachineCfg = {
62
- firmwareVersion: "",
63
- cellType: "",
64
- softwareMode: "",
65
- allowAnonymousControl: false,
66
- deviceIsBypassed: [],
67
- apiOpcuaDeviceId: -1,
68
- ethernetAdapterList: [],
69
- };
70
-
71
- export interface Machine {
72
- estopCircuit_OK: boolean;
73
- estopCircuitDelayed_OK: boolean;
74
- fenceCircuit_OK: boolean;
75
- guardDoors_LOCKED: boolean;
76
- networkHealth_OK: boolean;
77
- ethercatMaster_OK: boolean;
78
- ethercatSlaves_OK: boolean;
79
- supplyAir_OK: boolean;
80
- cfg: MachineCfg;
81
- pdmSts: PartDataStatus;
82
- errors: SystemFaultData;
83
- warnings: SystemFaultData;
84
- taskQueue: TaskQueue;
85
- registeredDevices: DeviceRegistration[];
86
- heartbeatPlc: number;
87
- heartbeatHmi: number;
88
- machineLog: LogRecordData;
89
- recipeStore: RecipeStore;
90
- //deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
91
- }
92
-
93
- // TYPE LogRecordData :
94
- // STRUCT
95
- // List: ARRAY[0..DiagConstants.NUM_ENTRIES_RECORDED_LOG-1] OF DebugLogData;
96
- // LastIndex:USINT; //index of the most recent recorde entries
97
- // END_STRUCT
98
- // END_TYPE
99
-
100
- export interface LogRecordData {
101
- list: DebugLogData[];
102
- lastIndex: number; // index of the most recent recorded entries
103
- }
104
-
105
- export const initialLogRecordData: LogRecordData = {
106
- list: Array(GCs.NUM_ENTRIES_MACHINE_LOG).fill(null).map(() => ({ ...initialDebugLogData })),
107
- lastIndex: 0,
108
- };
109
-
110
- export const initialMachine: Machine = ({
111
- estopCircuit_OK: false,
112
- estopCircuitDelayed_OK: false,
113
- fenceCircuit_OK: false,
114
- guardDoors_LOCKED: false,
115
- networkHealth_OK: false,
116
- ethercatMaster_OK: false,
117
- ethercatSlaves_OK: false,
118
- supplyAir_OK: false,
119
- cfg: { ...initialMachineCfg },
120
- pdmSts: initialPartDataStatus,
121
- errors: { ...initialSystemFaultData },
122
- warnings: { ...initialSystemFaultData },
123
- taskQueue: { ...initialTaskQueue },
124
- registeredDevices: [],
125
- heartbeatPlc: 0,
126
- heartbeatHmi: 0,
127
- machineLog: { ...initialLogRecordData },
128
- recipeStore: { ...initialRecipeStore },
129
- //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
130
- });
1
+ import { ComponentAnimation, DebugLogData, DeviceConstants, DeviceRegistration, initialDebugLogData, initialRecipeStore, initialTaskQueue, RecipeStore, TaskQueue } from ".";
2
+ import { initialPartDataStatus, PartDataStatus } from "./Part";
3
+ import { GCs } from "./GlobalConstants";
4
+
5
+
6
+ export interface UserData {
7
+ activeUser: number;
8
+ hmiLoginBtn: ComponentAnimation;
9
+ hmiLogoutBtn: ComponentAnimation;
10
+ }
11
+
12
+ export interface FaultCodeData {
13
+ deviceId: number;
14
+ code: number;
15
+ }
16
+
17
+ export const initialFaultCodeData: FaultCodeData = {
18
+ deviceId: 0,
19
+ code: 0,
20
+ };
21
+
22
+ export interface SystemFaultData {
23
+ list: FaultCodeData[];
24
+ present: boolean;
25
+ }
26
+
27
+ export const initialSystemFaultData: SystemFaultData = {
28
+ list: Array(DeviceConstants.DEVICE_FAULTCODEARRAY_LEN).fill(null).map(() => ({ ...initialFaultCodeData })),
29
+ present: false,
30
+ };
31
+
32
+
33
+
34
+ // TYPE MachineCfg :
35
+ // STRUCT
36
+ // FirmwareVersion: STRING;
37
+ // CellType: CellTypes;
38
+ // SoftwareMode: SoftwareModes;
39
+ // AllowAnonymousControl: BOOL;
40
+ // DeviceIsBypassed: ARRAY[0..(GCs.NUM_DEVICES-1)] OF BOOL; //used to set devices to be bypassed or not
41
+ // ApiOpcuaDeviceId:INT; //designates which device is using the opcua api
42
+ // EthernetAdapterList: ARRAY[0..4] OF INT;
43
+ // //SerialNumber: STRING(255); moved to ControllerInstanceData
44
+ // //Name: STRING; moved to ControllerInstanceData
45
+ // //Location: STRING; moved to ControllerInstanceData
46
+
47
+ // END_STRUCT
48
+ // END_TYPE
49
+
50
+
51
+ export interface MachineCfg {
52
+ firmwareVersion: string;
53
+ cellType: string;
54
+ softwareMode: string;
55
+ allowAnonymousControl: boolean;
56
+ deviceIsBypassed: boolean[];
57
+ apiOpcuaDeviceId: number;
58
+ ethernetAdapterList: number[];
59
+ }
60
+
61
+ export const initialMachineCfg: MachineCfg = {
62
+ firmwareVersion: "",
63
+ cellType: "",
64
+ softwareMode: "",
65
+ allowAnonymousControl: false,
66
+ deviceIsBypassed: [],
67
+ apiOpcuaDeviceId: -1,
68
+ ethernetAdapterList: [],
69
+ };
70
+
71
+ export interface Machine {
72
+ estopCircuit_OK: boolean;
73
+ estopCircuitDelayed_OK: boolean;
74
+ fenceCircuit_OK: boolean;
75
+ guardDoors_LOCKED: boolean;
76
+ networkHealth_OK: boolean;
77
+ ethercatMaster_OK: boolean;
78
+ ethercatSlaves_OK: boolean;
79
+ supplyAir_OK: boolean;
80
+ cfg: MachineCfg;
81
+ pdmSts: PartDataStatus;
82
+ errors: SystemFaultData;
83
+ warnings: SystemFaultData;
84
+ taskQueue: TaskQueue;
85
+ registeredDevices: DeviceRegistration[];
86
+ heartbeatPlc: number;
87
+ heartbeatHmi: number;
88
+ machineLog: LogRecordData;
89
+ recipeStore: RecipeStore;
90
+ //deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
91
+ }
92
+
93
+ // TYPE LogRecordData :
94
+ // STRUCT
95
+ // List: ARRAY[0..DiagConstants.NUM_ENTRIES_RECORDED_LOG-1] OF DebugLogData;
96
+ // LastIndex:USINT; //index of the most recent recorde entries
97
+ // END_STRUCT
98
+ // END_TYPE
99
+
100
+ export interface LogRecordData {
101
+ list: DebugLogData[];
102
+ lastIndex: number; // index of the most recent recorded entries
103
+ }
104
+
105
+ export const initialLogRecordData: LogRecordData = {
106
+ list: Array(GCs.NUM_ENTRIES_MACHINE_LOG).fill(null).map(() => ({ ...initialDebugLogData })),
107
+ lastIndex: 0,
108
+ };
109
+
110
+ export const initialMachine: Machine = ({
111
+ estopCircuit_OK: false,
112
+ estopCircuitDelayed_OK: false,
113
+ fenceCircuit_OK: false,
114
+ guardDoors_LOCKED: false,
115
+ networkHealth_OK: false,
116
+ ethercatMaster_OK: false,
117
+ ethercatSlaves_OK: false,
118
+ supplyAir_OK: false,
119
+ cfg: { ...initialMachineCfg },
120
+ pdmSts: initialPartDataStatus,
121
+ errors: { ...initialSystemFaultData },
122
+ warnings: { ...initialSystemFaultData },
123
+ taskQueue: { ...initialTaskQueue },
124
+ registeredDevices: [],
125
+ heartbeatPlc: 0,
126
+ heartbeatHmi: 0,
127
+ machineLog: { ...initialLogRecordData },
128
+ recipeStore: { ...initialRecipeStore },
129
+ //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
130
+ });