@kuriousdesign/machine-sdk 1.0.103 → 1.0.105

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,10 +1,19 @@
1
- import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, JobData, RecipeData, RecipeStore, TaskQueue } from ".";
1
+ import { DebugLogData, DeviceRegistration, FaultData, JobData, RecipeData, RecipeStore, TaskQueue } from ".";
2
2
  import { PartDataStatus } from "./Part";
3
+ export declare enum Users {
4
+ OPERATOR = 0,
5
+ EXPERT = 1
6
+ }
7
+ export declare function userIdToString(userId: number): string;
3
8
  export interface UserData {
4
9
  activeUser: number;
5
- hmiLoginBtn: ComponentAnimation;
6
- hmiLogoutBtn: ComponentAnimation;
10
+ login_REQ: boolean;
11
+ logout_REQ: boolean;
12
+ username: string;
13
+ password: string;
14
+ timeLeftBeforeAutoLogout_MIN: number;
7
15
  }
16
+ export declare const initialUserData: UserData;
8
17
  export interface FaultCodeData {
9
18
  deviceId: number;
10
19
  code: number;
@@ -66,6 +75,7 @@ export interface Machine {
66
75
  activeUserId: number;
67
76
  activeRecipe: RecipeData;
68
77
  settings: Settings;
78
+ user: UserData;
69
79
  }
70
80
  export interface LogRecordData {
71
81
  list: DebugLogData[];
@@ -1,9 +1,33 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialMachine = exports.initialLogRecordData = exports.initialSettings = exports.initialSettingsAllUsers = exports.initialSettingsExpert = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = void 0;
3
+ exports.initialMachine = exports.initialLogRecordData = exports.initialSettings = exports.initialSettingsAllUsers = exports.initialSettingsExpert = exports.initialMachineCfg = exports.initialSystemFaultData = exports.initialFaultCodeData = exports.initialUserData = exports.Users = void 0;
4
+ exports.userIdToString = userIdToString;
4
5
  const _1 = require(".");
5
6
  const Part_1 = require("./Part");
6
7
  const GlobalConstants_1 = require("./GlobalConstants");
8
+ var Users;
9
+ (function (Users) {
10
+ Users[Users["OPERATOR"] = 0] = "OPERATOR";
11
+ Users[Users["EXPERT"] = 1] = "EXPERT";
12
+ })(Users || (exports.Users = Users = {}));
13
+ function userIdToString(userId) {
14
+ switch (userId) {
15
+ case Users.OPERATOR:
16
+ return "Operator";
17
+ case Users.EXPERT:
18
+ return "Expert";
19
+ default:
20
+ return "Unknown";
21
+ }
22
+ }
23
+ exports.initialUserData = {
24
+ activeUser: 0,
25
+ login_REQ: false,
26
+ logout_REQ: false,
27
+ username: "",
28
+ password: "",
29
+ timeLeftBeforeAutoLogout_MIN: 0,
30
+ };
7
31
  exports.initialFaultCodeData = {
8
32
  deviceId: 0,
9
33
  code: 0,
@@ -66,4 +90,5 @@ exports.initialMachine = ({
66
90
  activeUserId: 0,
67
91
  activeRecipe: { ..._1.initialRecipe },
68
92
  settings: { ...exports.initialSettings },
93
+ user: { ...exports.initialUserData },
69
94
  });
@@ -60,6 +60,8 @@ export interface RecipeData {
60
60
  cameraId: number;
61
61
  cameraString: string;
62
62
  cameraSpeed: number;
63
+ usesBrushTool: boolean;
64
+ brushToolSpeed_RPM: number;
63
65
  }
64
66
  export declare enum CameraIds {
65
67
  NONE = 0,
@@ -150,6 +150,8 @@ exports.initialRecipe = {
150
150
  applicatorToolId: ApplicatorTools.NONE,
151
151
  applicatorToolString: exports.applicatorToolIdToStringMap.get(ApplicatorTools.NONE) || "",
152
152
  applicatorCollisionPayloadOffset: 0,
153
+ usesBrushTool: false,
154
+ brushToolSpeed_RPM: 0,
153
155
  cleanerId: Cleaners.NONE,
154
156
  cleanerString: exports.cleanerIdToStringMap.get(Cleaners.NONE) || "",
155
157
  weighingFingerId: WeighingFingers.NONE,
@@ -5,8 +5,3 @@ 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,19 +1,2 @@
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
- }
@@ -26,6 +26,7 @@ export declare const MachineTags: {
26
26
  ethercatSlaves_OK: string;
27
27
  currentTimeMs: string;
28
28
  settings: string;
29
+ user: string;
29
30
  };
30
31
  export declare const DeviceTags: {
31
32
  Cfg: string;
@@ -46,6 +46,7 @@ exports.MachineTags = {
46
46
  ethercatSlaves_OK: 'EthercatSlaves_OK',
47
47
  currentTimeMs: 'CurrentTimeMs',
48
48
  settings: 'Settings',
49
+ user: 'User',
49
50
  };
50
51
  exports.DeviceTags = {
51
52
  Cfg: 'Cfg',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kuriousdesign/machine-sdk",
3
- "version": "1.0.103",
3
+ "version": "1.0.105",
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",
@@ -2,13 +2,40 @@ import { ComponentAnimation, DebugLogData, DeviceRegistration, FaultData, initia
2
2
  import { initialPartDataStatus, PartDataStatus } from "./Part";
3
3
  import { GCs } from "./GlobalConstants";
4
4
 
5
+ export enum Users {
6
+ OPERATOR = 0,
7
+ EXPERT = 1,
8
+ }
9
+
10
+ export function userIdToString(userId: number): string {
11
+ switch (userId) {
12
+ case Users.OPERATOR:
13
+ return "Operator";
14
+ case Users.EXPERT:
15
+ return "Expert";
16
+ default:
17
+ return "Unknown";
18
+ }
19
+ }
5
20
 
6
21
  export interface UserData {
7
22
  activeUser: number;
8
- hmiLoginBtn: ComponentAnimation;
9
- hmiLogoutBtn: ComponentAnimation;
23
+ login_REQ: boolean;
24
+ logout_REQ: boolean;
25
+ username: string;
26
+ password: string;
27
+ timeLeftBeforeAutoLogout_MIN: number;
10
28
  }
11
29
 
30
+ export const initialUserData: UserData = {
31
+ activeUser: 0,
32
+ login_REQ: false,
33
+ logout_REQ: false,
34
+ username: "",
35
+ password: "",
36
+ timeLeftBeforeAutoLogout_MIN: 0,
37
+ };
38
+
12
39
  export interface FaultCodeData {
13
40
  deviceId: number;
14
41
  code: number;
@@ -30,24 +57,6 @@ export const initialSystemFaultData: SystemFaultData = {
30
57
  };
31
58
 
32
59
 
33
-
34
- // TYPE MachineCfg :
35
- // STRUCT
36
- // FirmwareVersion: STRING;
37
- // CellType: CellTypes;
38
- // SoftwareMode: SoftwareModes;
39
- // AllowAnonymousControl: BOOL;
40
- // DeviceIsBypassed: ARRAY[0..(GCs.NUM_DEVICES-1)] OF BOOL; //used to set devices to be bypassed or not
41
- // ApiOpcuaDeviceId:INT; //designates which device is using the opcua api
42
- // EthernetAdapterList: ARRAY[0..4] OF INT;
43
- // //SerialNumber: STRING(255); moved to ControllerInstanceData
44
- // //Name: STRING; moved to ControllerInstanceData
45
- // //Location: STRING; moved to ControllerInstanceData
46
-
47
- // END_STRUCT
48
- // END_TYPE
49
-
50
-
51
60
  export interface MachineCfg {
52
61
  firmwareVersion: string;
53
62
  cellType: string;
@@ -133,6 +142,7 @@ export interface Machine {
133
142
  activeUserId: number;
134
143
  activeRecipe: RecipeData;
135
144
  settings: Settings;
145
+ user: UserData;
136
146
  }
137
147
 
138
148
  // TYPE LogRecordData :
@@ -178,4 +188,5 @@ export const initialMachine: Machine = ({
178
188
  activeUserId: 0,
179
189
  activeRecipe: { ...initialRecipe},
180
190
  settings: { ...initialSettings },
191
+ user: { ...initialUserData },
181
192
  });
@@ -108,6 +108,9 @@ export interface RecipeData {
108
108
  cameraId: number;
109
109
  cameraString: string;
110
110
  cameraSpeed: number;
111
+
112
+ usesBrushTool: boolean;
113
+ brushToolSpeed_RPM: number;
111
114
  }
112
115
 
113
116
  export enum CameraIds {
@@ -235,6 +238,8 @@ export const initialRecipe: RecipeData = {
235
238
  applicatorToolId: ApplicatorTools.NONE,
236
239
  applicatorToolString: applicatorToolIdToStringMap.get(ApplicatorTools.NONE) || "",
237
240
  applicatorCollisionPayloadOffset: 0,
241
+ usesBrushTool: false,
242
+ brushToolSpeed_RPM: 0,
238
243
  cleanerId: Cleaners.NONE,
239
244
  cleanerString: cleanerIdToStringMap.get(Cleaners.NONE) || "",
240
245
  weighingFingerId: WeighingFingers.NONE,
@@ -7,18 +7,4 @@ export interface UserManagerFB {
7
7
  password: string;
8
8
  }
9
9
 
10
- export enum Users {
11
- OPERATOR = 0,
12
- EXPERT = 1,
13
- }
14
10
 
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
- }
24
- }
@@ -31,6 +31,7 @@ export const MachineTags = {
31
31
  ethercatSlaves_OK: 'EthercatSlaves_OK',
32
32
  currentTimeMs: 'CurrentTimeMs',
33
33
  settings: 'Settings',
34
+ user: 'User',
34
35
  }
35
36
 
36
37
  export const DeviceTags = {