@denevads/dnv-smo 1.0.38 → 1.0.40
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/interfaces/callbacks.d.ts +10 -0
- package/dist/smo.d.ts +7 -4
- package/dist/smo.js +14 -4
- package/package.json +1 -1
- package/src/interfaces/callbacks.ts +12 -2
- package/src/smo.ts +17 -6
|
@@ -3,6 +3,8 @@ export interface setDatasource {
|
|
|
3
3
|
}
|
|
4
4
|
export interface start {
|
|
5
5
|
}
|
|
6
|
+
export interface dispose {
|
|
7
|
+
}
|
|
6
8
|
export interface variable {
|
|
7
9
|
variable: string;
|
|
8
10
|
valor: string;
|
|
@@ -80,3 +82,11 @@ export interface Datasource {
|
|
|
80
82
|
export interface DatasourceMap {
|
|
81
83
|
[codigo: string]: Datasource;
|
|
82
84
|
}
|
|
85
|
+
export interface ValorCalendario {
|
|
86
|
+
codigo: number;
|
|
87
|
+
valor: any;
|
|
88
|
+
tipo: number;
|
|
89
|
+
inicio: string;
|
|
90
|
+
fin: string;
|
|
91
|
+
objIdDispositivo: number;
|
|
92
|
+
}
|
package/dist/smo.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, DatasourceMap } from "./interfaces/callbacks";
|
|
1
|
+
import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, DatasourceMap, ValorCalendario } from "./interfaces/callbacks";
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
export declare class SMO {
|
|
4
4
|
vars: any;
|
|
@@ -12,6 +12,7 @@ export declare class SMO {
|
|
|
12
12
|
init(): void;
|
|
13
13
|
initOnMessage(): void;
|
|
14
14
|
start(): void;
|
|
15
|
+
dispose(): void;
|
|
15
16
|
setDatasource(datasource: setDatasource): void;
|
|
16
17
|
getVariable(variable: variable): void;
|
|
17
18
|
setCurrentStream(stream: string): void;
|
|
@@ -27,11 +28,12 @@ export declare class SMO {
|
|
|
27
28
|
getVariableStorage(variable: variable): void;
|
|
28
29
|
checkHealth(json: string): void;
|
|
29
30
|
checkHealthPrinter(json: string): void;
|
|
30
|
-
getValorCalendario(
|
|
31
|
+
getValorCalendario(data: ValorCalendario | any): void;
|
|
31
32
|
getLocalDatasource(data: DatasourceMap): void;
|
|
32
33
|
}
|
|
33
34
|
declare class SmoEvents {
|
|
34
35
|
start: Subject<start>;
|
|
36
|
+
dispose: Subject<start>;
|
|
35
37
|
setDatasource: Subject<setDatasource>;
|
|
36
38
|
setDatasourceJson: Subject<any>;
|
|
37
39
|
getVariable: Subject<variable>;
|
|
@@ -48,7 +50,7 @@ declare class SmoEvents {
|
|
|
48
50
|
getVariableStorage: Subject<variable>;
|
|
49
51
|
checkHealth: Subject<string>;
|
|
50
52
|
checkHealthPrinter: Subject<string>;
|
|
51
|
-
getValorCalendario: Subject<
|
|
53
|
+
getValorCalendario: Subject<ValorCalendario | any>;
|
|
52
54
|
getLocalDatasource: Subject<DatasourceMap>;
|
|
53
55
|
constructor(smo: SMO);
|
|
54
56
|
}
|
|
@@ -99,7 +101,7 @@ declare class smoCallBacks {
|
|
|
99
101
|
checkHealth(): void;
|
|
100
102
|
checkHealthPrinter(): void;
|
|
101
103
|
printImage(image: string): void;
|
|
102
|
-
getValorCalendario(codigo: number, tipoObjeto?: number): void;
|
|
104
|
+
getValorCalendario(codigo: number, compleja?: boolean, tipoObjeto?: number): void;
|
|
103
105
|
/**
|
|
104
106
|
* Funcion que permite obtener uno o varios datasources pasando su/sus codigos
|
|
105
107
|
* Permite un solo codigo o un array de codigos
|
|
@@ -119,6 +121,7 @@ declare class Utils {
|
|
|
119
121
|
}
|
|
120
122
|
export declare enum SMO_EVENT_TYPE {
|
|
121
123
|
start = "start",
|
|
124
|
+
dispose = "dispose",
|
|
122
125
|
setDatasource = "setDatasource",
|
|
123
126
|
getVariable = "getVariable",
|
|
124
127
|
setCurrentStream = "setCurrentStream",
|
package/dist/smo.js
CHANGED
|
@@ -156,6 +156,10 @@ var SMO = /** @class */ (function () {
|
|
|
156
156
|
selft.start();
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
+
if (func == SMO_EVENT_TYPE.dispose) {
|
|
160
|
+
selft.dispose();
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
159
163
|
if (func == SMO_EVENT_TYPE.setDatasource) {
|
|
160
164
|
selft.setDatasource(e.data.objData);
|
|
161
165
|
return;
|
|
@@ -229,6 +233,9 @@ var SMO = /** @class */ (function () {
|
|
|
229
233
|
SMO.prototype.start = function () {
|
|
230
234
|
this.events.start.next({});
|
|
231
235
|
};
|
|
236
|
+
SMO.prototype.dispose = function () {
|
|
237
|
+
this.events.dispose.next({});
|
|
238
|
+
};
|
|
232
239
|
SMO.prototype.setDatasource = function (datasource) {
|
|
233
240
|
this.events.setDatasource.next(datasource);
|
|
234
241
|
this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
|
|
@@ -275,8 +282,8 @@ var SMO = /** @class */ (function () {
|
|
|
275
282
|
SMO.prototype.checkHealthPrinter = function (json) {
|
|
276
283
|
this.events.checkHealthPrinter.next(json);
|
|
277
284
|
};
|
|
278
|
-
SMO.prototype.getValorCalendario = function (
|
|
279
|
-
this.events.getValorCalendario.next(
|
|
285
|
+
SMO.prototype.getValorCalendario = function (data) {
|
|
286
|
+
this.events.getValorCalendario.next(data);
|
|
280
287
|
};
|
|
281
288
|
SMO.prototype.getLocalDatasource = function (data) {
|
|
282
289
|
this.events.getLocalDatasource.next(data);
|
|
@@ -287,6 +294,7 @@ exports.SMO = SMO;
|
|
|
287
294
|
var SmoEvents = /** @class */ (function () {
|
|
288
295
|
function SmoEvents(smo) {
|
|
289
296
|
this.start = new rxjs_1.Subject();
|
|
297
|
+
this.dispose = new rxjs_1.Subject();
|
|
290
298
|
this.setDatasource = new rxjs_1.Subject();
|
|
291
299
|
this.setDatasourceJson = new rxjs_1.Subject();
|
|
292
300
|
this.getVariable = new rxjs_1.Subject();
|
|
@@ -668,12 +676,13 @@ var smoCallBacks = /** @class */ (function () {
|
|
|
668
676
|
idSmo: this.smo.id
|
|
669
677
|
}, this.smo.vars.idSmo);
|
|
670
678
|
};
|
|
671
|
-
smoCallBacks.prototype.getValorCalendario = function (codigo, tipoObjeto) {
|
|
679
|
+
smoCallBacks.prototype.getValorCalendario = function (codigo, compleja, tipoObjeto) {
|
|
672
680
|
this.smo.utils.sendToParent({
|
|
673
681
|
target: "Dnv.smoCallbacks.getValorCalendario",
|
|
674
682
|
objData: {
|
|
675
683
|
codigo: codigo,
|
|
676
|
-
tipoObjeto: tipoObjeto
|
|
684
|
+
tipoObjeto: tipoObjeto,
|
|
685
|
+
compleja: compleja
|
|
677
686
|
},
|
|
678
687
|
idSmo: this.smo.id
|
|
679
688
|
}, this.smo.vars.idSmo);
|
|
@@ -852,6 +861,7 @@ var Utils = /** @class */ (function () {
|
|
|
852
861
|
var SMO_EVENT_TYPE;
|
|
853
862
|
(function (SMO_EVENT_TYPE) {
|
|
854
863
|
SMO_EVENT_TYPE["start"] = "start";
|
|
864
|
+
SMO_EVENT_TYPE["dispose"] = "dispose";
|
|
855
865
|
SMO_EVENT_TYPE["setDatasource"] = "setDatasource";
|
|
856
866
|
SMO_EVENT_TYPE["getVariable"] = "getVariable";
|
|
857
867
|
SMO_EVENT_TYPE["setCurrentStream"] = "setCurrentStream";
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
export
|
|
2
|
+
export interface setDatasource{
|
|
3
3
|
xml:string
|
|
4
4
|
}
|
|
5
5
|
export interface start{
|
|
6
6
|
|
|
7
|
+
}
|
|
8
|
+
export interface dispose{
|
|
9
|
+
|
|
7
10
|
}
|
|
8
11
|
export interface variable{
|
|
9
12
|
variable:string,
|
|
@@ -84,4 +87,11 @@ export interface Datasource{
|
|
|
84
87
|
export interface DatasourceMap {
|
|
85
88
|
[codigo: string]: Datasource; // Cada clave tiene un solo Datasource
|
|
86
89
|
}
|
|
87
|
-
|
|
90
|
+
export interface ValorCalendario {
|
|
91
|
+
codigo: number;
|
|
92
|
+
valor: any;
|
|
93
|
+
tipo: number;
|
|
94
|
+
inicio: string;
|
|
95
|
+
fin: string;
|
|
96
|
+
objIdDispositivo: number;
|
|
97
|
+
}
|
package/src/smo.ts
CHANGED
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
ExecFunction,
|
|
7
7
|
Notify,
|
|
8
8
|
start,
|
|
9
|
+
dispose,
|
|
9
10
|
GetRecursosByCodigo,
|
|
10
11
|
GetRecursos,
|
|
11
|
-
GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, Datasource, DatasourceMap
|
|
12
|
+
GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, Datasource, DatasourceMap, ValorCalendario
|
|
12
13
|
} from "./interfaces/callbacks";
|
|
13
14
|
import {interval, Subject, Subscription} from 'rxjs';
|
|
14
15
|
|
|
@@ -177,6 +178,10 @@ export class SMO {
|
|
|
177
178
|
selft.start();
|
|
178
179
|
return;
|
|
179
180
|
}
|
|
181
|
+
if(func == SMO_EVENT_TYPE.dispose){
|
|
182
|
+
selft.dispose();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
180
185
|
if(func == SMO_EVENT_TYPE.setDatasource){
|
|
181
186
|
selft.setDatasource(e.data.objData);
|
|
182
187
|
return;
|
|
@@ -250,6 +255,9 @@ export class SMO {
|
|
|
250
255
|
start():void{
|
|
251
256
|
this.events.start.next({});
|
|
252
257
|
}
|
|
258
|
+
dispose():void{
|
|
259
|
+
this.events.dispose.next({});
|
|
260
|
+
}
|
|
253
261
|
setDatasource(datasource:setDatasource):void {
|
|
254
262
|
this.events.setDatasource.next(datasource);
|
|
255
263
|
this.events.setDatasourceJson.next(this.utils.xmlToJSON(datasource.xml));
|
|
@@ -297,8 +305,8 @@ export class SMO {
|
|
|
297
305
|
checkHealthPrinter(json:string):void{
|
|
298
306
|
this.events.checkHealthPrinter.next(json);
|
|
299
307
|
}
|
|
300
|
-
getValorCalendario(
|
|
301
|
-
this.events.getValorCalendario.next(
|
|
308
|
+
getValorCalendario(data:ValorCalendario|any):void{
|
|
309
|
+
this.events.getValorCalendario.next(data);
|
|
302
310
|
}
|
|
303
311
|
getLocalDatasource(data: DatasourceMap):void{
|
|
304
312
|
this.events.getLocalDatasource.next(data);
|
|
@@ -307,6 +315,7 @@ export class SMO {
|
|
|
307
315
|
|
|
308
316
|
class SmoEvents{
|
|
309
317
|
public start: Subject<start> = new Subject<start>();
|
|
318
|
+
public dispose: Subject<start> = new Subject<dispose>();
|
|
310
319
|
public setDatasource: Subject<setDatasource> = new Subject<setDatasource>();
|
|
311
320
|
public setDatasourceJson: Subject<any> = new Subject<any>();
|
|
312
321
|
public getVariable: Subject<variable> = new Subject<variable>();
|
|
@@ -323,7 +332,7 @@ class SmoEvents{
|
|
|
323
332
|
public getVariableStorage: Subject<variable> = new Subject<variable>();
|
|
324
333
|
public checkHealth: Subject<string> = new Subject<string>();
|
|
325
334
|
public checkHealthPrinter: Subject<string> = new Subject<string>();
|
|
326
|
-
public getValorCalendario: Subject<
|
|
335
|
+
public getValorCalendario: Subject<ValorCalendario|any> = new Subject<ValorCalendario|any>();
|
|
327
336
|
public getLocalDatasource: Subject<DatasourceMap> = new Subject<DatasourceMap>();
|
|
328
337
|
constructor(smo:SMO){}
|
|
329
338
|
}
|
|
@@ -691,12 +700,13 @@ class smoCallBacks{
|
|
|
691
700
|
idSmo: this.smo.id
|
|
692
701
|
}, this.smo.vars.idSmo);
|
|
693
702
|
}
|
|
694
|
-
getValorCalendario(codigo:number, tipoObjeto?:number){
|
|
703
|
+
getValorCalendario(codigo:number, compleja?:boolean, tipoObjeto?:number){
|
|
695
704
|
this.smo.utils.sendToParent({
|
|
696
705
|
target: "Dnv.smoCallbacks.getValorCalendario",
|
|
697
706
|
objData: {
|
|
698
707
|
codigo: codigo,
|
|
699
|
-
tipoObjeto: tipoObjeto
|
|
708
|
+
tipoObjeto: tipoObjeto,
|
|
709
|
+
compleja: compleja
|
|
700
710
|
},
|
|
701
711
|
idSmo: this.smo.id
|
|
702
712
|
}, this.smo.vars.idSmo);
|
|
@@ -891,6 +901,7 @@ class Utils{
|
|
|
891
901
|
}
|
|
892
902
|
export enum SMO_EVENT_TYPE{
|
|
893
903
|
start = "start",
|
|
904
|
+
dispose = "dispose",
|
|
894
905
|
setDatasource = "setDatasource",
|
|
895
906
|
getVariable = "getVariable",
|
|
896
907
|
setCurrentStream = "setCurrentStream",
|