@kuriousdesign/machine-sdk 1.0.28 → 1.0.30

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,6 +1,6 @@
1
1
  import { Page } from "../enums";
2
2
  import { ButtonBar, StatusBar } from "./HMI";
3
- import { PartData } from "./PartData";
3
+ import { PartDataDeprecated } from "./Part";
4
4
  import { Device } from "./BaseDevice/Device";
5
5
  import { GlobalConstants } from "./GlobalConstants";
6
6
  import { RackData, RackHmiPbs, RecipeData, RecipeManagerPbs, SystemFaultData, TaskQueue, UserData, UserManagerFB, RobData } from ".";
@@ -35,7 +35,7 @@ export interface AppState {
35
35
  [NodeId.CNC]: Device;
36
36
  [NodeId.DBRR]: Device;
37
37
  [NodeId.WASH]: Device;
38
- [NodeId.PartData]: PartData;
38
+ [NodeId.PartData]: PartDataDeprecated;
39
39
  [NodeId.TaskQueue]: TaskQueue;
40
40
  [NodeId.GlobalConstants]: GlobalConstants;
41
41
  [NodeId.MachineUser]: UserData;
@@ -1,4 +1,5 @@
1
- import { ComponentAnimation } from ".";
1
+ import { ComponentAnimation, TaskQueue } from ".";
2
+ import { PartData } from "./Part";
2
3
  export interface UserData {
3
4
  activeUser: number;
4
5
  hmiLoginBtn: ComponentAnimation;
@@ -8,10 +9,22 @@ export interface FaultCodeData {
8
9
  deviceId: number;
9
10
  code: number;
10
11
  }
12
+ export declare const initialFaultCodeData: FaultCodeData;
11
13
  export interface SystemFaultData {
12
14
  list: FaultCodeData[];
13
15
  present: boolean;
14
16
  }
17
+ export declare const initialSystemFaultData: SystemFaultData;
18
+ export interface MachineCfg {
19
+ firmwareVersion: string;
20
+ cellType: string;
21
+ softwareMode: string;
22
+ allowAnonymousControl: boolean;
23
+ deviceIsBypassed: boolean[];
24
+ apiOpcuaDeviceId: number;
25
+ ethernetAdapterList: number[];
26
+ }
27
+ export declare const initialMachineCfg: MachineCfg;
15
28
  export interface Machine {
16
29
  estopCircuit_OK: boolean;
17
30
  estopCircuitDelayed_OK: boolean;
@@ -21,4 +34,10 @@ export interface Machine {
21
34
  ethercatMaster_OK: boolean;
22
35
  ethercatSlaves_OK: boolean;
23
36
  supplyAir_OK: boolean;
37
+ cfg: MachineCfg;
38
+ parts: PartData[];
39
+ errors: SystemFaultData;
40
+ warnings: SystemFaultData;
41
+ taskQueue: TaskQueue;
24
42
  }
43
+ export declare const initialMachine: Machine;
@@ -1,2 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialMachine = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
4
+ const _1 = require(".");
5
+ exports.initialFaultCodeData = {
6
+ deviceId: 0,
7
+ code: 0,
8
+ };
9
+ exports.initialSystemFaultData = {
10
+ list: Array(_1.DeviceConstants.DEVICE_FAULTCODEARRAY_LEN).fill(null).map(() => ({ ...exports.initialFaultCodeData })),
11
+ present: false,
12
+ };
13
+ exports.initialMachineCfg = {
14
+ firmwareVersion: "",
15
+ cellType: "",
16
+ softwareMode: "",
17
+ allowAnonymousControl: false,
18
+ deviceIsBypassed: [],
19
+ apiOpcuaDeviceId: -1,
20
+ ethernetAdapterList: [],
21
+ };
22
+ exports.initialMachine = {
23
+ estopCircuit_OK: false,
24
+ estopCircuitDelayed_OK: false,
25
+ fenceCircuit_OK: false,
26
+ guardDoors_LOCKED: false,
27
+ networkHealth_OK: false,
28
+ ethercatMaster_OK: false,
29
+ ethercatSlaves_OK: false,
30
+ supplyAir_OK: false,
31
+ cfg: exports.initialMachineCfg,
32
+ parts: [],
33
+ errors: exports.initialSystemFaultData,
34
+ warnings: exports.initialSystemFaultData,
35
+ taskQueue: _1.initialTaskQueue,
36
+ };
@@ -0,0 +1,25 @@
1
+ import { PartStateDeprecated as PartStateDeprecated } from "../enums";
2
+ export interface PartData {
3
+ processSts: number;
4
+ validation: PartValidationData;
5
+ loadedBadSensor: boolean;
6
+ fixtureLocationWhenLoaded: number;
7
+ currentLocation: number;
8
+ inFixture: boolean;
9
+ }
10
+ export interface PartValidationData {
11
+ state: number;
12
+ preWeightKg: number;
13
+ postWeightKg: number;
14
+ linerWeightKg: number;
15
+ }
16
+ export interface PartDataDeprecated {
17
+ cncPreOp: [PartStateDeprecated, PartStateDeprecated];
18
+ cnc: [PartStateDeprecated, PartStateDeprecated];
19
+ cncPostOp: [PartStateDeprecated, PartStateDeprecated];
20
+ doneShelf: PartStateDeprecated[];
21
+ rawShelf: PartStateDeprecated[];
22
+ robot: [PartStateDeprecated, PartStateDeprecated];
23
+ washer: [PartStateDeprecated, PartStateDeprecated];
24
+ hmiEditingAllowed: boolean;
25
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,24 +1,25 @@
1
- import { Priority, TaskId } from "..";
1
+ export declare enum Priorities {
2
+ NONE = 0,// do not remove or change this
3
+ LOAD_PARTS = 2,
4
+ START_UTILITIES = 10,
5
+ PRE_WEIGH_TUBES = 20,
6
+ APPLY_LINER = 30,
7
+ PHOTOGRAPH_TUBES = 40,
8
+ POST_WEIGH_TUBES = 50,
9
+ STOP_UTILITIES = 60,
10
+ UNLOAD_PARTS = 70
11
+ }
12
+ export interface TaskData {
13
+ targetId: number;
14
+ taskId: number;
15
+ paramArray: number[];
16
+ state: number;
17
+ }
18
+ export declare const initialTaskData: TaskData;
2
19
  export interface TaskQueue {
3
- topPriority: Priority;
4
- taskList: TaskId[];
20
+ topPriority: Priorities;
21
+ taskList: TaskData[];
5
22
  taskCnt: number;
6
23
  activeTaskIndex: number;
7
24
  }
8
- export interface TaskData {
9
- id: number;
10
- TaskString: string;
11
- T: number;
12
- TaskType: number;
13
- StartPositionId: number;
14
- EndPositionId: number;
15
- GateId: number;
16
- StationId: number;
17
- PartStatusStart: number[];
18
- PartStatusEnd: number[];
19
- PartId: number;
20
- OffsetUserFrameId: number;
21
- GripperPositionId: number;
22
- LeftGripperMustBeEmpty: boolean;
23
- isCurrentlyAllowed: boolean;
24
- }
25
+ export declare const initialTaskQueue: TaskQueue;
@@ -1,2 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initialTaskQueue = exports.initialTaskData = exports.Priorities = void 0;
4
+ const BaseDevice_1 = require("./BaseDevice");
5
+ var Priorities;
6
+ (function (Priorities) {
7
+ Priorities[Priorities["NONE"] = 0] = "NONE";
8
+ Priorities[Priorities["LOAD_PARTS"] = 2] = "LOAD_PARTS";
9
+ Priorities[Priorities["START_UTILITIES"] = 10] = "START_UTILITIES";
10
+ Priorities[Priorities["PRE_WEIGH_TUBES"] = 20] = "PRE_WEIGH_TUBES";
11
+ Priorities[Priorities["APPLY_LINER"] = 30] = "APPLY_LINER";
12
+ Priorities[Priorities["PHOTOGRAPH_TUBES"] = 40] = "PHOTOGRAPH_TUBES";
13
+ Priorities[Priorities["POST_WEIGH_TUBES"] = 50] = "POST_WEIGH_TUBES";
14
+ Priorities[Priorities["STOP_UTILITIES"] = 60] = "STOP_UTILITIES";
15
+ Priorities[Priorities["UNLOAD_PARTS"] = 70] = "UNLOAD_PARTS";
16
+ })(Priorities || (exports.Priorities = Priorities = {}));
17
+ exports.initialTaskData = {
18
+ targetId: 0,
19
+ taskId: 0,
20
+ paramArray: Array(BaseDevice_1.DeviceConstants.MAX_NUM_PARAMS).fill(0),
21
+ state: 0
22
+ };
23
+ exports.initialTaskQueue = {
24
+ topPriority: Priorities.NONE,
25
+ taskList: Array(BaseDevice_1.DeviceConstants.MAX_NUM_PARAMS).fill(null).map(() => ({ ...exports.initialTaskData })),
26
+ taskCnt: 0,
27
+ activeTaskIndex: -1
28
+ };
@@ -26,7 +26,7 @@ export declare enum States {
26
26
  export declare function convertStateToString(state: States): "ABORTING" | "ERROR" | "KILLED" | "INACTIVE" | "RESETTING" | "IDLE" | "RUNNING" | "STOPPING" | "PAUSED" | "DONE" | "MANUAL" | "UNKNOWN";
27
27
  export declare function convertStateToColor(state: States): "text-darkred-500" | "text-red-500" | "text-gray-500" | "text-white" | "text-lightblue-500" | "text-blue-500" | "text-green-500" | "text-orange-500" | "text-purple-500" | "text-pink-500" | undefined;
28
28
  export declare function getStateFromStep(step: number): States;
29
- export declare enum PartState {
29
+ export declare enum PartStateDeprecated {
30
30
  Empty = 0,//no part present
31
31
  Raw = 10,
32
32
  DeburrBottomStarted = 11,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BannerMode = exports.StatusMsg = exports.TaskItemState = exports.PartState = exports.States = exports.VisibilityState = void 0;
3
+ exports.BannerMode = exports.StatusMsg = exports.TaskItemState = exports.PartStateDeprecated = exports.States = exports.VisibilityState = void 0;
4
4
  exports.convertStateToString = convertStateToString;
5
5
  exports.convertStateToColor = convertStateToColor;
6
6
  exports.getStateFromStep = getStateFromStep;
@@ -143,24 +143,24 @@ function getStateFromStep(step) {
143
143
  }
144
144
  return state;
145
145
  }
146
- var PartState;
147
- (function (PartState) {
148
- PartState[PartState["Empty"] = 0] = "Empty";
149
- PartState[PartState["Raw"] = 10] = "Raw";
150
- PartState[PartState["DeburrBottomStarted"] = 11] = "DeburrBottomStarted";
151
- PartState[PartState["DeburrBottomFinished"] = 12] = "DeburrBottomFinished";
152
- PartState[PartState["DeburrTopStarted"] = 15] = "DeburrTopStarted";
153
- PartState[PartState["Deburred"] = 20] = "Deburred";
154
- PartState[PartState["MachiningStarted"] = 45] = "MachiningStarted";
155
- PartState[PartState["Machined"] = 50] = "Machined";
156
- PartState[PartState["WashStarted"] = 55] = "WashStarted";
157
- PartState[PartState["Washed"] = 60] = "Washed";
158
- PartState[PartState["DryStarted"] = 65] = "DryStarted";
159
- PartState[PartState["Dryed"] = 70] = "Dryed";
160
- PartState[PartState["Finished"] = 100] = "Finished";
161
- PartState[PartState["Scrapped"] = 911] = "Scrapped";
162
- PartState[PartState["Error"] = 999] = "Error";
163
- })(PartState || (exports.PartState = PartState = {}));
146
+ var PartStateDeprecated;
147
+ (function (PartStateDeprecated) {
148
+ PartStateDeprecated[PartStateDeprecated["Empty"] = 0] = "Empty";
149
+ PartStateDeprecated[PartStateDeprecated["Raw"] = 10] = "Raw";
150
+ PartStateDeprecated[PartStateDeprecated["DeburrBottomStarted"] = 11] = "DeburrBottomStarted";
151
+ PartStateDeprecated[PartStateDeprecated["DeburrBottomFinished"] = 12] = "DeburrBottomFinished";
152
+ PartStateDeprecated[PartStateDeprecated["DeburrTopStarted"] = 15] = "DeburrTopStarted";
153
+ PartStateDeprecated[PartStateDeprecated["Deburred"] = 20] = "Deburred";
154
+ PartStateDeprecated[PartStateDeprecated["MachiningStarted"] = 45] = "MachiningStarted";
155
+ PartStateDeprecated[PartStateDeprecated["Machined"] = 50] = "Machined";
156
+ PartStateDeprecated[PartStateDeprecated["WashStarted"] = 55] = "WashStarted";
157
+ PartStateDeprecated[PartStateDeprecated["Washed"] = 60] = "Washed";
158
+ PartStateDeprecated[PartStateDeprecated["DryStarted"] = 65] = "DryStarted";
159
+ PartStateDeprecated[PartStateDeprecated["Dryed"] = 70] = "Dryed";
160
+ PartStateDeprecated[PartStateDeprecated["Finished"] = 100] = "Finished";
161
+ PartStateDeprecated[PartStateDeprecated["Scrapped"] = 911] = "Scrapped";
162
+ PartStateDeprecated[PartStateDeprecated["Error"] = 999] = "Error";
163
+ })(PartStateDeprecated || (exports.PartStateDeprecated = PartStateDeprecated = {}));
164
164
  var TaskItemState;
165
165
  (function (TaskItemState) {
166
166
  TaskItemState[TaskItemState["TaskDone"] = 48] = "TaskDone";
@@ -4,6 +4,5 @@ export * from "./OpcuaDatatype";
4
4
  export * from "./ExtrusionType";
5
5
  export * from "./DeviceId";
6
6
  export * from "./TaskId";
7
- export * from "./Priorities";
8
7
  export * from "./Pages";
9
8
  export * from "./RobPositions";
@@ -20,6 +20,5 @@ __exportStar(require("./OpcuaDatatype"), exports);
20
20
  __exportStar(require("./ExtrusionType"), exports);
21
21
  __exportStar(require("./DeviceId"), exports);
22
22
  __exportStar(require("./TaskId"), exports);
23
- __exportStar(require("./Priorities"), exports);
24
23
  __exportStar(require("./Pages"), exports);
25
24
  __exportStar(require("./RobPositions"), exports);
@@ -1,4 +1,4 @@
1
1
  import { Color } from "../enums/Colors";
2
- import { States, PartState } from "../enums/States";
2
+ import { States, PartStateDeprecated } from "../enums/States";
3
3
  export declare function deviceStateToColorMap(state: States): Color;
4
- export declare function partStateToColorMap(state: PartState): Color;
4
+ export declare function partStateToColorMap(state: PartStateDeprecated): Color;
@@ -23,21 +23,21 @@ function deviceStateToColorMap(state) {
23
23
  }
24
24
  function partStateToColorMap(state) {
25
25
  const colorMap = {
26
- [States_1.PartState.Empty]: Colors_1.Color.Empty,
27
- [States_1.PartState.Raw]: Colors_1.Color.Raw,
28
- [States_1.PartState.DeburrBottomStarted]: Colors_1.Color.Processing,
29
- [States_1.PartState.DeburrBottomFinished]: Colors_1.Color.DeburrBottomFinished,
30
- [States_1.PartState.DeburrTopStarted]: Colors_1.Color.Processing,
31
- [States_1.PartState.Deburred]: Colors_1.Color.Deburred,
32
- [States_1.PartState.MachiningStarted]: Colors_1.Color.Processing,
33
- [States_1.PartState.Machined]: Colors_1.Color.Machined,
34
- [States_1.PartState.WashStarted]: Colors_1.Color.Processing,
35
- [States_1.PartState.Washed]: Colors_1.Color.Processing,
36
- [States_1.PartState.DryStarted]: Colors_1.Color.Processing,
37
- [States_1.PartState.Dryed]: Colors_1.Color.Dryed,
38
- [States_1.PartState.Finished]: Colors_1.Color.Finished,
39
- [States_1.PartState.Scrapped]: Colors_1.Color.Scrapped,
40
- [States_1.PartState.Error]: Colors_1.Color.Error,
26
+ [States_1.PartStateDeprecated.Empty]: Colors_1.Color.Empty,
27
+ [States_1.PartStateDeprecated.Raw]: Colors_1.Color.Raw,
28
+ [States_1.PartStateDeprecated.DeburrBottomStarted]: Colors_1.Color.Processing,
29
+ [States_1.PartStateDeprecated.DeburrBottomFinished]: Colors_1.Color.DeburrBottomFinished,
30
+ [States_1.PartStateDeprecated.DeburrTopStarted]: Colors_1.Color.Processing,
31
+ [States_1.PartStateDeprecated.Deburred]: Colors_1.Color.Deburred,
32
+ [States_1.PartStateDeprecated.MachiningStarted]: Colors_1.Color.Processing,
33
+ [States_1.PartStateDeprecated.Machined]: Colors_1.Color.Machined,
34
+ [States_1.PartStateDeprecated.WashStarted]: Colors_1.Color.Processing,
35
+ [States_1.PartStateDeprecated.Washed]: Colors_1.Color.Processing,
36
+ [States_1.PartStateDeprecated.DryStarted]: Colors_1.Color.Processing,
37
+ [States_1.PartStateDeprecated.Dryed]: Colors_1.Color.Dryed,
38
+ [States_1.PartStateDeprecated.Finished]: Colors_1.Color.Finished,
39
+ [States_1.PartStateDeprecated.Scrapped]: Colors_1.Color.Scrapped,
40
+ [States_1.PartStateDeprecated.Error]: Colors_1.Color.Error,
41
41
  };
42
42
  return colorMap[state];
43
43
  }
@@ -9,6 +9,7 @@ export declare const MachineTags: {
9
9
  axisStsArray: string;
10
10
  HeartbeatPLC: string;
11
11
  HeartbeatHMI: string;
12
+ parts: string;
12
13
  };
13
14
  export declare const DeviceTags: {
14
15
  Cfg: string;
@@ -26,7 +26,8 @@ exports.MachineTags = {
26
26
  registeredDevices: 'RegisteredDevices',
27
27
  axisStsArray: 'AxisStsArray',
28
28
  HeartbeatPLC: 'HeartbeatPLC',
29
- HeartbeatHMI: 'HeartbeatHMI'
29
+ HeartbeatHMI: 'HeartbeatHMI',
30
+ parts: 'Parts',
30
31
  };
31
32
  exports.DeviceTags = {
32
33
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.30",
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,6 +1,6 @@
1
- import { PartState, Page } from "../enums";
1
+ import { PartStateDeprecated, Page } from "../enums";
2
2
  import { ButtonBar, StatusBar } from "./HMI";
3
- import { PartData } from "./PartData";
3
+ import { PartDataDeprecated } from "./Part";
4
4
  import { Device } from "./BaseDevice/Device";
5
5
  import { GlobalConstants } from "./GlobalConstants";
6
6
  import {
@@ -51,7 +51,7 @@ export interface AppState {
51
51
  [NodeId.CNC]: Device;
52
52
  [NodeId.DBRR]: Device;
53
53
  [NodeId.WASH]: Device;
54
- [NodeId.PartData]: PartData;
54
+ [NodeId.PartData]: PartDataDeprecated;
55
55
  [NodeId.TaskQueue]: TaskQueue;
56
56
  [NodeId.GlobalConstants]: GlobalConstants;
57
57
  [NodeId.MachineUser]: UserData;
@@ -1,4 +1,5 @@
1
- import { ComponentAnimation } from ".";
1
+ import { ComponentAnimation, DeviceConstants, initialTaskQueue, TaskQueue } from ".";
2
+ import { PartData } from "./Part";
2
3
 
3
4
  export interface UserData {
4
5
  activeUser: number;
@@ -11,16 +12,59 @@ export interface FaultCodeData {
11
12
  code: number;
12
13
  }
13
14
 
15
+ export const initialFaultCodeData: FaultCodeData = {
16
+ deviceId: 0,
17
+ code: 0,
18
+ };
19
+
14
20
  export interface SystemFaultData {
15
21
  list: FaultCodeData[];
16
22
  present: boolean;
17
23
  }
18
24
 
19
- // export interface Machine {
20
- // user: UserData;
21
- // errors: SystemFaultData;
22
- // warnings: SystemFaultData;
23
- // }
25
+ export const initialSystemFaultData: SystemFaultData = {
26
+ list: Array(DeviceConstants.DEVICE_FAULTCODEARRAY_LEN).fill(null).map(() => ({ ...initialFaultCodeData })),
27
+ present: false,
28
+ };
29
+
30
+
31
+
32
+ // TYPE MachineCfg :
33
+ // STRUCT
34
+ // FirmwareVersion: STRING;
35
+ // CellType: CellTypes;
36
+ // SoftwareMode: SoftwareModes;
37
+ // AllowAnonymousControl: BOOL;
38
+ // DeviceIsBypassed: ARRAY[0..(GCs.NUM_DEVICES-1)] OF BOOL; //used to set devices to be bypassed or not
39
+ // ApiOpcuaDeviceId:INT; //designates which device is using the opcua api
40
+ // EthernetAdapterList: ARRAY[0..4] OF INT;
41
+ // //SerialNumber: STRING(255); moved to ControllerInstanceData
42
+ // //Name: STRING; moved to ControllerInstanceData
43
+ // //Location: STRING; moved to ControllerInstanceData
44
+
45
+ // END_STRUCT
46
+ // END_TYPE
47
+
48
+
49
+ export interface MachineCfg {
50
+ firmwareVersion: string;
51
+ cellType: string;
52
+ softwareMode: string;
53
+ allowAnonymousControl: boolean;
54
+ deviceIsBypassed: boolean[];
55
+ apiOpcuaDeviceId: number;
56
+ ethernetAdapterList: number[];
57
+ }
58
+
59
+ export const initialMachineCfg: MachineCfg = {
60
+ firmwareVersion: "",
61
+ cellType: "",
62
+ softwareMode: "",
63
+ allowAnonymousControl: false,
64
+ deviceIsBypassed: [],
65
+ apiOpcuaDeviceId: -1,
66
+ ethernetAdapterList: [],
67
+ };
24
68
 
25
69
  export interface Machine {
26
70
  estopCircuit_OK: boolean;
@@ -31,4 +75,25 @@ export interface Machine {
31
75
  ethercatMaster_OK: boolean;
32
76
  ethercatSlaves_OK: boolean;
33
77
  supplyAir_OK: boolean;
34
- }
78
+ cfg: MachineCfg;
79
+ parts: PartData[];
80
+ errors: SystemFaultData;
81
+ warnings: SystemFaultData;
82
+ taskQueue: TaskQueue;
83
+ }
84
+
85
+ export const initialMachine: Machine = {
86
+ estopCircuit_OK: false,
87
+ estopCircuitDelayed_OK: false,
88
+ fenceCircuit_OK: false,
89
+ guardDoors_LOCKED: false,
90
+ networkHealth_OK: false,
91
+ ethercatMaster_OK: false,
92
+ ethercatSlaves_OK: false,
93
+ supplyAir_OK: false,
94
+ cfg: initialMachineCfg,
95
+ parts: [],
96
+ errors: initialSystemFaultData,
97
+ warnings: initialSystemFaultData,
98
+ taskQueue: initialTaskQueue,
99
+ };
@@ -0,0 +1,57 @@
1
+ import { PartStateDeprecated as PartStateDeprecated } from "../enums";
2
+
3
+
4
+
5
+ // TYPE PartValidationData :
6
+ // STRUCT
7
+ // State:INT;
8
+ // PreWeightKg:LREAL;
9
+ // PostWeightKg:LREAL;
10
+ // LinerWeightKg:LREAL;
11
+ // END_STRUCT
12
+ // END_TYPE
13
+
14
+
15
+ // TYPE PartData :
16
+ // STRUCT
17
+ // ProcessSts:INT;//PartStates enum
18
+ // Validation:PartValidationData;
19
+ // LoadedBadSensor:BOOL; //marks if loaded into system with bad part present sensor
20
+ // FixtureLocationWhenLoaded:INT; //LocationIds enum, where this part was loaced
21
+ // CurrentLocation:INT; //LocationIds enum, this is also the same as the partIndex of the Machine.PartData[partIndex]
22
+ // InFixture:BOOL; //CurrentLocation = FixtureLocationWhenLoaded
23
+
24
+ // //RecipeData:PartRecipeData;
25
+ // END_STRUCT
26
+ // END_TYPE
27
+
28
+
29
+
30
+ export interface PartData {
31
+ processSts: number; // PartStates enum
32
+ validation: PartValidationData;
33
+ loadedBadSensor: boolean; // marks if loaded into system with bad part present sensor
34
+ fixtureLocationWhenLoaded: number; // LocationIds enum, where this part was loaced
35
+ currentLocation: number; // LocationIds enum, this is also the same as the partIndex of the Machine.PartData[partIndex]
36
+ inFixture: boolean; // CurrentLocation = FixtureLocationWhenLoaded
37
+ }
38
+
39
+ export interface PartValidationData {
40
+ state: number; // PartStates enum
41
+ preWeightKg: number; // LREAL
42
+ postWeightKg: number; // LREAL
43
+ linerWeightKg: number; // LREAL
44
+ }
45
+
46
+
47
+
48
+ export interface PartDataDeprecated {
49
+ cncPreOp: [PartStateDeprecated, PartStateDeprecated];
50
+ cnc: [PartStateDeprecated, PartStateDeprecated];
51
+ cncPostOp: [PartStateDeprecated, PartStateDeprecated];
52
+ doneShelf: PartStateDeprecated[];
53
+ rawShelf: PartStateDeprecated[];
54
+ robot: [PartStateDeprecated, PartStateDeprecated];
55
+ washer: [PartStateDeprecated, PartStateDeprecated];
56
+ hmiEditingAllowed: boolean;
57
+ }
@@ -1,31 +1,43 @@
1
- import { Priority, TaskId } from "..";
1
+ import { DeviceConstants } from "./BaseDevice";
2
2
 
3
- export interface TaskQueue {
4
- topPriority: Priority;
5
- taskList: TaskId[];
6
- taskCnt: number;
7
- activeTaskIndex: number;
3
+ export enum Priorities {
4
+ NONE = 0, // do not remove or change this
5
+ LOAD_PARTS = 2,
6
+ START_UTILITIES = 10,
7
+ PRE_WEIGH_TUBES = 20,
8
+ APPLY_LINER = 30,
9
+ PHOTOGRAPH_TUBES = 40,
10
+ POST_WEIGH_TUBES = 50,
11
+ STOP_UTILITIES = 60,
12
+ UNLOAD_PARTS = 70
8
13
  }
9
14
 
10
- export interface TaskData {
11
- id: number;
12
- TaskString: string; //like a description
13
- T: number; // time in seconds to complete task
14
- TaskType: number; //Pick (state change ignored), Load (state change ignored), Move (state change ignored), Move with Process (state change used), Transform/Process (stage change used)
15
15
 
16
- StartPositionId: number; //starting position required before this task is allowed
17
- EndPositionId: number; //ending position after this task is finished
18
- GateId: number; //robot-cnc door, for example
19
16
 
20
- StationId: number; //used for transform processes
21
- PartStatusStart: number[];
22
- PartStatusEnd: number[];
23
- PartId: number; //used for pick and load moves
17
+ export interface TaskData {
18
+ targetId: number;
19
+ taskId: number; // specific to the targetId
20
+ paramArray: number[]; // ARRAY[0..DeviceConstants.MAX_NUM_PARAMS-1] OF LREAL;
21
+ state: number; // DeviceStates: 0 (NONE), IDLE, RUNNING, PAUSED, ERROR, DONE
22
+ }
24
23
 
25
- OffsetUserFrameId: number; //90 Through 99, corresponds to our PRs 90-99 which correspdond to the user frame
24
+ export const initialTaskData: TaskData = {
25
+ targetId: 0,
26
+ taskId: 0,
27
+ paramArray: Array(DeviceConstants.MAX_NUM_PARAMS).fill(0),
28
+ state: 0
29
+ };
26
30
 
27
- GripperPositionId: number; //0 for left, 1 for right, 2 for both (used for moves in and out of CNC, and to from washer)
28
- LeftGripperMustBeEmpty: boolean;
29
31
 
30
- isCurrentlyAllowed: boolean; //set this with logic, do not configure
32
+ export interface TaskQueue {
33
+ topPriority: Priorities;
34
+ taskList: TaskData[];
35
+ taskCnt: number;
36
+ activeTaskIndex: number;
31
37
  }
38
+ export const initialTaskQueue: TaskQueue = {
39
+ topPriority: Priorities.NONE,
40
+ taskList: Array(DeviceConstants.MAX_NUM_PARAMS).fill(null).map(() => ({ ...initialTaskData })),
41
+ taskCnt: 0,
42
+ activeTaskIndex: -1
43
+ };
@@ -137,7 +137,7 @@ export function getStateFromStep(step:number): States {
137
137
  return state;
138
138
  }
139
139
 
140
- export enum PartState {
140
+ export enum PartStateDeprecated {
141
141
  Empty = 0, //no part present
142
142
  Raw = 10,
143
143
  DeburrBottomStarted = 11,
@@ -5,6 +5,6 @@ export * from "./ExtrusionType";
5
5
 
6
6
  export * from "./DeviceId";
7
7
  export * from "./TaskId";
8
- export * from "./Priorities";
8
+
9
9
  export * from "./Pages";
10
10
  export * from "./RobPositions";
@@ -1,5 +1,5 @@
1
1
  import { Color } from "../enums/Colors";
2
- import { States, PartState } from "../enums/States";
2
+ import { States, PartStateDeprecated } from "../enums/States";
3
3
 
4
4
  export function deviceStateToColorMap(state: States): Color {
5
5
  const colorMap: { [key in States]: Color } = {
@@ -20,23 +20,23 @@ export function deviceStateToColorMap(state: States): Color {
20
20
  return colorMap[state];
21
21
  }
22
22
 
23
- export function partStateToColorMap(state: PartState): Color {
24
- const colorMap: { [key in PartState]: Color } = {
25
- [PartState.Empty]: Color.Empty,
26
- [PartState.Raw]: Color.Raw,
27
- [PartState.DeburrBottomStarted]: Color.Processing,
28
- [PartState.DeburrBottomFinished]: Color.DeburrBottomFinished,
29
- [PartState.DeburrTopStarted]: Color.Processing,
30
- [PartState.Deburred]: Color.Deburred,
31
- [PartState.MachiningStarted]: Color.Processing,
32
- [PartState.Machined]: Color.Machined,
33
- [PartState.WashStarted]: Color.Processing,
34
- [PartState.Washed]: Color.Processing,
35
- [PartState.DryStarted]: Color.Processing,
36
- [PartState.Dryed]: Color.Dryed,
37
- [PartState.Finished]: Color.Finished,
38
- [PartState.Scrapped]: Color.Scrapped,
39
- [PartState.Error]: Color.Error,
23
+ export function partStateToColorMap(state: PartStateDeprecated): Color {
24
+ const colorMap: { [key in PartStateDeprecated]: Color } = {
25
+ [PartStateDeprecated.Empty]: Color.Empty,
26
+ [PartStateDeprecated.Raw]: Color.Raw,
27
+ [PartStateDeprecated.DeburrBottomStarted]: Color.Processing,
28
+ [PartStateDeprecated.DeburrBottomFinished]: Color.DeburrBottomFinished,
29
+ [PartStateDeprecated.DeburrTopStarted]: Color.Processing,
30
+ [PartStateDeprecated.Deburred]: Color.Deburred,
31
+ [PartStateDeprecated.MachiningStarted]: Color.Processing,
32
+ [PartStateDeprecated.Machined]: Color.Machined,
33
+ [PartStateDeprecated.WashStarted]: Color.Processing,
34
+ [PartStateDeprecated.Washed]: Color.Processing,
35
+ [PartStateDeprecated.DryStarted]: Color.Processing,
36
+ [PartStateDeprecated.Dryed]: Color.Dryed,
37
+ [PartStateDeprecated.Finished]: Color.Finished,
38
+ [PartStateDeprecated.Scrapped]: Color.Scrapped,
39
+ [PartStateDeprecated.Error]: Color.Error,
40
40
  };
41
41
 
42
42
  return colorMap[state];
@@ -10,7 +10,8 @@ export const MachineTags = {
10
10
  registeredDevices: 'RegisteredDevices',
11
11
  axisStsArray: 'AxisStsArray',
12
12
  HeartbeatPLC: 'HeartbeatPLC',
13
- HeartbeatHMI: 'HeartbeatHMI'
13
+ HeartbeatHMI: 'HeartbeatHMI',
14
+ parts: 'Parts',
14
15
  }
15
16
 
16
17
  export const DeviceTags = {
@@ -1,11 +0,0 @@
1
- import { PartState } from "../enums";
2
- export interface PartData {
3
- cncPreOp: [PartState, PartState];
4
- cnc: [PartState, PartState];
5
- cncPostOp: [PartState, PartState];
6
- doneShelf: PartState[];
7
- rawShelf: PartState[];
8
- robot: [PartState, PartState];
9
- washer: [PartState, PartState];
10
- hmiEditingAllowed: boolean;
11
- }
@@ -1,21 +0,0 @@
1
- export enum Priority {
2
- //TopPriorities must be ordered from most important (priority = 1) to least important
3
- NoPriority = 0, //no priorites were detected
4
- StartCnc = 1, //priority to start cnc (get robot out of cnc, close door and start that thing)
5
- DropoffMachinedParts = 2, //Dropoff machined parts in the post op (do this after cnc machining and before cnc loading)
6
- LoadCnc = 3, //Top priority to load the deburred parts into the cnc
7
- FinishPostOp = 4, //Top prioroity to finish parts after the cnc op
8
- UnloadCnc = 5, //Top priority to remove machined parts from cnc
9
- PrepParts = 6, //Top priority to get two parts deburred into the preop deadnest
10
- WaitToUnload = 7,
11
- CloseCncDoor = 8,
12
-
13
- //FillRobotWithTwoDeburredParts=11, //sub priority to loading cnc, robot needs to fill both grippers with deburred parts
14
- DeburrPart = 20, //sub priorty to loading cnc and robot needs deburred parts
15
- PickRawShelf = 21, //sub priority to pick raw shelf
16
- PickRawPartFromPreOp = 22, //sub priority to pick raw shelf
17
- LoadPreOpWithDeburred = 23,
18
- GatherDeburredPartsForCncLoad = 24, //Top priority to grab deburred parts and get in ready position to load cnc (do this before cnc loading)
19
- WashParts = 31,
20
- RejectScrap = 91, //priority to pick and reject a scrap part
21
- }