@kuriousdesign/machine-sdk 1.0.0 → 1.0.1

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.
Files changed (91) hide show
  1. package/dist/custom-types/AppState.d.ts +92 -0
  2. package/dist/custom-types/AppState.js +70 -0
  3. package/dist/custom-types/Com.d.ts +16 -0
  4. package/dist/custom-types/Com.js +2 -0
  5. package/dist/custom-types/Devices/BaseDevice.d.ts +34 -0
  6. package/dist/custom-types/Devices/BaseDevice.js +2 -0
  7. package/dist/custom-types/GlobalConstants.d.ts +4 -0
  8. package/dist/custom-types/GlobalConstants.js +2 -0
  9. package/dist/custom-types/HMI.d.ts +46 -0
  10. package/dist/custom-types/HMI.js +2 -0
  11. package/dist/custom-types/Machine.d.ts +14 -0
  12. package/dist/custom-types/Machine.js +7 -0
  13. package/dist/custom-types/PartData.d.ts +11 -0
  14. package/dist/custom-types/PartData.js +2 -0
  15. package/dist/custom-types/RackData.d.ts +18 -0
  16. package/dist/custom-types/RackData.js +2 -0
  17. package/dist/custom-types/RecipeData.d.ts +7 -0
  18. package/dist/custom-types/RecipeData.js +2 -0
  19. package/dist/custom-types/RecipeManagerFB.d.ts +10 -0
  20. package/dist/custom-types/RecipeManagerFB.js +2 -0
  21. package/dist/custom-types/RobData.d.ts +24 -0
  22. package/dist/custom-types/RobData.js +2 -0
  23. package/dist/custom-types/TaskQueue.d.ts +24 -0
  24. package/dist/custom-types/TaskQueue.js +2 -0
  25. package/dist/custom-types/UserManagerFB.d.ts +7 -0
  26. package/dist/custom-types/UserManagerFB.js +2 -0
  27. package/dist/custom-types/index.d.ts +12 -0
  28. package/dist/custom-types/index.js +28 -0
  29. package/dist/enums/Colors.d.ts +62 -0
  30. package/dist/enums/Colors.js +76 -0
  31. package/dist/enums/DeviceId.d.ts +10 -0
  32. package/dist/enums/DeviceId.js +14 -0
  33. package/dist/enums/Errors.d.ts +6 -0
  34. package/dist/enums/Errors.js +28 -0
  35. package/dist/enums/ExtrusionType.d.ts +4 -0
  36. package/dist/enums/ExtrusionType.js +9 -0
  37. package/dist/enums/OpcuaDatatype.d.ts +28 -0
  38. package/dist/enums/OpcuaDatatype.js +32 -0
  39. package/dist/enums/Pages.d.ts +18 -0
  40. package/dist/enums/Pages.js +22 -0
  41. package/dist/enums/Priorities.d.ts +18 -0
  42. package/dist/enums/Priorities.js +24 -0
  43. package/dist/enums/RobPositions.d.ts +12 -0
  44. package/dist/enums/RobPositions.js +16 -0
  45. package/dist/enums/States.d.ts +54 -0
  46. package/dist/enums/States.js +63 -0
  47. package/dist/enums/TaskId.d.ts +35 -0
  48. package/dist/enums/TaskId.js +40 -0
  49. package/dist/enums/Warnings.d.ts +6 -0
  50. package/dist/enums/Warnings.js +18 -0
  51. package/dist/enums/index.d.ts +11 -0
  52. package/dist/enums/index.js +27 -0
  53. package/dist/functions/colorMapping.d.ts +4 -0
  54. package/dist/functions/colorMapping.js +42 -0
  55. package/dist/functions/index.d.ts +2 -0
  56. package/dist/functions/index.js +18 -0
  57. package/dist/functions/topicMapping.d.ts +1 -0
  58. package/dist/functions/topicMapping.js +9 -0
  59. package/dist/index.d.ts +3 -16
  60. package/dist/index.js +17 -21
  61. package/package.json +8 -3
  62. package/src/custom-types/AppState.ts +116 -0
  63. package/src/custom-types/Com.ts +19 -0
  64. package/src/custom-types/Devices/BaseDevice.ts +41 -0
  65. package/src/custom-types/GlobalConstants.ts +4 -0
  66. package/src/custom-types/HMI.ts +52 -0
  67. package/src/custom-types/Machine.ts +23 -0
  68. package/src/custom-types/PartData.ts +11 -0
  69. package/src/custom-types/RackData.ts +21 -0
  70. package/src/custom-types/RecipeData.ts +7 -0
  71. package/src/custom-types/RecipeManagerFB.ts +11 -0
  72. package/src/custom-types/RobData.ts +27 -0
  73. package/src/custom-types/TaskQueue.ts +31 -0
  74. package/src/custom-types/UserManagerFB.ts +8 -0
  75. package/src/custom-types/index.ts +12 -0
  76. package/src/enums/Colors.ts +79 -0
  77. package/src/enums/DeviceId.ts +10 -0
  78. package/src/enums/Errors.ts +30 -0
  79. package/src/enums/ExtrusionType.ts +5 -0
  80. package/src/enums/OpcuaDatatype.ts +28 -0
  81. package/src/enums/Pages.ts +21 -0
  82. package/src/enums/Priorities.ts +21 -0
  83. package/src/enums/RobPositions.ts +12 -0
  84. package/src/enums/States.ts +59 -0
  85. package/src/enums/TaskId.ts +37 -0
  86. package/src/enums/Warnings.ts +20 -0
  87. package/src/enums/index.ts +11 -0
  88. package/src/functions/colorMapping.ts +42 -0
  89. package/src/functions/index.ts +2 -0
  90. package/src/functions/topicMapping.ts +6 -0
  91. package/src/index.ts +3 -34
