@kuriousdesign/machine-sdk 1.0.65 → 1.0.69

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 (77) 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/index.d.ts +0 -2
  8. package/dist/custom-types/Devices/index.js +0 -2
  9. package/dist/custom-types/Recipe.d.ts +1 -0
  10. package/dist/custom-types/Recipe.js +2 -0
  11. package/package.json +1 -1
  12. package/src/abb/enums/GCs.mod +44 -44
  13. package/src/abb/enums/PartLocationIds.mod +13 -13
  14. package/src/abb/enums/RobTasks.mod +18 -18
  15. package/src/abb/enums/States.mod +20 -20
  16. package/src/abb/procs/MainModule.mod +188 -188
  17. package/src/abb/records/DeviceDataTypes.mod +35 -35
  18. package/src/custom-types/AppState.ts +115 -115
  19. package/src/custom-types/BaseDevice/Actions.ts +45 -45
  20. package/src/custom-types/BaseDevice/ApiOpcua.ts +71 -71
  21. package/src/custom-types/BaseDevice/Device.ts +224 -224
  22. package/src/custom-types/BaseDevice/DeviceCmds.ts +45 -45
  23. package/src/custom-types/BaseDevice/DeviceConstants.ts +9 -9
  24. package/src/custom-types/{Devices → BaseDevice}/DeviceTypes.ts +60 -60
  25. package/src/custom-types/BaseDevice/Processes.ts +38 -38
  26. package/src/custom-types/BaseDevice/index.ts +7 -6
  27. package/src/custom-types/Bridge.ts +8 -8
  28. package/src/custom-types/Com.ts +19 -19
  29. package/src/custom-types/Devices/Axis.ts +222 -222
  30. package/src/custom-types/Devices/Conductor.ts +14 -14
  31. package/src/custom-types/Devices/Pot.ts +24 -24
  32. package/src/custom-types/Devices/Robot.ts +208 -208
  33. package/src/custom-types/Devices/index.ts +3 -4
  34. package/src/custom-types/GlobalConstants.ts +98 -98
  35. package/src/custom-types/HMI.ts +52 -52
  36. package/src/custom-types/Machine.ts +130 -130
  37. package/src/custom-types/Part.ts +238 -238
  38. package/src/custom-types/RackData.ts +22 -22
  39. package/src/custom-types/Recipe.ts +250 -247
  40. package/src/custom-types/RecipeManagerFB.ts +10 -10
  41. package/src/custom-types/TaskQueue.ts +86 -86
  42. package/src/custom-types/UserManagerFB.ts +7 -7
  43. package/src/custom-types/index.ts +14 -14
  44. package/src/enums/Colors.ts +79 -79
  45. package/src/enums/DeviceId.ts +116 -116
  46. package/src/enums/ExtrusionType.ts +5 -5
  47. package/src/enums/OpcuaDatatype.ts +27 -27
  48. package/src/enums/Pages.ts +21 -21
  49. package/src/enums/States.ts +173 -173
  50. package/src/enums/TaskId.ts +37 -37
  51. package/src/enums/index.ts +9 -9
  52. package/src/functions/colorMapping.ts +43 -43
  53. package/src/functions/index.ts +2 -2
  54. package/src/functions/mqtt-helpers.ts +20 -20
  55. package/src/functions/topicMapping.ts +6 -6
  56. package/src/index.ts +3 -3
  57. package/src/plc-tags/index.ts +38 -38
  58. package/src/plc-tags/mqtt.ts +9 -9
  59. package/src/plc-tags/opcua.ts +3 -3
  60. package/src/styles/animations.css +15 -15
  61. package/tsconfig.json +13 -13
  62. package/dist/custom-types/Devices/Device.d.ts +0 -111
  63. package/dist/custom-types/Devices/Device.js +0 -108
  64. package/dist/custom-types/PartData.d.ts +0 -11
  65. package/dist/custom-types/PartData.js +0 -2
  66. package/dist/custom-types/RecipeData.d.ts +0 -7
  67. package/dist/custom-types/RecipeData.js +0 -2
  68. package/dist/enums/Errors.d.ts +0 -6
  69. package/dist/enums/Errors.js +0 -28
  70. package/dist/enums/Priorities.d.ts +0 -18
  71. package/dist/enums/Priorities.js +0 -24
  72. package/dist/enums/RobPositions.d.ts +0 -12
  73. package/dist/enums/RobPositions.js +0 -16
  74. package/dist/enums/Warnings.d.ts +0 -6
  75. package/dist/enums/Warnings.js +0 -18
  76. /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.d.ts +0 -0
  77. /package/dist/custom-types/{Devices → BaseDevice}/DeviceTypes.js +0 -0
