@kuriousdesign/machine-sdk 1.0.39 → 1.0.41

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.
@@ -90,3 +90,7 @@ export interface Device {
90
90
  apiOpcua: ApiOpcuaData;
91
91
  }
92
92
  export declare const initialDevice: Device;
93
+ export interface DeviceLogData {
94
+ list: DebugLogData[];
95
+ lastIndex: number;
96
+ }
@@ -31,4 +31,5 @@ export declare const GCs: {
31
31
  SYSTIME_TO_UTC_SCALAR: number;
32
32
  NUM_PARTS_PER_FIXTURE: number;
33
33
  MAX_NUM_HW_CARDS: number;
34
+ NUM_ENTRIES_MACHINE_LOG: number;
34
35
  };
@@ -80,4 +80,5 @@ exports.GCs = {
80
80
  //TASKQUEUE_LEN:INT:=100;
81
81
  // HW SIDE
82
82
  MAX_NUM_HW_CARDS: 16,
83
+ NUM_ENTRIES_MACHINE_LOG: 100,
83
84
  };
@@ -1,4 +1,4 @@
1
- import { ComponentAnimation, DeviceRegistration, TaskQueue } from ".";
1
+ import { ComponentAnimation, DebugLogData, DeviceLogData, DeviceRegistration, TaskQueue } from ".";
2
2
  import { PartDataStatus } from "./Part";
