@denevads/dnv-smo 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,24 +1,24 @@
1
- {
2
- "name": "@denevads/dnv-smo",
3
- "version": "1.0.12",
4
- "description": "SMO module",
5
- "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "scripts": {
8
- "build": "tsc"
9
- },
10
- "compilerOptions": {
11
- "outDir": "./dist",
12
- "types": []
13
- },
14
- "keywords": [],
15
- "author": "Xavier",
16
- "license": "MIT",
17
- "devDependencies": {
18
- "@types/node": "^17.0.42"
19
- },
20
- "dependencies": {
21
- "mitt": "^3.0.0",
22
- "rxjs": "^7.5.6"
23
- }
24
- }
1
+ {
2
+ "name": "@denevads/dnv-smo",
3
+ "version": "1.0.14",
4
+ "description": "SMO module",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc"
9
+ },
10
+ "compilerOptions": {
11
+ "outDir": "./dist",
12
+ "types": []
13
+ },
14
+ "keywords": [],
15
+ "author": "Xavier",
16
+ "license": "MIT",
17
+ "devDependencies": {
18
+ "@types/node": "^20.1.4"
19
+ },
20
+ "dependencies": {
21
+ "mitt": "^3.0.0",
22
+ "rxjs": "^7.5.6"
23
+ }
24
+ }
package/src/smo.ts CHANGED
@@ -108,6 +108,10 @@ export class SMO {
108
108
  selft.getVariableStorage(e.data.objData);
109
109
  return;
110
110
  }
111
+ if(func == SMO_EVENT_TYPE.checkHealth){
112
+ selft.checkHealth(e.data.objData);
113
+ return;
114
+ }
111
115
  console.warn("message not implemented!!" +func);
112
116
  }
113
117
  }
@@ -147,7 +151,9 @@ export class SMO {
147
151
  getVariableStorage(variable:variable):void{
148
152
  this.events.getVariableStorage.next(variable);
149
153
  }
150
-
154
+ checkHealth(variable:string):void{
155
+ this.events.checkHealth.next(variable);
156
+ }
151
157
  }
152
158
 
153
159
  class SmoEvents{
@@ -163,6 +169,7 @@ class SmoEvents{
163
169
  public getRecursosDefault: Subject<GetRecursos> = new Subject<GetRecursos>();
164
170
  public getRecursosRelleno: Subject<GetRecursosRelleno> = new Subject<GetRecursosRelleno>();
165
171
  public getVariableStorage: Subject<variable> = new Subject<variable>();
172
+ public checkHealth: Subject<string> = new Subject<string>();
166
173
  constructor(smo:SMO){}
167
174
  }
168
175
  class smoCallBacks{
@@ -453,7 +460,50 @@ class smoCallBacks{
453
460
  }, "*");
454
461
  /* MIRAR SMO.getVariable */
455
462
  }
456
-
463
+ printTextLine(txt:string):void{
464
+ window.parent.postMessage({
465
+ target: "Dnv.smoCallbacks.printTextLine",
466
+ objData: {
467
+ txt: txt
468
+ },
469
+ idSmo: this.smo.id
470
+ }, "*");
471
+ }
472
+ printBarcode(code:string, width:number, height:number):void{
473
+ window.parent.postMessage({
474
+ target: "Dnv.smoCallbacks.printBarcode",
475
+ objData: {
476
+ code: code,
477
+ width: width,
478
+ height: height
479
+ },
480
+ idSmo: this.smo.id
481
+ }, "*");
482
+ }
483
+ cutPaper(percent:number):void{
484
+ window.parent.postMessage({
485
+ target: "Dnv.smoCallbacks.cutPaper",
486
+ objData: {
487
+ percent: percent
488
+ },
489
+ idSmo: this.smo.id
490
+ }, "*");
491
+ }
492
+ checkHealth(){
493
+ window.parent.postMessage({
494
+ target: "Dnv.smoCallbacks.checkHealth",
495
+ idSmo: this.smo.id
496
+ }, "*");
497
+ }
498
+ printImage(image:string):void{
499
+ window.parent.postMessage({
500
+ target: "Dnv.smoCallbacks.printImage",
501
+ objData: {
502
+ image: image
503
+ },
504
+ idSmo: this.smo.id
505
+ }, "*");
506
+ }
457
507
 
458
508
  }
459
509
  class Utils{
@@ -548,7 +598,8 @@ export enum SMO_EVENT_TYPE{
548
598
  getRecursos = "getRecursos",
549
599
  getRecursosDefault = "getRecursosDefault",
550
600
  getRecursosRelleno = "getRecursosRelleno",
551
- getVariableStorage = "getVariableStorage"
601
+ getVariableStorage = "getVariableStorage",
602
+ checkHealth = "checkHealth"
552
603
  }
553
604
  export enum LogLevel {
554
605
  Debug= 0,
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="WEB_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/temp" />
6
- <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
- <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
- </content>
9
- <orderEntry type="inheritedJdk" />
10
- <orderEntry type="sourceFolder" forTests="false" />
11
- </component>
12
- </module>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/denevads_dnv-smo.iml" filepath="$PROJECT_DIR$/.idea/denevads_dnv-smo.iml" />
6
- </modules>
7
- </component>
8
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>