@@ -0,0 +1,28 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ permissions:
9
+ id-token: write # Required for OIDC
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - uses: actions/setup-node@v4
19
+ with:
20
+ node-version: '22'
21
+ registry-url: 'https://registry.npmjs.org'
22
+
23
+ # Ensure npm 11.5.1 or later is installed
24
+ - name: Update npm
25
+ run: npm install -g npm@latest
26
+ - run: npm ci
27
+ - run: npm run build --if-present
28
+ - run: npm publish
package/README.md CHANGED
@@ -1,51 +1,28 @@
1
- # adding new opcua tags
2
- don't forget that tags need to start with lowercase
3
-
4
-
5
- # npm install @kuriousdesign/machine-sdk
6
- A shared SDK for data types and helper functions used in machine-related repositories.
7
-
8
- # Publishing to npm
9
- first, commit you git changes
10
- npm login (if not already)
11
- npm version patch # 1.0.0 → 1.0.1
12
- npm version minor # 1.0.0 → 1.1.0
13
- npm version major # 1.0.0 → 2.0.0
14
- npm publish
15
-
16
-
17
- # Installation
18
- npm install @kuriousdesign/machine-sdk@latest
19
-
20
- Usage
21
- import { Machine, formatTimestamp, isMachineActive } from '@kuriousdesign/machine-sdk';
22
-
23
- // Example: Machine data
24
- const machine: Machine = {
25
- id: 'M001',
26
- name: 'Conveyor',
27
- status: 'running',
28
- lastUpdated: new Date()
29
- };
30
-
31
- // Format timestamp
32
- console.log(formatTimestamp(machine.lastUpdated)); // e.g., "2025-08-15T22:23:00.000Z"
33
-
34
- // Check if machine is active
35
- console.log(isMachineActive(machine)); // true
36
-
37
- API
38
- Data Types
39
-
40
- Machine: Represents a machine with id, name, status, and lastUpdated.
41
- SensorData: Represents sensor readings with machineId, temperature, pressure, and timestamp.
42
-
43
- Helper Functions
44
-
45
- formatTimestamp(date: Date): string: Formats a Date to ISO string.
46
- isMachineActive(machine: Machine): boolean: Checks if a machine is running.
47
- calculateAverageTemperature(data: SensorData[]): number: Computes average temperature.
48
- validateMachineId(id: string): boolean: Validates a machine ID format.
49
-
50
- License
51
- MIT
1
+ # adding new opcua tags
2
+ don't forget that tags need to start with lowercase
3
+
4
+
5
+ # npm install @kuriousdesign/machine-sdk
6
+ A shared SDK for data types and helper functions used in machine-related repositories.
7
+
8
+ # Publishing to npm
9
+ first, commit you git changes
10
+ npm login (if not already)
11
+ npm version patch # 1.0.0 → 1.0.1
12
+ npm version minor # 1.0.0 → 1.1.0
13
+ npm version major # 1.0.0 → 2.0.0
14
+ npm publish
15
+
16
+
17
+ # Installation
18
+ npm install @kuriousdesign/machine-sdk@latest
19
+
20
+ Usage
21
+ import { Machine, formatTimestamp, isMachineActive } from '@kuriousdesign/machine-sdk';
22
+
23
+ # npm registry codes for trusted publishers
24
+ 50d6d0fc3dfbe9e405a3df45959751ac4efdec8eaf718e05d390ff5ee4ac28c8
25
+ d9e930bb97999f5b204a6f449e499906a936b57f18350ce4bc1ada267c9207c3
26
+ 07345eb11da75e1e050ddb07e81914975e90533f015567ed524f40073dedf99e
27
+ 3fb598a51fe5ead322e02a55755d19bb8790a8a886ed33c06efe020b479a27e2
28
+ 82876e59bb316170f05a92ca16b86276ccd4e31d8b272c55d79cd537aebeb631
@@ -1,4 +1,4 @@
1
- import { DeviceTypes } from '../Devices/DeviceTypes';
1
+ import { DeviceTypes } from './DeviceTypes';
2
2
  import { ProcessData } from './Processes';