3
3
  export interface UserData {
4
4
  activeUser: number;
@@ -42,5 +42,12 @@ export interface Machine {
42
42
  registeredDevices: DeviceRegistration[];
43
43
  heartbeatPlc: number;
44
44
  heartbeatHmi: number;
45
+ machineLog: LogRecordData;
46
+ deviceLogs: DeviceLogData[];
45
47
  }
48
+ export interface LogRecordData {
49
+ list: DebugLogData[];
50
+ lastIndex: number;
51
+ }
52
+ export declare const initialLogRecordData: LogRecordData;
46
53
  export declare const initialMachine: Machine;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialMachine = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
3
+ exports.initialMachine = exports.initialLogRecordData = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
4
4
  const _1 = require(".");
5
5
  const Part_1 = require("./Part");
6
6
  exports.initialFaultCodeData = {
@@ -20,6 +20,10 @@ exports.initialMachineCfg = {
20
20
  apiOpcuaDeviceId: -1,
21
21
  ethernetAdapterList: [],
22
22
  };
23
+ exports.initialLogRecordData = {
24
+ list: Array(_1.GCs.NUM_ENTRIES_MACHINE_LOG).fill(null).map(() => ({ ..._1.initialDebugLogData })),
25
+ lastIndex: 0,
26
+ };
23
27
  exports.initialMachine = ({
24
28
  estopCircuit_OK: false,
25
29
  estopCircuitDelayed_OK: false,
@@ -37,4 +41,6 @@ exports.initialMachine = ({
37
41
  registeredDevices: [],
38
42
  heartbeatPlc: 0,
39
43
  heartbeatHmi: 0,
44
+ machineLog: { ...exports.initialLogRecordData },
45
+ deviceLogs: Array(_1.GCs.NUM_DEVICES).fill(null).map(() => ({ ..._1.initialDeviceLogData })),
40
46
  });
@@ -11,6 +11,8 @@ export declare const MachineTags: {
11
11
  HeartbeatHMI: string;
12
12
  parts: string;
13
13
  taskQueue: string;
14
+ machineLog: string;
15
+ deviceLogs: string;
14
16
  };
15
17
  export declare const DeviceTags: {
16
18
  Cfg: string;
@@ -29,6 +29,9 @@ exports.MachineTags = {
29
29
  HeartbeatHMI: 'HeartbeatHMI',
30
30
  parts: 'Parts',
31
31
  taskQueue: 'TaskQueue',
32
+ //deviceLogs: 'DeviceLogs',
33
+ machineLog: 'MachineLog',
34
+ deviceLogs: 'Machine.DeviceLogs',
32
35
  };
33
36
  exports.DeviceTags = {
34
37
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
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",
@@ -102,10 +102,10 @@ export interface DeviceStatus {
102
102
  state: number; // enum for States enum, same as the boolean states in the data structure
103
103
  stepNum: number;
104
104
  stepDescription: string;
105
-
105
+
106
106
  colorCode: number; // color to indicate the current status for HMI purposes
107
107
  statusMsg: string; // status string
108
-
108
+
109
109
  error: boolean; // state, device or child has an error
110
110
  killed: boolean; // device is de-energized
111
111
  inactive: boolean; // waiting to be reset
@@ -124,15 +124,15 @@ export interface DeviceStatus {
124
124
  ipr: boolean; // IdleOrPausedOrRunning
125
125
  kei: boolean; // KilledErrorOrInactive
126
126
  runningOrStopping: boolean;
127
-
127
+
128
128
  // Children Status
129
129
  allChildrenIdle: boolean;
130
130
  allChildrenKilled: boolean;
131
131
  allChildrenInactive: boolean;
132
132
  allChildrenIdleOrError: boolean;
133
-
133
+
134
134
  commanderId: number; // used for external control
135
-
135
+
136
136
  recordingLogs: boolean;
137
137
  }
138
138
 
@@ -202,4 +202,17 @@ export const initialDevice: Device = {
202
202
  process: initialProcessData,
203
203
  script: initialProcessData,
204
204
  apiOpcua: initialApiOpcuaData
205
- };
205
+ };
206
+
207
+
208
+ // TYPE DeviceLogData :
209
+ // STRUCT
210
+ // List: ARRAY[0..DeviceConstants.NUM_LOG_ENTRIES-1] OF DebugLogData;
211
+ // LastIndex:INT; //index of the most recent recorde entries
212
+ // END_STRUCT
213
+ // END_TYPE
214
+
215
+ export interface DeviceLogData {
216
+ list: DebugLogData[];
217
+ lastIndex: number; // index of the most recent recorded entries
218
+ }
@@ -92,4 +92,5 @@ export const GCs = {
92
92
  //TASKQUEUE_LEN:INT:=100;
93
93
  // HW SIDE
94
94
  MAX_NUM_HW_CARDS: 16,
95
+ NUM_ENTRIES_MACHINE_LOG: 100,
95
96
  };
@@ -1,4 +1,4 @@
1
- import { ComponentAnimation, DeviceConstants, DeviceRegistration, GCs, initialDeviceRegistration, initialTaskQueue, TaskQueue } from ".";
1
+ import { ComponentAnimation, DebugLogData, DeviceConstants, DeviceLogData, DeviceRegistration, GCs, initialDebugLogData, initialDeviceLogData, initialDeviceRegistration, initialTaskQueue, TaskQueue } from ".";
2
2
  import { initialPartDataStatus, PartData, PartDataStatus } from "./Part";
3
3
 
4
4
 
@@ -84,8 +84,27 @@ export interface Machine {
84
84
  registeredDevices: DeviceRegistration[];
85
85
  heartbeatPlc: number;
86
86
  heartbeatHmi: number;
87
+ machineLog: LogRecordData;
88
+ deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
87
89
  }
88
90
 
91
+ // TYPE LogRecordData :
92
+ // STRUCT
93
+ // List: ARRAY[0..DiagConstants.NUM_ENTRIES_RECORDED_LOG-1] OF DebugLogData;
94
+ // LastIndex:USINT; //index of the most recent recorde entries
95
+ // END_STRUCT
96
+ // END_TYPE
97
+
98
+ export interface LogRecordData {
99
+ list: DebugLogData[];
100
+ lastIndex: number; // index of the most recent recorded entries
101
+ }
102
+
103
+ export const initialLogRecordData: LogRecordData = {
104
+ list: Array(GCs.NUM_ENTRIES_MACHINE_LOG).fill(null).map(() => ({ ...initialDebugLogData })),
105
+ lastIndex: 0,
106
+ };
107
+
89
108
  export const initialMachine: Machine = ({
90
109
  estopCircuit_OK: false,
91
110
  estopCircuitDelayed_OK: false,
@@ -103,4 +122,6 @@ export const initialMachine: Machine = ({
103
122
  registeredDevices: [],
104
123
  heartbeatPlc: 0,
105
124
  heartbeatHmi: 0,
125
+ machineLog: { ...initialLogRecordData },
126
+ deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
106
127
  });
@@ -11,4 +11,4 @@ export * from "./UserManagerFB";
11
11
  export * from "./TaskQueue";
12
12
  export * from "./Devices";
13
13
  export * from "./Bridge";
14
- export * from "./Part";
14
+ export * from "./Part";
@@ -13,6 +13,9 @@ export const MachineTags = {
13
13
  HeartbeatHMI: 'HeartbeatHMI',
14
14
  parts: 'Parts',
15
15
  taskQueue: 'TaskQueue',
16
+ //deviceLogs: 'DeviceLogs',
17
+ machineLog: 'MachineLog',
18
+ deviceLogs: 'Machine.DeviceLogs',
16
19
  }
17
20
 
18
21
  export const DeviceTags = {