@ricado/api-client 2.1.0 → 2.3.0
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/README.md +5 -7
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +25 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
- package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
- package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
- package/lib/Controllers/Packhouse/Site/index.js +15 -0
- package/lib/DataItems/PointValueItem.js +3 -3
- package/lib/Models/AccountPolicyModel.js +7 -7
- package/lib/Models/ApiAccountModel.js +7 -7
- package/lib/Models/CompanyModel.js +5 -5
- package/lib/Models/FirebaseTokenModel.js +8 -8
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/lib/Models/Packhouse/Site/PackingLineModel.js +539 -16
- package/lib/Models/Packhouse/Site/PackrunModel.js +81 -15
- package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +271 -15
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +204 -38
- package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/Packhouse/Site/index.js +15 -0
- package/lib/Models/RTUModel.js +6 -6
- package/lib/Models/RTUPluginModel.js +5 -5
- package/lib/Models/Site/AlarmGroupModel.js +7 -7
- package/lib/Models/Site/AlarmModel.js +17 -17
- package/lib/Models/Site/DefinitionModel.js +6 -6
- package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
- package/lib/Models/Site/PermanentObjectModel.js +7 -7
- package/lib/Models/Site/PointModel.js +11 -11
- package/lib/Models/Site/TemporaryObjectModel.js +6 -6
- package/lib/Models/SiteModel.js +6 -6
- package/lib/Models/TokenModel.js +10 -10
- package/lib/Models/UserAccountActionTokenModel.js +11 -11
- package/lib/Models/UserAccountModel.js +10 -10
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +22 -12
- package/lib/WebSocketHelper.js +29 -13
- package/lib/index.d.ts +3853 -1290
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
- package/src/Controllers/Packhouse/Site/PackingLineController.js +25 -1
- package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
- package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
- package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
- package/src/Controllers/Packhouse/Site/index.js +10 -0
- package/src/DataItems/PointValueItem.js +3 -3
- package/src/Models/AccountPolicyModel.js +7 -7
- package/src/Models/ApiAccountModel.js +7 -7
- package/src/Models/CompanyModel.js +5 -5
- package/src/Models/FirebaseTokenModel.js +8 -8
- package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/src/Models/Packhouse/Site/PackingLineModel.js +720 -16
- package/src/Models/Packhouse/Site/PackrunModel.js +90 -15
- package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +308 -15
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +229 -38
- package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/Packhouse/Site/index.js +10 -0
- package/src/Models/RTUModel.js +6 -6
- package/src/Models/RTUPluginModel.js +5 -5
- package/src/Models/Site/AlarmGroupModel.js +7 -7
- package/src/Models/Site/AlarmModel.js +17 -17
- package/src/Models/Site/DefinitionModel.js +6 -6
- package/src/Models/Site/PermanentObjectDataModel.js +8 -8
- package/src/Models/Site/PermanentObjectModel.js +7 -7
- package/src/Models/Site/PointModel.js +11 -11
- package/src/Models/Site/TemporaryObjectModel.js +6 -6
- package/src/Models/SiteModel.js +6 -6
- package/src/Models/TokenModel.js +10 -10
- package/src/Models/UserAccountActionTokenModel.js +11 -11
- package/src/Models/UserAccountModel.js +10 -10
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +24 -12
- package/src/WebSocketHelper.js +34 -13
- package/src/index.js +3 -3
- package/types/tslint.json +2 -1
|
@@ -31,7 +31,7 @@ class PackrunModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Packing Line ID this Packrun is associated with
|
|
@@ -39,7 +39,7 @@ class PackrunModel extends BaseModel
|
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.packingLineId =
|
|
42
|
+
this.packingLineId = "";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Packrun Name
|
|
@@ -47,7 +47,7 @@ class PackrunModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.name =
|
|
50
|
+
this.name = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* When this Packrun was Created
|
|
@@ -55,7 +55,7 @@ class PackrunModel extends BaseModel
|
|
|
55
55
|
* @type {Date}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.createdTimestamp =
|
|
58
|
+
this.createdTimestamp = new Date();
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Grower Name for this Packrun
|
|
@@ -63,7 +63,7 @@ class PackrunModel extends BaseModel
|
|
|
63
63
|
* @type {string}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.growerName =
|
|
66
|
+
this.growerName = "";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The Grower Code for this Packrun
|
|
@@ -71,7 +71,7 @@ class PackrunModel extends BaseModel
|
|
|
71
71
|
* @type {string}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.growerCode =
|
|
74
|
+
this.growerCode = "";
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Maturity Area for this Packrun
|
|
@@ -79,7 +79,7 @@ class PackrunModel extends BaseModel
|
|
|
79
79
|
* @type {string}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.maturityArea =
|
|
82
|
+
this.maturityArea = "";
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* When this Packrun was Started
|
|
@@ -87,7 +87,7 @@ class PackrunModel extends BaseModel
|
|
|
87
87
|
* @type {?Date}
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.startTimestamp =
|
|
90
|
+
this.startTimestamp = null;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* When this Packrun was Finished
|
|
@@ -95,7 +95,7 @@ class PackrunModel extends BaseModel
|
|
|
95
95
|
* @type {?Date}
|
|
96
96
|
* @public
|
|
97
97
|
*/
|
|
98
|
-
this.finishTimestamp =
|
|
98
|
+
this.finishTimestamp = null;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* The Variety for this Packrun
|
|
@@ -103,7 +103,7 @@ class PackrunModel extends BaseModel
|
|
|
103
103
|
* @type {string}
|
|
104
104
|
* @public
|
|
105
105
|
*/
|
|
106
|
-
this.varietyId =
|
|
106
|
+
this.varietyId = "";
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* The Growing Method for this Packrun
|
|
@@ -111,7 +111,7 @@ class PackrunModel extends BaseModel
|
|
|
111
111
|
* @type {?string}
|
|
112
112
|
* @public
|
|
113
113
|
*/
|
|
114
|
-
this.growingMethodId =
|
|
114
|
+
this.growingMethodId = null;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The Number of Allocated Bins for this Packrun
|
|
@@ -119,7 +119,7 @@ class PackrunModel extends BaseModel
|
|
|
119
119
|
* @type {number}
|
|
120
120
|
* @public
|
|
121
121
|
*/
|
|
122
|
-
this.allocatedBins =
|
|
122
|
+
this.allocatedBins = 0;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* The Time Batches for this Packrun
|
|
@@ -127,7 +127,31 @@ class PackrunModel extends BaseModel
|
|
|
127
127
|
* @type {Object[]}
|
|
128
128
|
* @public
|
|
129
129
|
*/
|
|
130
|
-
this.timeBatches =
|
|
130
|
+
this.timeBatches = [];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The FreshPack Grader ID associated with this Packrun
|
|
134
|
+
*
|
|
135
|
+
* @type {?number}
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
this.freshPackGraderId = null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The FreshPack Bin Lot Code associated with this Packrun
|
|
142
|
+
*
|
|
143
|
+
* @type {?string}
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
this.freshPackBinLotCode = null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The FreshPack Produce Code associated with this Packrun
|
|
150
|
+
*
|
|
151
|
+
* @type {?string}
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
this.freshPackProduceCode = null;
|
|
131
155
|
|
|
132
156
|
/**
|
|
133
157
|
* Whether the Packrun has been deleted
|
|
@@ -135,7 +159,7 @@ class PackrunModel extends BaseModel
|
|
|
135
159
|
* @type {boolean}
|
|
136
160
|
* @public
|
|
137
161
|
*/
|
|
138
|
-
this.deleted =
|
|
162
|
+
this.deleted = false;
|
|
139
163
|
|
|
140
164
|
/**
|
|
141
165
|
* When the Packrun was last updated
|
|
@@ -143,7 +167,7 @@ class PackrunModel extends BaseModel
|
|
|
143
167
|
* @type {Date}
|
|
144
168
|
* @public
|
|
145
169
|
*/
|
|
146
|
-
this.updateTimestamp =
|
|
170
|
+
this.updateTimestamp = new Date();
|
|
147
171
|
|
|
148
172
|
/**
|
|
149
173
|
* The Site ID associated with this Packrun
|
|
@@ -363,6 +387,57 @@ class PackrunModel extends BaseModel
|
|
|
363
387
|
}());
|
|
364
388
|
}
|
|
365
389
|
|
|
390
|
+
if('freshPackGraderId' in jsonObject)
|
|
391
|
+
{
|
|
392
|
+
model.freshPackGraderId = (function(){
|
|
393
|
+
if(jsonObject['freshPackGraderId'] === null)
|
|
394
|
+
{
|
|
395
|
+
return null;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if(typeof jsonObject['freshPackGraderId'] !== 'number')
|
|
399
|
+
{
|
|
400
|
+
return Number.isInteger(Number(jsonObject['freshPackGraderId'])) ? Number(jsonObject['freshPackGraderId']) : Math.floor(Number(jsonObject['freshPackGraderId']));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
return Number.isInteger(jsonObject['freshPackGraderId']) ? jsonObject['freshPackGraderId'] : Math.floor(jsonObject['freshPackGraderId']);
|
|
404
|
+
}());
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if('freshPackBinLotCode' in jsonObject)
|
|
408
|
+
{
|
|
409
|
+
model.freshPackBinLotCode = (function(){
|
|
410
|
+
if(jsonObject['freshPackBinLotCode'] === null)
|
|
411
|
+
{
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if(typeof jsonObject['freshPackBinLotCode'] !== 'string')
|
|
416
|
+
{
|
|
417
|
+
return String(jsonObject['freshPackBinLotCode']);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return jsonObject['freshPackBinLotCode'];
|
|
421
|
+
}());
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if('freshPackProduceCode' in jsonObject)
|
|
425
|
+
{
|
|
426
|
+
model.freshPackProduceCode = (function(){
|
|
427
|
+
if(jsonObject['freshPackProduceCode'] === null)
|
|
428
|
+
{
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if(typeof jsonObject['freshPackProduceCode'] !== 'string')
|
|
433
|
+
{
|
|
434
|
+
return String(jsonObject['freshPackProduceCode']);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return jsonObject['freshPackProduceCode'];
|
|
438
|
+
}());
|
|
439
|
+
}
|
|
440
|
+
|
|
366
441
|
if('deleted' in jsonObject)
|
|
367
442
|
{
|
|
368
443
|
model.deleted = (function(){
|
|
@@ -31,7 +31,7 @@ class RejectBinModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Reject Bin Scale ID this Reject Bin is associated with
|
|
@@ -39,7 +39,7 @@ class RejectBinModel extends BaseModel
|
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.rejectBinScaleId =
|
|
42
|
+
this.rejectBinScaleId = "";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* When this Reject Bin was Created
|
|
@@ -47,7 +47,7 @@ class RejectBinModel extends BaseModel
|
|
|
47
47
|
* @type {Date}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.createdTimestamp =
|
|
50
|
+
this.createdTimestamp = new Date();
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Name of the Reject Bin Scale where this Bin was Created
|
|
@@ -55,7 +55,7 @@ class RejectBinModel extends BaseModel
|
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.rejectBinScaleName =
|
|
58
|
+
this.rejectBinScaleName = "";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Tare Weight Captured by the Reject Bin Scale
|
|
@@ -63,7 +63,7 @@ class RejectBinModel extends BaseModel
|
|
|
63
63
|
* @type {?number}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.tareWeight =
|
|
66
|
+
this.tareWeight = null;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* When this Reject Bin was Finalized (No new Weights)
|
|
@@ -71,7 +71,7 @@ class RejectBinModel extends BaseModel
|
|
|
71
71
|
* @type {?Date}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.finalizedTimestamp =
|
|
74
|
+
this.finalizedTimestamp = null;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Multi-Grower Bins that will be submitted to FreshPack
|
|
@@ -79,7 +79,7 @@ class RejectBinModel extends BaseModel
|
|
|
79
79
|
* @type {Object[]}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.freshPackMultiGrowerBins =
|
|
82
|
+
this.freshPackMultiGrowerBins = [];
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Whether the Reject Bin has been deleted
|
|
@@ -87,7 +87,7 @@ class RejectBinModel extends BaseModel
|
|
|
87
87
|
* @type {boolean}
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.deleted =
|
|
90
|
+
this.deleted = false;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* When the Reject Bin was last updated
|
|
@@ -95,7 +95,7 @@ class RejectBinModel extends BaseModel
|
|
|
95
95
|
* @type {Date}
|
|
96
96
|
* @public
|
|
97
97
|
*/
|
|
98
|
-
this.updateTimestamp =
|
|
98
|
+
this.updateTimestamp = new Date();
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* The Site ID associated with this Reject Bin
|
|
@@ -31,7 +31,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The RTU this Reject Bin Scale belongs to
|
|
@@ -39,7 +39,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
39
39
|
* @type {?number}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.rtuId =
|
|
42
|
+
this.rtuId = null;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Name of this Reject Bin Scale
|
|
@@ -47,7 +47,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.name =
|
|
50
|
+
this.name = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Points used by this Reject Bin Scale
|
|
@@ -55,7 +55,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
55
55
|
* @type {Object}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.points =
|
|
58
|
+
this.points = {}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Packing Line that owns this Reject Bin Scale
|
|
@@ -63,7 +63,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
63
63
|
* @type {string}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.packingLineId =
|
|
66
|
+
this.packingLineId = "";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The Permanent Object that provides the Next Packrun for this Reject Bin Scale
|
|
@@ -71,7 +71,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
71
71
|
* @type {?string}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.packrunSourceId =
|
|
74
|
+
this.packrunSourceId = null;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Packrun Group this Reject Bin Scale is a part of
|
|
@@ -79,7 +79,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
79
79
|
* @type {?number}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.packrunGroup =
|
|
82
|
+
this.packrunGroup = null;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* An Array of Sources that deliver Fruit to this Reject Bin Scale
|
|
@@ -87,15 +87,103 @@ class RejectBinScaleModel extends BaseModel
|
|
|
87
87
|
* @type {Object[]}
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.sources =
|
|
90
|
+
this.sources = [];
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The Auto Packrun Change Configuration for this Reject Bin Scale
|
|
94
94
|
*
|
|
95
|
+
* @type {?{delay: ?number}}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.autoPackrunChange = null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Whether this Reject Bin Scale supports Live Weighing
|
|
102
|
+
*
|
|
103
|
+
* @type {?boolean}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.supportsLiveWeighing = null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The Minimum Weight Change Required to Automatically Start Live Weighing
|
|
110
|
+
*
|
|
95
111
|
* @type {?number}
|
|
96
112
|
* @public
|
|
97
113
|
*/
|
|
98
|
-
this.
|
|
114
|
+
this.autoWeighingStartThreshold = null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The Delay in Milliseconds before Auto Live Weighing would Start
|
|
118
|
+
*
|
|
119
|
+
* @type {?number}
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
this.autoWeighingStartDelay = null;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The Minimum Weight Change Required to Automatically Finish Live Weighing
|
|
126
|
+
*
|
|
127
|
+
* @type {?number}
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
this.autoWeighingFinishThreshold = null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The Delay in Milliseconds before Auto Live Weighing would Finish
|
|
134
|
+
*
|
|
135
|
+
* @type {?number}
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
this.autoWeighingFinishDelay = null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The Maximum Duration in Milliseconds before a Manual Intervention would end
|
|
142
|
+
*
|
|
143
|
+
* @type {?number}
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
this.manualInterventionMaximumDuration = null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The Maximum Weight Increase allowed within a single Live Weighing Update Interval
|
|
150
|
+
*
|
|
151
|
+
* @type {?number}
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
this.liveWeighingIncreaseTolerance = null;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The Maximum Weight Decrease allowed within a single Live Weighing Update Interval
|
|
158
|
+
*
|
|
159
|
+
* @type {?number}
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
this.liveWeighingDecreaseTolerance = null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The Interval in Milliseconds between Live Weighing Updates
|
|
166
|
+
*
|
|
167
|
+
* @type {?number}
|
|
168
|
+
* @public
|
|
169
|
+
*/
|
|
170
|
+
this.liveWeighingUpdateInterval = null;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Whether the Loadcell Stable Status is used to ignore Changes during Live Weighing
|
|
174
|
+
*
|
|
175
|
+
* @type {?boolean}
|
|
176
|
+
* @public
|
|
177
|
+
*/
|
|
178
|
+
this.liveWeighingUsesStableStatus = null;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The Maximum Weight Change allowed while Live Weighing before an Incorrect Operation is Logged
|
|
182
|
+
*
|
|
183
|
+
* @type {?number}
|
|
184
|
+
* @public
|
|
185
|
+
*/
|
|
186
|
+
this.incorrectOperationTolerance = null;
|
|
99
187
|
|
|
100
188
|
/**
|
|
101
189
|
* The FreshPack Integration Configuration for this Reject Bin Scale
|
|
@@ -103,7 +191,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
103
191
|
* @type {?Object}
|
|
104
192
|
* @public
|
|
105
193
|
*/
|
|
106
|
-
this.freshPackIntegration =
|
|
194
|
+
this.freshPackIntegration = null;
|
|
107
195
|
|
|
108
196
|
/**
|
|
109
197
|
* Whether the Reject Bin Scale has been deleted
|
|
@@ -111,7 +199,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
111
199
|
* @type {boolean}
|
|
112
200
|
* @public
|
|
113
201
|
*/
|
|
114
|
-
this.deleted =
|
|
202
|
+
this.deleted = false;
|
|
115
203
|
|
|
116
204
|
/**
|
|
117
205
|
* When the Reject Bin Scale was last updated
|
|
@@ -119,7 +207,7 @@ class RejectBinScaleModel extends BaseModel
|
|
|
119
207
|
* @type {Date}
|
|
120
208
|
* @public
|
|
121
209
|
*/
|
|
122
|
-
this.updateTimestamp =
|
|
210
|
+
this.updateTimestamp = new Date();
|
|
123
211
|
|
|
124
212
|
/**
|
|
125
213
|
* The Site ID associated with this Reject Bin Scale
|
|
@@ -287,12 +375,217 @@ class RejectBinScaleModel extends BaseModel
|
|
|
287
375
|
return null;
|
|
288
376
|
}
|
|
289
377
|
|
|
290
|
-
|
|
378
|
+
let autoPackrunChangeObject = {};
|
|
379
|
+
|
|
380
|
+
if(typeof jsonObject['autoPackrunChange'] === 'object' && 'delay' in jsonObject['autoPackrunChange'])
|
|
381
|
+
{
|
|
382
|
+
autoPackrunChangeObject.delay = (function(){
|
|
383
|
+
if(jsonObject['autoPackrunChange'].delay === null)
|
|
384
|
+
{
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if(typeof jsonObject['autoPackrunChange'].delay !== 'number')
|
|
389
|
+
{
|
|
390
|
+
return Number.isInteger(Number(jsonObject['autoPackrunChange'].delay)) ? Number(jsonObject['autoPackrunChange'].delay) : Math.floor(Number(jsonObject['autoPackrunChange'].delay));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return Number.isInteger(jsonObject['autoPackrunChange'].delay) ? jsonObject['autoPackrunChange'].delay : Math.floor(jsonObject['autoPackrunChange'].delay);
|
|
394
|
+
}());
|
|
395
|
+
}
|
|
396
|
+
else
|
|
397
|
+
{
|
|
398
|
+
autoPackrunChangeObject.delay = null;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return autoPackrunChangeObject;
|
|
402
|
+
}());
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if('supportsLiveWeighing' in jsonObject)
|
|
406
|
+
{
|
|
407
|
+
model.supportsLiveWeighing = (function(){
|
|
408
|
+
if(jsonObject['supportsLiveWeighing'] === null)
|
|
409
|
+
{
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if(typeof jsonObject['supportsLiveWeighing'] !== 'boolean')
|
|
414
|
+
{
|
|
415
|
+
return Boolean(jsonObject['supportsLiveWeighing']);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
return jsonObject['supportsLiveWeighing'];
|
|
419
|
+
}());
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if('autoWeighingStartThreshold' in jsonObject)
|
|
423
|
+
{
|
|
424
|
+
model.autoWeighingStartThreshold = (function(){
|
|
425
|
+
if(jsonObject['autoWeighingStartThreshold'] === null)
|
|
426
|
+
{
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
if(typeof jsonObject['autoWeighingStartThreshold'] !== 'number')
|
|
431
|
+
{
|
|
432
|
+
return Number(jsonObject['autoWeighingStartThreshold']);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return jsonObject['autoWeighingStartThreshold'];
|
|
436
|
+
}());
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
if('autoWeighingStartDelay' in jsonObject)
|
|
440
|
+
{
|
|
441
|
+
model.autoWeighingStartDelay = (function(){
|
|
442
|
+
if(jsonObject['autoWeighingStartDelay'] === null)
|
|
443
|
+
{
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if(typeof jsonObject['autoWeighingStartDelay'] !== 'number')
|
|
448
|
+
{
|
|
449
|
+
return Number.isInteger(Number(jsonObject['autoWeighingStartDelay'])) ? Number(jsonObject['autoWeighingStartDelay']) : Math.floor(Number(jsonObject['autoWeighingStartDelay']));
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return Number.isInteger(jsonObject['autoWeighingStartDelay']) ? jsonObject['autoWeighingStartDelay'] : Math.floor(jsonObject['autoWeighingStartDelay']);
|
|
453
|
+
}());
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
if('autoWeighingFinishThreshold' in jsonObject)
|
|
457
|
+
{
|
|
458
|
+
model.autoWeighingFinishThreshold = (function(){
|
|
459
|
+
if(jsonObject['autoWeighingFinishThreshold'] === null)
|
|
460
|
+
{
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if(typeof jsonObject['autoWeighingFinishThreshold'] !== 'number')
|
|
465
|
+
{
|
|
466
|
+
return Number(jsonObject['autoWeighingFinishThreshold']);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return jsonObject['autoWeighingFinishThreshold'];
|
|
470
|
+
}());
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if('autoWeighingFinishDelay' in jsonObject)
|
|
474
|
+
{
|
|
475
|
+
model.autoWeighingFinishDelay = (function(){
|
|
476
|
+
if(jsonObject['autoWeighingFinishDelay'] === null)
|
|
477
|
+
{
|
|
478
|
+
return null;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
if(typeof jsonObject['autoWeighingFinishDelay'] !== 'number')
|
|
482
|
+
{
|
|
483
|
+
return Number.isInteger(Number(jsonObject['autoWeighingFinishDelay'])) ? Number(jsonObject['autoWeighingFinishDelay']) : Math.floor(Number(jsonObject['autoWeighingFinishDelay']));
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return Number.isInteger(jsonObject['autoWeighingFinishDelay']) ? jsonObject['autoWeighingFinishDelay'] : Math.floor(jsonObject['autoWeighingFinishDelay']);
|
|
487
|
+
}());
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
if('manualInterventionMaximumDuration' in jsonObject)
|
|
491
|
+
{
|
|
492
|
+
model.manualInterventionMaximumDuration = (function(){
|
|
493
|
+
if(jsonObject['manualInterventionMaximumDuration'] === null)
|
|
494
|
+
{
|
|
495
|
+
return null;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
if(typeof jsonObject['manualInterventionMaximumDuration'] !== 'number')
|
|
499
|
+
{
|
|
500
|
+
return Number.isInteger(Number(jsonObject['manualInterventionMaximumDuration'])) ? Number(jsonObject['manualInterventionMaximumDuration']) : Math.floor(Number(jsonObject['manualInterventionMaximumDuration']));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return Number.isInteger(jsonObject['manualInterventionMaximumDuration']) ? jsonObject['manualInterventionMaximumDuration'] : Math.floor(jsonObject['manualInterventionMaximumDuration']);
|
|
504
|
+
}());
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
if('liveWeighingIncreaseTolerance' in jsonObject)
|
|
508
|
+
{
|
|
509
|
+
model.liveWeighingIncreaseTolerance = (function(){
|
|
510
|
+
if(jsonObject['liveWeighingIncreaseTolerance'] === null)
|
|
511
|
+
{
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if(typeof jsonObject['liveWeighingIncreaseTolerance'] !== 'number')
|
|
516
|
+
{
|
|
517
|
+
return Number(jsonObject['liveWeighingIncreaseTolerance']);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
return jsonObject['liveWeighingIncreaseTolerance'];
|
|
521
|
+
}());
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if('liveWeighingDecreaseTolerance' in jsonObject)
|
|
525
|
+
{
|
|
526
|
+
model.liveWeighingDecreaseTolerance = (function(){
|
|
527
|
+
if(jsonObject['liveWeighingDecreaseTolerance'] === null)
|
|
528
|
+
{
|
|
529
|
+
return null;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if(typeof jsonObject['liveWeighingDecreaseTolerance'] !== 'number')
|
|
533
|
+
{
|
|
534
|
+
return Number(jsonObject['liveWeighingDecreaseTolerance']);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
return jsonObject['liveWeighingDecreaseTolerance'];
|
|
538
|
+
}());
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
if('liveWeighingUpdateInterval' in jsonObject)
|
|
542
|
+
{
|
|
543
|
+
model.liveWeighingUpdateInterval = (function(){
|
|
544
|
+
if(jsonObject['liveWeighingUpdateInterval'] === null)
|
|
545
|
+
{
|
|
546
|
+
return null;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
if(typeof jsonObject['liveWeighingUpdateInterval'] !== 'number')
|
|
550
|
+
{
|
|
551
|
+
return Number.isInteger(Number(jsonObject['liveWeighingUpdateInterval'])) ? Number(jsonObject['liveWeighingUpdateInterval']) : Math.floor(Number(jsonObject['liveWeighingUpdateInterval']));
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
return Number.isInteger(jsonObject['liveWeighingUpdateInterval']) ? jsonObject['liveWeighingUpdateInterval'] : Math.floor(jsonObject['liveWeighingUpdateInterval']);
|
|
555
|
+
}());
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if('liveWeighingUsesStableStatus' in jsonObject)
|
|
559
|
+
{
|
|
560
|
+
model.liveWeighingUsesStableStatus = (function(){
|
|
561
|
+
if(jsonObject['liveWeighingUsesStableStatus'] === null)
|
|
562
|
+
{
|
|
563
|
+
return null;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
if(typeof jsonObject['liveWeighingUsesStableStatus'] !== 'boolean')
|
|
567
|
+
{
|
|
568
|
+
return Boolean(jsonObject['liveWeighingUsesStableStatus']);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return jsonObject['liveWeighingUsesStableStatus'];
|
|
572
|
+
}());
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
if('incorrectOperationTolerance' in jsonObject)
|
|
576
|
+
{
|
|
577
|
+
model.incorrectOperationTolerance = (function(){
|
|
578
|
+
if(jsonObject['incorrectOperationTolerance'] === null)
|
|
579
|
+
{
|
|
580
|
+
return null;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
if(typeof jsonObject['incorrectOperationTolerance'] !== 'number')
|
|
291
584
|
{
|
|
292
|
-
return Number
|
|
585
|
+
return Number(jsonObject['incorrectOperationTolerance']);
|
|
293
586
|
}
|
|
294
587
|
|
|
295
|
-
return
|
|
588
|
+
return jsonObject['incorrectOperationTolerance'];
|
|
296
589
|
}());
|
|
297
590
|
}
|
|
298
591
|
|