@denevads/dnv-smo 1.0.12 → 1.0.13

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/smo.js CHANGED
@@ -1,537 +1,581 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlarmaLevel = exports.LogLevel = exports.SMO_EVENT_TYPE = exports.SMO = void 0;
4
- var rxjs_1 = require("rxjs");
5
- var SMO = /** @class */ (function () {
6
- function SMO() {
7
- this.vars = {};
8
- this.id = "";
9
- this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
10
- this.initOnMessage();
11
- this.smoCallBacks = new smoCallBacks(this);
12
- this.utils = new Utils(this, this.smoCallBacks);
13
- this.events = new SmoEvents(this);
14
- this.init();
15
- }
16
- SMO.prototype.init = function () {
17
- var _this = this;
18
- var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
19
- return decodeURIComponent(s.replace(pl, " "));
20
- }, query = window.location.search.substring(1);
21
- while (match = search.exec(query)) {
22
- this.vars[decode(match[1])] = decode(match[2]);
23
- }
24
- if (this.vars.idSmo) {
25
- this.id = this.vars.idSmo;
26
- if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
27
- this.smoCallBacks.onSmoLoad();
28
- return;
29
- }
30
- if (this.vars["url"] != undefined) {
31
- this.smoCallBacks.getFile(this.vars["url"]);
32
- this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
33
- _this.smoCallBacks.getFile(_this.vars["url"]);
34
- });
35
- return;
36
- }
37
- if (this.vars["LocalData"] != undefined) {
38
- this.smoCallBacks.getLocalData(this.vars["LocalData"]);
39
- this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
40
- _this.smoCallBacks.getLocalData(_this.vars["LocalData"]);
41
- });
42
- return;
43
- }
44
- return;
45
- }
46
- console.warn("No idSmo found in URL");
47
- };
48
- SMO.prototype.initOnMessage = function () {
49
- var selft = this;
50
- window.onmessage = function (e) {
51
- if (e.data.target) {
52
- var targets = e.data.target.split('.');
53
- var func = targets[targets.length - 1];
54
- if (func == SMO_EVENT_TYPE.start) {
55
- selft.start();
56
- return;
57
- }
58
- if (func == SMO_EVENT_TYPE.setDatasource) {
59
- selft.setDatasource(e.data.objData);
60
- return;
61
- }
62
- if (func == SMO_EVENT_TYPE.getVariable) {
63
- selft.getVariable(e.data.objData);
64
- return;
65
- }
66
- if (func == SMO_EVENT_TYPE.setCurrentStream) {
67
- selft.setCurrentStream(e.data.objData);
68
- return;
69
- }
70
- if (func == SMO_EVENT_TYPE.infoCurrentLocation) {
71
- selft.infoCurrentLocation(e.data.objData);
72
- return;
73
- }
74
- if (func == SMO_EVENT_TYPE.setSalidaData) {
75
- selft.setSalidaData(e.data.objData);
76
- return;
77
- }
78
- if (func == SMO_EVENT_TYPE.updatefromsalida) {
79
- selft.updatefromsalida(e.data.objdata);
80
- return;
81
- }
82
- if (func == SMO_EVENT_TYPE.getRecursos) {
83
- selft.getRecursos(e.data.objData);
84
- }
85
- if (func == SMO_EVENT_TYPE.getRecursosDefault) {
86
- selft.getRecursosDefault(e.data.objData);
87
- }
88
- if (func == SMO_EVENT_TYPE.getRecursosRelleno) {
89
- selft.getRecursosRelleno(e.data.objData);
90
- return;
91
- }
92
- if (func == SMO_EVENT_TYPE.getVariableStorage) {
93
- selft.getVariableStorage(e.data.objData);
94
- return;
95
- }
96
- console.warn("message not implemented!!" + func);
97
- }
98
- };
99
- };
100
- SMO.prototype.start = function () {
101
- this.events.start.next({});
102
- };
103
- SMO.prototype.setDatasource = function (datasource) {
104
- this.events.setDatasource.next(datasource);
105
- this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
106
- };
107
- SMO.prototype.getVariable = function (variable) {
108
- this.events.getVariable.next(variable);
109
- };
110
- SMO.prototype.setCurrentStream = function (stream) {
111
- this.events.setCurrentStream.next(stream);
112
- };
113
- SMO.prototype.infoCurrentLocation = function (location) {
114
- this.events.infoCurrentLocation.next(location);
115
- };
116
- SMO.prototype.setSalidaData = function (data) {
117
- this.events.setSalidaData.next(data);
118
- };
119
- SMO.prototype.updatefromsalida = function (data) {
120
- this.events.updatefromsalida.next(data);
121
- };
122
- SMO.prototype.getRecursos = function (data) {
123
- this.events.getRecursos.next(data);
124
- };
125
- SMO.prototype.getRecursosDefault = function (data) {
126
- this.events.getRecursosDefault.next(data);
127
- };
128
- SMO.prototype.getRecursosRelleno = function (data) {
129
- this.events.getRecursosRelleno.next(data);
130
- };
131
- SMO.prototype.getVariableStorage = function (variable) {
132
- this.events.getVariableStorage.next(variable);
133
- };
134
- return SMO;
135
- }());
136
- exports.SMO = SMO;
137
- var SmoEvents = /** @class */ (function () {
138
- function SmoEvents(smo) {
139
- this.start = new rxjs_1.Subject();
140
- this.setDatasource = new rxjs_1.Subject();
141
- this.setDatasourceJson = new rxjs_1.Subject();
142
- this.getVariable = new rxjs_1.Subject();
143
- this.setCurrentStream = new rxjs_1.Subject();
144
- this.infoCurrentLocation = new rxjs_1.Subject();
145
- this.setSalidaData = new rxjs_1.Subject();
146
- this.updatefromsalida = new rxjs_1.Subject();
147
- this.getRecursos = new rxjs_1.Subject();
148
- this.getRecursosDefault = new rxjs_1.Subject();
149
- this.getRecursosRelleno = new rxjs_1.Subject();
150
- this.getVariableStorage = new rxjs_1.Subject();
151
- }
152
- return SmoEvents;
153
- }());
154
- var smoCallBacks = /** @class */ (function () {
155
- function smoCallBacks(_smo) {
156
- this.smo = _smo;
157
- }
158
- smoCallBacks.prototype.onSmoLoad = function () {
159
- window.parent.postMessage({
160
- target: "Dnv.smoCallbacks.onSmoLoad",
161
- objData: undefined,
162
- idSmo: this.smo.id
163
- }, "*");
164
- };
165
- smoCallBacks.prototype.onSmoReady = function () {
166
- window.parent.postMessage({
167
- target: "Dnv.smoCallbacks.onSmoReady",
168
- objData: undefined,
169
- idSmo: this.smo.id
170
- }, "*");
171
- };
172
- smoCallBacks.prototype.smoLog = function (msn, level) {
173
- if (level == undefined) {
174
- level = LogLevel.Info;
175
- }
176
- //level = Dnv.LogLevel.Debug...
177
- if (level == LogLevel.Debug) {
178
- console.debug(msn);
179
- }
180
- if (level == LogLevel.Info) {
181
- console.log(msn);
182
- }
183
- if (level == LogLevel.Warning) {
184
- console.warn(msn);
185
- }
186
- if (level == LogLevel.Error) {
187
- console.error(msn);
188
- }
189
- if (window.parent != window) {
190
- window.parent.postMessage({
191
- target: "Dnv.smoCallbacks.smoLog",
192
- objData: {
193
- level: level,
194
- txt: msn
195
- },
196
- idSmo: this.smo.id
197
- }, "*");
198
- }
199
- };
200
- smoCallBacks.prototype.smoAlarma = function (msn, level) {
201
- window.parent.postMessage({
202
- target: "Dnv.smoCallbacks.smoAlarma",
203
- objData: {
204
- level: level,
205
- txt: msn
206
- },
207
- idSmo: this.smo.id
208
- }, "*");
209
- };
210
- smoCallBacks.prototype.smoLogStash = function (msn) {
211
- window.parent.postMessage({
212
- target: "Dnv.smoCallbacks.smoLogStash",
213
- objData: {
214
- txt: msn
215
- },
216
- idSmo: this.smo.id
217
- }, "*");
218
- };
219
- smoCallBacks.prototype.smoLogNowShowing = function (msn) {
220
- window.parent.postMessage({
221
- target: "Dnv.smoCallbacks.smoNowShowing",
222
- objData: msn,
223
- idSmo: this.smo.id
224
- }, "*");
225
- };
226
- smoCallBacks.prototype.reiniciarDispositivo = function (msn) {
227
- //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
228
- window.parent.postMessage({
229
- target: "Dnv.smoCallbacks.reiniciarDispositivo",
230
- objData: {
231
- txt: msn // Razón del reinicio
232
- },
233
- idSmo: this.smo.id
234
- }, "*");
235
- };
236
- smoCallBacks.prototype.urlNext = function () {
237
- //Permite avanzar plantilla. Solo si Reloj Maestro activado.
238
- window.parent.postMessage({
239
- target: "Dnv.smoCallbacks.urlNext",
240
- objData: undefined,
241
- idSmo: this.smo.id
242
- }, "*");
243
- };
244
- smoCallBacks.prototype.exitInteractivity = function () {
245
- //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
246
- window.parent.postMessage({
247
- target: "Dnv.smoCallbacks.exitInteractivity",
248
- objData: undefined,
249
- idSmo: this.smo.id
250
- }, "*");
251
- };
252
- smoCallBacks.prototype.showBrowser = function () {
253
- /* DEPRECATED NOT IMPLEMENTED */
254
- };
255
- smoCallBacks.prototype.closeBrowser = function () {
256
- /* DEPRECATED NOT IMPLEMENTED */
257
- };
258
- smoCallBacks.prototype.urlNextDirectamente = function () {
259
- /* NOT IMPLEMENTED */
260
- };
261
- smoCallBacks.prototype.setVariable = function (variable, valor) {
262
- window.parent.postMessage({
263
- target: "Dnv.smoCallbacks.setVariable",
264
- objData: {
265
- variable: variable,
266
- valor: valor
267
- },
268
- idSmo: this.smo.id
269
- }, "*");
270
- };
271
- smoCallBacks.prototype.getVariable = function (variable) {
272
- window.parent.postMessage({
273
- target: "Dnv.smoCallbacks.getVariable",
274
- objData: {
275
- variable: variable
276
- },
277
- idSmo: this.smo.id
278
- }, "*");
279
- /* MIRAR SMO.getVariable */
280
- };
281
- smoCallBacks.prototype.getFile = function (file) {
282
- parent.postMessage({
283
- target: "Dnv.smoCallbacks.getFile",
284
- objData: file,
285
- idSmo: this.smo.id
286
- }, "*");
287
- };
288
- smoCallBacks.prototype.setLocalData = function (variable, valor) {
289
- parent.postMessage({
290
- target: "Dnv.smoCallbacks.setLocalData",
291
- objData: {
292
- nameData: variable,
293
- data: valor
294
- },
295
- idSmo: this.smo.id
296
- }, "*");
297
- };
298
- smoCallBacks.prototype.getLocalData = function (variable) {
299
- parent.postMessage({
300
- target: "Dnv.smoCallbacks.getLocalData",
301
- objData: variable,
302
- idSmo: this.smo.id
303
- }, "*");
304
- /* MIRAR SMO.setDatasource */
305
- };
306
- smoCallBacks.prototype.getCurrentStream = function () {
307
- parent.postMessage({
308
- target: "Dnv.smoCallbacks.getCurrentStream",
309
- objData: undefined,
310
- idSmo: this.smo.id
311
- }, "*");
312
- /* MIRAR SMO.setCurrentStream' */
313
- };
314
- smoCallBacks.prototype.finAviso = function (id) {
315
- parent.postMessage({
316
- target: "Dnv.smoCallbacks.finAviso",
317
- objData: id,
318
- idSmo: this.smo.id
319
- }, "*");
320
- };
321
- smoCallBacks.prototype.refreshDatasource = function (codigo) {
322
- parent.postMessage({
323
- target: "Dnv.smoCallbacks.refreshDatasource",
324
- objData: codigo,
325
- idSmo: this.smo.id
326
- }, "*");
327
- };
328
- smoCallBacks.prototype.getLocation = function () {
329
- parent.postMessage({
330
- target: "Dnv.smoCallbacks.getLocation",
331
- objData: undefined,
332
- idSmo: this.smo.id
333
- }, "*");
334
- /* MIRAR SMO.infoCurrentLocation */
335
- };
336
- smoCallBacks.prototype.getSalidaData = function (data) {
337
- parent.postMessage({
338
- target: "Dnv.smoCallbacks.getSalidaData",
339
- objData: data,
340
- idSmo: this.smo.id
341
- }, "*");
342
- /* MIRAR SMO.setSalidaData */
343
- };
344
- smoCallBacks.prototype.ejecutaFuncion = function (data) {
345
- /*data ={
346
- funcion: "", // Nombre de la función que se debe ejecutar
347
- params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
348
- } */
349
- parent.postMessage({
350
- target: "Dnv.smoCallbacks.ejecutaFuncion",
351
- objData: data,
352
- idSmo: this.smo.id
353
- }, "*");
354
- };
355
- smoCallBacks.prototype.addObserver = function (data) {
356
- /*data ="fruta"
357
- */
358
- parent.postMessage({
359
- target: "Dnv.smoCallbacks.addObserver",
360
- objData: data,
361
- idSmo: this.smo.id
362
- }, "*");
363
- };
364
- smoCallBacks.prototype.notify = function (data) {
365
- /*data ={
366
- destino: "fruta",
367
- value: "{'fruta':'manzana', 'color':'roja'}"
368
- } */
369
- parent.postMessage({
370
- target: "Dnv.smoCallbacks.notify",
371
- objData: data,
372
- idSmo: this.smo.id
373
- }, "*");
374
- };
375
- smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
376
- parent.postMessage({
377
- target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
378
- objData: { triggerCanal: trigger },
379
- idSmo: this.smo.id
380
- }, "*");
381
- };
382
- smoCallBacks.prototype.stopPlayOnceChannelByTrigger = function () {
383
- parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, "*");
384
- };
385
- smoCallBacks.prototype.playOnceChannel = function (codigoCanal) {
386
- parent.postMessage({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, "*");
387
- };
388
- smoCallBacks.prototype.stopPlayChannel = function () {
389
- parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, "*");
390
- };
391
- smoCallBacks.prototype.editWrapperStyle = function (obj) {
392
- /*{"posX": "0px","posY": "0px","alto": "0px","ancho": "0px","overflow": "hidden","scale": 0.1,"zindex": 0.1,"opacidad": 0.1,"isMaestro": true,duracionTransition: "1s", transitionTiming: "lineal", css: string} */
393
- parent.postMessage({
394
- target: "Dnv.smoCallbacks.editWrapperStyle",
395
- objData: obj,
396
- idSmo: this.smo.id
397
- }, "*");
398
- };
399
- smoCallBacks.prototype.getRecursos = function () {
400
- parent.postMessage({
401
- target: "Dnv.smoCallbacks.getRecursos",
402
- idSmo: this.smo.id
403
- }, "*");
404
- };
405
- smoCallBacks.prototype.getRecursosDefault = function () {
406
- parent.postMessage({
407
- target: "Dnv.smoCallbacks.getRecursosDefault",
408
- idSmo: this.smo.id
409
- }, "*");
410
- };
411
- smoCallBacks.prototype.getRecursosRelleno = function () {
412
- parent.postMessage({
413
- target: "Dnv.smoCallbacks.getRecursosRelleno",
414
- idSmo: this.smo.id
415
- }, "*");
416
- };
417
- smoCallBacks.prototype.setVariableStorage = function (variable, valor) {
418
- window.parent.postMessage({
419
- target: "Dnv.smoCallbacks.setVariableStorage",
420
- objData: {
421
- variable: variable,
422
- valor: valor
423
- },
424
- idSmo: this.smo.id
425
- }, "*");
426
- };
427
- smoCallBacks.prototype.getVariableStorage = function (variable) {
428
- window.parent.postMessage({
429
- target: "Dnv.smoCallbacks.getVariableStorage",
430
- objData: {
431
- variable: variable
432
- },
433
- idSmo: this.smo.id
434
- }, "*");
435
- /* MIRAR SMO.getVariable */
436
- };
437
- return smoCallBacks;
438
- }());
439
- var Utils = /** @class */ (function () {
440
- function Utils(_smo, _smoCallBacks) {
441
- this.smo = _smo;
442
- this.smoCallBacks = _smoCallBacks;
443
- }
444
- // Funciones para XML to JSON
445
- Utils.prototype.xmlToJSON = function (xml) {
446
- var getxml = new DOMParser();
447
- var xmlDoc = getxml.parseFromString(xml, "text/xml");
448
- // gets the JSON string
449
- var json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
450
- // sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
451
- return json_str;
452
- };
453
- Utils.prototype.jsonToStr = function (js_obj) {
454
- var rejsn = JSON.stringify(js_obj, undefined, 2).replace(/(\\t|\\r|\\n)/g, '').replace(/"",[\n\t\r\s]+""[,]*/g, '').replace(/(\n[\t\s\r]*\n)/g, '').replace(/[\s\t]{2,}""[,]{0,1}/g, '').replace(/"[\s\t]{1,}"[,]{0,1}/g, '').replace(/\[[\t\s]*\]/g, '""');
455
- return (rejsn.indexOf('"parsererror": {') == -1) ? rejsn : 'Invalid XML format';
456
- };
457
- Utils.prototype.setJsonObj = function (xml) {
458
- var js_obj = {};
459
- if (xml.nodeType == 1) { // Element
460
- if (xml.attributes.length > 0) {
461
- js_obj["@attributes"] = {};
462
- for (var j = 0; j < xml.attributes.length; j++) {
463
- var attribute = xml.attributes.item(j);
464
- js_obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
465
- }
466
- }
467
- }
468
- else if (xml.nodeType == 3) { // Text
469
- js_obj = xml.nodeValue;
470
- }
471
- else if (xml.nodeType == 4) { // CDATA
472
- js_obj = xml.nodeValue;
473
- }
474
- if (xml.hasChildNodes()) {
475
- for (var i = 0; i < xml.childNodes.length; i++) {
476
- var item = xml.childNodes.item(i);
477
- var nodeName = item.nodeName;
478
- if (typeof (js_obj[nodeName]) == "undefined") {
479
- js_obj[nodeName] = this.setJsonObj(item);
480
- }
481
- else {
482
- if (typeof (js_obj[nodeName].push) == "undefined") {
483
- var old = js_obj[nodeName];
484
- js_obj[nodeName] = [];
485
- js_obj[nodeName].push(old);
486
- }
487
- js_obj[nodeName].push(this.setJsonObj(item));
488
- }
489
- }
490
- }
491
- return js_obj;
492
- };
493
- Utils.prototype.dataToJSON = function (data) {
494
- try {
495
- var parser = new DOMParser();
496
- var xmlDoc = parser.parseFromString(data.xml, "text/xml");
497
- var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
498
- dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
499
- return JSON.parse(dataForJSON);
500
- }
501
- catch (error) {
502
- return {};
503
- }
504
- };
505
- return Utils;
506
- }());
507
- var SMO_EVENT_TYPE;
508
- (function (SMO_EVENT_TYPE) {
509
- SMO_EVENT_TYPE["start"] = "start";
510
- SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
511
- SMO_EVENT_TYPE["getVariable"] = "getVariable";
512
- SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
513
- SMO_EVENT_TYPE["infoCurrentLocation"] = "infoCurrentLocation";
514
- SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
515
- SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
516
- SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
517
- SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
518
- SMO_EVENT_TYPE["getRecursosDefault"] = "getRecursosDefault";
519
- SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
520
- SMO_EVENT_TYPE["getVariableStorage"] = "getVariableStorage";
521
- })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
522
- var LogLevel;
523
- (function (LogLevel) {
524
- LogLevel[LogLevel["Debug"] = 0] = "Debug";
525
- LogLevel[LogLevel["Info"] = 1] = "Info";
526
- LogLevel[LogLevel["Warning"] = 2] = "Warning";
527
- LogLevel[LogLevel["Error"] = 3] = "Error";
528
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
529
- var AlarmaLevel;
530
- (function (AlarmaLevel) {
531
- AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
532
- AlarmaLevel[AlarmaLevel["Ok"] = 1] = "Ok";
533
- AlarmaLevel[AlarmaLevel["Scanning"] = 2] = "Scanning";
534
- AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
535
- AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
536
- AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
537
- })(AlarmaLevel = exports.AlarmaLevel || (exports.AlarmaLevel = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AlarmaLevel = exports.LogLevel = exports.SMO_EVENT_TYPE = exports.SMO = void 0;
4
+ var rxjs_1 = require("rxjs");
5
+ var SMO = /** @class */ (function () {
6
+ function SMO() {
7
+ this.vars = {};
8
+ this.id = "";
9
+ this.intervalDataSource$ = (0, rxjs_1.interval)(5 * 60 * 1000);
10
+ this.initOnMessage();
11
+ this.smoCallBacks = new smoCallBacks(this);
12
+ this.utils = new Utils(this, this.smoCallBacks);
13
+ this.events = new SmoEvents(this);
14
+ this.init();
15
+ }
16
+ SMO.prototype.init = function () {
17
+ var _this = this;
18
+ var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
19
+ return decodeURIComponent(s.replace(pl, " "));
20
+ }, query = window.location.search.substring(1);
21
+ while (match = search.exec(query)) {
22
+ this.vars[decode(match[1])] = decode(match[2]);
23
+ }
24
+ if (this.vars.idSmo) {
25
+ this.id = this.vars.idSmo;
26
+ if (this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)) {
27
+ this.smoCallBacks.onSmoLoad();
28
+ return;
29
+ }
30
+ if (this.vars["url"] != undefined) {
31
+ this.smoCallBacks.getFile(this.vars["url"]);
32
+ this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
33
+ _this.smoCallBacks.getFile(_this.vars["url"]);
34
+ });
35
+ return;
36
+ }
37
+ if (this.vars["LocalData"] != undefined) {
38
+ this.smoCallBacks.getLocalData(this.vars["LocalData"]);
39
+ this.intervalsubscriptionDataSource = this.intervalDataSource$.subscribe(function () {
40
+ _this.smoCallBacks.getLocalData(_this.vars["LocalData"]);
41
+ });
42
+ return;
43
+ }
44
+ return;
45
+ }
46
+ console.warn("No idSmo found in URL");
47
+ };
48
+ SMO.prototype.initOnMessage = function () {
49
+ var selft = this;
50
+ window.onmessage = function (e) {
51
+ if (e.data.target) {
52
+ var targets = e.data.target.split('.');
53
+ var func = targets[targets.length - 1];
54
+ if (func == SMO_EVENT_TYPE.start) {
55
+ selft.start();
56
+ return;
57
+ }
58
+ if (func == SMO_EVENT_TYPE.setDatasource) {
59
+ selft.setDatasource(e.data.objData);
60
+ return;
61
+ }
62
+ if (func == SMO_EVENT_TYPE.getVariable) {
63
+ selft.getVariable(e.data.objData);
64
+ return;
65
+ }
66
+ if (func == SMO_EVENT_TYPE.setCurrentStream) {
67
+ selft.setCurrentStream(e.data.objData);
68
+ return;
69
+ }
70
+ if (func == SMO_EVENT_TYPE.infoCurrentLocation) {
71
+ selft.infoCurrentLocation(e.data.objData);
72
+ return;
73
+ }
74
+ if (func == SMO_EVENT_TYPE.setSalidaData) {
75
+ selft.setSalidaData(e.data.objData);
76
+ return;
77
+ }
78
+ if (func == SMO_EVENT_TYPE.updatefromsalida) {
79
+ selft.updatefromsalida(e.data.objdata);
80
+ return;
81
+ }
82
+ if (func == SMO_EVENT_TYPE.getRecursos) {
83
+ selft.getRecursos(e.data.objData);
84
+ }
85
+ if (func == SMO_EVENT_TYPE.getRecursosDefault) {
86
+ selft.getRecursosDefault(e.data.objData);
87
+ }
88
+ if (func == SMO_EVENT_TYPE.getRecursosRelleno) {
89
+ selft.getRecursosRelleno(e.data.objData);
90
+ return;
91
+ }
92
+ if (func == SMO_EVENT_TYPE.getVariableStorage) {
93
+ selft.getVariableStorage(e.data.objData);
94
+ return;
95
+ }
96
+ if (func == SMO_EVENT_TYPE.checkHealth) {
97
+ selft.checkHealth(e.data.objData);
98
+ return;
99
+ }
100
+ console.warn("message not implemented!!" + func);
101
+ }
102
+ };
103
+ };
104
+ SMO.prototype.start = function () {
105
+ this.events.start.next({});
106
+ };
107
+ SMO.prototype.setDatasource = function (datasource) {
108
+ this.events.setDatasource.next(datasource);
109
+ this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
110
+ };
111
+ SMO.prototype.getVariable = function (variable) {
112
+ this.events.getVariable.next(variable);
113
+ };
114
+ SMO.prototype.setCurrentStream = function (stream) {
115
+ this.events.setCurrentStream.next(stream);
116
+ };
117
+ SMO.prototype.infoCurrentLocation = function (location) {
118
+ this.events.infoCurrentLocation.next(location);
119
+ };
120
+ SMO.prototype.setSalidaData = function (data) {
121
+ this.events.setSalidaData.next(data);
122
+ };
123
+ SMO.prototype.updatefromsalida = function (data) {
124
+ this.events.updatefromsalida.next(data);
125
+ };
126
+ SMO.prototype.getRecursos = function (data) {
127
+ this.events.getRecursos.next(data);
128
+ };
129
+ SMO.prototype.getRecursosDefault = function (data) {
130
+ this.events.getRecursosDefault.next(data);
131
+ };
132
+ SMO.prototype.getRecursosRelleno = function (data) {
133
+ this.events.getRecursosRelleno.next(data);
134
+ };
135
+ SMO.prototype.getVariableStorage = function (variable) {
136
+ this.events.getVariableStorage.next(variable);
137
+ };
138
+ SMO.prototype.checkHealth = function (variable) {
139
+ this.events.checkHealth.next(variable);
140
+ };
141
+ return SMO;
142
+ }());
143
+ exports.SMO = SMO;
144
+ var SmoEvents = /** @class */ (function () {
145
+ function SmoEvents(smo) {
146
+ this.start = new rxjs_1.Subject();
147
+ this.setDatasource = new rxjs_1.Subject();
148
+ this.setDatasourceJson = new rxjs_1.Subject();
149
+ this.getVariable = new rxjs_1.Subject();
150
+ this.setCurrentStream = new rxjs_1.Subject();
151
+ this.infoCurrentLocation = new rxjs_1.Subject();
152
+ this.setSalidaData = new rxjs_1.Subject();
153
+ this.updatefromsalida = new rxjs_1.Subject();
154
+ this.getRecursos = new rxjs_1.Subject();
155
+ this.getRecursosDefault = new rxjs_1.Subject();
156
+ this.getRecursosRelleno = new rxjs_1.Subject();
157
+ this.getVariableStorage = new rxjs_1.Subject();
158
+ this.checkHealth = new rxjs_1.Subject();
159
+ }
160
+ return SmoEvents;
161
+ }());
162
+ var smoCallBacks = /** @class */ (function () {
163
+ function smoCallBacks(_smo) {
164
+ this.smo = _smo;
165
+ }
166
+ smoCallBacks.prototype.onSmoLoad = function () {
167
+ window.parent.postMessage({
168
+ target: "Dnv.smoCallbacks.onSmoLoad",
169
+ objData: undefined,
170
+ idSmo: this.smo.id
171
+ }, "*");
172
+ };
173
+ smoCallBacks.prototype.onSmoReady = function () {
174
+ window.parent.postMessage({
175
+ target: "Dnv.smoCallbacks.onSmoReady",
176
+ objData: undefined,
177
+ idSmo: this.smo.id
178
+ }, "*");
179
+ };
180
+ smoCallBacks.prototype.smoLog = function (msn, level) {
181
+ if (level == undefined) {
182
+ level = LogLevel.Info;
183
+ }
184
+ //level = Dnv.LogLevel.Debug...
185
+ if (level == LogLevel.Debug) {
186
+ console.debug(msn);
187
+ }
188
+ if (level == LogLevel.Info) {
189
+ console.log(msn);
190
+ }
191
+ if (level == LogLevel.Warning) {
192
+ console.warn(msn);
193
+ }
194
+ if (level == LogLevel.Error) {
195
+ console.error(msn);
196
+ }
197
+ if (window.parent != window) {
198
+ window.parent.postMessage({
199
+ target: "Dnv.smoCallbacks.smoLog",
200
+ objData: {
201
+ level: level,
202
+ txt: msn
203
+ },
204
+ idSmo: this.smo.id
205
+ }, "*");
206
+ }
207
+ };
208
+ smoCallBacks.prototype.smoAlarma = function (msn, level) {
209
+ window.parent.postMessage({
210
+ target: "Dnv.smoCallbacks.smoAlarma",
211
+ objData: {
212
+ level: level,
213
+ txt: msn
214
+ },
215
+ idSmo: this.smo.id
216
+ }, "*");
217
+ };
218
+ smoCallBacks.prototype.smoLogStash = function (msn) {
219
+ window.parent.postMessage({
220
+ target: "Dnv.smoCallbacks.smoLogStash",
221
+ objData: {
222
+ txt: msn
223
+ },
224
+ idSmo: this.smo.id
225
+ }, "*");
226
+ };
227
+ smoCallBacks.prototype.smoLogNowShowing = function (msn) {
228
+ window.parent.postMessage({
229
+ target: "Dnv.smoCallbacks.smoNowShowing",
230
+ objData: msn,
231
+ idSmo: this.smo.id
232
+ }, "*");
233
+ };
234
+ smoCallBacks.prototype.reiniciarDispositivo = function (msn) {
235
+ //Permite reiniciar el player, proporcionando una razón para el reinicio. Solo Player HTML5
236
+ window.parent.postMessage({
237
+ target: "Dnv.smoCallbacks.reiniciarDispositivo",
238
+ objData: {
239
+ txt: msn // Razón del reinicio
240
+ },
241
+ idSmo: this.smo.id
242
+ }, "*");
243
+ };
244
+ smoCallBacks.prototype.urlNext = function () {
245
+ //Permite avanzar plantilla. Solo si Reloj Maestro activado.
246
+ window.parent.postMessage({
247
+ target: "Dnv.smoCallbacks.urlNext",
248
+ objData: undefined,
249
+ idSmo: this.smo.id
250
+ }, "*");
251
+ };
252
+ smoCallBacks.prototype.exitInteractivity = function () {
253
+ //Para canales interactivos, vuelve al canal de reposo. Solo Android y Player PC.
254
+ window.parent.postMessage({
255
+ target: "Dnv.smoCallbacks.exitInteractivity",
256
+ objData: undefined,
257
+ idSmo: this.smo.id
258
+ }, "*");
259
+ };
260
+ smoCallBacks.prototype.showBrowser = function () {
261
+ /* DEPRECATED NOT IMPLEMENTED */
262
+ };
263
+ smoCallBacks.prototype.closeBrowser = function () {
264
+ /* DEPRECATED NOT IMPLEMENTED */
265
+ };
266
+ smoCallBacks.prototype.urlNextDirectamente = function () {
267
+ /* NOT IMPLEMENTED */
268
+ };
269
+ smoCallBacks.prototype.setVariable = function (variable, valor) {
270
+ window.parent.postMessage({
271
+ target: "Dnv.smoCallbacks.setVariable",
272
+ objData: {
273
+ variable: variable,
274
+ valor: valor
275
+ },
276
+ idSmo: this.smo.id
277
+ }, "*");
278
+ };
279
+ smoCallBacks.prototype.getVariable = function (variable) {
280
+ window.parent.postMessage({
281
+ target: "Dnv.smoCallbacks.getVariable",
282
+ objData: {
283
+ variable: variable
284
+ },
285
+ idSmo: this.smo.id
286
+ }, "*");
287
+ /* MIRAR SMO.getVariable */
288
+ };
289
+ smoCallBacks.prototype.getFile = function (file) {
290
+ parent.postMessage({
291
+ target: "Dnv.smoCallbacks.getFile",
292
+ objData: file,
293
+ idSmo: this.smo.id
294
+ }, "*");
295
+ };
296
+ smoCallBacks.prototype.setLocalData = function (variable, valor) {
297
+ parent.postMessage({
298
+ target: "Dnv.smoCallbacks.setLocalData",
299
+ objData: {
300
+ nameData: variable,
301
+ data: valor
302
+ },
303
+ idSmo: this.smo.id
304
+ }, "*");
305
+ };
306
+ smoCallBacks.prototype.getLocalData = function (variable) {
307
+ parent.postMessage({
308
+ target: "Dnv.smoCallbacks.getLocalData",
309
+ objData: variable,
310
+ idSmo: this.smo.id
311
+ }, "*");
312
+ /* MIRAR SMO.setDatasource */
313
+ };
314
+ smoCallBacks.prototype.getCurrentStream = function () {
315
+ parent.postMessage({
316
+ target: "Dnv.smoCallbacks.getCurrentStream",
317
+ objData: undefined,
318
+ idSmo: this.smo.id
319
+ }, "*");
320
+ /* MIRAR SMO.setCurrentStream' */
321
+ };
322
+ smoCallBacks.prototype.finAviso = function (id) {
323
+ parent.postMessage({
324
+ target: "Dnv.smoCallbacks.finAviso",
325
+ objData: id,
326
+ idSmo: this.smo.id
327
+ }, "*");
328
+ };
329
+ smoCallBacks.prototype.refreshDatasource = function (codigo) {
330
+ parent.postMessage({
331
+ target: "Dnv.smoCallbacks.refreshDatasource",
332
+ objData: codigo,
333
+ idSmo: this.smo.id
334
+ }, "*");
335
+ };
336
+ smoCallBacks.prototype.getLocation = function () {
337
+ parent.postMessage({
338
+ target: "Dnv.smoCallbacks.getLocation",
339
+ objData: undefined,
340
+ idSmo: this.smo.id
341
+ }, "*");
342
+ /* MIRAR SMO.infoCurrentLocation */
343
+ };
344
+ smoCallBacks.prototype.getSalidaData = function (data) {
345
+ parent.postMessage({
346
+ target: "Dnv.smoCallbacks.getSalidaData",
347
+ objData: data,
348
+ idSmo: this.smo.id
349
+ }, "*");
350
+ /* MIRAR SMO.setSalidaData */
351
+ };
352
+ smoCallBacks.prototype.ejecutaFuncion = function (data) {
353
+ /*data ={
354
+ funcion: "", // Nombre de la función que se debe ejecutar
355
+ params: "" // Parámetros que debemos enviarle a la funcion. sin separadores ni nada, un string y se usa como tal. Solo esta implementada en un caso y se usa como tal sin parsear ni nada
356
+ } */
357
+ parent.postMessage({
358
+ target: "Dnv.smoCallbacks.ejecutaFuncion",
359
+ objData: data,
360
+ idSmo: this.smo.id
361
+ }, "*");
362
+ };
363
+ smoCallBacks.prototype.addObserver = function (data) {
364
+ /*data ="fruta"
365
+ */
366
+ parent.postMessage({
367
+ target: "Dnv.smoCallbacks.addObserver",
368
+ objData: data,
369
+ idSmo: this.smo.id
370
+ }, "*");
371
+ };
372
+ smoCallBacks.prototype.notify = function (data) {
373
+ /*data ={
374
+ destino: "fruta",
375
+ value: "{'fruta':'manzana', 'color':'roja'}"
376
+ } */
377
+ parent.postMessage({
378
+ target: "Dnv.smoCallbacks.notify",
379
+ objData: data,
380
+ idSmo: this.smo.id
381
+ }, "*");
382
+ };
383
+ smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
384
+ parent.postMessage({
385
+ target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
386
+ objData: { triggerCanal: trigger },
387
+ idSmo: this.smo.id
388
+ }, "*");
389
+ };
390
+ smoCallBacks.prototype.stopPlayOnceChannelByTrigger = function () {
391
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannelByTrigger", objData: {}, idSmo: this.smo.id }, "*");
392
+ };
393
+ smoCallBacks.prototype.playOnceChannel = function (codigoCanal) {
394
+ parent.postMessage({ target: "Dnv.smoCallbacks.playOnceChannel", objData: { codigoCanal: codigoCanal, params: "PLAYONCE_CHANNEL|" + codigoCanal }, idSmo: this.smo.id }, "*");
395
+ };
396
+ smoCallBacks.prototype.stopPlayChannel = function () {
397
+ parent.postMessage({ target: "Dnv.smoCallbacks.stopPlayOnceChannel", objData: {}, idSmo: this.smo.id }, "*");
398
+ };
399
+ smoCallBacks.prototype.editWrapperStyle = function (obj) {
400
+ /*{"posX": "0px","posY": "0px","alto": "0px","ancho": "0px","overflow": "hidden","scale": 0.1,"zindex": 0.1,"opacidad": 0.1,"isMaestro": true,duracionTransition: "1s", transitionTiming: "lineal", css: string} */
401
+ parent.postMessage({
402
+ target: "Dnv.smoCallbacks.editWrapperStyle",
403
+ objData: obj,
404
+ idSmo: this.smo.id
405
+ }, "*");
406
+ };
407
+ smoCallBacks.prototype.getRecursos = function () {
408
+ parent.postMessage({
409
+ target: "Dnv.smoCallbacks.getRecursos",
410
+ idSmo: this.smo.id
411
+ }, "*");
412
+ };
413
+ smoCallBacks.prototype.getRecursosDefault = function () {
414
+ parent.postMessage({
415
+ target: "Dnv.smoCallbacks.getRecursosDefault",
416
+ idSmo: this.smo.id
417
+ }, "*");
418
+ };
419
+ smoCallBacks.prototype.getRecursosRelleno = function () {
420
+ parent.postMessage({
421
+ target: "Dnv.smoCallbacks.getRecursosRelleno",
422
+ idSmo: this.smo.id
423
+ }, "*");
424
+ };
425
+ smoCallBacks.prototype.setVariableStorage = function (variable, valor) {
426
+ window.parent.postMessage({
427
+ target: "Dnv.smoCallbacks.setVariableStorage",
428
+ objData: {
429
+ variable: variable,
430
+ valor: valor
431
+ },
432
+ idSmo: this.smo.id
433
+ }, "*");
434
+ };
435
+ smoCallBacks.prototype.getVariableStorage = function (variable) {
436
+ window.parent.postMessage({
437
+ target: "Dnv.smoCallbacks.getVariableStorage",
438
+ objData: {
439
+ variable: variable
440
+ },
441
+ idSmo: this.smo.id
442
+ }, "*");
443
+ /* MIRAR SMO.getVariable */
444
+ };
445
+ smoCallBacks.prototype.printTextLine = function (txt) {
446
+ window.parent.postMessage({
447
+ target: "Dnv.smoCallbacks.printTextLine",
448
+ objData: {
449
+ txt: txt
450
+ },
451
+ idSmo: this.smo.id
452
+ }, "*");
453
+ };
454
+ smoCallBacks.prototype.printBarcode = function (code, width, height) {
455
+ window.parent.postMessage({
456
+ target: "Dnv.smoCallbacks.printBarcode",
457
+ objData: {
458
+ code: code,
459
+ width: width,
460
+ height: height
461
+ },
462
+ idSmo: this.smo.id
463
+ }, "*");
464
+ };
465
+ smoCallBacks.prototype.cutPaper = function (percent) {
466
+ window.parent.postMessage({
467
+ target: "Dnv.smoCallbacks.cutPaper",
468
+ objData: {
469
+ percent: percent
470
+ },
471
+ idSmo: this.smo.id
472
+ }, "*");
473
+ };
474
+ smoCallBacks.prototype.checkHealth = function () {
475
+ window.parent.postMessage({
476
+ target: "Dnv.smoCallbacks.checkHealth",
477
+ idSmo: this.smo.id
478
+ }, "*");
479
+ };
480
+ return smoCallBacks;
481
+ }());
482
+ var Utils = /** @class */ (function () {
483
+ function Utils(_smo, _smoCallBacks) {
484
+ this.smo = _smo;
485
+ this.smoCallBacks = _smoCallBacks;
486
+ }
487
+ // Funciones para XML to JSON
488
+ Utils.prototype.xmlToJSON = function (xml) {
489
+ var getxml = new DOMParser();
490
+ var xmlDoc = getxml.parseFromString(xml, "text/xml");
491
+ // gets the JSON string
492
+ var json_str = this.jsonToStr(this.setJsonObj(xmlDoc));
493
+ // sets and returns the JSON object, if "rstr" undefined (not passed), else, returns JSON string
494
+ return json_str;
495
+ };
496
+ Utils.prototype.jsonToStr = function (js_obj) {
497
+ var rejsn = JSON.stringify(js_obj, undefined, 2).replace(/(\\t|\\r|\\n)/g, '').replace(/"",[\n\t\r\s]+""[,]*/g, '').replace(/(\n[\t\s\r]*\n)/g, '').replace(/[\s\t]{2,}""[,]{0,1}/g, '').replace(/"[\s\t]{1,}"[,]{0,1}/g, '').replace(/\[[\t\s]*\]/g, '""');
498
+ return (rejsn.indexOf('"parsererror": {') == -1) ? rejsn : 'Invalid XML format';
499
+ };
500
+ Utils.prototype.setJsonObj = function (xml) {
501
+ var js_obj = {};
502
+ if (xml.nodeType == 1) { // Element
503
+ if (xml.attributes.length > 0) {
504
+ js_obj["@attributes"] = {};
505
+ for (var j = 0; j < xml.attributes.length; j++) {
506
+ var attribute = xml.attributes.item(j);
507
+ js_obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
508
+ }
509
+ }
510
+ }
511
+ else if (xml.nodeType == 3) { // Text
512
+ js_obj = xml.nodeValue;
513
+ }
514
+ else if (xml.nodeType == 4) { // CDATA
515
+ js_obj = xml.nodeValue;
516
+ }
517
+ if (xml.hasChildNodes()) {
518
+ for (var i = 0; i < xml.childNodes.length; i++) {
519
+ var item = xml.childNodes.item(i);
520
+ var nodeName = item.nodeName;
521
+ if (typeof (js_obj[nodeName]) == "undefined") {
522
+ js_obj[nodeName] = this.setJsonObj(item);
523
+ }
524
+ else {
525
+ if (typeof (js_obj[nodeName].push) == "undefined") {
526
+ var old = js_obj[nodeName];
527
+ js_obj[nodeName] = [];
528
+ js_obj[nodeName].push(old);
529
+ }
530
+ js_obj[nodeName].push(this.setJsonObj(item));
531
+ }
532
+ }
533
+ }
534
+ return js_obj;
535
+ };
536
+ Utils.prototype.dataToJSON = function (data) {
537
+ try {
538
+ var parser = new DOMParser();
539
+ var xmlDoc = parser.parseFromString(data.xml, "text/xml");
540
+ var dataForJSON = xmlDoc.getElementsByTagName("item")[0].innerHTML;
541
+ dataForJSON = dataForJSON.replace(/{'/g, '{"').replace(/'}/g, '"}').replace(/:'/g, ':"').replace(/':/g, '":').replace(/,'/g, ',"').replace(/',/g, '",').replace(/\['/g, '["').replace(/'\]/g, '"]').replace(/(\r\n|\n|\r)/gm, "");
542
+ return JSON.parse(dataForJSON);
543
+ }
544
+ catch (error) {
545
+ return {};
546
+ }
547
+ };
548
+ return Utils;
549
+ }());
550
+ var SMO_EVENT_TYPE;
551
+ (function (SMO_EVENT_TYPE) {
552
+ SMO_EVENT_TYPE["start"] = "start";
553
+ SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
554
+ SMO_EVENT_TYPE["getVariable"] = "getVariable";
555
+ SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
556
+ SMO_EVENT_TYPE["infoCurrentLocation"] = "infoCurrentLocation";
557
+ SMO_EVENT_TYPE["setSalidaData"] = "setSalidaData";
558
+ SMO_EVENT_TYPE["updatefromsalida"] = "updatefromsalida";
559
+ SMO_EVENT_TYPE["setDatasourceJson"] = "setDatasourceJson";
560
+ SMO_EVENT_TYPE["getRecursos"] = "getRecursos";
561
+ SMO_EVENT_TYPE["getRecursosDefault"] = "getRecursosDefault";
562
+ SMO_EVENT_TYPE["getRecursosRelleno"] = "getRecursosRelleno";
563
+ SMO_EVENT_TYPE["getVariableStorage"] = "getVariableStorage";
564
+ SMO_EVENT_TYPE["checkHealth"] = "checkHealth";
565
+ })(SMO_EVENT_TYPE = exports.SMO_EVENT_TYPE || (exports.SMO_EVENT_TYPE = {}));
566
+ var LogLevel;
567
+ (function (LogLevel) {
568
+ LogLevel[LogLevel["Debug"] = 0] = "Debug";
569
+ LogLevel[LogLevel["Info"] = 1] = "Info";
570
+ LogLevel[LogLevel["Warning"] = 2] = "Warning";
571
+ LogLevel[LogLevel["Error"] = 3] = "Error";
572
+ })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
573
+ var AlarmaLevel;
574
+ (function (AlarmaLevel) {
575
+ AlarmaLevel[AlarmaLevel["Ok_off"] = 0] = "Ok_off";
576
+ AlarmaLevel[AlarmaLevel["Ok"] = 1] = "Ok";
577
+ AlarmaLevel[AlarmaLevel["Scanning"] = 2] = "Scanning";
578
+ AlarmaLevel[AlarmaLevel["Timeout"] = 3] = "Timeout";
579
+ AlarmaLevel[AlarmaLevel["Warning"] = 4] = "Warning";
580
+ AlarmaLevel[AlarmaLevel["Error"] = 5] = "Error";
581
+ })(AlarmaLevel = exports.AlarmaLevel || (exports.AlarmaLevel = {}));