@kuriousdesign/machine-sdk 1.0.0 → 1.0.2

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 (111) 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/Axis.d.ts +104 -0
  6. package/dist/custom-types/Devices/Axis.js +8 -0
  7. package/dist/custom-types/Devices/BaseDevice.d.ts +34 -0
  8. package/dist/custom-types/Devices/BaseDevice.js +2 -0
  9. package/dist/custom-types/Devices/Device.d.ts +74 -0
  10. package/dist/custom-types/Devices/Device.js +71 -0
  11. package/dist/custom-types/Devices/deviceTypes.d.ts +7 -0
  12. package/dist/custom-types/Devices/deviceTypes.js +11 -0
  13. package/dist/custom-types/Devices/index.d.ts +2 -0
  14. package/dist/custom-types/Devices/index.js +18 -0
  15. package/dist/custom-types/GlobalConstants.d.ts +4 -0
  16. package/dist/custom-types/GlobalConstants.js +2 -0
  17. package/dist/custom-types/HMI.d.ts +46 -0
  18. package/dist/custom-types/HMI.js +2 -0
  19. package/dist/custom-types/Machine.d.ts +14 -0
  20. package/dist/custom-types/Machine.js +7 -0
  21. package/dist/custom-types/PartData.d.ts +11 -0
  22. package/dist/custom-types/PartData.js +2 -0
  23. package/dist/custom-types/RackData.d.ts +18 -0
  24. package/dist/custom-types/RackData.js +2 -0
  25. package/dist/custom-types/RecipeData.d.ts +7 -0
  26. package/dist/custom-types/RecipeData.js +2 -0
  27. package/dist/custom-types/RecipeManagerFB.d.ts +10 -0
  28. package/dist/custom-types/RecipeManagerFB.js +2 -0
  29. package/dist/custom-types/RobData.d.ts +24 -0
  30. package/dist/custom-types/RobData.js +2 -0
  31. package/dist/custom-types/TaskQueue.d.ts +24 -0
  32. package/dist/custom-types/TaskQueue.js +2 -0
  33. package/dist/custom-types/UserManagerFB.d.ts +7 -0
  34. package/dist/custom-types/UserManagerFB.js +2 -0
  35. package/dist/custom-types/index.d.ts +13 -0
  36. package/dist/custom-types/index.js +29 -0
  37. package/dist/enums/Colors.d.ts +62 -0
  38. package/dist/enums/Colors.js +76 -0
  39. package/dist/enums/DeviceId.d.ts +10 -0
  40. package/dist/enums/DeviceId.js +14 -0
  41. package/dist/enums/Errors.d.ts +6 -0
  42. package/dist/enums/Errors.js +28 -0
  43. package/dist/enums/ExtrusionType.d.ts +4 -0
  44. package/dist/enums/ExtrusionType.js +9 -0
  45. package/dist/enums/OpcuaDatatype.d.ts +28 -0
  46. package/dist/enums/OpcuaDatatype.js +32 -0
  47. package/dist/enums/Pages.d.ts +18 -0
  48. package/dist/enums/Pages.js +22 -0
  49. package/dist/enums/Priorities.d.ts +18 -0
  50. package/dist/enums/Priorities.js +24 -0
  51. package/dist/enums/RobPositions.d.ts +12 -0
  52. package/dist/enums/RobPositions.js +16 -0
  53. package/dist/enums/States.d.ts +54 -0
  54. package/dist/enums/States.js +63 -0
  55. package/dist/enums/TaskId.d.ts +35 -0
  56. package/dist/enums/TaskId.js +40 -0
  57. package/dist/enums/Warnings.d.ts +6 -0
  58. package/dist/enums/Warnings.js +18 -0
  59. package/dist/enums/index.d.ts +11 -0
  60. package/dist/enums/index.js +27 -0
  61. package/dist/functions/colorMapping.d.ts +4 -0
  62. package/dist/functions/colorMapping.js +42 -0
  63. package/dist/functions/index.d.ts +2 -0
  64. package/dist/functions/index.js +18 -0
  65. package/dist/functions/topicMapping.d.ts +1 -0
  66. package/dist/functions/topicMapping.js +9 -0
  67. package/dist/index.d.ts +4 -16
  68. package/dist/index.js +18 -21
  69. package/dist/plc-tags/index.d.ts +19 -0
  70. package/dist/plc-tags/index.js +37 -0
  71. package/dist/plc-tags/mqtt.d.ts +7 -0
  72. package/dist/plc-tags/mqtt.js +6 -0
  73. package/dist/plc-tags/opcua.d.ts +2 -0
  74. package/dist/plc-tags/opcua.js +5 -0
  75. package/package.json +8 -3
  76. package/src/custom-types/AppState.ts +116 -0
  77. package/src/custom-types/Com.ts +19 -0
  78. package/src/custom-types/Devices/Axis.ts +159 -0
  79. package/src/custom-types/Devices/Device.ts +168 -0
  80. package/src/custom-types/Devices/DeviceTypes.ts +7 -0
  81. package/src/custom-types/Devices/index.ts +2 -0
  82. package/src/custom-types/GlobalConstants.ts +4 -0
  83. package/src/custom-types/HMI.ts +52 -0
  84. package/src/custom-types/Machine.ts +23 -0
  85. package/src/custom-types/PartData.ts +11 -0
  86. package/src/custom-types/RackData.ts +21 -0
  87. package/src/custom-types/RecipeData.ts +7 -0
  88. package/src/custom-types/RecipeManagerFB.ts +11 -0
  89. package/src/custom-types/RobData.ts +27 -0
  90. package/src/custom-types/TaskQueue.ts +31 -0
  91. package/src/custom-types/UserManagerFB.ts +8 -0
  92. package/src/custom-types/index.ts +13 -0
  93. package/src/enums/Colors.ts +79 -0
  94. package/src/enums/DeviceId.ts +10 -0
  95. package/src/enums/Errors.ts +30 -0
  96. package/src/enums/ExtrusionType.ts +5 -0
  97. package/src/enums/OpcuaDatatype.ts +28 -0
  98. package/src/enums/Pages.ts +21 -0
  99. package/src/enums/Priorities.ts +21 -0
  100. package/src/enums/RobPositions.ts +12 -0
  101. package/src/enums/States.ts +59 -0
  102. package/src/enums/TaskId.ts +37 -0
  103. package/src/enums/Warnings.ts +20 -0
  104. package/src/enums/index.ts +11 -0
  105. package/src/functions/colorMapping.ts +42 -0
  106. package/src/functions/index.ts +2 -0
  107. package/src/functions/topicMapping.ts +6 -0
  108. package/src/index.ts +4 -34
  109. package/src/plc-tags/index.ts +24 -0
  110. package/src/plc-tags/mqtt.ts +8 -0
  111. package/src/plc-tags/opcua.ts +3 -0
