@kuriousdesign/machine-sdk 1.0.32 → 1.0.34

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,5 +1,5 @@
1
1
  import { ComponentAnimation, DeviceRegistration, TaskQueue } from ".";
2
- import { PartData } from "./Part";
2
+ import { PartDataStatus } from "./Part";
3
3
  export interface UserData {
4
4
  activeUser: number;
5
5
  hmiLoginBtn: ComponentAnimation;
@@ -35,10 +35,12 @@ export interface Machine {
35
35
  ethercatSlaves_OK: boolean;
36
36
  supplyAir_OK: boolean;
37
37
  cfg: MachineCfg;
38
- parts: PartData[];
38
+ pdmSts: PartDataStatus;
39
39
  errors: SystemFaultData;
40
40
  warnings: SystemFaultData;
41
41
  taskQueue: TaskQueue;
42
42
  registeredDevices: DeviceRegistration[];
43
+ heartbeatPlc: number;
44
+ heartbeatHmi: number;
43
45
  }
44
46
  export declare const initialMachine: Machine;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.initialMachine = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
4
4
  const _1 = require(".");
5
+ const Part_1 = require("./Part");
5
6
  exports.initialFaultCodeData = {
6
7
  deviceId: 0,
7
8
  code: 0,
@@ -29,9 +30,11 @@ exports.initialMachine = ({
29
30
  ethercatSlaves_OK: false,
30
31
  supplyAir_OK: false,
31
32
  cfg: { ...exports.initialMachineCfg },
32
- parts: [],
33
+ pdmSts: Part_1.initialPartDataStatus,
33
34
  errors: { ...exports.initialSystemFaultData },
34
35
  warnings: { ...exports.initialSystemFaultData },
35
36
  taskQueue: { ..._1.initialTaskQueue },
36
37
  registeredDevices: [],
38
+ heartbeatPlc: 0,
39
+ heartbeatHmi: 0,
37
40
  });
@@ -13,6 +13,34 @@ export interface PartValidationData {
13
13
  postWeightKg: number;
14
14
  linerWeightKg: number;
15
15
  }
16
+ export declare const initialPartValidationData: PartValidationData;
17
+ export declare const initialPartData: PartData;
18
+ export interface PartDataStatus {
19
+ parts: PartData[];
20
+ allStationsAreEmpty: boolean;
21
+ rawShelfIsEmpty: boolean;
22
+ doneShelfIsEmpty: boolean;
23
+ doneShelfIsFull: boolean;
24
+ doneShelfSpacesLeftCnt: number;
25
+ rawShelfPartsLeftCnt: number;
26
+ allFixturesAreEmpty: boolean;
27
+ leftFixtureIsEmpty: boolean;
28
+ rightFixtureIsEmpty: boolean;
29
+ robotIsEmpty: boolean;
30
+ robotHasNoPostOpParts: boolean;
31
+ robotHasMachinedParts: boolean;
32
+ robotHasOnePreTopDeburring: boolean;
33
+ robotHasOnePreMachining: boolean;
34
+ robotHasTwoPreMachining: boolean;
35
+ robotHasOneRaw: boolean;
36
+ oneOrMoreRejectPartsInCell: boolean;
37
+ oneOrMoreRejectPartsInRobot: boolean;
38
+ robotHasOneFinishedPart: boolean;
39
+ finishedCnt: number;
40
+ activeCnt: number;
41
+ batchCntFlag: boolean;
42
+ }
43
+ export declare const initialPartDataStatus: PartDataStatus;
16
44
  export interface PartDataDeprecated {
17
45
  cncPreOp: [PartStateDeprecated, PartStateDeprecated];
18
46
  cnc: [PartStateDeprecated, PartStateDeprecated];
@@ -1,2 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialPartDataStatus = exports.initialPartData = exports.initialPartValidationData = void 0;
4
+ const GlobalConstants_1 = require("./GlobalConstants");
5
+ exports.initialPartValidationData = {
6
+ state: -1,
7
+ preWeightKg: -1,
8
+ postWeightKg: -1,
9
+ linerWeightKg: -1,
10
+ };
11
+ exports.initialPartData = {
12
+ processSts: -1,
13
+ validation: { ...exports.initialPartValidationData },
14
+ loadedBadSensor: false,
15
+ fixtureLocationWhenLoaded: -1,
16
+ currentLocation: -1,
17
+ inFixture: false,
18
+ };
19
+ exports.initialPartDataStatus = {
20
+ parts: Array(GlobalConstants_1.GCs.PARTDATA_COUNT).fill(null).map(() => ({ ...exports.initialPartData })),
21
+ allStationsAreEmpty: false,
22
+ rawShelfIsEmpty: false,
23
+ doneShelfIsEmpty: false,
24
+ doneShelfIsFull: false,
25
+ doneShelfSpacesLeftCnt: 0,
26
+ rawShelfPartsLeftCnt: 0,
27
+ allFixturesAreEmpty: false,
28
+ leftFixtureIsEmpty: false,
29
+ rightFixtureIsEmpty: false,
30
+ robotIsEmpty: false,
31
+ robotHasNoPostOpParts: false,
32
+ robotHasMachinedParts: false,
33
+ robotHasOnePreTopDeburring: false,
34
+ robotHasOnePreMachining: false,
35
+ robotHasTwoPreMachining: false,
36
+ robotHasOneRaw: false,
37
+ oneOrMoreRejectPartsInCell: false,
38
+ oneOrMoreRejectPartsInRobot: false,
39
+ robotHasOneFinishedPart: false,
40
+ finishedCnt: 0,
41
+ activeCnt: 0,
42
+ batchCntFlag: false,
43
+ };
@@ -10,6 +10,7 @@ export declare const MachineTags: {
10
10
  HeartbeatPLC: string;
11
11
  HeartbeatHMI: string;
12
12
  parts: string;
13
+ taskQueue: string;
13
14
  };
14
15
  export declare const DeviceTags: {
15
16
  Cfg: string;
@@ -28,6 +28,7 @@ exports.MachineTags = {
28
28
  HeartbeatPLC: 'HeartbeatPLC',
29
29
  HeartbeatHMI: 'HeartbeatHMI',
30
30
  parts: 'Parts',
31
+ taskQueue: 'TaskQueue',
31
32
  };
32
33
  exports.DeviceTags = {
33
34
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
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
1
  import { ComponentAnimation, DeviceConstants, DeviceRegistration, GCs, initialDeviceRegistration, initialTaskQueue, TaskQueue } from ".";
2
- import { PartData } from "./Part";
2
+ import { initialPartDataStatus, PartData, PartDataStatus } from "./Part";
3
3
 
4
4
 
5
5
  export interface UserData {
@@ -77,11 +77,13 @@ export interface Machine {
77
77
  ethercatSlaves_OK: boolean;
78
78
  supplyAir_OK: boolean;
79
79
  cfg: MachineCfg;
80
- parts: PartData[];
80
+ pdmSts: PartDataStatus;
81
81
  errors: SystemFaultData;
82
82
  warnings: SystemFaultData;
83
83
  taskQueue: TaskQueue;
84
84
  registeredDevices: DeviceRegistration[];
85
+ heartbeatPlc: number;
86
+ heartbeatHmi: number;
85
87
  }
86
88
 
87
89
  export const initialMachine: Machine = ({
@@ -94,10 +96,11 @@ export const initialMachine: Machine = ({
94
96
  ethercatSlaves_OK: false,
95
97
  supplyAir_OK: false,
96
98
  cfg: { ...initialMachineCfg },
97
- parts: [],
99
+ pdmSts: initialPartDataStatus,
98
100
  errors: { ...initialSystemFaultData },
99
101
  warnings: { ...initialSystemFaultData },
100
102
  taskQueue: { ...initialTaskQueue },
101
103
  registeredDevices: [],
102
-
104
+ heartbeatPlc: 0,
105
+ heartbeatHmi: 0,
103
106
  });
@@ -1,4 +1,5 @@
1
1
  import { PartStateDeprecated as PartStateDeprecated } from "../enums";
2
+ import { GCs } from "./GlobalConstants";
2
3
 
3
4
 
4
5
 
@@ -43,7 +44,108 @@ export interface PartValidationData {
43
44
  linerWeightKg: number; // LREAL
44
45
  }
45
46
 
47
+ export const initialPartValidationData: PartValidationData = {
48
+ state: -1,
49
+ preWeightKg: -1,
50
+ postWeightKg: -1,
51
+ linerWeightKg: -1,
52
+ };
53
+ export const initialPartData: PartData = {
54
+ processSts: -1,
55
+ validation: { ...initialPartValidationData },
56
+ loadedBadSensor: false,
57
+ fixtureLocationWhenLoaded: -1,
58
+ currentLocation: -1,
59
+ inFixture: false,
60
+ };
46
61
 
62
+ // TYPE PartDataStatus :
63
+ // STRUCT
64
+ // Parts: ARRAY[0..GCs.PARTDATA_COUNT-1] OF PartData; //uses PartLocationIds, but lost parts get added to the end of known locations
65
+ // AllStationsAreEmpty:BOOL;
66
+ // RawShelfIsEmpty:BOOL;
67
+ // DoneShelfIsEmpty:BOOL;
68
+ // DoneShelfIsFull:BOOL;
69
+ // DoneShelfSpacesLeftCnt:INT;
70
+ // RawShelfPartsLeftCnt:INT;
71
+ // AllFixturesAreEmpty:BOOL;
72
+ // LeftFixtureIsEmpty:BOOL;
73
+ // RightFixtureIsEmpty:BOOL;
74
+
75
+ // RobotIsEmpty:BOOL;
76
+ // RobotHasNoPostOpParts:BOOL; //robot isn't holding any parts that are machined or washing/dryed or finished
77
+ // RobotHasMachinedParts:BOOL; //robot is holding at least one machined part
78
+ // RobotHasOnePreTopDeburring:BOOL;
79
+ // RobotHasOnePreMachining:BOOL;
80
+ // RobotHasTwoPreMachining:BOOL;
81
+ // RobotHasOneRaw:BOOL;
82
+
83
+ // OneOrMoreRejectPartsInCell:BOOL;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
84
+ // OneOrMoreRejectPartsInRobot:BOOL;
85
+
86
+ // RobotHasOneFinishedPart:BOOL;
87
+ // FinishedCnt:INT;//amount of finished parts either in post op or in robot
88
+ // ActiveCnt:INT;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
89
+ // BatchCntFlag:BOOL; //prevent more parts from being picked by raw
90
+ // END_STRUCT
91
+ // END_TYPE
92
+ export interface PartDataStatus {
93
+ parts: PartData[];
94
+ allStationsAreEmpty: boolean;
95
+ rawShelfIsEmpty: boolean;
96
+ doneShelfIsEmpty: boolean;
97
+ doneShelfIsFull: boolean;
98
+ doneShelfSpacesLeftCnt: number;
99
+ rawShelfPartsLeftCnt: number;
100
+ allFixturesAreEmpty: boolean;
101
+ leftFixtureIsEmpty: boolean;
102
+ rightFixtureIsEmpty: boolean;
103
+
104
+ robotIsEmpty: boolean;
105
+ robotHasNoPostOpParts: boolean; //robot isn't holding any parts that are machined or washing/dryed or finished
106
+ robotHasMachinedParts: boolean; //robot is holding at least one machined part
107
+ robotHasOnePreTopDeburring: boolean;
108
+ robotHasOnePreMachining: boolean;
109
+ robotHasTwoPreMachining: boolean;
110
+ robotHasOneRaw: boolean;
111
+
112
+ oneOrMoreRejectPartsInCell: boolean;// there is a reject part in the robot, preop OR post op (doesn't look at cnc)
113
+ oneOrMoreRejectPartsInRobot: boolean;
114
+
115
+ robotHasOneFinishedPart: boolean;
116
+ finishedCnt: number;//amount of finished parts either in post op or in robot
117
+ activeCnt: number;//how many active parts are in the cell, cnc or robot (does not include raw or done rack)
118
+ batchCntFlag: boolean; //prevent more parts from being picked by raw
119
+ }
120
+
121
+ export const initialPartDataStatus: PartDataStatus = {
122
+ parts: Array(GCs.PARTDATA_COUNT).fill(null).map(() => ({ ...initialPartData })),
123
+ allStationsAreEmpty: false,
124
+ rawShelfIsEmpty: false,
125
+ doneShelfIsEmpty: false,
126
+ doneShelfIsFull: false,
127
+ doneShelfSpacesLeftCnt: 0,
128
+ rawShelfPartsLeftCnt: 0,
129
+ allFixturesAreEmpty: false,
130
+ leftFixtureIsEmpty: false,
131
+ rightFixtureIsEmpty: false,
132
+
133
+ robotIsEmpty: false,
134
+ robotHasNoPostOpParts: false,
135
+ robotHasMachinedParts: false,
136
+ robotHasOnePreTopDeburring: false,
137
+ robotHasOnePreMachining: false,
138
+ robotHasTwoPreMachining: false,
139
+ robotHasOneRaw: false,
140
+
141
+ oneOrMoreRejectPartsInCell: false,
142
+ oneOrMoreRejectPartsInRobot: false,
143
+
144
+ robotHasOneFinishedPart: false,
145
+ finishedCnt: 0,
146
+ activeCnt: 0,
147
+ batchCntFlag: false,
148
+ };
47
149
 
48
150
  export interface PartDataDeprecated {
49
151
  cncPreOp: [PartStateDeprecated, PartStateDeprecated];
@@ -12,6 +12,7 @@ export const MachineTags = {
12
12
  HeartbeatPLC: 'HeartbeatPLC',
13
13
  HeartbeatHMI: 'HeartbeatHMI',
14
14
  parts: 'Parts',
15
+ taskQueue: 'TaskQueue',
15
16
  }
16
17
 
17
18
  export const DeviceTags = {