remoterigs-raspberrypi 0.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/index.js +3 -0
- package/package.json +20 -0
- package/src/common/code.js +62 -0
- package/src/common/debug.js +77 -0
- package/src/common/signalr.js +189 -0
- package/src/common/webrtc-streamer-wrapper.js +483 -0
- package/src/component/component.js +358 -0
- package/src/component/input/input.js +26 -0
- package/src/component/pin/pin.js +92 -0
- package/src/component/property/property.js +32 -0
- package/src/component/status/status-number.js +7 -0
- package/src/component/status/status-state.js +27 -0
- package/src/component/status/status.js +41 -0
- package/src/config.json.default +8 -0
- package/src/models/models.js +1045 -0
- package/src/rig.js +65 -0
- package/src/server.js +87 -0
|
@@ -0,0 +1,1045 @@
|
|
|
1
|
+
export var StatusType;
|
|
2
|
+
(function (StatusType) {
|
|
3
|
+
StatusType[StatusType["RigComponentNumber"] = 1] = "RigComponentNumber";
|
|
4
|
+
StatusType[StatusType["RigComponentStates"] = 2] = "RigComponentStates";
|
|
5
|
+
StatusType[StatusType["RigOnline"] = 3] = "RigOnline";
|
|
6
|
+
StatusType[StatusType["RigModelLoaded"] = 4] = "RigModelLoaded";
|
|
7
|
+
StatusType[StatusType["RigLog"] = 5] = "RigLog";
|
|
8
|
+
StatusType[StatusType["RigOperator"] = 6] = "RigOperator";
|
|
9
|
+
StatusType[StatusType["RigComponentCamera"] = 7] = "RigComponentCamera";
|
|
10
|
+
StatusType[StatusType["WorldStatus"] = 100] = "WorldStatus";
|
|
11
|
+
StatusType[StatusType["WorldQueuePositions"] = 101] = "WorldQueuePositions";
|
|
12
|
+
StatusType[StatusType["WorldActiveSession"] = 102] = "WorldActiveSession";
|
|
13
|
+
})(StatusType || (StatusType = {}));
|
|
14
|
+
export class ComponentStatusViewModel {
|
|
15
|
+
constructor(data) {
|
|
16
|
+
if (data) {
|
|
17
|
+
for (var property in data) {
|
|
18
|
+
if (data.hasOwnProperty(property))
|
|
19
|
+
this[property] = data[property];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (!data) {
|
|
23
|
+
this.states = [];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
init(_data) {
|
|
27
|
+
if (_data) {
|
|
28
|
+
this.id = _data["id"];
|
|
29
|
+
this.componentId = _data["componentId"];
|
|
30
|
+
this.name = _data["name"];
|
|
31
|
+
this.type = _data["type"];
|
|
32
|
+
if (Array.isArray(_data["states"])) {
|
|
33
|
+
this.states = [];
|
|
34
|
+
for (let item of _data["states"])
|
|
35
|
+
this.states.push(ComponentStatusStateViewModel.fromJS(item));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static fromJS(data) {
|
|
40
|
+
data = typeof data === 'object' ? data : {};
|
|
41
|
+
let result = new ComponentStatusViewModel();
|
|
42
|
+
result.init(data);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
toJSON(data) {
|
|
46
|
+
data = typeof data === 'object' ? data : {};
|
|
47
|
+
data["id"] = this.id;
|
|
48
|
+
data["componentId"] = this.componentId;
|
|
49
|
+
data["name"] = this.name;
|
|
50
|
+
data["type"] = this.type;
|
|
51
|
+
if (Array.isArray(this.states)) {
|
|
52
|
+
data["states"] = [];
|
|
53
|
+
for (let item of this.states)
|
|
54
|
+
data["states"].push(item ? item.toJSON() : undefined);
|
|
55
|
+
}
|
|
56
|
+
return data;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export class ComponentStatusStateViewModel {
|
|
60
|
+
constructor(data) {
|
|
61
|
+
if (data) {
|
|
62
|
+
for (var property in data) {
|
|
63
|
+
if (data.hasOwnProperty(property))
|
|
64
|
+
this[property] = data[property];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
init(_data) {
|
|
69
|
+
if (_data) {
|
|
70
|
+
this.id = _data["id"];
|
|
71
|
+
this.name = _data["name"];
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
static fromJS(data) {
|
|
75
|
+
data = typeof data === 'object' ? data : {};
|
|
76
|
+
let result = new ComponentStatusStateViewModel();
|
|
77
|
+
result.init(data);
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
toJSON(data) {
|
|
81
|
+
data = typeof data === 'object' ? data : {};
|
|
82
|
+
data["id"] = this.id;
|
|
83
|
+
data["name"] = this.name;
|
|
84
|
+
return data;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export class ClientRTCConfigurationViewModel {
|
|
88
|
+
constructor(data) {
|
|
89
|
+
if (data) {
|
|
90
|
+
for (var property in data) {
|
|
91
|
+
if (data.hasOwnProperty(property))
|
|
92
|
+
this[property] = data[property];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
init(_data) {
|
|
97
|
+
if (_data) {
|
|
98
|
+
this.stunServer = _data["stunServer"];
|
|
99
|
+
this.turnServer = _data["turnServer"];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
static fromJS(data) {
|
|
103
|
+
data = typeof data === 'object' ? data : {};
|
|
104
|
+
let result = new ClientRTCConfigurationViewModel();
|
|
105
|
+
result.init(data);
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
toJSON(data) {
|
|
109
|
+
data = typeof data === 'object' ? data : {};
|
|
110
|
+
data["stunServer"] = this.stunServer;
|
|
111
|
+
data["turnServer"] = this.turnServer;
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export class StatusModel {
|
|
116
|
+
constructor(data) {
|
|
117
|
+
if (data) {
|
|
118
|
+
for (var property in data) {
|
|
119
|
+
if (data.hasOwnProperty(property))
|
|
120
|
+
this[property] = data[property];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
init(_data) {
|
|
125
|
+
if (_data) {
|
|
126
|
+
this.value = _data["value"];
|
|
127
|
+
this.type = _data["type"];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
static fromJS(data) {
|
|
131
|
+
data = typeof data === 'object' ? data : {};
|
|
132
|
+
let result = new StatusModel();
|
|
133
|
+
result.init(data);
|
|
134
|
+
return result;
|
|
135
|
+
}
|
|
136
|
+
toJSON(data) {
|
|
137
|
+
data = typeof data === 'object' ? data : {};
|
|
138
|
+
data["value"] = this.value;
|
|
139
|
+
data["type"] = this.type;
|
|
140
|
+
return data;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export class RigComponentStatusModel {
|
|
144
|
+
constructor(data) {
|
|
145
|
+
if (data) {
|
|
146
|
+
for (var property in data) {
|
|
147
|
+
if (data.hasOwnProperty(property))
|
|
148
|
+
this[property] = data[property];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
init(_data) {
|
|
153
|
+
if (_data) {
|
|
154
|
+
this.rigId = _data["rigId"];
|
|
155
|
+
this.worldId = _data["worldId"];
|
|
156
|
+
this.componentId = _data["componentId"];
|
|
157
|
+
this.statusId = _data["statusId"];
|
|
158
|
+
this.componentDefinitionStatusName = _data["componentDefinitionStatusName"];
|
|
159
|
+
this.componentName = _data["componentName"];
|
|
160
|
+
this.value = _data["value"];
|
|
161
|
+
this.valueStr = _data["valueStr"];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
static fromJS(data) {
|
|
165
|
+
data = typeof data === 'object' ? data : {};
|
|
166
|
+
let result = new RigComponentStatusModel();
|
|
167
|
+
result.init(data);
|
|
168
|
+
return result;
|
|
169
|
+
}
|
|
170
|
+
toJSON(data) {
|
|
171
|
+
data = typeof data === 'object' ? data : {};
|
|
172
|
+
data["rigId"] = this.rigId;
|
|
173
|
+
data["worldId"] = this.worldId;
|
|
174
|
+
data["componentId"] = this.componentId;
|
|
175
|
+
data["statusId"] = this.statusId;
|
|
176
|
+
data["componentDefinitionStatusName"] = this.componentDefinitionStatusName;
|
|
177
|
+
data["componentName"] = this.componentName;
|
|
178
|
+
data["value"] = this.value;
|
|
179
|
+
data["valueStr"] = this.valueStr;
|
|
180
|
+
return data;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export class RigModelLoadedModel {
|
|
184
|
+
constructor(data) {
|
|
185
|
+
if (data) {
|
|
186
|
+
for (var property in data) {
|
|
187
|
+
if (data.hasOwnProperty(property))
|
|
188
|
+
this[property] = data[property];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
init(_data) {
|
|
193
|
+
if (_data) {
|
|
194
|
+
this.rigId = _data["rigId"];
|
|
195
|
+
this.rigModelVersion = _data["rigModelVersion"];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
static fromJS(data) {
|
|
199
|
+
data = typeof data === 'object' ? data : {};
|
|
200
|
+
let result = new RigModelLoadedModel();
|
|
201
|
+
result.init(data);
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
toJSON(data) {
|
|
205
|
+
data = typeof data === 'object' ? data : {};
|
|
206
|
+
data["rigId"] = this.rigId;
|
|
207
|
+
data["rigModelVersion"] = this.rigModelVersion;
|
|
208
|
+
return data;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export class WebRTCMessage {
|
|
212
|
+
constructor(data) {
|
|
213
|
+
if (data) {
|
|
214
|
+
for (var property in data) {
|
|
215
|
+
if (data.hasOwnProperty(property))
|
|
216
|
+
this[property] = data[property];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
init(_data) {
|
|
221
|
+
if (_data) {
|
|
222
|
+
this.rigOwnerUsername = _data["rigOwnerUsername"];
|
|
223
|
+
this.rigId = _data["rigId"];
|
|
224
|
+
this.componentId = _data["componentId"];
|
|
225
|
+
this.webRTCConnectionType = _data["webRTCConnectionType"];
|
|
226
|
+
this.sessionId = _data["sessionId"];
|
|
227
|
+
this.username = _data["username"];
|
|
228
|
+
this.messageType = _data["messageType"];
|
|
229
|
+
this.message = _data["message"];
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
static fromJS(data) {
|
|
233
|
+
data = typeof data === 'object' ? data : {};
|
|
234
|
+
let result = new WebRTCMessage();
|
|
235
|
+
result.init(data);
|
|
236
|
+
return result;
|
|
237
|
+
}
|
|
238
|
+
toJSON(data) {
|
|
239
|
+
data = typeof data === 'object' ? data : {};
|
|
240
|
+
data["rigOwnerUsername"] = this.rigOwnerUsername;
|
|
241
|
+
data["rigId"] = this.rigId;
|
|
242
|
+
data["componentId"] = this.componentId;
|
|
243
|
+
data["webRTCConnectionType"] = this.webRTCConnectionType;
|
|
244
|
+
data["sessionId"] = this.sessionId;
|
|
245
|
+
data["username"] = this.username;
|
|
246
|
+
data["messageType"] = this.messageType;
|
|
247
|
+
data["message"] = this.message;
|
|
248
|
+
return data;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
export var WebRTCConnectionType;
|
|
252
|
+
(function (WebRTCConnectionType) {
|
|
253
|
+
WebRTCConnectionType[WebRTCConnectionType["Direct"] = 0] = "Direct";
|
|
254
|
+
WebRTCConnectionType[WebRTCConnectionType["Relay"] = 1] = "Relay";
|
|
255
|
+
WebRTCConnectionType[WebRTCConnectionType["File"] = 2] = "File";
|
|
256
|
+
})(WebRTCConnectionType || (WebRTCConnectionType = {}));
|
|
257
|
+
export class KeyEventClientModel {
|
|
258
|
+
constructor(data) {
|
|
259
|
+
if (data) {
|
|
260
|
+
for (var property in data) {
|
|
261
|
+
if (data.hasOwnProperty(property))
|
|
262
|
+
this[property] = data[property];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
init(_data) {
|
|
267
|
+
if (_data) {
|
|
268
|
+
this.componentInputId = _data["componentInputId"];
|
|
269
|
+
this.type = _data["type"];
|
|
270
|
+
this.timeStamp = _data["timeStamp"];
|
|
271
|
+
this.keyUp = _data["keyUp"];
|
|
272
|
+
this.keyDown = _data["keyDown"];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
static fromJS(data) {
|
|
276
|
+
data = typeof data === 'object' ? data : {};
|
|
277
|
+
let result = new KeyEventClientModel();
|
|
278
|
+
result.init(data);
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
281
|
+
toJSON(data) {
|
|
282
|
+
data = typeof data === 'object' ? data : {};
|
|
283
|
+
data["componentInputId"] = this.componentInputId;
|
|
284
|
+
data["type"] = this.type;
|
|
285
|
+
data["timeStamp"] = this.timeStamp;
|
|
286
|
+
data["keyUp"] = this.keyUp;
|
|
287
|
+
data["keyDown"] = this.keyDown;
|
|
288
|
+
return data;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
export var LogSettingType;
|
|
292
|
+
(function (LogSettingType) {
|
|
293
|
+
LogSettingType[LogSettingType["None"] = 0] = "None";
|
|
294
|
+
LogSettingType[LogSettingType["KeyEvents"] = 8] = "KeyEvents";
|
|
295
|
+
LogSettingType[LogSettingType["Commands"] = 9] = "Commands";
|
|
296
|
+
LogSettingType[LogSettingType["BLESensor"] = 10] = "BLESensor";
|
|
297
|
+
LogSettingType[LogSettingType["Component"] = 13] = "Component";
|
|
298
|
+
LogSettingType[LogSettingType["SignalR"] = 14] = "SignalR";
|
|
299
|
+
})(LogSettingType || (LogSettingType = {}));
|
|
300
|
+
export class RigClientViewModel {
|
|
301
|
+
constructor(data) {
|
|
302
|
+
if (data) {
|
|
303
|
+
for (var property in data) {
|
|
304
|
+
if (data.hasOwnProperty(property))
|
|
305
|
+
this[property] = data[property];
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (!data) {
|
|
309
|
+
this.rigModelViewModel = new RigModelViewModel();
|
|
310
|
+
this.logSettings = [];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
init(_data) {
|
|
314
|
+
if (_data) {
|
|
315
|
+
this.id = _data["id"];
|
|
316
|
+
this.name = _data["name"];
|
|
317
|
+
this.uniqueCode = _data["uniqueCode"];
|
|
318
|
+
this.videoType = _data["videoType"];
|
|
319
|
+
this.rigModelViewModel = _data["rigModelViewModel"] ? RigModelViewModel.fromJS(_data["rigModelViewModel"]) : new RigModelViewModel();
|
|
320
|
+
this.clientRTCConfigurationViewModel = _data["clientRTCConfigurationViewModel"] ? ClientRTCConfigurationViewModel.fromJS(_data["clientRTCConfigurationViewModel"]) : undefined;
|
|
321
|
+
if (Array.isArray(_data["logSettings"])) {
|
|
322
|
+
this.logSettings = [];
|
|
323
|
+
for (let item of _data["logSettings"])
|
|
324
|
+
this.logSettings.push(LogSettingViewModel.fromJS(item));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
static fromJS(data) {
|
|
329
|
+
data = typeof data === 'object' ? data : {};
|
|
330
|
+
let result = new RigClientViewModel();
|
|
331
|
+
result.init(data);
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
toJSON(data) {
|
|
335
|
+
data = typeof data === 'object' ? data : {};
|
|
336
|
+
data["id"] = this.id;
|
|
337
|
+
data["name"] = this.name;
|
|
338
|
+
data["uniqueCode"] = this.uniqueCode;
|
|
339
|
+
data["videoType"] = this.videoType;
|
|
340
|
+
data["rigModelViewModel"] = this.rigModelViewModel ? this.rigModelViewModel.toJSON() : undefined;
|
|
341
|
+
data["clientRTCConfigurationViewModel"] = this.clientRTCConfigurationViewModel ? this.clientRTCConfigurationViewModel.toJSON() : undefined;
|
|
342
|
+
if (Array.isArray(this.logSettings)) {
|
|
343
|
+
data["logSettings"] = [];
|
|
344
|
+
for (let item of this.logSettings)
|
|
345
|
+
data["logSettings"].push(item ? item.toJSON() : undefined);
|
|
346
|
+
}
|
|
347
|
+
return data;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
export var VideoType;
|
|
351
|
+
(function (VideoType) {
|
|
352
|
+
VideoType[VideoType["VP8"] = 0] = "VP8";
|
|
353
|
+
VideoType[VideoType["H264"] = 1] = "H264";
|
|
354
|
+
})(VideoType || (VideoType = {}));
|
|
355
|
+
export class RigModelViewModel {
|
|
356
|
+
constructor(data) {
|
|
357
|
+
if (data) {
|
|
358
|
+
for (var property in data) {
|
|
359
|
+
if (data.hasOwnProperty(property))
|
|
360
|
+
this[property] = data[property];
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (!data) {
|
|
364
|
+
this.components = [];
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
init(_data) {
|
|
368
|
+
if (_data) {
|
|
369
|
+
this.id = _data["id"];
|
|
370
|
+
this.name = _data["name"];
|
|
371
|
+
this.username = _data["username"];
|
|
372
|
+
this.canBeDelete = _data["canBeDelete"];
|
|
373
|
+
this.canBeEdited = _data["canBeEdited"];
|
|
374
|
+
this.version = _data["version"];
|
|
375
|
+
this.microControllerId = _data["microControllerId"];
|
|
376
|
+
this.descriptionHTML = _data["descriptionHTML"];
|
|
377
|
+
if (Array.isArray(_data["components"])) {
|
|
378
|
+
this.components = [];
|
|
379
|
+
for (let item of _data["components"])
|
|
380
|
+
this.components.push(ComponentViewModel.fromJS(item));
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
static fromJS(data) {
|
|
385
|
+
data = typeof data === 'object' ? data : {};
|
|
386
|
+
let result = new RigModelViewModel();
|
|
387
|
+
result.init(data);
|
|
388
|
+
return result;
|
|
389
|
+
}
|
|
390
|
+
toJSON(data) {
|
|
391
|
+
data = typeof data === 'object' ? data : {};
|
|
392
|
+
data["id"] = this.id;
|
|
393
|
+
data["name"] = this.name;
|
|
394
|
+
data["username"] = this.username;
|
|
395
|
+
data["canBeDelete"] = this.canBeDelete;
|
|
396
|
+
data["canBeEdited"] = this.canBeEdited;
|
|
397
|
+
data["version"] = this.version;
|
|
398
|
+
data["microControllerId"] = this.microControllerId;
|
|
399
|
+
data["descriptionHTML"] = this.descriptionHTML;
|
|
400
|
+
if (Array.isArray(this.components)) {
|
|
401
|
+
data["components"] = [];
|
|
402
|
+
for (let item of this.components)
|
|
403
|
+
data["components"].push(item ? item.toJSON() : undefined);
|
|
404
|
+
}
|
|
405
|
+
return data;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
export class ComponentViewModel {
|
|
409
|
+
constructor(data) {
|
|
410
|
+
if (data) {
|
|
411
|
+
for (var property in data) {
|
|
412
|
+
if (data.hasOwnProperty(property))
|
|
413
|
+
this[property] = data[property];
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
if (!data) {
|
|
417
|
+
this.children = [];
|
|
418
|
+
this.properties = [];
|
|
419
|
+
this.inputs = [];
|
|
420
|
+
this.pins = [];
|
|
421
|
+
this.status = [];
|
|
422
|
+
this.codeBlocks = [];
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
init(_data) {
|
|
426
|
+
if (_data) {
|
|
427
|
+
this.id = _data["id"];
|
|
428
|
+
this.name = _data["name"];
|
|
429
|
+
this.position = _data["position"];
|
|
430
|
+
this.componentDefinitionName = _data["componentDefinitionName"];
|
|
431
|
+
this.componentType = _data["componentType"];
|
|
432
|
+
this.componentDisplay = _data["componentDisplay"];
|
|
433
|
+
this.componentDefinitionId = _data["componentDefinitionId"];
|
|
434
|
+
this.active = _data["active"];
|
|
435
|
+
this.rigModelIsParent = _data["rigModelIsParent"];
|
|
436
|
+
this.hide = _data["hide"];
|
|
437
|
+
this.tempOpen = _data["tempOpen"];
|
|
438
|
+
this.hideChildren = _data["hideChildren"];
|
|
439
|
+
this.hideProperties = _data["hideProperties"];
|
|
440
|
+
this.hideInputs = _data["hideInputs"];
|
|
441
|
+
this.hidePins = _data["hidePins"];
|
|
442
|
+
if (Array.isArray(_data["children"])) {
|
|
443
|
+
this.children = [];
|
|
444
|
+
for (let item of _data["children"])
|
|
445
|
+
this.children.push(ComponentViewModel.fromJS(item));
|
|
446
|
+
}
|
|
447
|
+
if (Array.isArray(_data["properties"])) {
|
|
448
|
+
this.properties = [];
|
|
449
|
+
for (let item of _data["properties"])
|
|
450
|
+
this.properties.push(ComponentPropertyViewModel.fromJS(item));
|
|
451
|
+
}
|
|
452
|
+
if (Array.isArray(_data["inputs"])) {
|
|
453
|
+
this.inputs = [];
|
|
454
|
+
for (let item of _data["inputs"])
|
|
455
|
+
this.inputs.push(ComponentInputViewModel.fromJS(item));
|
|
456
|
+
}
|
|
457
|
+
if (Array.isArray(_data["pins"])) {
|
|
458
|
+
this.pins = [];
|
|
459
|
+
for (let item of _data["pins"])
|
|
460
|
+
this.pins.push(ComponentMicroControllerPinViewModel.fromJS(item));
|
|
461
|
+
}
|
|
462
|
+
if (Array.isArray(_data["status"])) {
|
|
463
|
+
this.status = [];
|
|
464
|
+
for (let item of _data["status"])
|
|
465
|
+
this.status.push(ComponentStatusViewModel.fromJS(item));
|
|
466
|
+
}
|
|
467
|
+
if (Array.isArray(_data["codeBlocks"])) {
|
|
468
|
+
this.codeBlocks = [];
|
|
469
|
+
for (let item of _data["codeBlocks"])
|
|
470
|
+
this.codeBlocks.push(CodeBlockViewModel.fromJS(item));
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
static fromJS(data) {
|
|
475
|
+
data = typeof data === 'object' ? data : {};
|
|
476
|
+
let result = new ComponentViewModel();
|
|
477
|
+
result.init(data);
|
|
478
|
+
return result;
|
|
479
|
+
}
|
|
480
|
+
toJSON(data) {
|
|
481
|
+
data = typeof data === 'object' ? data : {};
|
|
482
|
+
data["id"] = this.id;
|
|
483
|
+
data["name"] = this.name;
|
|
484
|
+
data["position"] = this.position;
|
|
485
|
+
data["componentDefinitionName"] = this.componentDefinitionName;
|
|
486
|
+
data["componentType"] = this.componentType;
|
|
487
|
+
data["componentDisplay"] = this.componentDisplay;
|
|
488
|
+
data["componentDefinitionId"] = this.componentDefinitionId;
|
|
489
|
+
data["active"] = this.active;
|
|
490
|
+
data["rigModelIsParent"] = this.rigModelIsParent;
|
|
491
|
+
data["hide"] = this.hide;
|
|
492
|
+
data["tempOpen"] = this.tempOpen;
|
|
493
|
+
data["hideChildren"] = this.hideChildren;
|
|
494
|
+
data["hideProperties"] = this.hideProperties;
|
|
495
|
+
data["hideInputs"] = this.hideInputs;
|
|
496
|
+
data["hidePins"] = this.hidePins;
|
|
497
|
+
if (Array.isArray(this.children)) {
|
|
498
|
+
data["children"] = [];
|
|
499
|
+
for (let item of this.children)
|
|
500
|
+
data["children"].push(item ? item.toJSON() : undefined);
|
|
501
|
+
}
|
|
502
|
+
if (Array.isArray(this.properties)) {
|
|
503
|
+
data["properties"] = [];
|
|
504
|
+
for (let item of this.properties)
|
|
505
|
+
data["properties"].push(item ? item.toJSON() : undefined);
|
|
506
|
+
}
|
|
507
|
+
if (Array.isArray(this.inputs)) {
|
|
508
|
+
data["inputs"] = [];
|
|
509
|
+
for (let item of this.inputs)
|
|
510
|
+
data["inputs"].push(item ? item.toJSON() : undefined);
|
|
511
|
+
}
|
|
512
|
+
if (Array.isArray(this.pins)) {
|
|
513
|
+
data["pins"] = [];
|
|
514
|
+
for (let item of this.pins)
|
|
515
|
+
data["pins"].push(item ? item.toJSON() : undefined);
|
|
516
|
+
}
|
|
517
|
+
if (Array.isArray(this.status)) {
|
|
518
|
+
data["status"] = [];
|
|
519
|
+
for (let item of this.status)
|
|
520
|
+
data["status"].push(item ? item.toJSON() : undefined);
|
|
521
|
+
}
|
|
522
|
+
if (Array.isArray(this.codeBlocks)) {
|
|
523
|
+
data["codeBlocks"] = [];
|
|
524
|
+
for (let item of this.codeBlocks)
|
|
525
|
+
data["codeBlocks"].push(item ? item.toJSON() : undefined);
|
|
526
|
+
}
|
|
527
|
+
return data;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
export var ComponentType;
|
|
531
|
+
(function (ComponentType) {
|
|
532
|
+
ComponentType[ComponentType["General"] = 1] = "General";
|
|
533
|
+
ComponentType[ComponentType["Camera"] = 2] = "Camera";
|
|
534
|
+
ComponentType[ComponentType["CameraContainer"] = 3] = "CameraContainer";
|
|
535
|
+
})(ComponentType || (ComponentType = {}));
|
|
536
|
+
export var ComponentDisplay;
|
|
537
|
+
(function (ComponentDisplay) {
|
|
538
|
+
ComponentDisplay[ComponentDisplay["Default"] = 0] = "Default";
|
|
539
|
+
ComponentDisplay[ComponentDisplay["TwoInputsAndOneStatus"] = 1] = "TwoInputsAndOneStatus";
|
|
540
|
+
ComponentDisplay[ComponentDisplay["Movement"] = 2] = "Movement";
|
|
541
|
+
ComponentDisplay[ComponentDisplay["Actuator"] = 3] = "Actuator";
|
|
542
|
+
ComponentDisplay[ComponentDisplay["Camera"] = 4] = "Camera";
|
|
543
|
+
})(ComponentDisplay || (ComponentDisplay = {}));
|
|
544
|
+
export class HighScoreModel {
|
|
545
|
+
constructor(data) {
|
|
546
|
+
if (data) {
|
|
547
|
+
for (var property in data) {
|
|
548
|
+
if (data.hasOwnProperty(property))
|
|
549
|
+
this[property] = data[property];
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
init(_data) {
|
|
554
|
+
if (_data) {
|
|
555
|
+
this.points = _data["points"];
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
static fromJS(data) {
|
|
559
|
+
data = typeof data === 'object' ? data : {};
|
|
560
|
+
let result = new HighScoreModel();
|
|
561
|
+
result.init(data);
|
|
562
|
+
return result;
|
|
563
|
+
}
|
|
564
|
+
toJSON(data) {
|
|
565
|
+
data = typeof data === 'object' ? data : {};
|
|
566
|
+
data["points"] = this.points;
|
|
567
|
+
return data;
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
export class LogModel {
|
|
571
|
+
constructor(data) {
|
|
572
|
+
if (data) {
|
|
573
|
+
for (var property in data) {
|
|
574
|
+
if (data.hasOwnProperty(property))
|
|
575
|
+
this[property] = data[property];
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
init(_data) {
|
|
580
|
+
if (_data) {
|
|
581
|
+
this.dateTime = _data["dateTime"] ? new Date(_data["dateTime"].toString()) : undefined;
|
|
582
|
+
this.name = _data["name"];
|
|
583
|
+
this.message = _data["message"];
|
|
584
|
+
this.storedInFile = _data["storedInFile"];
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
static fromJS(data) {
|
|
588
|
+
data = typeof data === 'object' ? data : {};
|
|
589
|
+
let result = new LogModel();
|
|
590
|
+
result.init(data);
|
|
591
|
+
return result;
|
|
592
|
+
}
|
|
593
|
+
toJSON(data) {
|
|
594
|
+
data = typeof data === 'object' ? data : {};
|
|
595
|
+
data["dateTime"] = this.dateTime ? this.dateTime.toISOString() : undefined;
|
|
596
|
+
data["name"] = this.name;
|
|
597
|
+
data["message"] = this.message;
|
|
598
|
+
data["storedInFile"] = this.storedInFile;
|
|
599
|
+
return data;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
export class CommandMessage {
|
|
603
|
+
constructor(data) {
|
|
604
|
+
if (data) {
|
|
605
|
+
for (var property in data) {
|
|
606
|
+
if (data.hasOwnProperty(property))
|
|
607
|
+
this[property] = data[property];
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
init(_data) {
|
|
612
|
+
if (_data) {
|
|
613
|
+
this.type = _data["type"];
|
|
614
|
+
this.value = _data["value"];
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
static fromJS(data) {
|
|
618
|
+
data = typeof data === 'object' ? data : {};
|
|
619
|
+
let result = new CommandMessage();
|
|
620
|
+
result.init(data);
|
|
621
|
+
return result;
|
|
622
|
+
}
|
|
623
|
+
toJSON(data) {
|
|
624
|
+
data = typeof data === 'object' ? data : {};
|
|
625
|
+
data["type"] = this.type;
|
|
626
|
+
data["value"] = this.value;
|
|
627
|
+
return data;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
export var CommandType;
|
|
631
|
+
(function (CommandType) {
|
|
632
|
+
CommandType[CommandType["RigReloadRigModel"] = 1] = "RigReloadRigModel";
|
|
633
|
+
CommandType[CommandType["RigShutdown"] = 2] = "RigShutdown";
|
|
634
|
+
CommandType[CommandType["RigBecomeOperator"] = 3] = "RigBecomeOperator";
|
|
635
|
+
CommandType[CommandType["RigStopBeingOperator"] = 4] = "RigStopBeingOperator";
|
|
636
|
+
CommandType[CommandType["RigStartWebRTCConnection"] = 5] = "RigStartWebRTCConnection";
|
|
637
|
+
CommandType[CommandType["WorldStart"] = 101] = "WorldStart";
|
|
638
|
+
CommandType[CommandType["WorldStop"] = 102] = "WorldStop";
|
|
639
|
+
CommandType[CommandType["ExploreWorldJoinQueue"] = 201] = "ExploreWorldJoinQueue";
|
|
640
|
+
CommandType[CommandType["ExploreWorldLeaveQueue"] = 202] = "ExploreWorldLeaveQueue";
|
|
641
|
+
CommandType[CommandType["ExploreWorldStartSession"] = 203] = "ExploreWorldStartSession";
|
|
642
|
+
CommandType[CommandType["ExploreWorldStopSession"] = 204] = "ExploreWorldStopSession";
|
|
643
|
+
CommandType[CommandType["VideoSetTime"] = 301] = "VideoSetTime";
|
|
644
|
+
CommandType[CommandType["VideoSetPlayPause"] = 302] = "VideoSetPlayPause";
|
|
645
|
+
})(CommandType || (CommandType = {}));
|
|
646
|
+
export class ComponentPropertyViewModel {
|
|
647
|
+
constructor(data) {
|
|
648
|
+
if (data) {
|
|
649
|
+
for (var property in data) {
|
|
650
|
+
if (data.hasOwnProperty(property))
|
|
651
|
+
this[property] = data[property];
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
init(_data) {
|
|
656
|
+
if (_data) {
|
|
657
|
+
this.componentPropertyId = _data["componentPropertyId"];
|
|
658
|
+
this.componentPropertyValue = _data["componentPropertyValue"];
|
|
659
|
+
this.componentDefinitionPropertyId = _data["componentDefinitionPropertyId"];
|
|
660
|
+
this.componentDefinitionPropertyName = _data["componentDefinitionPropertyName"];
|
|
661
|
+
this.componentDefinitionPropertyDefault = _data["componentDefinitionPropertyDefault"];
|
|
662
|
+
this.componentDefinitionPropertyType = _data["componentDefinitionPropertyType"];
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
static fromJS(data) {
|
|
666
|
+
data = typeof data === 'object' ? data : {};
|
|
667
|
+
let result = new ComponentPropertyViewModel();
|
|
668
|
+
result.init(data);
|
|
669
|
+
return result;
|
|
670
|
+
}
|
|
671
|
+
toJSON(data) {
|
|
672
|
+
data = typeof data === 'object' ? data : {};
|
|
673
|
+
data["componentPropertyId"] = this.componentPropertyId;
|
|
674
|
+
data["componentPropertyValue"] = this.componentPropertyValue;
|
|
675
|
+
data["componentDefinitionPropertyId"] = this.componentDefinitionPropertyId;
|
|
676
|
+
data["componentDefinitionPropertyName"] = this.componentDefinitionPropertyName;
|
|
677
|
+
data["componentDefinitionPropertyDefault"] = this.componentDefinitionPropertyDefault;
|
|
678
|
+
data["componentDefinitionPropertyType"] = this.componentDefinitionPropertyType;
|
|
679
|
+
return data;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
export var ComponentDefinitionPropertyType;
|
|
683
|
+
(function (ComponentDefinitionPropertyType) {
|
|
684
|
+
ComponentDefinitionPropertyType[ComponentDefinitionPropertyType["String"] = 0] = "String";
|
|
685
|
+
ComponentDefinitionPropertyType[ComponentDefinitionPropertyType["Integer"] = 1] = "Integer";
|
|
686
|
+
ComponentDefinitionPropertyType[ComponentDefinitionPropertyType["Float"] = 2] = "Float";
|
|
687
|
+
ComponentDefinitionPropertyType[ComponentDefinitionPropertyType["Boolean"] = 3] = "Boolean";
|
|
688
|
+
})(ComponentDefinitionPropertyType || (ComponentDefinitionPropertyType = {}));
|
|
689
|
+
export class ComponentInputViewModel {
|
|
690
|
+
constructor(data) {
|
|
691
|
+
if (data) {
|
|
692
|
+
for (var property in data) {
|
|
693
|
+
if (data.hasOwnProperty(property))
|
|
694
|
+
this[property] = data[property];
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (!data) {
|
|
698
|
+
this.input = new InputViewModel();
|
|
699
|
+
this.componentDefinitionInput = new InputViewModel();
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
init(_data) {
|
|
703
|
+
if (_data) {
|
|
704
|
+
this.position = _data["position"];
|
|
705
|
+
this.componentInputId = _data["componentInputId"];
|
|
706
|
+
this.componentInputName = _data["componentInputName"];
|
|
707
|
+
this.input = _data["input"] ? InputViewModel.fromJS(_data["input"]) : new InputViewModel();
|
|
708
|
+
this.componentDefinitionInputId = _data["componentDefinitionInputId"];
|
|
709
|
+
this.componentDefinitionInputName = _data["componentDefinitionInputName"];
|
|
710
|
+
this.componentDefinitionInputParentName = _data["componentDefinitionInputParentName"];
|
|
711
|
+
this.componentDefinitionInput = _data["componentDefinitionInput"] ? InputViewModel.fromJS(_data["componentDefinitionInput"]) : new InputViewModel();
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
static fromJS(data) {
|
|
715
|
+
data = typeof data === 'object' ? data : {};
|
|
716
|
+
let result = new ComponentInputViewModel();
|
|
717
|
+
result.init(data);
|
|
718
|
+
return result;
|
|
719
|
+
}
|
|
720
|
+
toJSON(data) {
|
|
721
|
+
data = typeof data === 'object' ? data : {};
|
|
722
|
+
data["position"] = this.position;
|
|
723
|
+
data["componentInputId"] = this.componentInputId;
|
|
724
|
+
data["componentInputName"] = this.componentInputName;
|
|
725
|
+
data["input"] = this.input ? this.input.toJSON() : undefined;
|
|
726
|
+
data["componentDefinitionInputId"] = this.componentDefinitionInputId;
|
|
727
|
+
data["componentDefinitionInputName"] = this.componentDefinitionInputName;
|
|
728
|
+
data["componentDefinitionInputParentName"] = this.componentDefinitionInputParentName;
|
|
729
|
+
data["componentDefinitionInput"] = this.componentDefinitionInput ? this.componentDefinitionInput.toJSON() : undefined;
|
|
730
|
+
return data;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
export class InputViewModel {
|
|
734
|
+
constructor(data) {
|
|
735
|
+
if (data) {
|
|
736
|
+
for (var property in data) {
|
|
737
|
+
if (data.hasOwnProperty(property))
|
|
738
|
+
this[property] = data[property];
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
init(_data) {
|
|
743
|
+
if (_data) {
|
|
744
|
+
this.id = _data["id"];
|
|
745
|
+
this.inputCategoryId = _data["inputCategoryId"];
|
|
746
|
+
this.categoryName = _data["categoryName"];
|
|
747
|
+
this.name = _data["name"];
|
|
748
|
+
this.username = _data["username"];
|
|
749
|
+
this.singlePress = _data["singlePress"];
|
|
750
|
+
this.defaultKey = _data["defaultKey"];
|
|
751
|
+
this.defaultAltKey = _data["defaultAltKey"];
|
|
752
|
+
this.canBeDelete = _data["canBeDelete"];
|
|
753
|
+
this.canBeEdited = _data["canBeEdited"];
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
static fromJS(data) {
|
|
757
|
+
data = typeof data === 'object' ? data : {};
|
|
758
|
+
let result = new InputViewModel();
|
|
759
|
+
result.init(data);
|
|
760
|
+
return result;
|
|
761
|
+
}
|
|
762
|
+
toJSON(data) {
|
|
763
|
+
data = typeof data === 'object' ? data : {};
|
|
764
|
+
data["id"] = this.id;
|
|
765
|
+
data["inputCategoryId"] = this.inputCategoryId;
|
|
766
|
+
data["categoryName"] = this.categoryName;
|
|
767
|
+
data["name"] = this.name;
|
|
768
|
+
data["username"] = this.username;
|
|
769
|
+
data["singlePress"] = this.singlePress;
|
|
770
|
+
data["defaultKey"] = this.defaultKey;
|
|
771
|
+
data["defaultAltKey"] = this.defaultAltKey;
|
|
772
|
+
data["canBeDelete"] = this.canBeDelete;
|
|
773
|
+
data["canBeEdited"] = this.canBeEdited;
|
|
774
|
+
return data;
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
export class ComponentMicroControllerPinViewModel {
|
|
778
|
+
constructor(data) {
|
|
779
|
+
if (data) {
|
|
780
|
+
for (var property in data) {
|
|
781
|
+
if (data.hasOwnProperty(property))
|
|
782
|
+
this[property] = data[property];
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
if (!data) {
|
|
786
|
+
this.componentMicroControllerPin = new MicroControllerPinViewModel();
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
init(_data) {
|
|
790
|
+
if (_data) {
|
|
791
|
+
this.componentMicroControllerPinId = _data["componentMicroControllerPinId"];
|
|
792
|
+
this.componentMicroControllerPin = _data["componentMicroControllerPin"] ? MicroControllerPinViewModel.fromJS(_data["componentMicroControllerPin"]) : new MicroControllerPinViewModel();
|
|
793
|
+
this.rigModelId = _data["rigModelId"];
|
|
794
|
+
this.componentDefinitionMicroControllerPinId = _data["componentDefinitionMicroControllerPinId"];
|
|
795
|
+
this.componentDefinitionMicroControllerPinName = _data["componentDefinitionMicroControllerPinName"];
|
|
796
|
+
this.pinMode = _data["pinMode"];
|
|
797
|
+
this.pinPullUpDown = _data["pinPullUpDown"];
|
|
798
|
+
this.codeBlock = _data["codeBlock"] ? CodeBlockViewModel.fromJS(_data["codeBlock"]) : undefined;
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
static fromJS(data) {
|
|
802
|
+
data = typeof data === 'object' ? data : {};
|
|
803
|
+
let result = new ComponentMicroControllerPinViewModel();
|
|
804
|
+
result.init(data);
|
|
805
|
+
return result;
|
|
806
|
+
}
|
|
807
|
+
toJSON(data) {
|
|
808
|
+
data = typeof data === 'object' ? data : {};
|
|
809
|
+
data["componentMicroControllerPinId"] = this.componentMicroControllerPinId;
|
|
810
|
+
data["componentMicroControllerPin"] = this.componentMicroControllerPin ? this.componentMicroControllerPin.toJSON() : undefined;
|
|
811
|
+
data["rigModelId"] = this.rigModelId;
|
|
812
|
+
data["componentDefinitionMicroControllerPinId"] = this.componentDefinitionMicroControllerPinId;
|
|
813
|
+
data["componentDefinitionMicroControllerPinName"] = this.componentDefinitionMicroControllerPinName;
|
|
814
|
+
data["pinMode"] = this.pinMode;
|
|
815
|
+
data["pinPullUpDown"] = this.pinPullUpDown;
|
|
816
|
+
data["codeBlock"] = this.codeBlock ? this.codeBlock.toJSON() : undefined;
|
|
817
|
+
return data;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
export class MicroControllerPinViewModel {
|
|
821
|
+
constructor(data) {
|
|
822
|
+
if (data) {
|
|
823
|
+
for (var property in data) {
|
|
824
|
+
if (data.hasOwnProperty(property))
|
|
825
|
+
this[property] = data[property];
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
init(_data) {
|
|
830
|
+
if (_data) {
|
|
831
|
+
this.id = _data["id"];
|
|
832
|
+
this.microControllerId = _data["microControllerId"];
|
|
833
|
+
this.name = _data["name"];
|
|
834
|
+
this.count = _data["count"];
|
|
835
|
+
this.gpio = _data["gpio"];
|
|
836
|
+
this.microControllerPinType = _data["microControllerPinType"];
|
|
837
|
+
this.pwm = _data["pwm"];
|
|
838
|
+
this.initialState = _data["initialState"];
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
static fromJS(data) {
|
|
842
|
+
data = typeof data === 'object' ? data : {};
|
|
843
|
+
let result = new MicroControllerPinViewModel();
|
|
844
|
+
result.init(data);
|
|
845
|
+
return result;
|
|
846
|
+
}
|
|
847
|
+
toJSON(data) {
|
|
848
|
+
data = typeof data === 'object' ? data : {};
|
|
849
|
+
data["id"] = this.id;
|
|
850
|
+
data["microControllerId"] = this.microControllerId;
|
|
851
|
+
data["name"] = this.name;
|
|
852
|
+
data["count"] = this.count;
|
|
853
|
+
data["gpio"] = this.gpio;
|
|
854
|
+
data["microControllerPinType"] = this.microControllerPinType;
|
|
855
|
+
data["pwm"] = this.pwm;
|
|
856
|
+
data["initialState"] = this.initialState;
|
|
857
|
+
return data;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
export var MicroControllerPinType;
|
|
861
|
+
(function (MicroControllerPinType) {
|
|
862
|
+
MicroControllerPinType[MicroControllerPinType["V33"] = 1] = "V33";
|
|
863
|
+
MicroControllerPinType[MicroControllerPinType["V5"] = 2] = "V5";
|
|
864
|
+
MicroControllerPinType[MicroControllerPinType["Ground"] = 3] = "Ground";
|
|
865
|
+
MicroControllerPinType[MicroControllerPinType["UART"] = 4] = "UART";
|
|
866
|
+
MicroControllerPinType[MicroControllerPinType["I2C"] = 5] = "I2C";
|
|
867
|
+
MicroControllerPinType[MicroControllerPinType["SPI"] = 6] = "SPI";
|
|
868
|
+
MicroControllerPinType[MicroControllerPinType["GPIO"] = 7] = "GPIO";
|
|
869
|
+
})(MicroControllerPinType || (MicroControllerPinType = {}));
|
|
870
|
+
export var MicroControllerPinInitialState;
|
|
871
|
+
(function (MicroControllerPinInitialState) {
|
|
872
|
+
MicroControllerPinInitialState[MicroControllerPinInitialState["V0"] = 0] = "V0";
|
|
873
|
+
MicroControllerPinInitialState[MicroControllerPinInitialState["V33"] = 1] = "V33";
|
|
874
|
+
})(MicroControllerPinInitialState || (MicroControllerPinInitialState = {}));
|
|
875
|
+
export var PinPullUpDown;
|
|
876
|
+
(function (PinPullUpDown) {
|
|
877
|
+
PinPullUpDown[PinPullUpDown["PUD_OFF"] = 0] = "PUD_OFF";
|
|
878
|
+
PinPullUpDown[PinPullUpDown["PUD_DOWN"] = 1] = "PUD_DOWN";
|
|
879
|
+
PinPullUpDown[PinPullUpDown["PUD_UP"] = 2] = "PUD_UP";
|
|
880
|
+
})(PinPullUpDown || (PinPullUpDown = {}));
|
|
881
|
+
export var PinMode;
|
|
882
|
+
(function (PinMode) {
|
|
883
|
+
PinMode[PinMode["INPUT"] = 1] = "INPUT";
|
|
884
|
+
PinMode[PinMode["OUTPUT"] = 2] = "OUTPUT";
|
|
885
|
+
})(PinMode || (PinMode = {}));
|
|
886
|
+
export class LogSettingViewModel {
|
|
887
|
+
constructor(data) {
|
|
888
|
+
if (data) {
|
|
889
|
+
for (var property in data) {
|
|
890
|
+
if (data.hasOwnProperty(property))
|
|
891
|
+
this[property] = data[property];
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
init(_data) {
|
|
896
|
+
if (_data) {
|
|
897
|
+
this.id = _data["id"];
|
|
898
|
+
this.logSettingType = _data["logSettingType"];
|
|
899
|
+
this.parameter1 = _data["parameter1"];
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
static fromJS(data) {
|
|
903
|
+
data = typeof data === 'object' ? data : {};
|
|
904
|
+
let result = new LogSettingViewModel();
|
|
905
|
+
result.init(data);
|
|
906
|
+
return result;
|
|
907
|
+
}
|
|
908
|
+
toJSON(data) {
|
|
909
|
+
data = typeof data === 'object' ? data : {};
|
|
910
|
+
data["id"] = this.id;
|
|
911
|
+
data["logSettingType"] = this.logSettingType;
|
|
912
|
+
data["parameter1"] = this.parameter1;
|
|
913
|
+
return data;
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
export class KeyEventModel {
|
|
917
|
+
constructor(data) {
|
|
918
|
+
if (data) {
|
|
919
|
+
for (var property in data) {
|
|
920
|
+
if (data.hasOwnProperty(property))
|
|
921
|
+
this[property] = data[property];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
init(_data) {
|
|
926
|
+
if (_data) {
|
|
927
|
+
this.rigId = _data["rigId"];
|
|
928
|
+
this.componentInputId = _data["componentInputId"];
|
|
929
|
+
this.worldId = _data["worldId"];
|
|
930
|
+
this.type = _data["type"];
|
|
931
|
+
this.timeStamp = _data["timeStamp"];
|
|
932
|
+
this.repeat = _data["repeat"];
|
|
933
|
+
this.shiftKey = _data["shiftKey"];
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
static fromJS(data) {
|
|
937
|
+
data = typeof data === 'object' ? data : {};
|
|
938
|
+
let result = new KeyEventModel();
|
|
939
|
+
result.init(data);
|
|
940
|
+
return result;
|
|
941
|
+
}
|
|
942
|
+
toJSON(data) {
|
|
943
|
+
data = typeof data === 'object' ? data : {};
|
|
944
|
+
data["rigId"] = this.rigId;
|
|
945
|
+
data["componentInputId"] = this.componentInputId;
|
|
946
|
+
data["worldId"] = this.worldId;
|
|
947
|
+
data["type"] = this.type;
|
|
948
|
+
data["timeStamp"] = this.timeStamp;
|
|
949
|
+
data["repeat"] = this.repeat;
|
|
950
|
+
data["shiftKey"] = this.shiftKey;
|
|
951
|
+
return data;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
export class CodeBlockViewModel {
|
|
955
|
+
constructor(data) {
|
|
956
|
+
if (data) {
|
|
957
|
+
for (var property in data) {
|
|
958
|
+
if (data.hasOwnProperty(property))
|
|
959
|
+
this[property] = data[property];
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
if (!data) {
|
|
963
|
+
this.parameters = [];
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
init(_data) {
|
|
967
|
+
if (_data) {
|
|
968
|
+
this.id = _data["id"];
|
|
969
|
+
this.name = _data["name"];
|
|
970
|
+
this.code = _data["code"];
|
|
971
|
+
this.type = _data["type"];
|
|
972
|
+
if (Array.isArray(_data["parameters"])) {
|
|
973
|
+
this.parameters = [];
|
|
974
|
+
for (let item of _data["parameters"])
|
|
975
|
+
this.parameters.push(CodeBlockParameterViewModel.fromJS(item));
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
static fromJS(data) {
|
|
980
|
+
data = typeof data === 'object' ? data : {};
|
|
981
|
+
let result = new CodeBlockViewModel();
|
|
982
|
+
result.init(data);
|
|
983
|
+
return result;
|
|
984
|
+
}
|
|
985
|
+
toJSON(data) {
|
|
986
|
+
data = typeof data === 'object' ? data : {};
|
|
987
|
+
data["id"] = this.id;
|
|
988
|
+
data["name"] = this.name;
|
|
989
|
+
data["code"] = this.code;
|
|
990
|
+
data["type"] = this.type;
|
|
991
|
+
if (Array.isArray(this.parameters)) {
|
|
992
|
+
data["parameters"] = [];
|
|
993
|
+
for (let item of this.parameters)
|
|
994
|
+
data["parameters"].push(item ? item.toJSON() : undefined);
|
|
995
|
+
}
|
|
996
|
+
return data;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
export var CodeBlockType;
|
|
1000
|
+
(function (CodeBlockType) {
|
|
1001
|
+
CodeBlockType[CodeBlockType["OnAlert"] = 1] = "OnAlert";
|
|
1002
|
+
CodeBlockType[CodeBlockType["Init"] = 3] = "Init";
|
|
1003
|
+
CodeBlockType[CodeBlockType["ProcessKeyEvent"] = 5] = "ProcessKeyEvent";
|
|
1004
|
+
CodeBlockType[CodeBlockType["Function"] = 6] = "Function";
|
|
1005
|
+
CodeBlockType[CodeBlockType["Shutdown"] = 10] = "Shutdown";
|
|
1006
|
+
CodeBlockType[CodeBlockType["ComponentViewHTML"] = 20] = "ComponentViewHTML";
|
|
1007
|
+
CodeBlockType[CodeBlockType["ComponentViewFunction"] = 21] = "ComponentViewFunction";
|
|
1008
|
+
})(CodeBlockType || (CodeBlockType = {}));
|
|
1009
|
+
export class CodeBlockParameterViewModel {
|
|
1010
|
+
constructor(data) {
|
|
1011
|
+
if (data) {
|
|
1012
|
+
for (var property in data) {
|
|
1013
|
+
if (data.hasOwnProperty(property))
|
|
1014
|
+
this[property] = data[property];
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
init(_data) {
|
|
1019
|
+
if (_data) {
|
|
1020
|
+
this.id = _data["id"];
|
|
1021
|
+
this.name = _data["name"];
|
|
1022
|
+
this.type = _data["type"];
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
static fromJS(data) {
|
|
1026
|
+
data = typeof data === 'object' ? data : {};
|
|
1027
|
+
let result = new CodeBlockParameterViewModel();
|
|
1028
|
+
result.init(data);
|
|
1029
|
+
return result;
|
|
1030
|
+
}
|
|
1031
|
+
toJSON(data) {
|
|
1032
|
+
data = typeof data === 'object' ? data : {};
|
|
1033
|
+
data["id"] = this.id;
|
|
1034
|
+
data["name"] = this.name;
|
|
1035
|
+
data["type"] = this.type;
|
|
1036
|
+
return data;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
export var CodeBlockParameterType;
|
|
1040
|
+
(function (CodeBlockParameterType) {
|
|
1041
|
+
CodeBlockParameterType[CodeBlockParameterType["Number"] = 1] = "Number";
|
|
1042
|
+
CodeBlockParameterType[CodeBlockParameterType["String"] = 2] = "String";
|
|
1043
|
+
CodeBlockParameterType[CodeBlockParameterType["Boolean"] = 3] = "Boolean";
|
|
1044
|
+
})(CodeBlockParameterType || (CodeBlockParameterType = {}));
|
|
1045
|
+
//# sourceMappingURL=models.js.map
|