@kuriousdesign/machine-sdk 1.0.29 → 1.0.31
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.
- package/dist/custom-types/GlobalConstants.d.ts +30 -0
- package/dist/custom-types/GlobalConstants.js +81 -0
- package/dist/custom-types/Machine.d.ts +7 -1
- package/dist/custom-types/Machine.js +35 -0
- package/dist/custom-types/TaskQueue.d.ts +8 -6
- package/dist/custom-types/TaskQueue.js +14 -1
- package/package.json +1 -1
- package/src/custom-types/GlobalConstants.ts +92 -1
- package/src/custom-types/Machine.ts +44 -3
- package/src/custom-types/TaskQueue.ts +25 -7
|
@@ -2,3 +2,33 @@ export interface GlobalConstants {
|
|
|
2
2
|
HIDE_LEFT_TWO_COLUMNS: boolean;
|
|
3
3
|
HIDE_RIGHT_COLUMN: boolean;
|
|
4
4
|
}
|
|
5
|
+
export declare const GCs: {
|
|
6
|
+
NUM_AXES: number;
|
|
7
|
+
MAX_NUM_NAUTILUS_AXES: number;
|
|
8
|
+
NUM_DEVICES: number;
|
|
9
|
+
MOMENTARY_PB: number;
|
|
10
|
+
ROBOT_PART_COUNT: number;
|
|
11
|
+
RECIPE_COUNT_MAX: number;
|
|
12
|
+
HIDE_LEFT_TWO_COLUMNS: boolean;
|
|
13
|
+
HIDE_RIGHT_COLUMN: boolean;
|
|
14
|
+
HIDE_LEFT_ONE_COLUMN: boolean;
|
|
15
|
+
SHELF_PART_COUNT: number;
|
|
16
|
+
NUM_OF_COLS: number;
|
|
17
|
+
PARTS_IN_COL: number;
|
|
18
|
+
MACHINE_FAULTCODEARRAY_LEN: number;
|
|
19
|
+
MAX_NUM_INPUTS: number;
|
|
20
|
+
NUM_PARTS_XFER: number;
|
|
21
|
+
NUM_PARTS_IB: number;
|
|
22
|
+
NUM_LOG_ENTRIES: number;
|
|
23
|
+
TASK_LIST_LEN: number;
|
|
24
|
+
TASK_STORE_LEN: number;
|
|
25
|
+
TASK_LOG_LEN: number;
|
|
26
|
+
STATION_COUNT: number;
|
|
27
|
+
TOP_PRIORITY_COUNT: number;
|
|
28
|
+
DEFAULT_TASK_DURATION_SEC: number;
|
|
29
|
+
PARTDATA_COUNT: number;
|
|
30
|
+
USERFRAME_COUNT: number;
|
|
31
|
+
SYSTIME_TO_UTC_SCALAR: number;
|
|
32
|
+
NUM_PARTS_PER_FIXTURE: number;
|
|
33
|
+
MAX_NUM_HW_CARDS: number;
|
|
34
|
+
};
|
|
@@ -1,2 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GCs = void 0;
|
|
4
|
+
// {attribute 'qualified_only'}
|
|
5
|
+
// VAR_GLOBAL CONSTANT
|
|
6
|
+
// NUM_AXES:INT:=20;
|
|
7
|
+
// MAX_NUM_NAUTILUS_AXES:INT:=20;
|
|
8
|
+
// NUM_DEVICES:INT:=50; //get this from DeviceIds
|
|
9
|
+
// //STEP_TIMEOUT: TIME := T#5000MS;
|
|
10
|
+
// //TIMEOUT_ERROR_CODE_SHIFT: INT:= 10000;
|
|
11
|
+
// //DEVICE_FAULTCODEARRAY_LEN:INT:=3;
|
|
12
|
+
// MOMENTARY_PB: TIME:= T#250MS;
|
|
13
|
+
// ROBOT_PART_COUNT: INT:=2;
|
|
14
|
+
// //CNC_PART_COUNT: INT:=2;
|
|
15
|
+
// RECIPE_COUNT_MAX:INT :=20;
|
|
16
|
+
// HIDE_LEFT_TWO_COLUMNS:BOOL:=TRUE;//if true, the robot will pick/load the last two columns of the raw/done shelves
|
|
17
|
+
// HIDE_RIGHT_COLUMN:BOOL:=TRUE;
|
|
18
|
+
// HIDE_LEFT_ONE_COLUMN:BOOL:=FALSE;//this must be false if hide left two is true
|
|
19
|
+
// SHELF_PART_COUNT: INT:=100;
|
|
20
|
+
// NUM_OF_COLS:INT:=20; //total columns on shelf
|
|
21
|
+
// PARTS_IN_COL:INT:=5; //total parts in a column
|
|
22
|
+
// //DIAGONAL_PATTERN: BOOL:=TRUE;//is shelf picking/loading is diagonal pattern, otherwise its column picking/loading
|
|
23
|
+
// //WASHER_PART_COUNT: INT:=2;
|
|
24
|
+
// MACHINE_FAULTCODEARRAY_LEN: INT:=50;
|
|
25
|
+
// MAX_NUM_INPUTS: INT :=50;
|
|
26
|
+
// NUM_PARTS_XFER:INT:=10;
|
|
27
|
+
// NUM_PARTS_IB:INT:=51;
|
|
28
|
+
// NUM_LOG_ENTRIES:INT:=25;
|
|
29
|
+
// TASK_LIST_LEN:INT:=25;
|
|
30
|
+
// TASK_STORE_LEN:INT:=100 + TASK_LIST_LEN; //length of the array of stored (configured) tasks, the range of index 100 and greater are reserved for waypoints
|
|
31
|
+
// TASK_LOG_LEN:INT:=25;
|
|
32
|
+
// STATION_COUNT:INT:=6; //total number of designated areas that can hold parts: robot, raw shelf, preop, cnc, postop and done shelf
|
|
33
|
+
// TOP_PRIORITY_COUNT:INT:=7; //total number of top priorities in the Priorities ENUM
|
|
34
|
+
// //DEBUG_LOG_LEN:INT:=10;
|
|
35
|
+
// DEFAULT_TASK_DURATION_SEC:INT:=5;
|
|
36
|
+
// PARTDATA_COUNT:INT:= 25;//total count of parts contained in PartData struct
|
|
37
|
+
// USERFRAME_COUNT:INT:=10;
|
|
38
|
+
// //DEVICE_CHILDREN_ARRAY_LEN:INT:=10;
|
|
39
|
+
// SYSTIME_TO_UTC_SCALAR:ULINT := LREAL_TO_ULINT(10E6);
|
|
40
|
+
// NUM_PARTS_PER_FIXTURE:INT:=8;
|
|
41
|
+
// //TASKQUEUE_LEN:INT:=100;
|
|
42
|
+
// // HW SIDE
|
|
43
|
+
// MAX_NUM_HW_CARDS:INT:=16;
|
|
44
|
+
// END_VAR
|
|
45
|
+
exports.GCs = {
|
|
46
|
+
NUM_AXES: 20,
|
|
47
|
+
MAX_NUM_NAUTILUS_AXES: 20,
|
|
48
|
+
NUM_DEVICES: 50, //get this from DeviceIds
|
|
49
|
+
//STEP_TIMEOUT: TIME := T#5000MS;
|
|
50
|
+
//TIMEOUT_ERROR_CODE_SHIFT: INT:= 10000;
|
|
51
|
+
MOMENTARY_PB: 250, // TIME:= T#250MS;
|
|
52
|
+
ROBOT_PART_COUNT: 2,
|
|
53
|
+
//CNC_PART_COUNT: INT:=2;
|
|
54
|
+
RECIPE_COUNT_MAX: 20,
|
|
55
|
+
HIDE_LEFT_TWO_COLUMNS: true, //if true, the robot will pick/load the last two columns of the raw/done shelves
|
|
56
|
+
HIDE_RIGHT_COLUMN: true,
|
|
57
|
+
HIDE_LEFT_ONE_COLUMN: false, //this must be false if hide left two is true
|
|
58
|
+
SHELF_PART_COUNT: 100,
|
|
59
|
+
NUM_OF_COLS: 20, //total columns on shelf
|
|
60
|
+
PARTS_IN_COL: 5, //total parts in a column
|
|
61
|
+
//DIAGONAL_PATTERN: BOOL:=TRUE;//is shelf picking/loading is diagonal pattern, otherwise its column picking/loading
|
|
62
|
+
//WASHER_PART_COUNT: INT:=2;
|
|
63
|
+
MACHINE_FAULTCODEARRAY_LEN: 50,
|
|
64
|
+
MAX_NUM_INPUTS: 50,
|
|
65
|
+
NUM_PARTS_XFER: 10,
|
|
66
|
+
NUM_PARTS_IB: 51,
|
|
67
|
+
NUM_LOG_ENTRIES: 25,
|
|
68
|
+
TASK_LIST_LEN: 25,
|
|
69
|
+
TASK_STORE_LEN: 125, //length of the array of stored (configured) tasks, the range of index 100 and greater are reserved for waypoints
|
|
70
|
+
TASK_LOG_LEN: 25,
|
|
71
|
+
STATION_COUNT: 6, //total number of designated areas that can hold parts: robot, raw shelf, preop, cnc, postop and done shelf
|
|
72
|
+
TOP_PRIORITY_COUNT: 7, //total number of top priorities in the Priorities ENUM
|
|
73
|
+
//DEBUG_LOG_LEN:INT:=10;
|
|
74
|
+
DEFAULT_TASK_DURATION_SEC: 5,
|
|
75
|
+
PARTDATA_COUNT: 25, //total count of parts contained in PartData struct
|
|
76
|
+
USERFRAME_COUNT: 10,
|
|
77
|
+
//DEVICE_CHILDREN_ARRAY_LEN:INT:=10;
|
|
78
|
+
SYSTIME_TO_UTC_SCALAR: 10E6, //ULINT := LREAL_TO_ULINT(10E6);
|
|
79
|
+
NUM_PARTS_PER_FIXTURE: 8,
|
|
80
|
+
//TASKQUEUE_LEN:INT:=100;
|
|
81
|
+
// HW SIDE
|
|
82
|
+
MAX_NUM_HW_CARDS: 16,
|
|
83
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentAnimation } from ".";
|
|
1
|
+
import { ComponentAnimation, DeviceRegistration, TaskQueue } from ".";
|
|
2
2
|
import { PartData } from "./Part";
|
|
3
3
|
export interface UserData {
|
|
4
4
|
activeUser: number;
|
|
@@ -9,10 +9,12 @@ export interface FaultCodeData {
|
|
|
9
9
|
deviceId: number;
|
|
10
10
|
code: number;
|
|
11
11
|
}
|
|
12
|
+
export declare const initialFaultCodeData: FaultCodeData;
|
|
12
13
|
export interface SystemFaultData {
|
|
13
14
|
list: FaultCodeData[];
|
|
14
15
|
present: boolean;
|
|
15
16
|
}
|
|
17
|
+
export declare const initialSystemFaultData: SystemFaultData;
|
|
16
18
|
export interface MachineCfg {
|
|
17
19
|
firmwareVersion: string;
|
|
18
20
|
cellType: string;
|
|
@@ -22,6 +24,7 @@ export interface MachineCfg {
|
|
|
22
24
|
apiOpcuaDeviceId: number;
|
|
23
25
|
ethernetAdapterList: number[];
|
|
24
26
|
}
|
|
27
|
+
export declare const initialMachineCfg: MachineCfg;
|
|
25
28
|
export interface Machine {
|
|
26
29
|
estopCircuit_OK: boolean;
|
|
27
30
|
estopCircuitDelayed_OK: boolean;
|
|
@@ -35,4 +38,7 @@ export interface Machine {
|
|
|
35
38
|
parts: PartData[];
|
|
36
39
|
errors: SystemFaultData;
|
|
37
40
|
warnings: SystemFaultData;
|
|
41
|
+
taskQueue: TaskQueue;
|
|
42
|
+
registeredDevices: DeviceRegistration[];
|
|
38
43
|
}
|
|
44
|
+
export declare const initialMachine: Machine;
|
|
@@ -1,2 +1,37 @@
|
|
|
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
|
+
registeredDevices: Array(_1.GCs.NUM_DEVICES).fill(null).map(() => ({ ..._1.initialDeviceRegistration }))
|
|
37
|
+
});
|
|
@@ -9,15 +9,17 @@ export declare enum Priorities {
|
|
|
9
9
|
STOP_UTILITIES = 60,
|
|
10
10
|
UNLOAD_PARTS = 70
|
|
11
11
|
}
|
|
12
|
-
export interface TaskQueue {
|
|
13
|
-
topPriority: Priorities;
|
|
14
|
-
taskList: TaskData[];
|
|
15
|
-
taskCnt: number;
|
|
16
|
-
activeTaskIndex: number;
|
|
17
|
-
}
|
|
18
12
|
export interface TaskData {
|
|
19
13
|
targetId: number;
|
|
20
14
|
taskId: number;
|
|
21
15
|
paramArray: number[];
|
|
22
16
|
state: number;
|
|
23
17
|
}
|
|
18
|
+
export declare const initialTaskData: TaskData;
|
|
19
|
+
export interface TaskQueue {
|
|
20
|
+
topPriority: Priorities;
|
|
21
|
+
taskList: TaskData[];
|
|
22
|
+
taskCnt: number;
|
|
23
|
+
activeTaskIndex: number;
|
|
24
|
+
}
|
|
25
|
+
export declare const initialTaskQueue: TaskQueue;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Priorities = void 0;
|
|
3
|
+
exports.initialTaskQueue = exports.initialTaskData = exports.Priorities = void 0;
|
|
4
|
+
const BaseDevice_1 = require("./BaseDevice");
|
|
4
5
|
var Priorities;
|
|
5
6
|
(function (Priorities) {
|
|
6
7
|
Priorities[Priorities["NONE"] = 0] = "NONE";
|
|
@@ -13,3 +14,15 @@ var Priorities;
|
|
|
13
14
|
Priorities[Priorities["STOP_UTILITIES"] = 60] = "STOP_UTILITIES";
|
|
14
15
|
Priorities[Priorities["UNLOAD_PARTS"] = 70] = "UNLOAD_PARTS";
|
|
15
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
|
+
};
|
package/package.json
CHANGED
|
@@ -1,4 +1,95 @@
|
|
|
1
1
|
export interface GlobalConstants {
|
|
2
2
|
HIDE_LEFT_TWO_COLUMNS: boolean;
|
|
3
3
|
HIDE_RIGHT_COLUMN: boolean;
|
|
4
|
-
}
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// {attribute 'qualified_only'}
|
|
7
|
+
// VAR_GLOBAL CONSTANT
|
|
8
|
+
// NUM_AXES:INT:=20;
|
|
9
|
+
// MAX_NUM_NAUTILUS_AXES:INT:=20;
|
|
10
|
+
// NUM_DEVICES:INT:=50; //get this from DeviceIds
|
|
11
|
+
// //STEP_TIMEOUT: TIME := T#5000MS;
|
|
12
|
+
// //TIMEOUT_ERROR_CODE_SHIFT: INT:= 10000;
|
|
13
|
+
// //DEVICE_FAULTCODEARRAY_LEN:INT:=3;
|
|
14
|
+
|
|
15
|
+
// MOMENTARY_PB: TIME:= T#250MS;
|
|
16
|
+
// ROBOT_PART_COUNT: INT:=2;
|
|
17
|
+
// //CNC_PART_COUNT: INT:=2;
|
|
18
|
+
// RECIPE_COUNT_MAX:INT :=20;
|
|
19
|
+
// HIDE_LEFT_TWO_COLUMNS:BOOL:=TRUE;//if true, the robot will pick/load the last two columns of the raw/done shelves
|
|
20
|
+
// HIDE_RIGHT_COLUMN:BOOL:=TRUE;
|
|
21
|
+
// HIDE_LEFT_ONE_COLUMN:BOOL:=FALSE;//this must be false if hide left two is true
|
|
22
|
+
// SHELF_PART_COUNT: INT:=100;
|
|
23
|
+
// NUM_OF_COLS:INT:=20; //total columns on shelf
|
|
24
|
+
// PARTS_IN_COL:INT:=5; //total parts in a column
|
|
25
|
+
// //DIAGONAL_PATTERN: BOOL:=TRUE;//is shelf picking/loading is diagonal pattern, otherwise its column picking/loading
|
|
26
|
+
// //WASHER_PART_COUNT: INT:=2;
|
|
27
|
+
// MACHINE_FAULTCODEARRAY_LEN: INT:=50;
|
|
28
|
+
// MAX_NUM_INPUTS: INT :=50;
|
|
29
|
+
|
|
30
|
+
// NUM_PARTS_XFER:INT:=10;
|
|
31
|
+
// NUM_PARTS_IB:INT:=51;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
// NUM_LOG_ENTRIES:INT:=25;
|
|
35
|
+
// TASK_LIST_LEN:INT:=25;
|
|
36
|
+
// TASK_STORE_LEN:INT:=100 + TASK_LIST_LEN; //length of the array of stored (configured) tasks, the range of index 100 and greater are reserved for waypoints
|
|
37
|
+
// TASK_LOG_LEN:INT:=25;
|
|
38
|
+
// STATION_COUNT:INT:=6; //total number of designated areas that can hold parts: robot, raw shelf, preop, cnc, postop and done shelf
|
|
39
|
+
// TOP_PRIORITY_COUNT:INT:=7; //total number of top priorities in the Priorities ENUM
|
|
40
|
+
|
|
41
|
+
// //DEBUG_LOG_LEN:INT:=10;
|
|
42
|
+
// DEFAULT_TASK_DURATION_SEC:INT:=5;
|
|
43
|
+
// PARTDATA_COUNT:INT:= 25;//total count of parts contained in PartData struct
|
|
44
|
+
|
|
45
|
+
// USERFRAME_COUNT:INT:=10;
|
|
46
|
+
// //DEVICE_CHILDREN_ARRAY_LEN:INT:=10;
|
|
47
|
+
// SYSTIME_TO_UTC_SCALAR:ULINT := LREAL_TO_ULINT(10E6);
|
|
48
|
+
// NUM_PARTS_PER_FIXTURE:INT:=8;
|
|
49
|
+
// //TASKQUEUE_LEN:INT:=100;
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// // HW SIDE
|
|
53
|
+
// MAX_NUM_HW_CARDS:INT:=16;
|
|
54
|
+
// END_VAR
|
|
55
|
+
|
|
56
|
+
export const GCs = {
|
|
57
|
+
|
|
58
|
+
NUM_AXES: 20,
|
|
59
|
+
MAX_NUM_NAUTILUS_AXES: 20,
|
|
60
|
+
NUM_DEVICES: 50, //get this from DeviceIds
|
|
61
|
+
//STEP_TIMEOUT: TIME := T#5000MS;
|
|
62
|
+
//TIMEOUT_ERROR_CODE_SHIFT: INT:= 10000;
|
|
63
|
+
MOMENTARY_PB: 250, // TIME:= T#250MS;
|
|
64
|
+
ROBOT_PART_COUNT: 2,
|
|
65
|
+
//CNC_PART_COUNT: INT:=2;
|
|
66
|
+
RECIPE_COUNT_MAX: 20,
|
|
67
|
+
HIDE_LEFT_TWO_COLUMNS: true, //if true, the robot will pick/load the last two columns of the raw/done shelves
|
|
68
|
+
HIDE_RIGHT_COLUMN: true,
|
|
69
|
+
HIDE_LEFT_ONE_COLUMN: false, //this must be false if hide left two is true
|
|
70
|
+
SHELF_PART_COUNT: 100,
|
|
71
|
+
NUM_OF_COLS: 20, //total columns on shelf
|
|
72
|
+
PARTS_IN_COL: 5, //total parts in a column
|
|
73
|
+
//DIAGONAL_PATTERN: BOOL:=TRUE;//is shelf picking/loading is diagonal pattern, otherwise its column picking/loading
|
|
74
|
+
//WASHER_PART_COUNT: INT:=2;
|
|
75
|
+
MACHINE_FAULTCODEARRAY_LEN: 50,
|
|
76
|
+
MAX_NUM_INPUTS: 50,
|
|
77
|
+
NUM_PARTS_XFER: 10,
|
|
78
|
+
NUM_PARTS_IB: 51,
|
|
79
|
+
NUM_LOG_ENTRIES: 25,
|
|
80
|
+
TASK_LIST_LEN: 25,
|
|
81
|
+
TASK_STORE_LEN: 125, //length of the array of stored (configured) tasks, the range of index 100 and greater are reserved for waypoints
|
|
82
|
+
TASK_LOG_LEN: 25,
|
|
83
|
+
STATION_COUNT: 6, //total number of designated areas that can hold parts: robot, raw shelf, preop, cnc, postop and done shelf
|
|
84
|
+
TOP_PRIORITY_COUNT: 7, //total number of top priorities in the Priorities ENUM
|
|
85
|
+
//DEBUG_LOG_LEN:INT:=10;
|
|
86
|
+
DEFAULT_TASK_DURATION_SEC: 5,
|
|
87
|
+
PARTDATA_COUNT: 25, //total count of parts contained in PartData struct
|
|
88
|
+
USERFRAME_COUNT: 10,
|
|
89
|
+
//DEVICE_CHILDREN_ARRAY_LEN:INT:=10;
|
|
90
|
+
SYSTIME_TO_UTC_SCALAR: 10E6, //ULINT := LREAL_TO_ULINT(10E6);
|
|
91
|
+
NUM_PARTS_PER_FIXTURE: 8,
|
|
92
|
+
//TASKQUEUE_LEN:INT:=100;
|
|
93
|
+
// HW SIDE
|
|
94
|
+
MAX_NUM_HW_CARDS: 16,
|
|
95
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ComponentAnimation } from ".";
|
|
1
|
+
import { ComponentAnimation, DeviceConstants, DeviceRegistration, GCs, initialDeviceRegistration, initialTaskQueue, TaskQueue } from ".";
|
|
2
2
|
import { PartData } from "./Part";
|
|
3
3
|
|
|
4
|
+
|
|
4
5
|
export interface UserData {
|
|
5
6
|
activeUser: number;
|
|
6
7
|
hmiLoginBtn: ComponentAnimation;
|
|
@@ -12,11 +13,22 @@ export interface FaultCodeData {
|
|
|
12
13
|
code: number;
|
|
13
14
|
}
|
|
14
15
|
|
|
16
|
+
export const initialFaultCodeData: FaultCodeData = {
|
|
17
|
+
deviceId: 0,
|
|
18
|
+
code: 0,
|
|
19
|
+
};
|
|
20
|
+
|
|
15
21
|
export interface SystemFaultData {
|
|
16
22
|
list: FaultCodeData[];
|
|
17
23
|
present: boolean;
|
|
18
24
|
}
|
|
19
25
|
|
|
26
|
+
export const initialSystemFaultData: SystemFaultData = {
|
|
27
|
+
list: Array(DeviceConstants.DEVICE_FAULTCODEARRAY_LEN).fill(null).map(() => ({ ...initialFaultCodeData })),
|
|
28
|
+
present: false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
|
|
20
32
|
|
|
21
33
|
// TYPE MachineCfg :
|
|
22
34
|
// STRUCT
|
|
@@ -45,6 +57,16 @@ export interface MachineCfg {
|
|
|
45
57
|
ethernetAdapterList: number[];
|
|
46
58
|
}
|
|
47
59
|
|
|
60
|
+
export const initialMachineCfg: MachineCfg = {
|
|
61
|
+
firmwareVersion: "",
|
|
62
|
+
cellType: "",
|
|
63
|
+
softwareMode: "",
|
|
64
|
+
allowAnonymousControl: false,
|
|
65
|
+
deviceIsBypassed: [],
|
|
66
|
+
apiOpcuaDeviceId: -1,
|
|
67
|
+
ethernetAdapterList: [],
|
|
68
|
+
};
|
|
69
|
+
|
|
48
70
|
export interface Machine {
|
|
49
71
|
estopCircuit_OK: boolean;
|
|
50
72
|
estopCircuitDelayed_OK: boolean;
|
|
@@ -58,5 +80,24 @@ export interface Machine {
|
|
|
58
80
|
parts: PartData[];
|
|
59
81
|
errors: SystemFaultData;
|
|
60
82
|
warnings: SystemFaultData;
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
taskQueue: TaskQueue;
|
|
84
|
+
registeredDevices: DeviceRegistration[];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const initialMachine: Machine = ({
|
|
88
|
+
estopCircuit_OK: false,
|
|
89
|
+
estopCircuitDelayed_OK: false,
|
|
90
|
+
fenceCircuit_OK: false,
|
|
91
|
+
guardDoors_LOCKED: false,
|
|
92
|
+
networkHealth_OK: false,
|
|
93
|
+
ethercatMaster_OK: false,
|
|
94
|
+
ethercatSlaves_OK: false,
|
|
95
|
+
supplyAir_OK: false,
|
|
96
|
+
cfg: { ...initialMachineCfg },
|
|
97
|
+
parts: [],
|
|
98
|
+
errors: { ...initialSystemFaultData },
|
|
99
|
+
warnings: { ...initialSystemFaultData },
|
|
100
|
+
taskQueue: { ...initialTaskQueue },
|
|
101
|
+
registeredDevices: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceRegistration }))
|
|
102
|
+
|
|
103
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DeviceConstants } from "./BaseDevice";
|
|
2
|
+
|
|
1
3
|
export enum Priorities {
|
|
2
4
|
NONE = 0, // do not remove or change this
|
|
3
5
|
LOAD_PARTS = 2,
|
|
@@ -10,16 +12,32 @@ export enum Priorities {
|
|
|
10
12
|
UNLOAD_PARTS = 70
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
topPriority: Priorities;
|
|
15
|
-
taskList: TaskData[];
|
|
16
|
-
taskCnt: number;
|
|
17
|
-
activeTaskIndex: number;
|
|
18
|
-
}
|
|
15
|
+
|
|
19
16
|
|
|
20
17
|
export interface TaskData {
|
|
21
18
|
targetId: number;
|
|
22
19
|
taskId: number; // specific to the targetId
|
|
23
20
|
paramArray: number[]; // ARRAY[0..DeviceConstants.MAX_NUM_PARAMS-1] OF LREAL;
|
|
24
21
|
state: number; // DeviceStates: 0 (NONE), IDLE, RUNNING, PAUSED, ERROR, DONE
|
|
25
|
-
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const initialTaskData: TaskData = {
|
|
25
|
+
targetId: 0,
|
|
26
|
+
taskId: 0,
|
|
27
|
+
paramArray: Array(DeviceConstants.MAX_NUM_PARAMS).fill(0),
|
|
28
|
+
state: 0
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export interface TaskQueue {
|
|
33
|
+
topPriority: Priorities;
|
|
34
|
+
taskList: TaskData[];
|
|
35
|
+
taskCnt: number;
|
|
36
|
+
activeTaskIndex: number;
|
|
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
|
+
};
|