3
3
  import { ApiOpcuaData } from './ApiOpcua';
4
4
  export interface DebugLogData {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initialDevice = exports.initialSts = exports.initialDeviceStatus = exports.initialDeviceFaultData = exports.initialFaultData = exports.initialDeviceCfg = exports.initialDeviceRegistration = exports.initialDeviceLogData = exports.initialDebugLogData = void 0;
4
- const DeviceTypes_1 = require("../Devices/DeviceTypes");
4
+ const DeviceTypes_1 = require("./DeviceTypes");
5
5
  const Processes_1 = require("./Processes");
6
6
  const DeviceConstants_1 = require("./DeviceConstants");
7
7
  const ApiOpcua_1 = require("./ApiOpcua");
@@ -4,3 +4,4 @@ export * from "./Device";
4
4
  export * from "./DeviceConstants";
5
5
  export * from "./Processes";
6
6
  export * from "./DeviceCmds";
7
+ export * from "./DeviceTypes";
@@ -20,3 +20,4 @@ __exportStar(require("./Device"), exports);
20
20
  __exportStar(require("./DeviceConstants"), exports);
21
21
  __exportStar(require("./Processes"), exports);
22
22
  __exportStar(require("./DeviceCmds"), exports);
23
+ __exportStar(require("./DeviceTypes"), exports);
@@ -1,5 +1,3 @@
1
1
  export * from "./Axis";
2
- export * from "../BaseDevice/Device";
3
- export * from "./DeviceTypes";
4
2
  export * from "./Robot";
5
3
  export * from "./Pot";
@@ -15,7 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Axis"), exports);
18
- __exportStar(require("../BaseDevice/Device"), exports);
19
- __exportStar(require("./DeviceTypes"), exports);
20
18
  __exportStar(require("./Robot"), exports);
21
19
  __exportStar(require("./Pot"), exports);
@@ -26,6 +26,7 @@ export interface RecipeData {
26
26
  tubeTypeId: number;
27
27
  tubeTypeString: string;
28
28
  tubeOuterDiameterMax: number;
29
+ tubeHeightMax: number;
29
30
  falseBottomStaysOpen: boolean;
30
31
  linerPotPressure: number;
31
32
  linerTypeString: string;
@@ -136,6 +136,7 @@ exports.exampleRecipe = {
136
136
  tubeTypeId: TubeTypes.TYPE_1340_38,
137
137
  tubeTypeString: "1340-38",
138
138
  tubeOuterDiameterMax: 38.1,
139
+ tubeHeightMax: 100, // example value in mm
139
140
  falseBottomStaysOpen: false,
140
141
  applicatorSetpoints: exports.exampleApplicatorSetpoints,
141
142
  applicatorToolId: ApplicatorTools.RED_37_INCH,
@@ -155,6 +156,7 @@ exports.initialRecipe = {
155
156
  tubeOuterDiameterMax: 0.0,
156
157
  tubeTypeId: TubeTypes.NONE,
157
158
  tubeTypeString: "",
159
+ tubeHeightMax: 0, // example value in mm
158
160
  linerPotPressure: 0,
159
161
  applicatorSetpoints: exports.initialApplicatorSetpoints,
160
162
  applicatorToolId: ApplicatorTools.NONE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.65",
3
+ "version": "1.0.69",
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,44 +1,44 @@
1
- MODULE Globals
2
-
3
- ! Axes & device counts
4
- CONST num NUM_AXES := 20;
5
- CONST num MAX_NUM_NAUTILUS_AXES := 20;
6
- CONST num NUM_DEVICES := 50;
7
-
8
- ! Timing & durations
9
- CONST clock MOMENTARY_PB := T#250MS;
10
- CONST num DEFAULT_TASK_DURATION_SEC := 5;
11
-
12
- ! Robot & part counts
13
- CONST num ROBOT_PART_COUNT := 2;
14
- CONST num RECIPE_COUNT_MAX := 20;
15
- CONST bool HIDE_LEFT_TWO_COLUMNS := TRUE;
16
- CONST bool HIDE_RIGHT_COLUMN := TRUE;
17
- CONST bool HIDE_LEFT_ONE_COLUMN := FALSE;
18
- CONST num SHELF_PART_COUNT := 100;
19
- CONST num NUM_OF_COLS := 20;
20
- CONST num PARTS_IN_COL := 5;
21
- CONST num NUM_PARTS_XFER := 10;
22
- CONST num NUM_PARTS_IB := 51;
23
- CONST num NUM_PARTS_PER_FIXTURE := 8;
24
-
25
- ! Logging & tasks
26
- CONST num NUM_LOG_ENTRIES := 25;
27
- CONST num TASK_LIST_LEN := 25;
28
- CONST num TASK_STORE_LEN := 125; ! 100 + TASK_LIST_LEN
29
- CONST num TASK_LOG_LEN := 25;
30
- CONST num STATION_COUNT := 6;
31
- CONST num TOP_PRIORITY_COUNT := 7;
32
- CONST num PARTDATA_COUNT := 25;
33
- CONST num USERFRAME_COUNT := 10;
34
- CONST num NUM_ENTRIES_MACHINE_LOG := 100;
35
-
36
- ! Machine & IO limits
37
- CONST num MACHINE_FAULTCODEARRAY_LEN := 50;
38
- CONST num MAX_NUM_INPUTS := 50;
39
- CONST num MAX_NUM_HW_CARDS := 16;
40
-
41
- ! Time conversion
42
- CONST num SYSTIME_TO_UTC_SCALAR := 10000000; ! 10E6, RAPID uses num/ULINT as needed
43
-
44
- ENDMODULE
1
+ MODULE Globals
2
+
3
+ ! Axes & device counts
4
+ CONST num NUM_AXES := 20;
5
+ CONST num MAX_NUM_NAUTILUS_AXES := 20;
6
+ CONST num NUM_DEVICES := 50;
7
+
8
+ ! Timing & durations
9
+ CONST clock MOMENTARY_PB := T#250MS;
10
+ CONST num DEFAULT_TASK_DURATION_SEC := 5;
11
+
12
+ ! Robot & part counts
13
+ CONST num ROBOT_PART_COUNT := 2;
14
+ CONST num RECIPE_COUNT_MAX := 20;
15
+ CONST bool HIDE_LEFT_TWO_COLUMNS := TRUE;
16
+ CONST bool HIDE_RIGHT_COLUMN := TRUE;
17
+ CONST bool HIDE_LEFT_ONE_COLUMN := FALSE;
18
+ CONST num SHELF_PART_COUNT := 100;
19
+ CONST num NUM_OF_COLS := 20;
20
+ CONST num PARTS_IN_COL := 5;
21
+ CONST num NUM_PARTS_XFER := 10;
22
+ CONST num NUM_PARTS_IB := 51;
23
+ CONST num NUM_PARTS_PER_FIXTURE := 8;
24
+
25
+ ! Logging & tasks
26
+ CONST num NUM_LOG_ENTRIES := 25;
27
+ CONST num TASK_LIST_LEN := 25;
28
+ CONST num TASK_STORE_LEN := 125; ! 100 + TASK_LIST_LEN
29
+ CONST num TASK_LOG_LEN := 25;
30
+ CONST num STATION_COUNT := 6;
31
+ CONST num TOP_PRIORITY_COUNT := 7;
32
+ CONST num PARTDATA_COUNT := 25;
33
+ CONST num USERFRAME_COUNT := 10;
34
+ CONST num NUM_ENTRIES_MACHINE_LOG := 100;
35
+
36
+ ! Machine & IO limits
37
+ CONST num MACHINE_FAULTCODEARRAY_LEN := 50;
38
+ CONST num MAX_NUM_INPUTS := 50;
39
+ CONST num MAX_NUM_HW_CARDS := 16;
40
+
41
+ ! Time conversion
42
+ CONST num SYSTIME_TO_UTC_SCALAR := 10000000; ! 10E6, RAPID uses num/ULINT as needed
43
+
44
+ ENDMODULE
@@ -1,13 +1,13 @@
1
- MODULE PartLocationIds
2
-
3
- ! Define the part locations as a record
4
- CONST record PartLocationRec :=
5
- [
6
- None := 0,
7
- LeftFixture_P1 := 1,
8
- RightFixture_P9 := LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
9
- RobotGripper := RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
10
- Lost := RobotGripper + 1
11
- ];
12
-
13
- ENDMODULE
1
+ MODULE PartLocationIds
2
+
3
+ ! Define the part locations as a record
4
+ CONST record PartLocationRec :=
5
+ [
6
+ None := 0,
7
+ LeftFixture_P1 := 1,
8
+ RightFixture_P9 := LeftFixture_P1 + GCs.NUM_PARTS_PER_FIXTURE,
9
+ RobotGripper := RightFixture_P9 + GCs.NUM_PARTS_PER_FIXTURE,
10
+ Lost := RobotGripper + 1
11
+ ];
12
+
13
+ ENDMODULE
@@ -1,18 +1,18 @@
1
- MODULE RobTasks
2
-
3
- ! Define a record containing only PASSTHRU tasks
4
- CONST record RobTasksRec :=
5
- [
6
- RETRIEVE_TOOL := 1, ! param0: toolId
7
- RETURN_TOOL := 2, ! param0: toolId
8
- PICK_PART_FROM_FIXTURE := 4, ! param0: partLocationId
9
- WEIGH_PART := 5, ! param0: partLocationId
10
- PLACE_PART_IN_FIXTURE := 6, ! param0: partLocationId
11
- WIPE_APPLICATOR := 9, ! no params
12
- APPLY_LINER := 10, ! param0: partLocationId
13
- PHOTOGRAPH_TUBE := 12, ! param0: partLocationId
14
- RELEASE_PART_AND_MOVE_TO_PERCH := 13, ! param0: partLocationId
15
- CALIBRATE_SQUEEGEE := 14 ! no params
16
- ];
17
-
18
- ENDMODULE
1
+ MODULE RobTasks
2
+
3
+ ! Define a record containing only PASSTHRU tasks
4
+ CONST record RobTasksRec :=
5
+ [
6
+ RETRIEVE_TOOL := 1, ! param0: toolId
7
+ RETURN_TOOL := 2, ! param0: toolId
8
+ PICK_PART_FROM_FIXTURE := 4, ! param0: partLocationId
9
+ WEIGH_PART := 5, ! param0: partLocationId
10
+ PLACE_PART_IN_FIXTURE := 6, ! param0: partLocationId
11
+ WIPE_APPLICATOR := 9, ! no params
12
+ APPLY_LINER := 10, ! param0: partLocationId
13
+ PHOTOGRAPH_TUBE := 12, ! param0: partLocationId
14
+ RELEASE_PART_AND_MOVE_TO_PERCH := 13, ! param0: partLocationId
15
+ CALIBRATE_SQUEEGEE := 14 ! no params
16
+ ];
17
+
18
+ ENDMODULE
@@ -1,20 +1,20 @@
1
- !************************************************************
2
- ! States.mod — Shared State Definitions
3
- !************************************************************
4
- MODULE States
5
-
6
- CONST record StatesType
7
- ABORTING := -3,
8
- ERROR := -2,
9
- KILLED := -1,
10
- INACTIVE := 0,
11
- RESETTING := 50,
12
- IDLE := 100,
13
- RUNNING := 500,
14
- STOPPING := 900,
15
- PAUSED := 999,
16
- DONE := 1000,
17
- MANUAL := 1100;
18
- CONST StatesType States;
19
-
20
- ENDMODULE
1
+ !************************************************************
2
+ ! States.mod — Shared State Definitions
3
+ !************************************************************
4
+ MODULE States
5
+
6
+ CONST record StatesType
7
+ ABORTING := -3,
8
+ ERROR := -2,
9
+ KILLED := -1,
10
+ INACTIVE := 0,
11
+ RESETTING := 50,
12
+ IDLE := 100,
13
+ RUNNING := 500,
14
+ STOPPING := 900,
15
+ PAUSED := 999,
16
+ DONE := 1000,
17
+ MANUAL := 1100;
18
+ CONST StatesType States;
19
+
20
+ ENDMODULE