@kuriousdesign/machine-sdk 1.0.33 → 1.0.35
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,6 +1,22 @@
|
|
|
1
1
|
import { PartStateDeprecated as PartStateDeprecated } from "../enums";
|
|
2
|
+
export declare enum PartStates {
|
|
3
|
+
Empty = 0,//no part present
|
|
4
|
+
UnvalidatedRaw = 10,//used if registered by sensor, but not approved by operator
|
|
5
|
+
Raw = 20,
|
|
6
|
+
StartedPreWeighing = 29,
|
|
7
|
+
PreWeighed = 30,
|
|
8
|
+
StartedApplying = 31,
|
|
9
|
+
Applied = 40,
|
|
10
|
+
StartedPhotographing = 61,
|
|
11
|
+
Photographed = 70,
|
|
12
|
+
StartedPostWeighing = 71,
|
|
13
|
+
PostWeighed = 80,
|
|
14
|
+
Failed = 911,
|
|
15
|
+
Passed = 1000
|
|
16
|
+
}
|
|
17
|
+
export declare function partStateToString(state: PartStates): string;
|
|
2
18
|
export interface PartData {
|
|
3
|
-
processSts:
|
|
19
|
+
processSts: PartStates;
|
|
4
20
|
validation: PartValidationData;
|
|
5
21
|
loadedBadSensor: boolean;
|
|
6
22
|
fixtureLocationWhenLoaded: number;
|
|
@@ -1,7 +1,85 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialPartDataStatus = exports.initialPartData = exports.initialPartValidationData = void 0;
|
|
3
|
+
exports.initialPartDataStatus = exports.initialPartData = exports.initialPartValidationData = exports.PartStates = void 0;
|
|
4
|
+
exports.partStateToString = partStateToString;
|
|
4
5
|
const GlobalConstants_1 = require("./GlobalConstants");
|
|
6
|
+
// TYPE PartValidationData :
|
|
7
|
+
// STRUCT
|
|
8
|
+
// State:INT;
|
|
9
|
+
// PreWeightKg:LREAL;
|
|
10
|
+
// PostWeightKg:LREAL;
|
|
11
|
+
// LinerWeightKg:LREAL;
|
|
12
|
+
// END_STRUCT
|
|
13
|
+
// END_TYPE
|
|
14
|
+
// TYPE PartData :
|
|
15
|
+
// STRUCT
|
|
16
|
+
// ProcessSts:INT;//PartStates enum
|
|
17
|
+
// Validation:PartValidationData;
|
|
18
|
+
// LoadedBadSensor:BOOL; //marks if loaded into system with bad part present sensor
|
|
19
|
+
// FixtureLocationWhenLoaded:INT; //LocationIds enum, where this part was loaced
|
|
20
|
+
// CurrentLocation:INT; //LocationIds enum, this is also the same as the partIndex of the Machine.PartData[partIndex]
|
|
21
|
+
// InFixture:BOOL; //CurrentLocation = FixtureLocationWhenLoaded
|
|
22
|
+
// //RecipeData:PartRecipeData;
|
|
23
|
+
// END_STRUCT
|
|
24
|
+
// END_TYPE
|
|
25
|
+
// {attribute 'qualified_only'}
|
|
26
|
+
// {attribute 'strict'}
|
|
27
|
+
// //Just subtract 5 from a discrete part state that, this corresponds to processing
|
|
28
|
+
// TYPE PartStates :
|
|
29
|
+
// (
|
|
30
|
+
// Empty:=0,//no part present
|
|
31
|
+
// //BadSensorEmpty:=1, //used if sensors give false positive
|
|
32
|
+
// UnvalidatedRaw:=10, //used if registered by sensor, but not approved by operator
|
|
33
|
+
// Raw:=20,
|
|
34
|
+
// //BadSensorRaw:=21, //used if loaded by sensor didn't work
|
|
35
|
+
// StartedPreWeighing:=29,
|
|
36
|
+
// PreWeighed:=30,
|
|
37
|
+
// StartedApplying:=31,
|
|
38
|
+
// Applied:=40,
|
|
39
|
+
// StartedPhotographing:=61,
|
|
40
|
+
// Photographed:=70,
|
|
41
|
+
// StartedPostWeighing:=71,
|
|
42
|
+
// PostWeighed:=80,
|
|
43
|
+
// Failed:=911,
|
|
44
|
+
// Passed:=1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
45
|
+
// );
|
|
46
|
+
// END_TYPE
|
|
47
|
+
var PartStates;
|
|
48
|
+
(function (PartStates) {
|
|
49
|
+
PartStates[PartStates["Empty"] = 0] = "Empty";
|
|
50
|
+
//BadSensorEmpty = 1, //used if sensors give false positive
|
|
51
|
+
PartStates[PartStates["UnvalidatedRaw"] = 10] = "UnvalidatedRaw";
|
|
52
|
+
PartStates[PartStates["Raw"] = 20] = "Raw";
|
|
53
|
+
//BadSensorRaw = 21, //used if loaded by sensor didn't work
|
|
54
|
+
PartStates[PartStates["StartedPreWeighing"] = 29] = "StartedPreWeighing";
|
|
55
|
+
PartStates[PartStates["PreWeighed"] = 30] = "PreWeighed";
|
|
56
|
+
PartStates[PartStates["StartedApplying"] = 31] = "StartedApplying";
|
|
57
|
+
PartStates[PartStates["Applied"] = 40] = "Applied";
|
|
58
|
+
PartStates[PartStates["StartedPhotographing"] = 61] = "StartedPhotographing";
|
|
59
|
+
PartStates[PartStates["Photographed"] = 70] = "Photographed";
|
|
60
|
+
PartStates[PartStates["StartedPostWeighing"] = 71] = "StartedPostWeighing";
|
|
61
|
+
PartStates[PartStates["PostWeighed"] = 80] = "PostWeighed";
|
|
62
|
+
PartStates[PartStates["Failed"] = 911] = "Failed";
|
|
63
|
+
PartStates[PartStates["Passed"] = 1000] = "Passed"; //ProessingDone, back in fixture and waiting to be unloaded
|
|
64
|
+
})(PartStates || (exports.PartStates = PartStates = {}));
|
|
65
|
+
;
|
|
66
|
+
function partStateToString(state) {
|
|
67
|
+
switch (state) {
|
|
68
|
+
case PartStates.Empty: return "Empty";
|
|
69
|
+
case PartStates.UnvalidatedRaw: return "Unvalidated Raw";
|
|
70
|
+
case PartStates.Raw: return "Raw";
|
|
71
|
+
case PartStates.StartedPreWeighing: return "Started Pre-Weighing";
|
|
72
|
+
case PartStates.PreWeighed: return "Pre-Weighed";
|
|
73
|
+
case PartStates.StartedApplying: return "Started Applying";
|
|
74
|
+
case PartStates.Applied: return "Applied";
|
|
75
|
+
case PartStates.StartedPhotographing: return "Started Photographing";
|
|
76
|
+
case PartStates.Photographed: return "Photographed";
|
|
77
|
+
case PartStates.StartedPostWeighing: return "Started Post-Weighing";
|
|
78
|
+
case PartStates.PostWeighed: return "Post-Weighed";
|
|
79
|
+
case PartStates.Failed: return "Failed";
|
|
80
|
+
case PartStates.Passed: return "Passed";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
5
83
|
exports.initialPartValidationData = {
|
|
6
84
|
state: -1,
|
|
7
85
|
preWeightKg: -1,
|
|
@@ -9,7 +87,7 @@ exports.initialPartValidationData = {
|
|
|
9
87
|
linerWeightKg: -1,
|
|
10
88
|
};
|
|
11
89
|
exports.initialPartData = {
|
|
12
|
-
processSts:
|
|
90
|
+
processSts: PartStates.Empty,
|
|
13
91
|
validation: { ...exports.initialPartValidationData },
|
|
14
92
|
loadedBadSensor: false,
|
|
15
93
|
fixtureLocationWhenLoaded: -1,
|
package/package.json
CHANGED
|
@@ -82,6 +82,8 @@ export interface Machine {
|
|
|
82
82
|
warnings: SystemFaultData;
|
|
83
83
|
taskQueue: TaskQueue;
|
|
84
84
|
registeredDevices: DeviceRegistration[];
|
|
85
|
+
heartbeatPlc: number;
|
|
86
|
+
heartbeatHmi: number;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
export const initialMachine: Machine = ({
|
|
@@ -99,5 +101,6 @@ export const initialMachine: Machine = ({
|
|
|
99
101
|
warnings: { ...initialSystemFaultData },
|
|
100
102
|
taskQueue: { ...initialTaskQueue },
|
|
101
103
|
registeredDevices: [],
|
|
102
|
-
|
|
104
|
+
heartbeatPlc: 0,
|
|
105
|
+
heartbeatHmi: 0,
|
|
103
106
|
});
|
package/src/custom-types/Part.ts
CHANGED
|
@@ -26,10 +26,76 @@ import { GCs } from "./GlobalConstants";
|
|
|
26
26
|
// END_STRUCT
|
|
27
27
|
// END_TYPE
|
|
28
28
|
|
|
29
|
+
// {attribute 'qualified_only'}
|
|
30
|
+
// {attribute 'strict'}
|
|
31
|
+
// //Just subtract 5 from a discrete part state that, this corresponds to processing
|
|
32
|
+
// TYPE PartStates :
|
|
33
|
+
// (
|
|
34
|
+
// Empty:=0,//no part present
|
|
35
|
+
// //BadSensorEmpty:=1, //used if sensors give false positive
|
|
36
|
+
|
|
37
|
+
// UnvalidatedRaw:=10, //used if registered by sensor, but not approved by operator
|
|
38
|
+
|
|
39
|
+
// Raw:=20,
|
|
40
|
+
// //BadSensorRaw:=21, //used if loaded by sensor didn't work
|
|
41
|
+
|
|
42
|
+
// StartedPreWeighing:=29,
|
|
43
|
+
// PreWeighed:=30,
|
|
44
|
+
|
|
45
|
+
// StartedApplying:=31,
|
|
46
|
+
// Applied:=40,
|
|
47
|
+
|
|
48
|
+
// StartedPhotographing:=61,
|
|
49
|
+
// Photographed:=70,
|
|
50
|
+
|
|
51
|
+
// StartedPostWeighing:=71,
|
|
52
|
+
// PostWeighed:=80,
|
|
53
|
+
|
|
54
|
+
// Failed:=911,
|
|
55
|
+
// Passed:=1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
29
56
|
|
|
57
|
+
|
|
58
|
+
// );
|
|
59
|
+
// END_TYPE
|
|
60
|
+
|
|
61
|
+
export enum PartStates {
|
|
62
|
+
Empty = 0,//no part present
|
|
63
|
+
//BadSensorEmpty = 1, //used if sensors give false positive
|
|
64
|
+
UnvalidatedRaw = 10, //used if registered by sensor, but not approved by operator
|
|
65
|
+
Raw = 20,
|
|
66
|
+
//BadSensorRaw = 21, //used if loaded by sensor didn't work
|
|
67
|
+
StartedPreWeighing = 29,
|
|
68
|
+
PreWeighed = 30,
|
|
69
|
+
StartedApplying = 31,
|
|
70
|
+
Applied = 40,
|
|
71
|
+
StartedPhotographing = 61,
|
|
72
|
+
Photographed = 70,
|
|
73
|
+
StartedPostWeighing = 71,
|
|
74
|
+
PostWeighed = 80,
|
|
75
|
+
Failed = 911,
|
|
76
|
+
Passed = 1000 //ProessingDone, back in fixture and waiting to be unloaded
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export function partStateToString(state: PartStates): string {
|
|
80
|
+
switch (state) {
|
|
81
|
+
case PartStates.Empty: return "Empty";
|
|
82
|
+
case PartStates.UnvalidatedRaw: return "Unvalidated Raw";
|
|
83
|
+
case PartStates.Raw: return "Raw";
|
|
84
|
+
case PartStates.StartedPreWeighing: return "Started Pre-Weighing";
|
|
85
|
+
case PartStates.PreWeighed: return "Pre-Weighed";
|
|
86
|
+
case PartStates.StartedApplying: return "Started Applying";
|
|
87
|
+
case PartStates.Applied: return "Applied";
|
|
88
|
+
case PartStates.StartedPhotographing: return "Started Photographing";
|
|
89
|
+
case PartStates.Photographed: return "Photographed";
|
|
90
|
+
case PartStates.StartedPostWeighing: return "Started Post-Weighing";
|
|
91
|
+
case PartStates.PostWeighed: return "Post-Weighed";
|
|
92
|
+
case PartStates.Failed: return "Failed";
|
|
93
|
+
case PartStates.Passed: return "Passed";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
30
96
|
|
|
31
97
|
export interface PartData {
|
|
32
|
-
processSts:
|
|
98
|
+
processSts: PartStates; // PartStates enum
|
|
33
99
|
validation: PartValidationData;
|
|
34
100
|
loadedBadSensor: boolean; // marks if loaded into system with bad part present sensor
|
|
35
101
|
fixtureLocationWhenLoaded: number; // LocationIds enum, where this part was loaced
|
|
@@ -51,7 +117,7 @@ export const initialPartValidationData: PartValidationData = {
|
|
|
51
117
|
linerWeightKg: -1,
|
|
52
118
|
};
|
|
53
119
|
export const initialPartData: PartData = {
|
|
54
|
-
processSts:
|
|
120
|
+
processSts: PartStates.Empty,
|
|
55
121
|
validation: { ...initialPartValidationData },
|
|
56
122
|
loadedBadSensor: false,
|
|
57
123
|
fixtureLocationWhenLoaded: -1,
|