@kuriousdesign/machine-sdk 1.0.85 → 1.0.86

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,4 +1,4 @@
1
- import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, JobData, RecipeStore, TaskQueue } from ".";
1
+ import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, JobData, RecipeData, RecipeStore, TaskQueue } from ".";
2
2
  import { PartDataStatus } from "./Part";
3
3
  export interface UserData {
4
4
  activeUser: number;
@@ -46,6 +46,9 @@ export interface Machine {
46
46
  machineLog: LogRecordData;
47
47
  recipeStore: RecipeStore;
48
48
  job: JobData;
49
+ currentTimeMs: number;
50
+ activeUserId: number;
51
+ activeRecipe: RecipeData;
49
52
  }
50
53
  export interface LogRecordData {
51
54
  list: DebugLogData[];
@@ -47,4 +47,7 @@ exports.initialMachine = ({
47
47
  recipeStore: { ..._1.initialRecipeStore },
48
48
  job: { ..._1.initialJobData },
49
49
  //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
50
+ currentTimeMs: 0,
51
+ activeUserId: 0,
52
+ activeRecipe: { ..._1.initialRecipe },
50
53
  });
@@ -5,3 +5,8 @@ export interface UserManagerFB {
5
5
  username: string;
6
6
  password: string;
7
7
  }
8
+ export declare enum Users {
9
+ OPERATOR = 0,
10
+ EXPERT = 1
11
+ }
12
+ export declare function userIdToString(userId: number): string;
@@ -1,2 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Users = void 0;
4
+ exports.userIdToString = userIdToString;
5
+ var Users;
6
+ (function (Users) {
7
+ Users[Users["OPERATOR"] = 0] = "OPERATOR";
8
+ Users[Users["EXPERT"] = 1] = "EXPERT";
9
+ })(Users || (exports.Users = Users = {}));
10
+ function userIdToString(userId) {
11
+ switch (userId) {
12
+ case Users.OPERATOR:
13
+ return "Operator";
14
+ case Users.EXPERT:
15
+ return "Expert";
16
+ default:
17
+ return "Unknown";
18
+ }
19
+ }
@@ -24,6 +24,7 @@ export declare const MachineTags: {
24
24
  networkHealth_OK: string;
25
25
  ethercatMaster_OK: string;
26
26
  ethercatSlaves_OK: string;
27
+ currentTimeMs: string;
27
28
  };
28
29
  export declare const DeviceTags: {
29
30
  Cfg: string;
@@ -44,6 +44,7 @@ exports.MachineTags = {
44
44
  networkHealth_OK: 'NetworkHealth_OK',
45
45
  ethercatMaster_OK: 'EthercatMaster_OK',
46
46
  ethercatSlaves_OK: 'EthercatSlaves_OK',
47
+ currentTimeMs: 'CurrentTimeMs',
47
48
  };
48
49
  exports.DeviceTags = {
49
50
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.85",
3
+ "version": "1.0.86",
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,4 +1,4 @@
1
- import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, initialDebugLogData, initialFaultData, initialJobData, initialRecipeStore, initialTaskQueue, JobData, RecipeStore, TaskQueue } from ".";
1
+ import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, initialDebugLogData, initialFaultData, initialJobData, initialRecipe, initialRecipeStore, initialTaskQueue, JobData, RecipeData, RecipeStore, TaskQueue } from ".";
2
2
  import { initialPartDataStatus, PartDataStatus } from "./Part";
3
3
  import { GCs } from "./GlobalConstants";
4
4
 
@@ -90,6 +90,9 @@ export interface Machine {
90
90
  recipeStore: RecipeStore;
91
91
  job: JobData;
92
92
  //deviceLogs: DeviceLogData[]; //ARRAY[0..(GCs.NUM_DEVICES-1)] OF DeviceLogData;
93
+ currentTimeMs: number;
94
+ activeUserId: number;
95
+ activeRecipe: RecipeData;
93
96
  }
94
97
 
95
98
  // TYPE LogRecordData :
@@ -131,4 +134,7 @@ export const initialMachine: Machine = ({
131
134
  recipeStore: { ...initialRecipeStore },
132
135
  job: { ...initialJobData },
133
136
  //deviceLogs: Array(GCs.NUM_DEVICES).fill(null).map(() => ({ ...initialDeviceLogData })),
137
+ currentTimeMs: 0,
138
+ activeUserId: 0,
139
+ activeRecipe: { ...initialRecipe},
134
140
  });
@@ -5,4 +5,20 @@ export interface UserManagerFB {
5
5
  logoutBtn: ComponentAnimation;
6
6
  username: string;
7
7
  password: string;
8
+ }
9
+
10
+ export enum Users {
11
+ OPERATOR = 0,
12
+ EXPERT = 1,
13
+ }
14
+
15
+ export function userIdToString(userId: number): string {
16
+ switch (userId) {
17
+ case Users.OPERATOR:
18
+ return "Operator";
19
+ case Users.EXPERT:
20
+ return "Expert";
21
+ default:
22
+ return "Unknown";
23
+ }
8
24
  }
@@ -29,6 +29,7 @@ export const MachineTags = {
29
29
  networkHealth_OK: 'NetworkHealth_OK',
30
30
  ethercatMaster_OK: 'EthercatMaster_OK',
31
31
  ethercatSlaves_OK: 'EthercatSlaves_OK',
32
+ currentTimeMs: 'CurrentTimeMs',
32
33
  }
33
34
 
34
35
  export const DeviceTags = {