@@ -0,0 +1,6 @@
1
+ import { DeviceId } from "./DeviceId";
2
+ export declare const ErrorsMap: {
3
+ [key in DeviceId]: {
4
+ [key: number]: string;
5
+ };
6
+ };
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorsMap = void 0;
4
+ const DeviceId_1 = require("./DeviceId");
5
+ exports.ErrorsMap = {
6
+ [DeviceId_1.DeviceId.SFTY]: {
7
+ 0: "NoError",
8
+ 1: "EstopDumpValveCh1Off",
9
+ 2: "EstopDumpValveCh2Off",
10
+ 3: "EstopDumpValveCh1On",
11
+ 4: "EstopDumpValveCh2On",
12
+ 5: "FenceDumpValveCh1Off",
13
+ 6: "FenceDumpValveCh2Off",
14
+ 7: "FenceDumpValveCh1On",
15
+ 8: "FenceDumpValveCh2On",
16
+ },
17
+ [DeviceId_1.DeviceId.CNC]: {},
18
+ [DeviceId_1.DeviceId.CON]: {},
19
+ [DeviceId_1.DeviceId.DBRR]: {},
20
+ [DeviceId_1.DeviceId.ROB]: {
21
+ 0: "NoError",
22
+ 1: "ControllerFault",
23
+ 2: "RobotStartedWrongTask",
24
+ },
25
+ [DeviceId_1.DeviceId.SYS]: {},
26
+ [DeviceId_1.DeviceId.WASH]: {},
27
+ [DeviceId_1.DeviceId.RACK]: {},
28
+ };
@@ -0,0 +1,4 @@
1
+ export declare enum ExtrusionType {
2
+ ARMY_1703429 = 1,
3
+ ARMY_1801183 = 2
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExtrusionType = void 0;
4
+ var ExtrusionType;
5
+ (function (ExtrusionType) {
6
+ //FORMATTING CUSTOMERNAME_PARTNO, please use all caps
7
+ ExtrusionType[ExtrusionType["ARMY_1703429"] = 1] = "ARMY_1703429";
8
+ ExtrusionType[ExtrusionType["ARMY_1801183"] = 2] = "ARMY_1801183";
9
+ })(ExtrusionType || (exports.ExtrusionType = ExtrusionType = {}));
@@ -0,0 +1,28 @@
1
+ export declare enum OpcuaDatatype {
2
+ Null = 0,
3
+ Boolean = 1,
4
+ SByte = 2,
5
+ Byte = 3,
6
+ Int16 = 4,
7
+ UInt16 = 5,
8
+ Int32 = 6,
9
+ UInt32 = 7,
10
+ Int64 = 8,
11
+ UInt64 = 9,
12
+ Float = 10,
13
+ Double = 11,
14
+ String = 12,
15
+ DateTime = 13,
16
+ Guid = 14,
17
+ ByteString = 15,
18
+ XmlElement = 16,
19
+ NodeId = 17,
20
+ ExpandedNodeId = 18,
21
+ StatusCode = 19,
22
+ QualifiedName = 20,
23
+ LocalizedText = 21,
24
+ ExtensionObject = 22,
25
+ DataValue = 23,
26
+ Variant = 24,
27
+ DiagnosticInfo = 25
28
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpcuaDatatype = void 0;
4
+ var OpcuaDatatype;
5
+ (function (OpcuaDatatype) {
6
+ OpcuaDatatype[OpcuaDatatype["Null"] = 0] = "Null";
7
+ OpcuaDatatype[OpcuaDatatype["Boolean"] = 1] = "Boolean";
8
+ OpcuaDatatype[OpcuaDatatype["SByte"] = 2] = "SByte";
9
+ OpcuaDatatype[OpcuaDatatype["Byte"] = 3] = "Byte";
10
+ OpcuaDatatype[OpcuaDatatype["Int16"] = 4] = "Int16";
11
+ OpcuaDatatype[OpcuaDatatype["UInt16"] = 5] = "UInt16";
12
+ OpcuaDatatype[OpcuaDatatype["Int32"] = 6] = "Int32";
13
+ OpcuaDatatype[OpcuaDatatype["UInt32"] = 7] = "UInt32";
14
+ OpcuaDatatype[OpcuaDatatype["Int64"] = 8] = "Int64";
15
+ OpcuaDatatype[OpcuaDatatype["UInt64"] = 9] = "UInt64";
16
+ OpcuaDatatype[OpcuaDatatype["Float"] = 10] = "Float";
17
+ OpcuaDatatype[OpcuaDatatype["Double"] = 11] = "Double";
18
+ OpcuaDatatype[OpcuaDatatype["String"] = 12] = "String";
19
+ OpcuaDatatype[OpcuaDatatype["DateTime"] = 13] = "DateTime";
20
+ OpcuaDatatype[OpcuaDatatype["Guid"] = 14] = "Guid";
21
+ OpcuaDatatype[OpcuaDatatype["ByteString"] = 15] = "ByteString";
22
+ OpcuaDatatype[OpcuaDatatype["XmlElement"] = 16] = "XmlElement";
23
+ OpcuaDatatype[OpcuaDatatype["NodeId"] = 17] = "NodeId";
24
+ OpcuaDatatype[OpcuaDatatype["ExpandedNodeId"] = 18] = "ExpandedNodeId";
25
+ OpcuaDatatype[OpcuaDatatype["StatusCode"] = 19] = "StatusCode";
26
+ OpcuaDatatype[OpcuaDatatype["QualifiedName"] = 20] = "QualifiedName";
27
+ OpcuaDatatype[OpcuaDatatype["LocalizedText"] = 21] = "LocalizedText";
28
+ OpcuaDatatype[OpcuaDatatype["ExtensionObject"] = 22] = "ExtensionObject";
29
+ OpcuaDatatype[OpcuaDatatype["DataValue"] = 23] = "DataValue";
30
+ OpcuaDatatype[OpcuaDatatype["Variant"] = 24] = "Variant";
31
+ OpcuaDatatype[OpcuaDatatype["DiagnosticInfo"] = 25] = "DiagnosticInfo";
32
+ })(OpcuaDatatype || (exports.OpcuaDatatype = OpcuaDatatype = {}));
@@ -0,0 +1,18 @@
1
+ export declare enum Page {
2
+ UNCONTROLLED = 0,
3
+ LOGIN = 1,
4
+ OPERATION = 2,
5
+ HOME = 3,
6
+ SETTINGS = 4,
7
+ RAW_SHELF = 5,
8
+ EDIT_RAW_SHELF = 6,
9
+ DONE_SHELF = 7,
10
+ EDIT_DONE_SHELF = 8,
11
+ RECIPES = 9,
12
+ EDIT_RECIPES = 10,
13
+ CHANGE_RECIPE = 11,
14
+ JOB_SETUP = 13,
15
+ ERRORS = 14,
16
+ WARNINGS = 15,
17
+ ROBOT = 16
18
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Page = void 0;
4
+ var Page;
5
+ (function (Page) {
6
+ Page[Page["UNCONTROLLED"] = 0] = "UNCONTROLLED";
7
+ Page[Page["LOGIN"] = 1] = "LOGIN";
8
+ Page[Page["OPERATION"] = 2] = "OPERATION";
9
+ Page[Page["HOME"] = 3] = "HOME";
10
+ Page[Page["SETTINGS"] = 4] = "SETTINGS";
11
+ Page[Page["RAW_SHELF"] = 5] = "RAW_SHELF";
12
+ Page[Page["EDIT_RAW_SHELF"] = 6] = "EDIT_RAW_SHELF";
13
+ Page[Page["DONE_SHELF"] = 7] = "DONE_SHELF";
14
+ Page[Page["EDIT_DONE_SHELF"] = 8] = "EDIT_DONE_SHELF";
15
+ Page[Page["RECIPES"] = 9] = "RECIPES";
16
+ Page[Page["EDIT_RECIPES"] = 10] = "EDIT_RECIPES";
17
+ Page[Page["CHANGE_RECIPE"] = 11] = "CHANGE_RECIPE";
18
+ Page[Page["JOB_SETUP"] = 13] = "JOB_SETUP";
19
+ Page[Page["ERRORS"] = 14] = "ERRORS";
20
+ Page[Page["WARNINGS"] = 15] = "WARNINGS";
21
+ Page[Page["ROBOT"] = 16] = "ROBOT";
22
+ })(Page || (exports.Page = Page = {}));
@@ -0,0 +1,18 @@
1
+ export declare enum Priority {
2
+ NoPriority = 0,//no priorites were detected
3
+ StartCnc = 1,//priority to start cnc (get robot out of cnc, close door and start that thing)
4
+ DropoffMachinedParts = 2,//Dropoff machined parts in the post op (do this after cnc machining and before cnc loading)
5
+ LoadCnc = 3,//Top priority to load the deburred parts into the cnc
6
+ FinishPostOp = 4,//Top prioroity to finish parts after the cnc op
7
+ UnloadCnc = 5,//Top priority to remove machined parts from cnc
8
+ PrepParts = 6,//Top priority to get two parts deburred into the preop deadnest
9
+ WaitToUnload = 7,
10
+ CloseCncDoor = 8,
11
+ DeburrPart = 20,//sub priorty to loading cnc and robot needs deburred parts
12
+ PickRawShelf = 21,//sub priority to pick raw shelf
13
+ PickRawPartFromPreOp = 22,//sub priority to pick raw shelf
14
+ LoadPreOpWithDeburred = 23,
15
+ GatherDeburredPartsForCncLoad = 24,//Top priority to grab deburred parts and get in ready position to load cnc (do this before cnc loading)
16
+ WashParts = 31,
17
+ RejectScrap = 91
18
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Priority = void 0;
4
+ var Priority;
5
+ (function (Priority) {
6
+ //TopPriorities must be ordered from most important (priority = 1) to least important
7
+ Priority[Priority["NoPriority"] = 0] = "NoPriority";
8
+ Priority[Priority["StartCnc"] = 1] = "StartCnc";
9
+ Priority[Priority["DropoffMachinedParts"] = 2] = "DropoffMachinedParts";
10
+ Priority[Priority["LoadCnc"] = 3] = "LoadCnc";
11
+ Priority[Priority["FinishPostOp"] = 4] = "FinishPostOp";
12
+ Priority[Priority["UnloadCnc"] = 5] = "UnloadCnc";
13
+ Priority[Priority["PrepParts"] = 6] = "PrepParts";
14
+ Priority[Priority["WaitToUnload"] = 7] = "WaitToUnload";
15
+ Priority[Priority["CloseCncDoor"] = 8] = "CloseCncDoor";
16
+ //FillRobotWithTwoDeburredParts=11, //sub priority to loading cnc, robot needs to fill both grippers with deburred parts
17
+ Priority[Priority["DeburrPart"] = 20] = "DeburrPart";
18
+ Priority[Priority["PickRawShelf"] = 21] = "PickRawShelf";
19
+ Priority[Priority["PickRawPartFromPreOp"] = 22] = "PickRawPartFromPreOp";
20
+ Priority[Priority["LoadPreOpWithDeburred"] = 23] = "LoadPreOpWithDeburred";
21
+ Priority[Priority["GatherDeburredPartsForCncLoad"] = 24] = "GatherDeburredPartsForCncLoad";
22
+ Priority[Priority["WashParts"] = 31] = "WashParts";
23
+ Priority[Priority["RejectScrap"] = 91] = "RejectScrap";
24
+ })(Priority || (exports.Priority = Priority = {}));
@@ -0,0 +1,12 @@
1
+ export declare enum RobPositions {
2
+ AnyPosition = -1,//used when configuring tasks, this is used for start position id for pure moves
3
+ Lost = 0,
4
+ Home = 1,
5
+ WashPerch = 2,
6
+ RackPerch = 3,//used for shelf picking and reject
7
+ DeadNestPerch = 4,//used for preop and postop tasks
8
+ CncPerch = 5,//standby position outside of cnc door with wrist rotated so parts are horizontal
9
+ DeburrPerch = 6,
10
+ CncWaypoint = 7,
11
+ CncHover = 8
12
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RobPositions = void 0;
4
+ var RobPositions;
5
+ (function (RobPositions) {
6
+ RobPositions[RobPositions["AnyPosition"] = -1] = "AnyPosition";
7
+ RobPositions[RobPositions["Lost"] = 0] = "Lost";
8
+ RobPositions[RobPositions["Home"] = 1] = "Home";
9
+ RobPositions[RobPositions["WashPerch"] = 2] = "WashPerch";
10
+ RobPositions[RobPositions["RackPerch"] = 3] = "RackPerch";
11
+ RobPositions[RobPositions["DeadNestPerch"] = 4] = "DeadNestPerch";
12
+ RobPositions[RobPositions["CncPerch"] = 5] = "CncPerch";
13
+ RobPositions[RobPositions["DeburrPerch"] = 6] = "DeburrPerch";
14
+ RobPositions[RobPositions["CncWaypoint"] = 7] = "CncWaypoint";
15
+ RobPositions[RobPositions["CncHover"] = 8] = "CncHover";
16
+ })(RobPositions || (exports.RobPositions = RobPositions = {}));
@@ -0,0 +1,54 @@
1
+ export declare enum VisibilityState {
2
+ Invisible = 0,
3
+ Visible = 1,
4
+ FlashingFast = 2,
5
+ FlashingMed = 3,
6
+ FlashingSlow = 4,
7
+ StrobingFast = 5,
8
+ StrobingSlow = 6,
9
+ GrowingSlow = 7
10
+ }
11
+ export declare enum DeviceState {
12
+ Faulted = -2,
13
+ Killed = -1,
14
+ Inactive = 0,
15
+ Resetting = 50,
16
+ Idle = 100,
17
+ Running = 500,
18
+ Stopping = 900,
19
+ Aborting = 911,
20
+ Paused = 999,
21
+ Done = 1000,
22
+ Manual = 2000
23
+ }
24
+ export declare enum PartState {
25
+ Empty = 0,//no part present
26
+ Raw = 10,
27
+ DeburrBottomStarted = 11,
28
+ DeburrBottomFinished = 12,
29
+ DeburrTopStarted = 15,
30
+ Deburred = 20,//completely deburred, both bottom and top
31
+ MachiningStarted = 45,
32
+ Machined = 50,
33
+ WashStarted = 55,
34
+ Washed = 60,
35
+ DryStarted = 65,
36
+ Dryed = 70,
37
+ Finished = 100,
38
+ Scrapped = 911,
39
+ Error = 999
40
+ }
41
+ export declare enum TaskItemState {
42
+ TaskDone = 48,
43
+ TaskActive = 49,
44
+ TaskFuture = 50
45
+ }
46
+ export declare enum StatusMsg {
47
+ Running = 0,
48
+ Faulted = 2
49
+ }
50
+ export declare enum BannerMode {
51
+ Good = 0,
52
+ Warning = 1,
53
+ Faulted = 2
54
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BannerMode = exports.StatusMsg = exports.TaskItemState = exports.PartState = exports.DeviceState = exports.VisibilityState = void 0;
4
+ var VisibilityState;
5
+ (function (VisibilityState) {
6
+ VisibilityState[VisibilityState["Invisible"] = 0] = "Invisible";
7
+ VisibilityState[VisibilityState["Visible"] = 1] = "Visible";
8
+ VisibilityState[VisibilityState["FlashingFast"] = 2] = "FlashingFast";
9
+ VisibilityState[VisibilityState["FlashingMed"] = 3] = "FlashingMed";
10
+ VisibilityState[VisibilityState["FlashingSlow"] = 4] = "FlashingSlow";
11
+ VisibilityState[VisibilityState["StrobingFast"] = 5] = "StrobingFast";
12
+ VisibilityState[VisibilityState["StrobingSlow"] = 6] = "StrobingSlow";
13
+ VisibilityState[VisibilityState["GrowingSlow"] = 7] = "GrowingSlow";
14
+ })(VisibilityState || (exports.VisibilityState = VisibilityState = {}));
15
+ var DeviceState;
16
+ (function (DeviceState) {
17
+ DeviceState[DeviceState["Faulted"] = -2] = "Faulted";
18
+ DeviceState[DeviceState["Killed"] = -1] = "Killed";
19
+ DeviceState[DeviceState["Inactive"] = 0] = "Inactive";
20
+ DeviceState[DeviceState["Resetting"] = 50] = "Resetting";
21
+ DeviceState[DeviceState["Idle"] = 100] = "Idle";
22
+ DeviceState[DeviceState["Running"] = 500] = "Running";
23
+ DeviceState[DeviceState["Stopping"] = 900] = "Stopping";
24
+ DeviceState[DeviceState["Aborting"] = 911] = "Aborting";
25
+ DeviceState[DeviceState["Paused"] = 999] = "Paused";
26
+ DeviceState[DeviceState["Done"] = 1000] = "Done";
27
+ DeviceState[DeviceState["Manual"] = 2000] = "Manual";
28
+ })(DeviceState || (exports.DeviceState = DeviceState = {}));
29
+ var PartState;
30
+ (function (PartState) {
31
+ PartState[PartState["Empty"] = 0] = "Empty";
32
+ PartState[PartState["Raw"] = 10] = "Raw";
33
+ PartState[PartState["DeburrBottomStarted"] = 11] = "DeburrBottomStarted";
34
+ PartState[PartState["DeburrBottomFinished"] = 12] = "DeburrBottomFinished";
35
+ PartState[PartState["DeburrTopStarted"] = 15] = "DeburrTopStarted";
36
+ PartState[PartState["Deburred"] = 20] = "Deburred";
37
+ PartState[PartState["MachiningStarted"] = 45] = "MachiningStarted";
38
+ PartState[PartState["Machined"] = 50] = "Machined";
39
+ PartState[PartState["WashStarted"] = 55] = "WashStarted";
40
+ PartState[PartState["Washed"] = 60] = "Washed";
41
+ PartState[PartState["DryStarted"] = 65] = "DryStarted";
42
+ PartState[PartState["Dryed"] = 70] = "Dryed";
43
+ PartState[PartState["Finished"] = 100] = "Finished";
44
+ PartState[PartState["Scrapped"] = 911] = "Scrapped";
45
+ PartState[PartState["Error"] = 999] = "Error";
46
+ })(PartState || (exports.PartState = PartState = {}));
47
+ var TaskItemState;
48
+ (function (TaskItemState) {
49
+ TaskItemState[TaskItemState["TaskDone"] = 48] = "TaskDone";
50
+ TaskItemState[TaskItemState["TaskActive"] = 49] = "TaskActive";
51
+ TaskItemState[TaskItemState["TaskFuture"] = 50] = "TaskFuture";
52
+ })(TaskItemState || (exports.TaskItemState = TaskItemState = {}));
53
+ var StatusMsg;
54
+ (function (StatusMsg) {
55
+ StatusMsg[StatusMsg["Running"] = 0] = "Running";
56
+ StatusMsg[StatusMsg["Faulted"] = 2] = "Faulted";
57
+ })(StatusMsg || (exports.StatusMsg = StatusMsg = {}));
58
+ var BannerMode;
59
+ (function (BannerMode) {
60
+ BannerMode[BannerMode["Good"] = 0] = "Good";
61
+ BannerMode[BannerMode["Warning"] = 1] = "Warning";
62
+ BannerMode[BannerMode["Faulted"] = 2] = "Faulted";
63
+ })(BannerMode || (exports.BannerMode = BannerMode = {}));
@@ -0,0 +1,35 @@
1
+ export declare enum TaskId {
2
+ NoTask = 0,
3
+ WayPointMove = 1,//use endPositionId as the destination to communicate to robot, all other parameters are useless.
4
+ PickRawShelf_R = 2,//pick raw shelf with Right Gripper, left gripper must be empty
5
+ DeburrBottom_R = 3,//Right Gripper Side Only, params(top/bottom/both
6
+ DeburrTop_R = 4,//Right Gripper Side Only, params(top/bottom/both
7
+ LoadPreOp2_L = 5,//rarely used (only be used if robot were ready to load cnc but had to abandon that to go wash parts or something like that), position 2 on pre op is on the right, left gripper must be empty
8
+ LoadPreOp2_R = 6,//position 2 on pre op is on the right, left gripper must be empty
9
+ LoadPreOp1_R = 7,//position 1 on pre op is on the left
10
+ PickPreOp1_R = 8,//position 1 on pre op is on the left
11
+ PickPreOp2_L = 9,//position 2 on pre op is on the right
12
+ LoadCnc2_L = 10,
13
+ LoadCnc1_R = 11,
14
+ PickCnc1_R = 12,
15
+ PickCnc2_L = 13,
16
+ LoadPostOp2_L = 14,
17
+ LoadPostOp1_R = 15,
18
+ PickPostOp1_R = 16,
19
+ PickPostOp2_L = 17,
20
+ PickPostOp2_R = 18,//left gripper must be empty
21
+ WashAndDry = 19,
22
+ LoadDoneShelf_R = 20,//uses a PLC PR offset for done shelf user frame
23
+ RejectPart_L = 21,//start and end at rack perch
24
+ RejectPart_R = 22,//start and end at rack perch
25
+ WaitToUnload = 23,//MARTIN WE WILL USE WayPointMove FOR THIS,
26
+ WaitToLoad = 24,//MARTIN WE WILL USE WayPointMove FOR THIS, wait in front of cnc with deburred parts in both robot gripppers, only used when cnc is empty and waiting to be filled, REPLACE WITH WAYPOINT MOVE?
27
+ ExitCnc = 25,//MARTIN WE WILL USE WayPointMove FOR THIS, move from cnc hover position to cnc perch position, REPLACE WITH WAYPOINT MOVE?
28
+ EnterCnc = 26,//MARTIN WE WILL USE WayPointMove FOR THIS, move to cnc hover position, MARTIN WE WILL USE WayPointMove FOR THIS
29
+ ChangeCncProgram = 27,
30
+ StartCnc = 28,
31
+ StopCnc = 29,
32
+ ResetCnc = 30,
33
+ OpenCncDoor = 31,
34
+ CloseCncDoor = 32
35
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TaskId = void 0;
4
+ var TaskId;
5
+ (function (TaskId) {
6
+ TaskId[TaskId["NoTask"] = 0] = "NoTask";
7
+ TaskId[TaskId["WayPointMove"] = 1] = "WayPointMove";
8
+ TaskId[TaskId["PickRawShelf_R"] = 2] = "PickRawShelf_R";
9
+ TaskId[TaskId["DeburrBottom_R"] = 3] = "DeburrBottom_R";
10
+ TaskId[TaskId["DeburrTop_R"] = 4] = "DeburrTop_R";
11
+ TaskId[TaskId["LoadPreOp2_L"] = 5] = "LoadPreOp2_L";
12
+ TaskId[TaskId["LoadPreOp2_R"] = 6] = "LoadPreOp2_R";
13
+ TaskId[TaskId["LoadPreOp1_R"] = 7] = "LoadPreOp1_R";
14
+ TaskId[TaskId["PickPreOp1_R"] = 8] = "PickPreOp1_R";
15
+ TaskId[TaskId["PickPreOp2_L"] = 9] = "PickPreOp2_L";
16
+ TaskId[TaskId["LoadCnc2_L"] = 10] = "LoadCnc2_L";
17
+ TaskId[TaskId["LoadCnc1_R"] = 11] = "LoadCnc1_R";
18
+ TaskId[TaskId["PickCnc1_R"] = 12] = "PickCnc1_R";
19
+ TaskId[TaskId["PickCnc2_L"] = 13] = "PickCnc2_L";
20
+ TaskId[TaskId["LoadPostOp2_L"] = 14] = "LoadPostOp2_L";
21
+ TaskId[TaskId["LoadPostOp1_R"] = 15] = "LoadPostOp1_R";
22
+ TaskId[TaskId["PickPostOp1_R"] = 16] = "PickPostOp1_R";
23
+ TaskId[TaskId["PickPostOp2_L"] = 17] = "PickPostOp2_L";
24
+ TaskId[TaskId["PickPostOp2_R"] = 18] = "PickPostOp2_R";
25
+ TaskId[TaskId["WashAndDry"] = 19] = "WashAndDry";
26
+ TaskId[TaskId["LoadDoneShelf_R"] = 20] = "LoadDoneShelf_R";
27
+ TaskId[TaskId["RejectPart_L"] = 21] = "RejectPart_L";
28
+ TaskId[TaskId["RejectPart_R"] = 22] = "RejectPart_R";
29
+ TaskId[TaskId["WaitToUnload"] = 23] = "WaitToUnload";
30
+ TaskId[TaskId["WaitToLoad"] = 24] = "WaitToLoad";
31
+ TaskId[TaskId["ExitCnc"] = 25] = "ExitCnc";
32
+ TaskId[TaskId["EnterCnc"] = 26] = "EnterCnc";
33
+ //non-robot tasks
34
+ TaskId[TaskId["ChangeCncProgram"] = 27] = "ChangeCncProgram";
35
+ TaskId[TaskId["StartCnc"] = 28] = "StartCnc";
36
+ TaskId[TaskId["StopCnc"] = 29] = "StopCnc";
37
+ TaskId[TaskId["ResetCnc"] = 30] = "ResetCnc";
38
+ TaskId[TaskId["OpenCncDoor"] = 31] = "OpenCncDoor";
39
+ TaskId[TaskId["CloseCncDoor"] = 32] = "CloseCncDoor";
40
+ })(TaskId || (exports.TaskId = TaskId = {}));
@@ -0,0 +1,6 @@
1
+ import { DeviceId } from "./DeviceId";
2
+ export declare const WarningsMap: {
3
+ [key in DeviceId]: {
4
+ [key: number]: string;
5
+ };
6
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WarningsMap = void 0;
4
+ const DeviceId_1 = require("./DeviceId");
5
+ exports.WarningsMap = {
6
+ [DeviceId_1.DeviceId.SYS]: {
7
+ //refer to SysWarnings enum in CoDeSys for mapping
8
+ },
9
+ [DeviceId_1.DeviceId.RACK]: {
10
+ //refer to RackWarnings enum in CoDeSys for mapping
11
+ },
12
+ [DeviceId_1.DeviceId.CNC]: {},
13
+ [DeviceId_1.DeviceId.CON]: {},
14
+ [DeviceId_1.DeviceId.DBRR]: {},
15
+ [DeviceId_1.DeviceId.ROB]: {},
16
+ [DeviceId_1.DeviceId.SFTY]: {},
17
+ [DeviceId_1.DeviceId.WASH]: {},
18
+ };
@@ -0,0 +1,11 @@
1
+ export * from "./Colors";
2
+ export * from "./States";
3
+ export * from "./OpcuaDatatype";
4
+ export * from "./ExtrusionType";
5
+ export * from "./Warnings";
6
+ export * from "./Errors";
7
+ export * from "./DeviceId";
8
+ export * from "./TaskId";
9
+ export * from "./Priorities";
10
+ export * from "./Pages";
11
+ export * from "./RobPositions";
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Colors"), exports);
18
+ __exportStar(require("./States"), exports);
19
+ __exportStar(require("./OpcuaDatatype"), exports);
20
+ __exportStar(require("./ExtrusionType"), exports);
21
+ __exportStar(require("./Warnings"), exports);
22
+ __exportStar(require("./Errors"), exports);
23
+ __exportStar(require("./DeviceId"), exports);
24
+ __exportStar(require("./TaskId"), exports);
25
+ __exportStar(require("./Priorities"), exports);
26
+ __exportStar(require("./Pages"), exports);
27
+ __exportStar(require("./RobPositions"), exports);
@@ -0,0 +1,4 @@
1
+ import { Color } from "../enums/Colors";
2
+ import { DeviceState, PartState } from "../enums/States";
3
+ export declare function deviceStateToColorMap(state: DeviceState): Color;
4
+ export declare function partStateToColorMap(state: PartState): Color;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deviceStateToColorMap = deviceStateToColorMap;
4
+ exports.partStateToColorMap = partStateToColorMap;
5
+ const Colors_1 = require("../enums/Colors");
6
+ const States_1 = require("../enums/States");
7
+ function deviceStateToColorMap(state) {
8
+ const colorMap = {
9
+ [States_1.DeviceState.Killed]: Colors_1.Color.Black,
10
+ [States_1.DeviceState.Inactive]: Colors_1.Color.Inactive,
11
+ [States_1.DeviceState.Resetting]: Colors_1.Color.Resetting,
12
+ [States_1.DeviceState.Idle]: Colors_1.Color.Idle,
13
+ [States_1.DeviceState.Running]: Colors_1.Color.Running,
14
+ [States_1.DeviceState.Stopping]: Colors_1.Color.Processing,
15
+ [States_1.DeviceState.Done]: Colors_1.Color.Done,
16
+ [States_1.DeviceState.Aborting]: Colors_1.Color.Error,
17
+ [States_1.DeviceState.Manual]: Colors_1.Color.Manual,
18
+ [States_1.DeviceState.Paused]: Colors_1.Color.Processing,
19
+ [States_1.DeviceState.Faulted]: Colors_1.Color.Error,
20
+ };
21
+ return colorMap[state];
22
+ }
23
+ function partStateToColorMap(state) {
24
+ const colorMap = {
25
+ [States_1.PartState.Empty]: Colors_1.Color.Empty,
26
+ [States_1.PartState.Raw]: Colors_1.Color.Raw,
27
+ [States_1.PartState.DeburrBottomStarted]: Colors_1.Color.Processing,
28
+ [States_1.PartState.DeburrBottomFinished]: Colors_1.Color.DeburrBottomFinished,
29
+ [States_1.PartState.DeburrTopStarted]: Colors_1.Color.Processing,
30
+ [States_1.PartState.Deburred]: Colors_1.Color.Deburred,
31
+ [States_1.PartState.MachiningStarted]: Colors_1.Color.Processing,
32
+ [States_1.PartState.Machined]: Colors_1.Color.Machined,
33
+ [States_1.PartState.WashStarted]: Colors_1.Color.Processing,
34
+ [States_1.PartState.Washed]: Colors_1.Color.Processing,
35
+ [States_1.PartState.DryStarted]: Colors_1.Color.Processing,
36
+ [States_1.PartState.Dryed]: Colors_1.Color.Dryed,
37
+ [States_1.PartState.Finished]: Colors_1.Color.Finished,
38
+ [States_1.PartState.Scrapped]: Colors_1.Color.Scrapped,
39
+ [States_1.PartState.Error]: Colors_1.Color.Error,
40
+ };
41
+ return colorMap[state];
42
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./colorMapping";
2
+ export * from "./topicMapping";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./colorMapping"), exports);
18
+ __exportStar(require("./topicMapping"), exports);
@@ -0,0 +1 @@
1
+ export declare function machineIdToTopicMap(id: string): string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.machineIdToTopicMap = machineIdToTopicMap;
4
+ function machineIdToTopicMap(id) {
5
+ const topicMap = {
6
+ "BendPro G2 Demo": "BendProG2/2286/198C/#",
7
+ };
8
+ return topicMap[id];
9
+ }
package/dist/index.d.ts CHANGED
@@ -1,16 +1,3 @@
1
- export interface Machine {
2
- id: string;
3
- name: string;
4
- status: 'idle' | 'running' | 'stopped' | 'error';
5
- lastUpdated: Date;
6
- }
7
- export interface SensorData {
8
- machineId: string;
9
- temperature: number;
10
- pressure: number;
11
- timestamp: Date;
12
- }
13
- export declare function formatTimestamp(timestamp: Date): string;
14
- export declare function isMachineActive(machine: Machine): boolean;
15
- export declare function calculateAverageTemperature(data: SensorData[]): number;
16
- export declare function validateMachineId(id: string): boolean;
1
+ export * from "./custom-types";
2
+ export * from "./enums";
3
+ export * from "./functions";
package/dist/index.js CHANGED
@@ -1,23 +1,19 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatTimestamp = formatTimestamp;
4
- exports.isMachineActive = isMachineActive;
5
- exports.calculateAverageTemperature = calculateAverageTemperature;
6
- exports.validateMachineId = validateMachineId;
7
- // Helper Functions
8
- function formatTimestamp(timestamp) {
9
- return timestamp.toISOString();
10
- }
11
- function isMachineActive(machine) {
12
- return machine.status === 'running';
13
- }
14
- function calculateAverageTemperature(data) {
15
- if (data.length === 0)
16
- return 0;
17
- const total = data.reduce((sum, reading) => sum + reading.temperature, 0);
18
- return Number((total / data.length).toFixed(2));
19
- }
20
- function validateMachineId(id) {
21
- const idRegex = /^[A-Za-z0-9-_]{1,36}$/;
22
- return idRegex.test(id);
23
- }
17
+ __exportStar(require("./custom-types"), exports);
18
+ __exportStar(require("./enums"), exports);
19
+ __exportStar(require("./functions"), exports);