node-red-trexmes-commands 1.5.3 → 1.5.5
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.
- package/package.json +1 -1
- package/trexcommands.html +1 -1
- package/trexcommands.js +18 -14
package/package.json
CHANGED
package/trexcommands.html
CHANGED
|
@@ -464,7 +464,7 @@
|
|
|
464
464
|
data = '{ "WorkstationId": 10 }';
|
|
465
465
|
}
|
|
466
466
|
else if(operationMode.startsWith('16|')) { //Create Deffect
|
|
467
|
-
data = '{ "WorkstationId": 10, "DefectId": 11,"StockId": 12, "Quantity": 15.5 }';
|
|
467
|
+
data = '{ "WorkstationId": 10, "JobOrderId": 123456, "DefectId": 11,"StockId": 12, "Quantity": 15.5 }';
|
|
468
468
|
}
|
|
469
469
|
else if(operationMode.startsWith('100|')) { //Get Open Jobs
|
|
470
470
|
data = '{ "WorkstationId": 10 }';
|
package/trexcommands.js
CHANGED
|
@@ -44,85 +44,89 @@ module.exports = function (RED) {
|
|
|
44
44
|
|
|
45
45
|
if(payload.operationMode == "1" ) { // Load Job Plan
|
|
46
46
|
if(!payload.PlanId){
|
|
47
|
+
node.warn("DENEME");
|
|
47
48
|
return result;
|
|
48
49
|
}
|
|
49
|
-
result.command = JSON.stringify({ "
|
|
50
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "PlanId": payload.PlanId });
|
|
50
51
|
result.isOk = true;
|
|
51
52
|
}
|
|
52
53
|
else if(payload.operationMode == "4" ) { // Finish Production
|
|
53
|
-
result.command = JSON.stringify({ "
|
|
54
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "Quantity": 0, "ReferenceQuantityType": 0, "IsQuantityApproved": false });
|
|
54
55
|
result.isOk = true;
|
|
55
56
|
}
|
|
56
57
|
else if(payload.operationMode == "5" ) { // Start Stoppage
|
|
57
58
|
if(!payload.StoppageCauseId){
|
|
58
59
|
return result;
|
|
59
60
|
}
|
|
60
|
-
result.command = JSON.stringify({ "
|
|
61
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "StoppageCauseId": payload.StoppageCauseId });
|
|
61
62
|
result.isOk = true;
|
|
62
63
|
}
|
|
63
64
|
else if(payload.operationMode == "6" ) { // Change Stoppage
|
|
64
65
|
if(!payload.StoppageCauseId){
|
|
65
66
|
return result;
|
|
66
67
|
}
|
|
67
|
-
result.command = JSON.stringify({ "
|
|
68
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "StoppageCauseId": payload.StoppageCauseId });
|
|
68
69
|
result.isOk = true;
|
|
69
70
|
}
|
|
70
71
|
else if(payload.operationMode == "7" ) { // Finish Stoppage
|
|
71
|
-
result.command = JSON.stringify({ "
|
|
72
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId });
|
|
72
73
|
result.isOk = true;
|
|
73
74
|
}
|
|
74
75
|
else if(payload.operationMode == "9" ) { // Login Employee
|
|
75
76
|
if(!payload.EmployeeId){
|
|
76
77
|
return result;
|
|
77
78
|
}
|
|
78
|
-
result.command = JSON.stringify({ "
|
|
79
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "EmployeeId": payload.EmployeeId });
|
|
79
80
|
result.isOk = true;
|
|
80
81
|
}
|
|
81
82
|
else if(payload.operationMode == "10" ) { // Logout Employee
|
|
82
83
|
if(!payload.EmployeeId){
|
|
83
84
|
return result;
|
|
84
85
|
}
|
|
85
|
-
result.command = JSON.stringify({ "
|
|
86
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "EmployeeId": payload.EmployeeId });
|
|
86
87
|
result.isOk = true;
|
|
87
88
|
}
|
|
88
89
|
else if(payload.operationMode == "13" ) { // Shifted Shift
|
|
89
90
|
if(!payload.LineId){
|
|
90
91
|
return result;
|
|
91
92
|
}
|
|
92
|
-
result.command = JSON.stringify({ "
|
|
93
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "LineId": payload.LineId });
|
|
93
94
|
result.isOk = true;
|
|
94
95
|
}
|
|
95
96
|
else if(payload.operationMode == "14" ) { // Start Test Mode
|
|
96
97
|
if(!payload.StoppageCauseId){
|
|
97
98
|
return result;
|
|
98
99
|
}
|
|
99
|
-
result.command = JSON.stringify({ "
|
|
100
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "StoppageCauseId": payload.StoppageCauseId });
|
|
100
101
|
result.isOk = true;
|
|
101
102
|
}
|
|
102
103
|
else if(payload.operationMode == "15" ) { // Finish Test Mode
|
|
103
|
-
result.command = JSON.stringify({ "
|
|
104
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId });
|
|
104
105
|
result.isOk = true;
|
|
105
106
|
}
|
|
106
107
|
else if(payload.operationMode == "16" ) { // Create Deffect
|
|
107
108
|
if(!payload.DefectId){
|
|
108
109
|
return result;
|
|
109
110
|
}
|
|
111
|
+
if(!payload.JobOrderId){
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
110
114
|
if(!payload.StockId){
|
|
111
115
|
return result;
|
|
112
116
|
}
|
|
113
117
|
if(!payload.Quantity){
|
|
114
118
|
return result;
|
|
115
119
|
}
|
|
116
|
-
result.command = JSON.stringify({ "
|
|
120
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId, "JobOrderId":payload.JobOrderId, "DefectId": payload.DefectId, "StockId": payload.StockId, "Quantity": payload.Quantity, "ReferenceQuantityType": 0 });
|
|
117
121
|
result.isOk = true;
|
|
118
122
|
}
|
|
119
123
|
else if(payload.operationMode == "100" ) { // Get Open Jobs
|
|
120
|
-
result.command = JSON.stringify({ "
|
|
124
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId });
|
|
121
125
|
result.isOk = true;
|
|
122
126
|
result.isGetFunc = true;
|
|
123
127
|
}
|
|
124
128
|
else if(payload.operationMode == "101" ) { // Get StopCause List
|
|
125
|
-
result.command = JSON.stringify({ "
|
|
129
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId });
|
|
126
130
|
result.isOk = true;
|
|
127
131
|
result.isGetFunc = true;
|
|
128
132
|
}
|
|
@@ -132,7 +136,7 @@ module.exports = function (RED) {
|
|
|
132
136
|
result.isGetFunc = true;
|
|
133
137
|
}
|
|
134
138
|
else if(payload.operationMode == "103" ) { // Get Station Status
|
|
135
|
-
result.command = JSON.stringify({ "
|
|
139
|
+
result.command = JSON.stringify({ "WorkStationId" : payload.WorkstationId });
|
|
136
140
|
result.isOk = true;
|
|
137
141
|
result.isGetFunc = true;
|
|
138
142
|
}
|