@ricado/api-client 1.4.1 → 2.1.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/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/AccountPolicyController.js +1 -1
- package/lib/Controllers/ApiAccountController.js +2 -2
- package/lib/Controllers/CompanyController.js +1 -1
- package/lib/Controllers/FirebaseTokenController.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +1 -1
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +2 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +1 -1
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +2 -2
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackTypeController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +288 -2
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +2 -2
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +1 -1
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +2 -2
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +2 -2
- package/lib/Controllers/Packhouse/Site/VarietyController.js +1 -1
- package/lib/Controllers/RTU/GlobalSettingsController.js +2 -2
- package/lib/Controllers/RTU/PluginSettingsController.js +2 -2
- package/lib/Controllers/RTUController.js +1 -1
- package/lib/Controllers/RTUPluginController.js +1 -1
- package/lib/Controllers/Site/AlarmController.js +2 -2
- package/lib/Controllers/Site/AlarmGroupController.js +1 -1
- package/lib/Controllers/Site/DefinitionController.js +1 -1
- package/lib/Controllers/Site/PermanentObjectController.js +1 -1
- package/lib/Controllers/Site/PermanentObjectDataController.js +2 -2
- package/lib/Controllers/Site/PointController.js +2 -2
- package/lib/Controllers/Site/TemporaryObjectController.js +1 -1
- package/lib/Controllers/SiteController.js +1 -1
- package/lib/Controllers/TokenController.js +2 -2
- package/lib/Controllers/ToolsController.js +1 -1
- package/lib/Controllers/UserAccountActionTokenController.js +2 -2
- package/lib/Controllers/UserAccountController.js +2 -2
- package/lib/DataItems/PointValueItem.js +2 -2
- package/lib/Errors/BadRequestError.js +7 -3
- package/lib/Errors/ForbiddenError.js +7 -3
- package/lib/Errors/NetworkError.js +7 -3
- package/lib/Errors/NotAllowedError.js +7 -3
- package/lib/Errors/NotFoundError.js +7 -3
- package/lib/Errors/ServerError.js +7 -3
- package/lib/Errors/UnauthorizedError.js +7 -3
- package/lib/Models/AccountPolicyModel.js +29 -133
- package/lib/Models/ApiAccountModel.js +29 -133
- package/lib/Models/BaseModel.js +6 -2
- package/lib/Models/CompanyModel.js +23 -101
- package/lib/Models/FirebaseTokenModel.js +32 -149
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +43 -185
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +40 -169
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +58 -265
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +46 -201
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +40 -169
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +34 -137
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +52 -233
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +58 -265
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +40 -169
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +34 -137
- package/lib/Models/Packhouse/Site/PackTypeModel.js +40 -169
- package/lib/Models/Packhouse/Site/PackingLineModel.js +61 -281
- package/lib/Models/Packhouse/Site/PackrunModel.js +61 -281
- package/lib/Models/Packhouse/Site/RejectBinModel.js +43 -185
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +52 -233
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +46 -201
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +52 -233
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +127 -633
- package/lib/Models/Packhouse/Site/ShiftModel.js +73 -345
- package/lib/Models/Packhouse/Site/VarietyModel.js +40 -169
- package/lib/Models/RTUModel.js +26 -117
- package/lib/Models/RTUPluginModel.js +23 -101
- package/lib/Models/Site/AlarmGroupModel.js +37 -153
- package/lib/Models/Site/AlarmModel.js +67 -313
- package/lib/Models/Site/DefinitionModel.js +34 -137
- package/lib/Models/Site/PermanentObjectDataModel.js +40 -169
- package/lib/Models/Site/PermanentObjectModel.js +37 -153
- package/lib/Models/Site/PointModel.js +49 -217
- package/lib/Models/Site/TemporaryObjectModel.js +34 -137
- package/lib/Models/Site/index.js +0 -3
- package/lib/Models/SiteModel.js +26 -117
- package/lib/Models/TokenModel.js +38 -181
- package/lib/Models/UserAccountActionTokenModel.js +41 -197
- package/lib/Models/UserAccountModel.js +38 -181
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +1 -1
- package/lib/RequestHelper.js +2 -2
- package/lib/WebSocketHelper.js +1 -1
- package/lib/index.d.ts +945 -1206
- package/package.json +3 -3
- package/src/Controllers/Packhouse/Site/PackrunController.js +361 -0
- package/src/Models/AccountPolicyModel.js +21 -117
- package/src/Models/ApiAccountModel.js +21 -117
- package/src/Models/CompanyModel.js +15 -87
- package/src/Models/FirebaseTokenModel.js +24 -132
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +32 -163
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +29 -148
- package/src/Models/Packhouse/Site/CompacSizerModel.js +47 -238
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +35 -178
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +29 -148
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +23 -118
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +41 -208
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +47 -238
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +29 -148
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +23 -118
- package/src/Models/Packhouse/Site/PackTypeModel.js +29 -148
- package/src/Models/Packhouse/Site/PackingLineModel.js +50 -253
- package/src/Models/Packhouse/Site/PackrunModel.js +50 -253
- package/src/Models/Packhouse/Site/RejectBinModel.js +32 -163
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +41 -208
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +35 -178
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +41 -208
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +116 -583
- package/src/Models/Packhouse/Site/ShiftModel.js +62 -313
- package/src/Models/Packhouse/Site/VarietyModel.js +29 -148
- package/src/Models/RTUModel.js +18 -102
- package/src/Models/RTUPluginModel.js +15 -87
- package/src/Models/Site/AlarmGroupModel.js +26 -133
- package/src/Models/Site/AlarmModel.js +56 -283
- package/src/Models/Site/DefinitionModel.js +23 -118
- package/src/Models/Site/PermanentObjectDataModel.js +29 -148
- package/src/Models/Site/PermanentObjectModel.js +26 -133
- package/src/Models/Site/PointModel.js +38 -193
- package/src/Models/Site/TemporaryObjectModel.js +23 -118
- package/src/Models/Site/index.js +0 -2
- package/src/Models/SiteModel.js +18 -102
- package/src/Models/TokenModel.js +30 -162
- package/src/Models/UserAccountActionTokenModel.js +33 -177
- package/src/Models/UserAccountModel.js +30 -162
- package/src/PackageVersion.js +1 -1
- package/lib/Models/Site/BaseSiteModel.js +0 -58
- package/src/Models/Site/BaseSiteModel.js +0 -30
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* Do Not Edit this File Manually!
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import BaseModel from '../../Models/BaseModel';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Model Class for a Alarm
|
|
11
11
|
*
|
|
12
12
|
* @class
|
|
13
13
|
* @hideconstructor
|
|
14
|
-
* @extends
|
|
14
|
+
* @extends BaseModel
|
|
15
15
|
*/
|
|
16
|
-
class AlarmModel extends
|
|
16
|
+
class AlarmModel extends BaseModel
|
|
17
17
|
{
|
|
18
18
|
/**
|
|
19
19
|
* AlarmModel Constructor
|
|
@@ -29,372 +29,145 @@ class AlarmModel extends BaseSiteModel
|
|
|
29
29
|
* The Alarm ID
|
|
30
30
|
*
|
|
31
31
|
* @type {string}
|
|
32
|
-
* @
|
|
32
|
+
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.
|
|
34
|
+
this.id = undefined;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The RTU this Alarm belongs to
|
|
38
38
|
*
|
|
39
39
|
* @type {?number}
|
|
40
|
-
* @
|
|
40
|
+
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.
|
|
42
|
+
this.rtuId = undefined;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Alarm Group this Alarm is a part of
|
|
46
46
|
*
|
|
47
47
|
* @type {string}
|
|
48
|
-
* @
|
|
48
|
+
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.
|
|
50
|
+
this.groupId = undefined;
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Alarm Name
|
|
54
54
|
*
|
|
55
55
|
* @type {string}
|
|
56
|
-
* @
|
|
56
|
+
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.
|
|
58
|
+
this.name = undefined;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether the Alarm is Critical or not
|
|
62
62
|
*
|
|
63
63
|
* @type {boolean}
|
|
64
|
-
* @
|
|
64
|
+
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.
|
|
66
|
+
this.critical = undefined;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* The Python Script with the Conditions to Trip this Alarm
|
|
70
70
|
*
|
|
71
71
|
* @type {string}
|
|
72
|
-
* @
|
|
72
|
+
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.
|
|
74
|
+
this.tripScript = undefined;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Python Script with the Conditions to Reset this Alarm
|
|
78
78
|
*
|
|
79
79
|
* @type {?string}
|
|
80
|
-
* @
|
|
80
|
+
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.
|
|
82
|
+
this.resetScript = undefined;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* The Delay before this Alarm will Trip in Milliseconds
|
|
86
86
|
*
|
|
87
87
|
* @type {number}
|
|
88
|
-
* @
|
|
88
|
+
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.
|
|
90
|
+
this.tripDelay = undefined;
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The Delay before this Alarm will Reset in Milliseconds
|
|
94
94
|
*
|
|
95
95
|
* @type {number}
|
|
96
|
-
* @
|
|
96
|
+
* @public
|
|
97
97
|
*/
|
|
98
|
-
this.
|
|
98
|
+
this.resetDelay = undefined;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Whether the Alarm should Automatically Reset
|
|
102
102
|
*
|
|
103
103
|
* @type {boolean}
|
|
104
|
-
* @
|
|
104
|
+
* @public
|
|
105
105
|
*/
|
|
106
|
-
this.
|
|
106
|
+
this.autoReset = undefined;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
109
|
* The Delay before this Alarm should Auto Reset in Milliseconds
|
|
110
110
|
*
|
|
111
111
|
* @type {number}
|
|
112
|
-
* @
|
|
112
|
+
* @public
|
|
113
113
|
*/
|
|
114
|
-
this.
|
|
114
|
+
this.autoResetDelay = undefined;
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* The Point used to store the Alarm Tripped State
|
|
118
118
|
*
|
|
119
119
|
* @type {number}
|
|
120
|
-
* @
|
|
120
|
+
* @public
|
|
121
121
|
*/
|
|
122
|
-
this.
|
|
122
|
+
this.trippedStatePoint = undefined;
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* The Point used to store the Alarm Tripped Timestamp
|
|
126
126
|
*
|
|
127
127
|
* @type {number}
|
|
128
|
-
* @
|
|
128
|
+
* @public
|
|
129
129
|
*/
|
|
130
|
-
this.
|
|
130
|
+
this.trippedTimestampPoint = undefined;
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* The Point used to store the Alarm's Internal Trip Start
|
|
134
134
|
*
|
|
135
135
|
* @type {number}
|
|
136
|
-
* @
|
|
136
|
+
* @public
|
|
137
137
|
*/
|
|
138
|
-
this.
|
|
138
|
+
this.internalTripStartPoint = undefined;
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* The Point used to store the Alarm's Internal Reset Start
|
|
142
142
|
*
|
|
143
143
|
* @type {number}
|
|
144
|
-
* @
|
|
144
|
+
* @public
|
|
145
145
|
*/
|
|
146
|
-
this.
|
|
146
|
+
this.internalResetStartPoint = undefined;
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
* Whether the Alarm has been deleted
|
|
150
150
|
*
|
|
151
151
|
* @type {boolean}
|
|
152
|
-
* @
|
|
152
|
+
* @public
|
|
153
153
|
*/
|
|
154
|
-
this.
|
|
154
|
+
this.deleted = undefined;
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
157
|
* When the Alarm was last updated
|
|
158
158
|
*
|
|
159
159
|
* @type {Date}
|
|
160
|
-
* @
|
|
160
|
+
* @public
|
|
161
161
|
*/
|
|
162
|
-
this.
|
|
162
|
+
this.updateTimestamp = undefined;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* The Site ID associated with this Alarm
|
|
166
166
|
*
|
|
167
167
|
* @type {number}
|
|
168
|
-
* @
|
|
168
|
+
* @public
|
|
169
169
|
*/
|
|
170
|
-
this.
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* The Alarm ID
|
|
175
|
-
*
|
|
176
|
-
* @public
|
|
177
|
-
* @type {string}
|
|
178
|
-
*/
|
|
179
|
-
get id()
|
|
180
|
-
{
|
|
181
|
-
return this._id;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* The RTU this Alarm belongs to
|
|
186
|
-
*
|
|
187
|
-
* @public
|
|
188
|
-
* @type {?number}
|
|
189
|
-
*/
|
|
190
|
-
get rtuId()
|
|
191
|
-
{
|
|
192
|
-
return this._rtuId;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* The Alarm Group this Alarm is a part of
|
|
197
|
-
*
|
|
198
|
-
* @public
|
|
199
|
-
* @type {string}
|
|
200
|
-
*/
|
|
201
|
-
get groupId()
|
|
202
|
-
{
|
|
203
|
-
return this._groupId;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* The Alarm Name
|
|
208
|
-
*
|
|
209
|
-
* @public
|
|
210
|
-
* @type {string}
|
|
211
|
-
*/
|
|
212
|
-
get name()
|
|
213
|
-
{
|
|
214
|
-
return this._name;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Whether the Alarm is Critical or not
|
|
219
|
-
*
|
|
220
|
-
* @public
|
|
221
|
-
* @type {boolean}
|
|
222
|
-
*/
|
|
223
|
-
get critical()
|
|
224
|
-
{
|
|
225
|
-
return this._critical;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* The Python Script with the Conditions to Trip this Alarm
|
|
230
|
-
*
|
|
231
|
-
* @public
|
|
232
|
-
* @type {string}
|
|
233
|
-
*/
|
|
234
|
-
get tripScript()
|
|
235
|
-
{
|
|
236
|
-
return this._tripScript;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* The Python Script with the Conditions to Reset this Alarm
|
|
241
|
-
*
|
|
242
|
-
* @public
|
|
243
|
-
* @type {?string}
|
|
244
|
-
*/
|
|
245
|
-
get resetScript()
|
|
246
|
-
{
|
|
247
|
-
return this._resetScript;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* The Delay before this Alarm will Trip in Milliseconds
|
|
252
|
-
*
|
|
253
|
-
* @public
|
|
254
|
-
* @type {number}
|
|
255
|
-
*/
|
|
256
|
-
get tripDelay()
|
|
257
|
-
{
|
|
258
|
-
return this._tripDelay;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* The Delay before this Alarm will Reset in Milliseconds
|
|
263
|
-
*
|
|
264
|
-
* @public
|
|
265
|
-
* @type {number}
|
|
266
|
-
*/
|
|
267
|
-
get resetDelay()
|
|
268
|
-
{
|
|
269
|
-
return this._resetDelay;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Whether the Alarm should Automatically Reset
|
|
274
|
-
*
|
|
275
|
-
* @public
|
|
276
|
-
* @type {boolean}
|
|
277
|
-
*/
|
|
278
|
-
get autoReset()
|
|
279
|
-
{
|
|
280
|
-
return this._autoReset;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* The Delay before this Alarm should Auto Reset in Milliseconds
|
|
285
|
-
*
|
|
286
|
-
* @public
|
|
287
|
-
* @type {number}
|
|
288
|
-
*/
|
|
289
|
-
get autoResetDelay()
|
|
290
|
-
{
|
|
291
|
-
return this._autoResetDelay;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* The Point used to store the Alarm Tripped State
|
|
296
|
-
*
|
|
297
|
-
* @public
|
|
298
|
-
* @type {number}
|
|
299
|
-
*/
|
|
300
|
-
get trippedStatePoint()
|
|
301
|
-
{
|
|
302
|
-
return this._trippedStatePoint;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* The Point used to store the Alarm Tripped Timestamp
|
|
307
|
-
*
|
|
308
|
-
* @public
|
|
309
|
-
* @type {number}
|
|
310
|
-
*/
|
|
311
|
-
get trippedTimestampPoint()
|
|
312
|
-
{
|
|
313
|
-
return this._trippedTimestampPoint;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* The Point used to store the Alarm's Internal Trip Start
|
|
318
|
-
*
|
|
319
|
-
* @public
|
|
320
|
-
* @type {number}
|
|
321
|
-
*/
|
|
322
|
-
get internalTripStartPoint()
|
|
323
|
-
{
|
|
324
|
-
return this._internalTripStartPoint;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* The Point used to store the Alarm's Internal Reset Start
|
|
329
|
-
*
|
|
330
|
-
* @public
|
|
331
|
-
* @type {number}
|
|
332
|
-
*/
|
|
333
|
-
get internalResetStartPoint()
|
|
334
|
-
{
|
|
335
|
-
return this._internalResetStartPoint;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Whether the Alarm has been deleted
|
|
340
|
-
*
|
|
341
|
-
* @public
|
|
342
|
-
* @type {boolean}
|
|
343
|
-
*/
|
|
344
|
-
get deleted()
|
|
345
|
-
{
|
|
346
|
-
return this._deleted;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* When the Alarm was last updated
|
|
351
|
-
*
|
|
352
|
-
* @public
|
|
353
|
-
* @type {Date}
|
|
354
|
-
*/
|
|
355
|
-
get updateTimestamp()
|
|
356
|
-
{
|
|
357
|
-
return this._updateTimestamp;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* The Site ID associated with this Alarm
|
|
362
|
-
*
|
|
363
|
-
* @public
|
|
364
|
-
* @type {number}
|
|
365
|
-
*/
|
|
366
|
-
get siteId()
|
|
367
|
-
{
|
|
368
|
-
return this._siteId;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Convert this **AlarmModel** to a JSON Object
|
|
373
|
-
*
|
|
374
|
-
* @public
|
|
375
|
-
* @return {Object<string, any>}
|
|
376
|
-
*/
|
|
377
|
-
toJSON()
|
|
378
|
-
{
|
|
379
|
-
return {
|
|
380
|
-
id: this._id,
|
|
381
|
-
rtuId: this._rtuId,
|
|
382
|
-
groupId: this._groupId,
|
|
383
|
-
name: this._name,
|
|
384
|
-
critical: this._critical,
|
|
385
|
-
tripScript: this._tripScript,
|
|
386
|
-
resetScript: this._resetScript,
|
|
387
|
-
tripDelay: this._tripDelay,
|
|
388
|
-
resetDelay: this._resetDelay,
|
|
389
|
-
autoReset: this._autoReset,
|
|
390
|
-
autoResetDelay: this._autoResetDelay,
|
|
391
|
-
trippedStatePoint: this._trippedStatePoint,
|
|
392
|
-
trippedTimestampPoint: this._trippedTimestampPoint,
|
|
393
|
-
internalTripStartPoint: this._internalTripStartPoint,
|
|
394
|
-
internalResetStartPoint: this._internalResetStartPoint,
|
|
395
|
-
deleted: this._deleted,
|
|
396
|
-
updateTimestamp: this._updateTimestamp
|
|
397
|
-
};
|
|
170
|
+
this.siteId = siteId;
|
|
398
171
|
}
|
|
399
172
|
|
|
400
173
|
/**
|
|
@@ -428,7 +201,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
428
201
|
|
|
429
202
|
if('id' in jsonObject)
|
|
430
203
|
{
|
|
431
|
-
model.
|
|
204
|
+
model.id = (function(){
|
|
432
205
|
if(typeof jsonObject['id'] !== 'string')
|
|
433
206
|
{
|
|
434
207
|
return String(jsonObject['id']);
|
|
@@ -440,7 +213,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
440
213
|
|
|
441
214
|
if('rtuId' in jsonObject)
|
|
442
215
|
{
|
|
443
|
-
model.
|
|
216
|
+
model.rtuId = (function(){
|
|
444
217
|
if(jsonObject['rtuId'] === null)
|
|
445
218
|
{
|
|
446
219
|
return null;
|
|
@@ -457,7 +230,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
457
230
|
|
|
458
231
|
if('groupId' in jsonObject)
|
|
459
232
|
{
|
|
460
|
-
model.
|
|
233
|
+
model.groupId = (function(){
|
|
461
234
|
if(typeof jsonObject['groupId'] !== 'string')
|
|
462
235
|
{
|
|
463
236
|
return String(jsonObject['groupId']);
|
|
@@ -469,7 +242,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
469
242
|
|
|
470
243
|
if('name' in jsonObject)
|
|
471
244
|
{
|
|
472
|
-
model.
|
|
245
|
+
model.name = (function(){
|
|
473
246
|
if(typeof jsonObject['name'] !== 'string')
|
|
474
247
|
{
|
|
475
248
|
return String(jsonObject['name']);
|
|
@@ -481,7 +254,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
481
254
|
|
|
482
255
|
if('critical' in jsonObject)
|
|
483
256
|
{
|
|
484
|
-
model.
|
|
257
|
+
model.critical = (function(){
|
|
485
258
|
if(typeof jsonObject['critical'] !== 'boolean')
|
|
486
259
|
{
|
|
487
260
|
return Boolean(jsonObject['critical']);
|
|
@@ -493,7 +266,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
493
266
|
|
|
494
267
|
if('tripScript' in jsonObject)
|
|
495
268
|
{
|
|
496
|
-
model.
|
|
269
|
+
model.tripScript = (function(){
|
|
497
270
|
if(typeof jsonObject['tripScript'] !== 'string')
|
|
498
271
|
{
|
|
499
272
|
return String(jsonObject['tripScript']);
|
|
@@ -505,7 +278,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
505
278
|
|
|
506
279
|
if('resetScript' in jsonObject)
|
|
507
280
|
{
|
|
508
|
-
model.
|
|
281
|
+
model.resetScript = (function(){
|
|
509
282
|
if(jsonObject['resetScript'] === null)
|
|
510
283
|
{
|
|
511
284
|
return null;
|
|
@@ -522,7 +295,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
522
295
|
|
|
523
296
|
if('tripDelay' in jsonObject)
|
|
524
297
|
{
|
|
525
|
-
model.
|
|
298
|
+
model.tripDelay = (function(){
|
|
526
299
|
if(typeof jsonObject['tripDelay'] !== 'number')
|
|
527
300
|
{
|
|
528
301
|
return Number.isInteger(Number(jsonObject['tripDelay'])) ? Number(jsonObject['tripDelay']) : Math.floor(Number(jsonObject['tripDelay']));
|
|
@@ -534,7 +307,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
534
307
|
|
|
535
308
|
if('resetDelay' in jsonObject)
|
|
536
309
|
{
|
|
537
|
-
model.
|
|
310
|
+
model.resetDelay = (function(){
|
|
538
311
|
if(typeof jsonObject['resetDelay'] !== 'number')
|
|
539
312
|
{
|
|
540
313
|
return Number.isInteger(Number(jsonObject['resetDelay'])) ? Number(jsonObject['resetDelay']) : Math.floor(Number(jsonObject['resetDelay']));
|
|
@@ -546,7 +319,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
546
319
|
|
|
547
320
|
if('autoReset' in jsonObject)
|
|
548
321
|
{
|
|
549
|
-
model.
|
|
322
|
+
model.autoReset = (function(){
|
|
550
323
|
if(typeof jsonObject['autoReset'] !== 'boolean')
|
|
551
324
|
{
|
|
552
325
|
return Boolean(jsonObject['autoReset']);
|
|
@@ -558,7 +331,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
558
331
|
|
|
559
332
|
if('autoResetDelay' in jsonObject)
|
|
560
333
|
{
|
|
561
|
-
model.
|
|
334
|
+
model.autoResetDelay = (function(){
|
|
562
335
|
if(typeof jsonObject['autoResetDelay'] !== 'number')
|
|
563
336
|
{
|
|
564
337
|
return Number.isInteger(Number(jsonObject['autoResetDelay'])) ? Number(jsonObject['autoResetDelay']) : Math.floor(Number(jsonObject['autoResetDelay']));
|
|
@@ -570,7 +343,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
570
343
|
|
|
571
344
|
if('trippedStatePoint' in jsonObject)
|
|
572
345
|
{
|
|
573
|
-
model.
|
|
346
|
+
model.trippedStatePoint = (function(){
|
|
574
347
|
if(typeof jsonObject['trippedStatePoint'] !== 'number')
|
|
575
348
|
{
|
|
576
349
|
return Number.isInteger(Number(jsonObject['trippedStatePoint'])) ? Number(jsonObject['trippedStatePoint']) : Math.floor(Number(jsonObject['trippedStatePoint']));
|
|
@@ -582,7 +355,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
582
355
|
|
|
583
356
|
if('trippedTimestampPoint' in jsonObject)
|
|
584
357
|
{
|
|
585
|
-
model.
|
|
358
|
+
model.trippedTimestampPoint = (function(){
|
|
586
359
|
if(typeof jsonObject['trippedTimestampPoint'] !== 'number')
|
|
587
360
|
{
|
|
588
361
|
return Number.isInteger(Number(jsonObject['trippedTimestampPoint'])) ? Number(jsonObject['trippedTimestampPoint']) : Math.floor(Number(jsonObject['trippedTimestampPoint']));
|
|
@@ -594,7 +367,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
594
367
|
|
|
595
368
|
if('internalTripStartPoint' in jsonObject)
|
|
596
369
|
{
|
|
597
|
-
model.
|
|
370
|
+
model.internalTripStartPoint = (function(){
|
|
598
371
|
if(typeof jsonObject['internalTripStartPoint'] !== 'number')
|
|
599
372
|
{
|
|
600
373
|
return Number.isInteger(Number(jsonObject['internalTripStartPoint'])) ? Number(jsonObject['internalTripStartPoint']) : Math.floor(Number(jsonObject['internalTripStartPoint']));
|
|
@@ -606,7 +379,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
606
379
|
|
|
607
380
|
if('internalResetStartPoint' in jsonObject)
|
|
608
381
|
{
|
|
609
|
-
model.
|
|
382
|
+
model.internalResetStartPoint = (function(){
|
|
610
383
|
if(typeof jsonObject['internalResetStartPoint'] !== 'number')
|
|
611
384
|
{
|
|
612
385
|
return Number.isInteger(Number(jsonObject['internalResetStartPoint'])) ? Number(jsonObject['internalResetStartPoint']) : Math.floor(Number(jsonObject['internalResetStartPoint']));
|
|
@@ -618,7 +391,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
618
391
|
|
|
619
392
|
if('deleted' in jsonObject)
|
|
620
393
|
{
|
|
621
|
-
model.
|
|
394
|
+
model.deleted = (function(){
|
|
622
395
|
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
623
396
|
{
|
|
624
397
|
return Boolean(jsonObject['deleted']);
|
|
@@ -630,7 +403,7 @@ class AlarmModel extends BaseSiteModel
|
|
|
630
403
|
|
|
631
404
|
if('updateTimestamp' in jsonObject)
|
|
632
405
|
{
|
|
633
|
-
model.
|
|
406
|
+
model.updateTimestamp = (function(){
|
|
634
407
|
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
635
408
|
{
|
|
636
409
|
return new Date(String(jsonObject['updateTimestamp']));
|