@@ -0,0 +1,159 @@
1
+ export enum AxisDriveTypes {
2
+ STINGRAY = 0,
3
+ BOSCH_FSOE = 1
4
+ }
5
+
6
+ //ignored-
7
+ export interface AxisCfg {
8
+ DriveType: AxisDriveTypes;
9
+ DriveId: number; // use either the BoschDrives enum or the Nautilus Drives enum
10
+ Unit: string;
11
+ AtPosTol: number; // note: this may already be defined in the drive (if using bosch fsoe) difference between data.actualPosition and data.targetPosition below threshold and used during validation to determine if checked position matches the stored mastering position
12
+
13
+
14
+ IgnoreSoftwareLimits: boolean;
15
+ IgnoreLimitSwitches: boolean;
16
+
17
+ Ignores: boolean[]; // use AxisPermissives ENUM
18
+
19
+ SoftwareLimitPositive: number; // this is the limit that will produce an error if exceeded
20
+ SoftwareLimitNegative: number;
21
+ OperationalPositionMin: number; // this is the nominal operation minimum
22
+ OperationalPositionMax: number;
23
+ HardStopPositive: number;
24
+ HardStopNegative: number;
25
+ SensorPositions: number[];
26
+ //ignored-MotionProfiles: AxisMotionProfileData[]; // normal use case motion profiles, not e-stopping or error related
27
+ AxisType: number;
28
+
29
+ //ignored-ValidationSensor: AxisSensors; // used for homing or position verification
30
+ //ignored-PositionReferencingMethod: PositionReferencingMethods; // homing or position verification
31
+ VerificationSensorOffsetFromZero: number;
32
+ SearchDistance: number; // allowed distance to search beyond operation limit to find the validation sensor
33
+ hasRailBrakes: boolean;
34
+ AutoPositionVerifyDuringReset: boolean; // set to true if you want the axis to automatically try to position verify during reset
35
+ hasDynamicPositiveLimit: boolean;
36
+ hasDynamicNegativeLimit: boolean;
37
+
38
+ HomingToHardstopDir: number; // use -1.0 for negative and 1.0 for positive
39
+ MaxCurrentWhileHomingToHardstop: number; // if homing in neg direction, then use a negative value only used if using home_to_hardstop_<dir> as the position verification method.
40
+ MaxCurrentNormalOperation: number; // max current allowed during normal operation, ignore unless using homing to hardstop
41
+
42
+ updateScalingIsNeeded: boolean; // set this to TRUE to enforce scaling changes
43
+ //ignored-SoftMotionScalingParams: SoftMotionScalingParams;
44
+
45
+ // DUAL AXIS ONLY
46
+ GearingPositionTolerance: number; // mm, (dual Axis only) used for checking differences between geared axes while synced
47
+ AxesPositionToleranceForSkew: number; // mm, (dual Axis only) used for checking if axes have gone beyond their mechanical limit for position differences before ruining the machine
48
+
49
+ ShippingPosition: number; // mm, this should be something that is between the hardstop positions
50
+ KeepMasteredStatusAtStartup: boolean; // if TRUE, this will maintain the mastered status/homed status of the axis after a power cycle
51
+ }
52
+
53
+ export interface AxisMotionProfileData {
54
+ speed: number; // this must be greater than zero
55
+ acceleration: number; // used for accel and decel
56
+ jerk: number;
57
+ }
58
+
59
+
60
+
61
+ export interface AxisSts {
62
+ Cfg: AxisCfg; // read-only
63
+
64
+ actualPosition: number;
65
+ // actualSetpoint: number; // use the enum associated with setpoints
66
+ actualVelocity: number;
67
+ actualAcceleration: number;
68
+ ActualTorque: number;
69
+ ActualCurrent: number;
70
+ //ignored-ActualControllerMode: SMC_CONTROLLER_MODE;
71
+
72
+ ActiveStreamType: number;
73
+
74
+ AxisRefState: number; // uses SMC_AXIS_STATE;
75
+
76
+ targetPosition: number; // used for MoveAbs or MoveRel, change value before issuing your mc cmd, result should be echoed in setPosition after corresponding MC Cmd
77
+ targetSetpoint: number;
78
+ targetVelocity: number; // used for jogging, change value before issuing your mc cmd, result should be echoed in setVelocity after corresponding MC Cmd
79
+
80
+ targetDir: number; // used for jogging and moving, 1.0 for fwd and -1.0 for bckwd
81
+ // targetAccel: number;
82
+ targetMaxCurrent: number; // only used for homing to hardstop of swing arms
83
+ targetTorque: number; // not used
84
+ targetMotionProfileId: number;
85
+ targetMotionProfileData: AxisMotionProfileData; // used for moving and jogging, change value before issuing your mc cmd, result should be echoed in setVelocity/setAcceleration after corresponding MC Cmd
86
+ TargetControllerMode: number; // uses SMC_CONTROLLER_MODE;
87
+
88
+ setPosition: number; // this value is updated by the drive
89
+ setVelocity: number; // this value is updated by the drive
90
+ setAccel: number; // this value is updated by the drive
91
+ setTorque: number; // this value is updated by the drive
92
+ setJerk: number; // this value is updated by the drive
93
+
94
+ // STATUS BITS
95
+ isEnabled: boolean;
96
+ isHoming: boolean; // used to indicate that axis in the process of homing or used to indicate that axis is in the process of verifying its position
97
+ isHomed: boolean; // used to indicate that axis has homed to a sensor and updated its position accordingly or used to indicate that position has been verified, useful when using absolute encoders that don't require homing (overwriting of known zero position)
98
+ isMastered: boolean; // used to indicate that axis has been mastered, useful for axes that require position verification as their position referencing method
99
+
100
+ mutingSwAndHwLimitsWhileHoming: boolean;
101
+ //ignored-DriveHwLimitsEnforcement: AxisLimitEnforcements; // this status is set after calling the set software limits
102
+ //ignored-DriveSwLimitsEnforcement: AxisLimitEnforcements;
103
+
104
+ // MOTION STATES - these are all mutually exclusive
105
+ isStandstill: boolean; // axis is not moving (within zero velocity threshold)
106
+ isAtPosAndStandstill: boolean; // axis is at the target position and at standstill
107
+ isJogging: boolean; // axis is rotating with velocity cmd
108
+ isMoving: boolean; // axis is moving to a position
109
+ isGeared: boolean; // axis is moving synchronously with another axis
110
+ isTorquing: boolean; // axis is in torque mode and actively applying torque
111
+
112
+ // DRIVE RELATED
113
+ DriveStatusMsg: string;
114
+ DriveHasError: boolean;
115
+ DriveIsStoppingMotor: boolean; // is True when motor faults and starts stopping itself
116
+ DriveStoppedMotor: boolean; // True after motor finishes stopping itself. clears when you reset the motor
117
+
118
+ SoftMotionHasError: boolean;
119
+ SoftMotionErrorId: number; // uses SMC_ERROR;
120
+
121
+ ConfiguredSoftLimitTravelRange: number; // determined by the sw limits;
122
+ HomeOffsetFromZero: number; // units, this is a read-only value, the retain var HomeOffsetFromZero is used (this might be deprecated)
123
+
124
+ CalculatedStoppingPosition: number;
125
+ TravelLimitNegative: number;
126
+ TravelLimitPositive: number;
127
+
128
+ //ignored-Permissives: AxisPermissiveStsData[]; // Array of NUM_PERMISSIVES length
129
+ RestrictedToSlow: boolean; // (TODO: replace this with NOT Permissives.FullSpeed_OK) used to speed limit the axis when it is not homed or has software and hardware limits disabled
130
+
131
+ //ignored-RailBrakes: RailBrakeInputs;
132
+ Sensors: boolean[]; // Array of MAX_NUM_SENSORS length
133
+
134
+ targetEncoderSetpoint: number;
135
+
136
+ targetMasterAxisDevId: number;
137
+ targetMasterAxisRefPointer: any; // TypeScript doesn't have direct pointer equivalents
138
+ actualMasterAxisDevId: number;
139
+ actualMasterAxisRefPointer: any; // TypeScript doesn't have direct pointer equivalents
140
+
141
+ RecordedPosition: number; // use this to save position information, useful for mastering and position verification processes
142
+ //ignored-Interlocks: AxisInterlocks;
143
+
144
+ ignoringRailBrakes: boolean;
145
+ EtherCatComms_OK: boolean;
146
+
147
+ // ROBOT CONTROLLER STATE
148
+ RcHomingState: number; // uses enumRcAxisHomingState;
149
+ RcControlMode: number; // uses enumRcAxisMode;
150
+
151
+ isStreaming: boolean;
152
+
153
+ // DUAL AXIS ONLY
154
+ PositionDifference: number; // (Dual Axis Only) difference between the axes: axis1 - axis2
155
+ AxesPositionDifference_OK: boolean; // (Dual Axis Only)status stating difference in position between two axes while moving or idle is acceptable, based on cfg.GearingPositionTolerance
156
+ AxesPositionDifference_CORRECTABLE: boolean; // (Dual Axis Only)status stating difference in position between two axes able to be automatically corrected, based on cfg.AxesPositionToleranceForSkew
157
+ SkippingPositionCorrectionBeforeGearing: boolean; // (Dual Axis Only)this is usually TRUE if the axes are first being setup
158
+ DualAxisStopType: number; // uses DualAxisStopTypes; // (Dual Axis Only)
159
+ }
@@ -0,0 +1,168 @@
1
+ import { DeviceTypes } from './DeviceTypes'
2
+
3
+ export interface DeviceRegistration {
4
+ mnemonic: string; // short hand notation for the device, e.g. IB for Bufferwall, IBG for gantry
5
+ id: number; // this device id
6
+ childIdArray: number[]; // array of child device ids
7
+ parentId: number; // this is the parent id
8
+ deviceType: DeviceTypes; // type of the device
9
+ }
10
+
11
+ export const initialDeviceRegistration: DeviceRegistration = {
12
+ mnemonic: '',
13
+ id: 0,
14
+ childIdArray: [],
15
+ parentId: 0,
16
+ deviceType: DeviceTypes.Base // Assuming Unknown exists in DeviceTypes enum
17
+ };
18
+
19
+ export interface DeviceCfg {
20
+ safetyZoneId: number;
21
+ controllableByHmi: boolean;
22
+ autoReset: boolean;
23
+ ignore: boolean;
24
+ //ignore--OutboundAxisInterlocks: AxisInterlockCfgData[];
25
+ }
26
+
27
+ export const initialDeviceCfg: DeviceCfg = {
28
+ safetyZoneId: 0,
29
+ controllableByHmi: false,
30
+ autoReset: false,
31
+ ignore: false
32
+ };
33
+
34
+ export interface FaultData {
35
+ DeviceId: number;
36
+ Code: number; // this is deprecated
37
+ Msg: string;
38
+ AutoReset: boolean; // if this is true, the code will be reset by the fault monitor
39
+ ResetFlag: boolean; // used by the fault monitor to know whether to clear an fault or not
40
+ LogFlag: boolean; // when true, this fault hasn't been logged yet
41
+ TimeStamp: Date;
42
+ StepNum: number; // of this device
43
+ ParentStepNum: number;
44
+ }
45
+
46
+ export const initialFaultData: FaultData = {
47
+ DeviceId: 0,
48
+ Code: 0,
49
+ Msg: '',
50
+ AutoReset: false,
51
+ ResetFlag: false,
52
+ LogFlag: false,
53
+ TimeStamp: new Date(),
54
+ StepNum: 0,
55
+ ParentStepNum: 0
56
+ };
57
+
58
+ export interface DeviceFaultData {
59
+ List: FaultData[]; // Array of fault data
60
+ Present: boolean; // status
61
+ ChildrenPresent: boolean; // status that children have errors
62
+ }
63
+
64
+ export const initialDeviceFaultData: DeviceFaultData = {
65
+ List: [],
66
+ Present: false,
67
+ ChildrenPresent: false
68
+ };
69
+
70
+ export interface DeviceStatus {
71
+ state: number; // enum for States enum, same as the boolean states in the data structure
72
+ stepNum: number;
73
+ stepDescription: string;
74
+
75
+ colorCode: number; // color to indicate the current status for HMI purposes
76
+ statusMsg: string; // status string
77
+
78
+ error: boolean; // state, device or child has an error
79
+ killed: boolean; // device is de-energized
80
+ inactive: boolean; // waiting to be reset
81
+ resetting: boolean; // taking action to be idle
82
+ idle: boolean; // ready for auto tasks
83
+ running: boolean; // performing an active task (excludes tasks that just involve data exchange like recipe changing)
84
+ stopping: boolean;
85
+ paused: boolean; // action paused mid-task, able to be resumed (finish the task) or stopped (abandon task and back to idle or inactive)
86
+ aborting: boolean; // Aborting (Reacting TO E-Stop)
87
+ done: boolean; // finished with task, waiting for parent to drop the request
88
+ manual: boolean;
89
+
90
+ idleOrError: boolean; // useful to check for stopping
91
+ iifkm: boolean; // IdleOrInactiveOrFaultedOrKilledOrManual
92
+ rri: boolean; // ResettingOrRunningOrIdle
93
+ ipr: boolean; // IdleOrPausedOrRunning
94
+ kei: boolean; // KilledErrorOrInactive
95
+ runningOrStopping: boolean;
96
+
97
+ // Children Status
98
+ allChildrenIdle: boolean;
99
+ allChildrenKilled: boolean;
100
+ allChildrenInactive: boolean;
101
+ allChildrenIdleOrError: boolean;
102
+
103
+ commanderId: number; // used for external control
104
+
105
+ recordingLogs: boolean;
106
+ }
107
+
108
+ export const initialDeviceStatus: DeviceStatus = {
109
+ state: 0,
110
+ stepNum: 0,
111
+ stepDescription: '',
112
+ colorCode: 0,
113
+ statusMsg: '',
114
+ error: false,
115
+ killed: false,
116
+ inactive: false,
117
+ resetting: false,
118
+ idle: false,
119
+ running: false,
120
+ stopping: false,
121
+ paused: false,
122
+ aborting: false,
123
+ done: false,
124
+ manual: false,
125
+ idleOrError: false,
126
+ iifkm: false,
127
+ rri: false,
128
+ ipr: false,
129
+ kei: false,
130
+ runningOrStopping: false,
131
+ allChildrenIdle: false,
132
+ allChildrenKilled: false,
133
+ allChildrenInactive: false,
134
+ allChildrenIdleOrError: false,
135
+ commanderId: 0,
136
+ recordingLogs: false
137
+ };
138
+
139
+ export interface Device {
140
+ is: DeviceStatus;
141
+ errors: DeviceFaultData;
142
+ warnings: DeviceFaultData;
143
+ registration: DeviceRegistration;
144
+ cfg: DeviceCfg;
145
+ //ignore--instants: DeviceInstants;
146
+
147
+ //ignore--instantsexecMethod: ProcessData;
148
+ //ignore--instantstask: ProcessData;
149
+ //ignore--instantsprocess: ProcessData; //read-only
150
+ //ignore--instantsscript: ProcessData; //read-only
151
+
152
+ //ignore--instantsmission: ProcessData;
153
+ //ignore--instantssettings: DeviceSettings;
154
+ connectionStatus: boolean;
155
+
156
+ //ignore--instantsrequests: Array<DeviceActionRequestData>; //this can be written to outside of the device fb;
157
+ //ignore--instantsapiOpcua: ApiOpcuaData;
158
+ //ignore--instantsudp: UdpData;
159
+ }
160
+
161
+ export const initialDevice: Device = {
162
+ is: initialDeviceStatus,
163
+ errors: initialDeviceFaultData,
164
+ warnings: initialDeviceFaultData,
165
+ registration: initialDeviceRegistration,
166
+ cfg: initialDeviceCfg,
167
+ connectionStatus: false
168
+ };
@@ -0,0 +1,7 @@
1
+ export enum DeviceTypes {
2
+ Base = 0,
3
+ Axis = 1,
4
+ BoschAxis = 2, //need to deprecate this soon
5
+ DualAxis = 3,
6
+ Gantry = 4
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Device";
2
+ export * from "./Axis";
@@ -0,0 +1,4 @@
1
+ export interface GlobalConstants {
2
+ HIDE_LEFT_TWO_COLUMNS: boolean;
3
+ HIDE_RIGHT_COLUMN: boolean;
4
+ }
@@ -0,0 +1,52 @@
1
+ import { FaultCodeData } from "./Machine";
2
+ import { BannerMode, Color, DeviceState, VisibilityState } from "..";
3
+
4
+
5
+ export interface ComponentAnimation {
6
+ visibility: VisibilityState; //enum
7
+ needsExpertUser: boolean; //requires expert user to be active user in order to function
8
+ backgroundColor: Color; //enum
9
+ accentColor: Color; //enum
10
+ fontColor: Color; //enum
11
+ wasClicked: boolean; //this is set by the UI and reset by the PLC
12
+ }
13
+
14
+ export interface ButtonBar {
15
+ stopBtn: ComponentAnimation;
16
+ unloadBtn: ComponentAnimation;
17
+ loadBtn: ComponentAnimation;
18
+ unlockBtn: ComponentAnimation;
19
+ startBtn: ComponentAnimation;
20
+ lockBtn: ComponentAnimation;
21
+ resetBtn: ComponentAnimation;
22
+ jobChangeBtn: ComponentAnimation;
23
+ clearFaultsBtn: ComponentAnimation;
24
+ energizeBtn: ComponentAnimation;
25
+ }
26
+
27
+ export interface StatusBar {
28
+ jobName: string;
29
+ statusMsg: DeviceState;
30
+ status: number;
31
+ cncTimeLeft: number[]; // get the second element in the array
32
+ goodCnt: number;
33
+ batchQty: number;
34
+ dateAndTime: string; //format : 1970-01-01T00:00:00.000Z
35
+ bannerMode: BannerMode;
36
+ faultCodeData: FaultCodeData;
37
+ }
38
+
39
+ export interface RackHmiPbs {
40
+ editRawShelfBtn: ComponentAnimation;
41
+ editDoneShelfBtn: ComponentAnimation;
42
+ cancelBtn: ComponentAnimation;
43
+ saveBtn: ComponentAnimation;
44
+ }
45
+
46
+ export interface HmiData {
47
+ buttonBar: ButtonBar;
48
+ statusBar: StatusBar;
49
+ rackPbs: RackHmiPbs;
50
+ heartbeatPLC: number;
51
+ heartbeatHMI: number;
52
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentAnimation } from ".";
2
+
3
+ export interface UserData {
4
+ activeUser: number;
5
+ hmiLoginBtn: ComponentAnimation;
6
+ hmiLogoutBtn: ComponentAnimation;
7
+ }
8
+
9
+ export interface FaultCodeData {
10
+ deviceId: number;
11
+ code: number;
12
+ }
13
+
14
+ export interface SystemFaultData {
15
+ list: FaultCodeData[];
16
+ present: boolean;
17
+ }
18
+
19
+ // export interface Machine {
20
+ // user: UserData;
21
+ // errors: SystemFaultData;
22
+ // warnings: SystemFaultData;
23
+ // }
@@ -0,0 +1,11 @@
1
+ import { PartState } from "../enums";
2
+ export interface PartData {
3
+ cncPreOp: [PartState, PartState];
4
+ cnc: [PartState, PartState];
5
+ cncPostOp: [PartState, PartState];
6
+ doneShelf: PartState[];
7
+ rawShelf: PartState[];
8
+ robot: [PartState, PartState];
9
+ washer: [PartState, PartState];
10
+ hmiEditingAllowed: boolean;
11
+ }
@@ -0,0 +1,21 @@
1
+ import { RobPositionData } from "..";
2
+
3
+ export interface ShelfPartPositionData {
4
+ index: number;
5
+ colNum: number;
6
+ posLetter: number;
7
+ offest: RobPositionData;
8
+ }
9
+
10
+ export interface RackShelfData {
11
+ nextPart: ShelfPartPositionData;
12
+ lastPart: ShelfPartPositionData;
13
+ isEmpty: boolean;
14
+ isFull: boolean;
15
+ isEditMode: boolean;
16
+ }
17
+
18
+ export interface RackData {
19
+ raw: RackShelfData;
20
+ done: RackShelfData;
21
+ }
@@ -0,0 +1,7 @@
1
+ export interface RecipeData {
2
+ partName: string;
3
+ extrusionType: number;
4
+ extrusionLength_mm: number;
5
+ ncProgramNumber: number;
6
+ partWeight_kg: number;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { ComponentAnimation } from ".";
2
+
3
+ export interface RecipeManagerPbs {
4
+ editBtn: ComponentAnimation;
5
+ changeBtn: ComponentAnimation;
6
+ jobSetupBtn: ComponentAnimation;
7
+ activateBtn: boolean;
8
+ startSetupBtn: boolean;
9
+ finishSetupBtn: boolean;
10
+ cancelBtn: boolean;
11
+ }
@@ -0,0 +1,27 @@
1
+ import { TaskData, RobPositions, TaskId } from "..";
2
+
3
+ export interface RobData {
4
+ zone: RobZoneData;
5
+ pos: RobPositions;
6
+ dest: RobPositions;
7
+ cartesian: RobPositionData;
8
+ taskReq: TaskId; //incoming task request
9
+ taskData: TaskData;
10
+ recipeOffsets: RobPositionData[];
11
+ }
12
+
13
+ export interface RobPositionData {
14
+ x: number;
15
+ y: number;
16
+ z: number;
17
+ wdeg: number;
18
+ pdeg: number;
19
+ rdeg: number;
20
+ }
21
+
22
+ export interface RobZoneData {
23
+ cncHorzShuttle: boolean;
24
+ waypointShuttle: boolean; //Joint moves, wrist is holding parts upright and at a distance that allows robot to rotate about J1 without fear of collision, basically just moving J1
25
+ dcsNoGo: boolean;
26
+ outsideOfCnc: boolean;
27
+ }
@@ -0,0 +1,31 @@
1
+ import { Priority, TaskId } from "..";
2
+
3
+ export interface TaskQueue {
4
+ topPriority: Priority;
5
+ taskList: TaskId[];
6
+ taskCnt: number;
7
+ activeTaskIndex: number;
8
+ }
9
+
10
+ export interface TaskData {
11
+ id: number;
12
+ TaskString: string; //like a description
13
+ T: number; // time in seconds to complete task
14
+ TaskType: number; //Pick (state change ignored), Load (state change ignored), Move (state change ignored), Move with Process (state change used), Transform/Process (stage change used)
15
+
16
+ StartPositionId: number; //starting position required before this task is allowed
17
+ EndPositionId: number; //ending position after this task is finished
18
+ GateId: number; //robot-cnc door, for example
19
+
20
+ StationId: number; //used for transform processes
21
+ PartStatusStart: number[];
22
+ PartStatusEnd: number[];
23
+ PartId: number; //used for pick and load moves
24
+
25
+ OffsetUserFrameId: number; //90 Through 99, corresponds to our PRs 90-99 which correspdond to the user frame
26
+
27
+ GripperPositionId: number; //0 for left, 1 for right, 2 for both (used for moves in and out of CNC, and to from washer)
28
+ LeftGripperMustBeEmpty: boolean;
29
+
30
+ isCurrentlyAllowed: boolean; //set this with logic, do not configure
31
+ }
@@ -0,0 +1,8 @@
1
+ import { ComponentAnimation } from "./HMI";
2
+
3
+ export interface UserManagerFB {
4
+ loginBtn: ComponentAnimation;
5
+ logoutBtn: ComponentAnimation;
6
+ username: string;
7
+ password: string;
8
+ }
@@ -0,0 +1,13 @@
1
+ export * from "./Com";
2
+ export * from "./AppState";
3
+ export * from "./HMI";
4
+ export * from "./Devices/Device";
5
+ export * from "./Machine";
6
+ export * from "./RackData";
7
+ export * from "./GlobalConstants";
8
+ export * from "./RecipeData";
9
+ export * from "./RecipeManagerFB";
10
+ export * from "./UserManagerFB";
11
+ export * from "./TaskQueue";
12
+ export * from "./RobData";
13
+ export * from "./Devices";
@@ -0,0 +1,79 @@
1
+ export enum Color {
2
+ Transparent = -1,
3
+ //uses ROYGBIV FOR 1-7
4
+ Black = 0, //#000000,
5
+ Red = 1,
6
+ Orange = 2,
7
+ Yellow = 3, //#FFFF00,
8
+ Green = 4,
9
+ Blue = 5,
10
+ Indigo = 6,
11
+ Violet = 7,
12
+ Gray = 8, //#F2F2F2,
13
+ White = 9,
14
+ //Light Colors
15
+ LightBlack = 10,
16
+ LightRed = 11, //#FF6B6B
17
+ LightOrange = 12,
18
+ LightYellow = 13,
19
+ LightGreen = 14,
20
+ LightBlue = 15,
21
+ LightIndigo = 16,
22
+ LightViolet = 17,
23
+ LightGray = 18,
24
+ LightWhite = 19, //#7F7F7F,
25
+ //Dark Colors
26
+ DarkRed = 201, //#D20000
27
+ DarkYellow = 203, //#F0EA00
28
+ DarkGray = 208,
29
+
30
+ //Bg Colors
31
+ Light = 1001,
32
+ Dark = 1002,
33
+
34
+ //Action Push Button Background Colors
35
+ ActionBtn1 = 21, //#F7A143,
36
+ ActionBtn2 = 22, //#8FAADC,
37
+ ActionBtn3 = 23, //#FF0000, red
38
+ ActionBtn4 = 24,
39
+ ActionBtn5 = 25,
40
+ ActionBtn6 = 26,
41
+
42
+ //General status
43
+ Good = 31,
44
+ Warn = 32, //#FFFF00,
45
+ Error = 33, //#FF0000,
46
+
47
+ //Device states
48
+ Killed = 40,
49
+ Inactive = 41,
50
+ Resetting = 42,
51
+ Idle = 43, //#D9D9D9,
52
+ Running = 44, //#5CEE82,
53
+ Done = 45,
54
+ Aborting = 46,
55
+ Manual = 47,
56
+ Paused = 48,
57
+ Faulted = 49,
58
+ Stopping = 440,
59
+
60
+ //Task List Status
61
+ TaskDone = 50, //#C5E0B4,
62
+ TaskActive = 51, //#8FAADC,
63
+ TaskFuture = 52, //#D9D9D9, same as Idle
64
+
65
+ // Mfg-specific colors
66
+ FanucYellow = 60, //#FFFF00,
67
+
68
+ //Part Status
69
+ Empty = 100, //#373737,
70
+ Processing = 101, //#ED7D31,
71
+ Raw = 102, //#A6A6A6,
72
+ Deburred = 103, //rgba(0,112,192,0.4),
73
+ Machined = 104, //rgba(0,112,192,0.6),
74
+ Washed = 105, //rgba(0,112,192,0.8),
75
+ Dryed = 106, //rgba(0,112,192,1.0),
76
+ Scrapped = 109, //#FF0000, same as Error
77
+ Finished = 110, //#5CEE82, same as Running
78
+ DeburrBottomFinished = 111, //rgba(0,112,192,0.2),
79
+ }
@@ -0,0 +1,10 @@
1
+ export enum DeviceId {
2
+ SYS = 0,
3
+ CON = 1,
4
+ CNC = 2,
5
+ ROB = 3,
6
+ DBRR = 4,
7
+ SFTY = 5,
8
+ RACK = 6,
9
+ WASH = 7,
10
+ }
@@ -0,0 +1,30 @@
1
+ import { DeviceId } from "./DeviceId";
2
+
3
+ export const ErrorsMap: {
4
+ [key in DeviceId]: {
5
+ [key: number]: string;
6
+ };
7
+ } = {
8
+ [DeviceId.SFTY]: {
9
+ 0: "NoError",
10
+ 1: "EstopDumpValveCh1Off",
11
+ 2: "EstopDumpValveCh2Off",
12
+ 3: "EstopDumpValveCh1On",
13
+ 4: "EstopDumpValveCh2On",
14
+ 5: "FenceDumpValveCh1Off",
15
+ 6: "FenceDumpValveCh2Off",
16
+ 7: "FenceDumpValveCh1On",
17
+ 8: "FenceDumpValveCh2On",
18
+ },
19
+ [DeviceId.CNC]: {},
20
+ [DeviceId.CON]: {},
21
+ [DeviceId.DBRR]: {},
22
+ [DeviceId.ROB]: {
23
+ 0: "NoError",
24
+ 1: "ControllerFault",
25
+ 2: "RobotStartedWrongTask",
26
+ },
27
+ [DeviceId.SYS]: {},
28
+ [DeviceId.WASH]: {},
29
+ [DeviceId.RACK]: {},
30
+ };