@frangoteam/fuxa-min 1.1.19
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/LICENSE +21 -0
- package/README.md +41 -0
- package/_images/Pipes/P1.svg +39 -0
- package/_images/Tanks/Fl.svg +7 -0
- package/api/alarms/index.js +132 -0
- package/api/auth/index.js +71 -0
- package/api/command/index.js +187 -0
- package/api/daq/index.js +79 -0
- package/api/diagnose/index.js +163 -0
- package/api/index.js +181 -0
- package/api/jwt-helper.js +106 -0
- package/api/plugins/index.js +109 -0
- package/api/projects/index.js +229 -0
- package/api/resources/index.js +118 -0
- package/api/scripts/index.js +82 -0
- package/api/users/index.js +109 -0
- package/dist/3rdpartylicenses.txt +1477 -0
- package/dist/Quicksand-Bold.071154c292aef0b8.woff +0 -0
- package/dist/Quicksand-Bold.6383d6475ed5c40f.woff2 +0 -0
- package/dist/Quicksand-Bold.f07d467887f9cfab.ttf +0 -0
- package/dist/Quicksand-Medium.0982a651e8d4315f.woff +0 -0
- package/dist/Quicksand-Medium.9d2733fbfb9b1be8.ttf +0 -0
- package/dist/Quicksand-Medium.b09302365c586eb2.woff2 +0 -0
- package/dist/Quicksand-Regular.16adf9eecd267273.woff +0 -0
- package/dist/Quicksand-Regular.78819724f6aeff59.woff2 +0 -0
- package/dist/Quicksand-Regular.8829564f0e14bf76.ttf +0 -0
- package/dist/assets/fonts/icomoon.eot +0 -0
- package/dist/assets/fonts/icomoon.svg +19 -0
- package/dist/assets/fonts/icomoon.ttf +0 -0
- package/dist/assets/fonts/icomoon.woff +0 -0
- package/dist/assets/fonts/myicons.eot +0 -0
- package/dist/assets/fonts/myicons.svg +19 -0
- package/dist/assets/fonts/myicons.ttf +0 -0
- package/dist/assets/fonts/myicons.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.ttf +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff +0 -0
- package/dist/assets/fonts/quicksand-bold/Quicksand-Bold.woff2 +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.ttf +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff +0 -0
- package/dist/assets/fonts/quicksand-medium/Quicksand-Medium.woff2 +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.ttf +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff +0 -0
- package/dist/assets/fonts/quicksand-regular/Quicksand-Regular.woff2 +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.svg +10486 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-bold/roboto-bold-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.svg +9998 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-light/roboto-light-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.svg +10487 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-medium/roboto-medium-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.svg +10004 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-regular/roboto-regular-webfont.woff2 +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.svg +10012 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.ttf +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff +0 -0
- package/dist/assets/fonts/roboto-thin/roboto-thin-webfont.woff2 +0 -0
- package/dist/assets/i18n/de.json +1308 -0
- package/dist/assets/i18n/en.json +1438 -0
- package/dist/assets/i18n/es.json +777 -0
- package/dist/assets/i18n/fr.json +1129 -0
- package/dist/assets/i18n/ko.json +774 -0
- package/dist/assets/i18n/pt.json +657 -0
- package/dist/assets/i18n/ru.json +1228 -0
- package/dist/assets/i18n/tr.json +673 -0
- package/dist/assets/i18n/ua.json +614 -0
- package/dist/assets/i18n/zh-cn.json +1252 -0
- package/dist/assets/images/align-bottom.svg +88 -0
- package/dist/assets/images/align-center.svg +86 -0
- package/dist/assets/images/align-left.svg +86 -0
- package/dist/assets/images/align-middle.svg +88 -0
- package/dist/assets/images/align-right.svg +88 -0
- package/dist/assets/images/align-top.svg +88 -0
- package/dist/assets/images/bag.svg +115 -0
- package/dist/assets/images/button.svg +22 -0
- package/dist/assets/images/chart.svg +17 -0
- package/dist/assets/images/circle.svg +84 -0
- package/dist/assets/images/compressor-a.svg +2 -0
- package/dist/assets/images/editvalue.svg +14 -0
- package/dist/assets/images/ellipse.svg +84 -0
- package/dist/assets/images/flip-orizontal.svg +86 -0
- package/dist/assets/images/flip-vertical.svg +82 -0
- package/dist/assets/images/gauge-donut.png +0 -0
- package/dist/assets/images/gauge-mat.png +0 -0
- package/dist/assets/images/gauge-zone.png +0 -0
- package/dist/assets/images/graphbar.svg +18 -0
- package/dist/assets/images/group.svg +91 -0
- package/dist/assets/images/iframe.svg +54 -0
- package/dist/assets/images/image.svg +95 -0
- package/dist/assets/images/led-circle.svg +77 -0
- package/dist/assets/images/line.svg +86 -0
- package/dist/assets/images/linecap-butt.svg +77 -0
- package/dist/assets/images/linecap-round.svg +77 -0
- package/dist/assets/images/linecap-square.svg +82 -0
- package/dist/assets/images/linejoin-bevel.svg +77 -0
- package/dist/assets/images/linejoin-miter.svg +77 -0
- package/dist/assets/images/linejoin-round.svg +77 -0
- package/dist/assets/images/logo.svg +18 -0
- package/dist/assets/images/path.svg +100 -0
- package/dist/assets/images/pencil.svg +98 -0
- package/dist/assets/images/pipe.svg +15 -0
- package/dist/assets/images/progress-v.svg +79 -0
- package/dist/assets/images/rect.svg +84 -0
- package/dist/assets/images/select-pointer.svg +93 -0
- package/dist/assets/images/selectvalue.svg +14 -0
- package/dist/assets/images/semaphore.svg +19 -0
- package/dist/assets/images/slider.svg +17 -0
- package/dist/assets/images/switch.svg +15 -0
- package/dist/assets/images/table.svg +55 -0
- package/dist/assets/images/text.svg +294 -0
- package/dist/assets/images/to-bottom.svg +163 -0
- package/dist/assets/images/to-path.svg +94 -0
- package/dist/assets/images/to-top.svg +163 -0
- package/dist/assets/images/to_top.svg +88 -0
- package/dist/assets/images/todelete.svg +13 -0
- package/dist/assets/images/ungroup.svg +108 -0
- package/dist/assets/images/value.svg +81 -0
- package/dist/assets/images/valve-a.svg +2 -0
- package/dist/assets/images/webcam.svg +16 -0
- package/dist/assets/lib/ext-styles.css +28 -0
- package/dist/assets/lib/gauge/gauge.js +988 -0
- package/dist/assets/lib/gauge/gauge.min.js +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.css +1 -0
- package/dist/assets/lib/nouislider/nouislider.min.js +1 -0
- package/dist/assets/lib/numeral/locales.min.js +7 -0
- package/dist/assets/lib/numeral/numeral.min.js +8 -0
- package/dist/assets/lib/pdfkit-table/index.js +967 -0
- package/dist/assets/lib/svg/raphael.min.js +1 -0
- package/dist/assets/lib/svg/svg.js +5573 -0
- package/dist/assets/lib/svg/svg.min.js +13 -0
- package/dist/assets/lib/svgeditor/extensions/ext-bundle.min.js +1 -0
- package/dist/assets/lib/svgeditor/extensions/ext-html_button.min.css +1 -0
- package/dist/assets/lib/svgeditor/fuxa-editor.min.js +23 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.css +2 -0
- package/dist/assets/lib/svgeditor/jquery-plugin.min.js +52 -0
- package/dist/assets/lib/svgeditor/jquery-ui-1.8.17.custom.min.js +54 -0
- package/dist/assets/lib/svgeditor/jquery.min.js +4 -0
- package/dist/assets/lib/svgeditor/shapes/ape-shapes.js +39 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-disc.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-paddle.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-prop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/agitator-turbo.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-eli.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/anim-piston.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifugal1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/centrifuge4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compair.svg +92 -0
- package/dist/assets/lib/svgeditor/shapes/img/compdiaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compejector.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/compreci2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-fan.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-piston.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compressor-void.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/compring2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/comprotary2.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/compscrew.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/compsilence.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/compturbo.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher3.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher4.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher5.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/crusher7.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/diaph.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier3.svg +23 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier4.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/drier5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-filter.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-heat.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger-tube.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger6.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger8.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/exchanger9.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder2.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/feeder3.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter2.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/filter3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting1.svg +67 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting10.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting11.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting12.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting13.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting3.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting6.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/fitting9.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc1.svg +75 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc2.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc4.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc7.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/misc8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/motor-simb.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/nozzle2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi1.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi5.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi6.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/pipi7.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpblower.svg +76 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri1.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpcentri2.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpfeed.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear.svg +18 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpgear2.svg +19 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphidra.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumphorizo.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpjet.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpperis.svg +20 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpscreew2.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpturbi.svg +64 -0
- package/dist/assets/lib/svgeditor/shapes/img/pumpvacuum.svg +72 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-arrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-circleindi.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cloud.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cone.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-corner.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cross.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-cylinder.svg +71 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-delay.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-diamond.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-display.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-docu.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-doublearrow.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-drop.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-halfcircle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-heart.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-looplimit.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-maninput.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-nosymbol.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-octagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-offpage.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-or2.svg +17 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-parallelogram.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-pentagon.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-poval.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-prepara.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-rectindi.svg +16 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-star4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-switch.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tape.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-tee.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-ticket.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-trape.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-triangle.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/shape-vor.svg +14 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank1.svg +63 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank2.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank3.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank4.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank5.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank6.svg +68 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank7.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank8.svg +15 -0
- package/dist/assets/lib/svgeditor/shapes/img/tank9.svg +21 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-ax.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-bx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/valve-cx.svg +13 -0
- package/dist/assets/lib/svgeditor/shapes/img/webcam.svg +6 -0
- package/dist/assets/lib/svgeditor/shapes/my-shapes.js +178 -0
- package/dist/assets/lib/svgeditor/shapes/proc-comp-shapes.js +105 -0
- package/dist/assets/lib/svgeditor/shapes/proc-general-shapes.js +60 -0
- package/dist/assets/lib/svgeditor/shapes/proc-pumps-shapes.js +112 -0
- package/dist/assets/lib/svgeditor/shapes/proc-shapes.js +606 -0
- package/dist/assets/lib/svgeditor/shapes/shapes.js +30 -0
- package/dist/assets/lib/svgeditor/svg-editor.min.css +1 -0
- package/dist/assets/lib/uplot/placement.min.js +2 -0
- package/dist/assets/project.demo.fuxap +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/icomoon.86abfb46e057ade8.eot +0 -0
- package/dist/icomoon.c1f8b59bad308d66.woff +0 -0
- package/dist/icomoon.ce427f75e21963af.ttf +0 -0
- package/dist/icomoon.dfb0a89feb346906.svg +19 -0
- package/dist/index.html +50 -0
- package/dist/logo.0e8e64e69250a450.svg +18 -0
- package/dist/main.a356f552d9838b9e.js +1 -0
- package/dist/material-icons-outlined.78a93b2079680a08.woff +0 -0
- package/dist/material-icons-outlined.f86cb7b0aa53f0fe.woff2 +0 -0
- package/dist/material-icons-round.92dc7ca2f4c591e7.woff +0 -0
- package/dist/material-icons-round.b10ec9db5b7fbc74.woff2 +0 -0
- package/dist/material-icons-sharp.3885863ee4746422.woff2 +0 -0
- package/dist/material-icons-sharp.a71cb2bf66c604de.woff +0 -0
- package/dist/material-icons-two-tone.588d63134de807a7.woff +0 -0
- package/dist/material-icons-two-tone.675bd578bd14533e.woff2 +0 -0
- package/dist/material-icons.4ad034d2c499d9b6.woff +0 -0
- package/dist/material-icons.59322316b3fd6063.woff2 +0 -0
- package/dist/polyfills.2696a6f9dc75535e.js +1 -0
- package/dist/roboto-bold-webfont.29ac6158e35aee95.woff +0 -0
- package/dist/roboto-bold-webfont.568ab1fa3f154a77.svg +10486 -0
- package/dist/roboto-bold-webfont.6bcfbdc216b3bc78.woff2 +0 -0
- package/dist/roboto-bold-webfont.7c22a4dfdee2ff33.ttf +0 -0
- package/dist/roboto-light-webfont.13492ec56771eeee.svg +9998 -0
- package/dist/roboto-light-webfont.61fa26c99b07ac83.woff2 +0 -0
- package/dist/roboto-light-webfont.95295ce84942d8ce.ttf +0 -0
- package/dist/roboto-light-webfont.ae19119a2889dfdf.woff +0 -0
- package/dist/roboto-medium-webfont.30344f0411888055.woff +0 -0
- package/dist/roboto-medium-webfont.57fb00cab0317d2d.woff2 +0 -0
- package/dist/roboto-medium-webfont.a40869e060a388c0.ttf +0 -0
- package/dist/roboto-medium-webfont.ea02241c29620c02.svg +10487 -0
- package/dist/roboto-regular-webfont.2b0501b72f5a94d5.ttf +0 -0
- package/dist/roboto-regular-webfont.2ce0ba9a06424965.svg +10004 -0
- package/dist/roboto-regular-webfont.ae47f6f1292d196f.woff2 +0 -0
- package/dist/roboto-regular-webfont.f58066a2d9061006.woff +0 -0
- package/dist/roboto-thin-webfont.0a64479870f676e8.ttf +0 -0
- package/dist/roboto-thin-webfont.0f7221f5c7e972ef.woff2 +0 -0
- package/dist/roboto-thin-webfont.51b221e22714b1fe.svg +10012 -0
- package/dist/roboto-thin-webfont.dac941649dd4eac0.woff +0 -0
- package/dist/runtime.8ef63094e52a66ba.js +1 -0
- package/dist/scripts.1c3385254ff4c93c.js +1 -0
- package/dist/styles.cf8e3cf50d039a5c.css +1 -0
- package/fuxa.js +39 -0
- package/main.js +381 -0
- package/package.json +68 -0
- package/paths.js +44 -0
- package/project.default.json +11 -0
- package/project.demo.fuxap +1 -0
- package/runtime/alarms/alarmstorage.js +205 -0
- package/runtime/alarms/index.js +678 -0
- package/runtime/devices/bacnet/index.js +730 -0
- package/runtime/devices/device-utils.js +95 -0
- package/runtime/devices/device.js +551 -0
- package/runtime/devices/ethernetip/index.js +381 -0
- package/runtime/devices/fuxaserver/index.js +310 -0
- package/runtime/devices/httprequest/index.js +495 -0
- package/runtime/devices/index.js +489 -0
- package/runtime/devices/modbus/datatypes.js +122 -0
- package/runtime/devices/modbus/index.js +730 -0
- package/runtime/devices/mqtt/index.js +618 -0
- package/runtime/devices/odbc/index.js +408 -0
- package/runtime/devices/opcua/index.js +817 -0
- package/runtime/devices/s7/datatypes.js +88 -0
- package/runtime/devices/s7/index.js +702 -0
- package/runtime/devices/template/index.js +141 -0
- package/runtime/events.js +33 -0
- package/runtime/index.js +559 -0
- package/runtime/jobs/cleaner.js +74 -0
- package/runtime/jobs/fonts/LICENSE.txt +202 -0
- package/runtime/jobs/fonts/Roboto-Black.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BlackItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Bold.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-BoldItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Italic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Light.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-LightItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Medium.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-MediumItalic.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Regular.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-Thin.ttf +0 -0
- package/runtime/jobs/fonts/Roboto-ThinItalic.ttf +0 -0
- package/runtime/jobs/helper/image-generator.js +82 -0
- package/runtime/jobs/index.js +214 -0
- package/runtime/jobs/report.js +353 -0
- package/runtime/logger.js +113 -0
- package/runtime/notificator/index.js +383 -0
- package/runtime/notificator/notifystorage.js +179 -0
- package/runtime/plugins/index.js +255 -0
- package/runtime/project/index.js +959 -0
- package/runtime/project/prjstorage.js +222 -0
- package/runtime/scripts/index.js +313 -0
- package/runtime/scripts/msm.js +146 -0
- package/runtime/storage/calculator.js +227 -0
- package/runtime/storage/daqstorage.js +188 -0
- package/runtime/storage/influxdb/index.js +240 -0
- package/runtime/storage/sqlite/currentstorage.js +144 -0
- package/runtime/storage/sqlite/index.js +695 -0
- package/runtime/storage/tdengine/index.js +106 -0
- package/runtime/users/index.js +123 -0
- package/runtime/users/usrstorage.js +201 -0
- package/runtime/utils.js +284 -0
- package/screenshot/feature-action-move.gif +0 -0
- package/screenshot/fuxa-ani.gif +0 -0
- package/screenshot/fuxa-device.gif +0 -0
- package/screenshot/fuxa-editor.png +0 -0
- package/screenshot/fuxa-hmi.gif +0 -0
- package/screenshot/fuxa-home.png +0 -0
- package/screenshot/fuxa-test.gif +0 -0
- package/settings.default.js +65 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Devices manager, manage all the configurated devices in project
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
var Device = require('./device');
|
|
7
|
+
|
|
8
|
+
var sharedDevices = {}; // Shared Devices list
|
|
9
|
+
var activeDevices = {}; // Actives Devices list
|
|
10
|
+
var runtime; // Access to application resource like logger/settings
|
|
11
|
+
var wokingStatus; // Current status (start/stop) to know if is working
|
|
12
|
+
|
|
13
|
+
const FuxaServerId = '0';
|
|
14
|
+
/**
|
|
15
|
+
* Init by set the access to application resource
|
|
16
|
+
* @param {*} _runtime
|
|
17
|
+
*/
|
|
18
|
+
function init(_runtime) {
|
|
19
|
+
runtime = _runtime;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Load and start all Devices actives
|
|
24
|
+
*/
|
|
25
|
+
function start() {
|
|
26
|
+
wokingStatus = 'starting';
|
|
27
|
+
devices.load();
|
|
28
|
+
return new Promise(function (resolve, reject) {
|
|
29
|
+
// runtime.logger.info('devices.start-all (' + Object.keys(activeDevices).length + ')', true);
|
|
30
|
+
for (var id in activeDevices) {
|
|
31
|
+
activeDevices[id].start();
|
|
32
|
+
}
|
|
33
|
+
resolve();
|
|
34
|
+
wokingStatus = null;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Stop all Devices
|
|
40
|
+
*/
|
|
41
|
+
function stop() {
|
|
42
|
+
wokingStatus = 'stopping';
|
|
43
|
+
return new Promise(function (resolve, reject) {
|
|
44
|
+
// runtime.logger.info('devices.stop-all (' + Object.keys(activeDevices).length + ')');
|
|
45
|
+
var deviceStopfnc = [];
|
|
46
|
+
for (var id in activeDevices) {
|
|
47
|
+
deviceStopfnc.push(activeDevices[id].stop());
|
|
48
|
+
}
|
|
49
|
+
return Promise.all(deviceStopfnc).then(values => {
|
|
50
|
+
resolve(true);
|
|
51
|
+
wokingStatus = null;
|
|
52
|
+
}, reason => {
|
|
53
|
+
runtime.logger.error('devices.stop-all: ' + reason);
|
|
54
|
+
resolve(reason);
|
|
55
|
+
wokingStatus = null;
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Update all by restart all devices
|
|
62
|
+
*/
|
|
63
|
+
function update() {
|
|
64
|
+
devices.stop().then(function () {
|
|
65
|
+
devices.start().then(function () {
|
|
66
|
+
|
|
67
|
+
}).catch(function (err) {
|
|
68
|
+
runtime.logger.error('devices.update-start: ' + err);
|
|
69
|
+
});
|
|
70
|
+
}).catch(function (err) {
|
|
71
|
+
runtime.logger.error('devices.ipdate-stop: ' + err);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Update the device, load and restart it
|
|
77
|
+
* @param {*} device
|
|
78
|
+
*/
|
|
79
|
+
function updateDevice(device) {
|
|
80
|
+
if (!activeDevices[device.id]) {
|
|
81
|
+
if (devices.loadDevice(device) && device.enabled) {
|
|
82
|
+
activeDevices[device.id].start();
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
activeDevices[device.id].stop().then(function () {
|
|
86
|
+
devices.loadDevice(device);
|
|
87
|
+
if (device.enabled) {
|
|
88
|
+
activeDevices[device.id].start();
|
|
89
|
+
} else {
|
|
90
|
+
delete activeDevices[device.id];
|
|
91
|
+
}
|
|
92
|
+
}).catch(function (err) {
|
|
93
|
+
runtime.logger.error('devices.update-device ' + device.name + ': ' + err);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Remove the device, stop it if active and remove from actieDevices list
|
|
100
|
+
* @param {*} device
|
|
101
|
+
*/
|
|
102
|
+
function removeDevice(device) {
|
|
103
|
+
if (!activeDevices[device.id]) {
|
|
104
|
+
delete activeDevices[device.id];
|
|
105
|
+
} else {
|
|
106
|
+
activeDevices[device.id].stop().then(function () {
|
|
107
|
+
delete activeDevices[device.id];
|
|
108
|
+
}).catch(function (err) {
|
|
109
|
+
delete activeDevices[device.id];
|
|
110
|
+
runtime.logger.error('devices.remove-device by stop ' + device.name + ': ' + err);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Load the device from project and add or remove of active device for the management
|
|
117
|
+
*/
|
|
118
|
+
function load() {
|
|
119
|
+
var tempdevices = runtime.project.getDevices();
|
|
120
|
+
activeDevices = {};
|
|
121
|
+
runtime.daqStorage.reset();
|
|
122
|
+
// check existing or to add new
|
|
123
|
+
for (var id in tempdevices) {
|
|
124
|
+
if (tempdevices[id].enabled) {
|
|
125
|
+
if(tempdevices[id].type == 'ModbusRTU'){
|
|
126
|
+
if(!(tempdevices[id].property.address in sharedDevices)){
|
|
127
|
+
sharedDevices[tempdevices[id].property.address] = [];
|
|
128
|
+
}
|
|
129
|
+
sharedDevices[tempdevices[id].property.address].push(id);
|
|
130
|
+
tempdevices[id].sharedDevices = sharedDevices;
|
|
131
|
+
}
|
|
132
|
+
devices.loadDevice(tempdevices[id]);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// log remove device not used
|
|
136
|
+
for (var id in activeDevices) {
|
|
137
|
+
if (Object.keys(tempdevices).indexOf(id) < 0) {
|
|
138
|
+
runtime.logger.info(`devices.load-removed: '${activeDevices[id].name}'`, true);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Load the device to manage and set on depending of settings
|
|
145
|
+
* @param {*} device
|
|
146
|
+
*/
|
|
147
|
+
function loadDevice(device) {
|
|
148
|
+
if (activeDevices[device.id]) {
|
|
149
|
+
// device exist
|
|
150
|
+
runtime.logger.info(`'${device.name}' exist`, true);
|
|
151
|
+
activeDevices[device.id].load(device);
|
|
152
|
+
} else {
|
|
153
|
+
// device create
|
|
154
|
+
let tdev = Device.create(device, runtime);
|
|
155
|
+
if (tdev && tdev.start) {
|
|
156
|
+
runtime.logger.info(`'${device.name}' created`);
|
|
157
|
+
activeDevices[device.id] = tdev;
|
|
158
|
+
activeDevices[device.id].bindGetProperty(runtime.project.getDeviceProperty);
|
|
159
|
+
activeDevices[device.id].bindUpdateConnectionStatus(setDeviceConnectionStatus);
|
|
160
|
+
} else {
|
|
161
|
+
if (!Device.isInternal(device)) {
|
|
162
|
+
runtime.logger.warn('try to create ' + device.name + ' but plugin is missing!');
|
|
163
|
+
}
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (runtime.settings.daqEnabled) {
|
|
168
|
+
var fncToSaveDaqValue = runtime.daqStorage.addDaqNode(device.id, activeDevices[device.id].getTagProperty);
|
|
169
|
+
activeDevices[device.id].bindSaveDaqValue(fncToSaveDaqValue);
|
|
170
|
+
activeDevices[device.id].bindGetDaqValueToRestore(runtime.daqStorage.getCurrentStorageFnc());
|
|
171
|
+
}
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Return all devices status
|
|
177
|
+
*/
|
|
178
|
+
function getDevicesStatus() {
|
|
179
|
+
var adev = {};
|
|
180
|
+
for (var id in activeDevices) {
|
|
181
|
+
adev[id] = activeDevices[id].getStatus();
|
|
182
|
+
}
|
|
183
|
+
return adev;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Return all devices values
|
|
188
|
+
*/
|
|
189
|
+
function getDevicesValues() {
|
|
190
|
+
var adev = {};
|
|
191
|
+
for (var id in activeDevices) {
|
|
192
|
+
adev[id] = activeDevices[id].getValues();
|
|
193
|
+
}
|
|
194
|
+
return adev;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Get the Device Tag value
|
|
200
|
+
* used from Alarms
|
|
201
|
+
* @param {*} deviceid
|
|
202
|
+
* @param {*} sigid
|
|
203
|
+
* @param {*} value
|
|
204
|
+
*/
|
|
205
|
+
function getDeviceValue(deviceid, sigid) {
|
|
206
|
+
if (activeDevices[deviceid]) {
|
|
207
|
+
return activeDevices[deviceid].getValue(sigid);
|
|
208
|
+
}
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Get the Device Tag value
|
|
214
|
+
* used from Alarms, Script
|
|
215
|
+
* @param {*} sigid
|
|
216
|
+
* @param {*} fully, struct with timestamp
|
|
217
|
+
*/
|
|
218
|
+
function getTagValue(sigid, fully) {
|
|
219
|
+
try {
|
|
220
|
+
let deviceid = getDeviceIdFromTag(sigid)
|
|
221
|
+
if (activeDevices[deviceid]) {
|
|
222
|
+
let result = activeDevices[deviceid].getValue(sigid);
|
|
223
|
+
if (fully) {
|
|
224
|
+
return result;
|
|
225
|
+
} else if (result) {
|
|
226
|
+
return result.value;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
} catch (err) {
|
|
230
|
+
console.error(err);
|
|
231
|
+
}
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Get the Device Tag Id
|
|
237
|
+
* used from Script
|
|
238
|
+
* @param {*} tagName
|
|
239
|
+
* @param {*} deviceName
|
|
240
|
+
*/
|
|
241
|
+
function getTagId(tagName, deviceName) {
|
|
242
|
+
try {
|
|
243
|
+
const devices = runtime.project.getDevices();
|
|
244
|
+
for (var id in devices) {
|
|
245
|
+
if (!deviceName || devices[id].name === deviceName) {
|
|
246
|
+
const tag = Object.values(devices[id].tags).find(tag => tag.name === tagName);
|
|
247
|
+
if (tag) {
|
|
248
|
+
return tag.id;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
} catch (err) {
|
|
253
|
+
console.error(err);
|
|
254
|
+
}
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Set the Device Tag value
|
|
260
|
+
* used from Scripts
|
|
261
|
+
* @param {*} tagid
|
|
262
|
+
* @param {*} value
|
|
263
|
+
*/
|
|
264
|
+
function setTagValue(tagid, value) {
|
|
265
|
+
try {
|
|
266
|
+
let deviceid = getDeviceIdFromTag(tagid)
|
|
267
|
+
if (activeDevices[deviceid]) {
|
|
268
|
+
return activeDevices[deviceid].setValue(tagid, value);
|
|
269
|
+
}
|
|
270
|
+
} catch (err) {
|
|
271
|
+
console.error(err);
|
|
272
|
+
}
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Get the Device Tag Daq settings
|
|
278
|
+
* used from Scripts
|
|
279
|
+
* @param {*} tagid
|
|
280
|
+
*/
|
|
281
|
+
function getTagDaqSettings(tagId) {
|
|
282
|
+
try {
|
|
283
|
+
let deviceId = getDeviceIdFromTag(tagId)
|
|
284
|
+
if (activeDevices[deviceId]) {
|
|
285
|
+
return activeDevices[deviceId].getTagDaqSettings(tagId);
|
|
286
|
+
}
|
|
287
|
+
} catch (err) {
|
|
288
|
+
console.error(err);
|
|
289
|
+
}
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Set the Device Tag Daq settings
|
|
295
|
+
* used from Scripts
|
|
296
|
+
* @param {*} tagId
|
|
297
|
+
* @param {*} settings
|
|
298
|
+
*/
|
|
299
|
+
function setTagDaqSettings(tagId, settings) {
|
|
300
|
+
try {
|
|
301
|
+
let deviceId = getDeviceIdFromTag(tagId)
|
|
302
|
+
if (activeDevices[deviceId]) {
|
|
303
|
+
return activeDevices[deviceId].setTagDaqSettings(tagId, settings);
|
|
304
|
+
}
|
|
305
|
+
} catch (err) {
|
|
306
|
+
console.error(err);
|
|
307
|
+
}
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Enable/disable Device connection
|
|
313
|
+
* used from Scripts
|
|
314
|
+
* @param {*} deviceName
|
|
315
|
+
* @param {*} enable
|
|
316
|
+
*/
|
|
317
|
+
function enableDevice(deviceName, enable) {
|
|
318
|
+
try {
|
|
319
|
+
let device = runtime.project.getDevice(deviceName);
|
|
320
|
+
enable = (typeof enable === 'string') ? enable === "true" : Boolean(enable);
|
|
321
|
+
if (device && device.enabled !== enable) {
|
|
322
|
+
device.enabled = enable;
|
|
323
|
+
updateDevice(device);
|
|
324
|
+
}
|
|
325
|
+
runtime.logger.info(`devices.enableDevice: '${deviceName} - ${enable}'`, true);
|
|
326
|
+
} catch (err) {
|
|
327
|
+
console.error(err);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Get the Device from the tag id
|
|
333
|
+
* used from Alarms
|
|
334
|
+
* @param {*} sigid
|
|
335
|
+
*/
|
|
336
|
+
function getDeviceIdFromTag(sigid) {
|
|
337
|
+
for (var id in activeDevices) {
|
|
338
|
+
var tag = activeDevices[id].getTagProperty(sigid);
|
|
339
|
+
if (tag) {
|
|
340
|
+
return id;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Get the Tag value format from the tag id
|
|
348
|
+
* used from Report
|
|
349
|
+
* @param {*} sigid
|
|
350
|
+
*/
|
|
351
|
+
function getTagFormat(sigid) {
|
|
352
|
+
for (var id in activeDevices) {
|
|
353
|
+
var tag = activeDevices[id].getTagProperty(sigid);
|
|
354
|
+
if (tag) {
|
|
355
|
+
return tag.format;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Return if manager is working (started or stopped)
|
|
363
|
+
*/
|
|
364
|
+
function isWoking() {
|
|
365
|
+
return (wokingStatus) ? true : false;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Set the Device Tag value
|
|
370
|
+
* @param {*} deviceid
|
|
371
|
+
* @param {*} sigid
|
|
372
|
+
* @param {*} value
|
|
373
|
+
*/
|
|
374
|
+
function setDeviceValue(deviceid, sigid, value, fnc) {
|
|
375
|
+
if (activeDevices[deviceid]) {
|
|
376
|
+
activeDevices[deviceid].setValue(sigid, value, fnc);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Set connection device status to server tag
|
|
382
|
+
* @param {*} deviceId
|
|
383
|
+
* @param {*} status
|
|
384
|
+
*/
|
|
385
|
+
function setDeviceConnectionStatus(deviceId, status) {
|
|
386
|
+
activeDevices[FuxaServerId].setDeviceConnectionStatus(deviceId, status);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Return the Device browser result Tags/Nodes
|
|
391
|
+
* @param {*} deviceid
|
|
392
|
+
* @param {*} node
|
|
393
|
+
*/
|
|
394
|
+
function browseDevice(deviceid, node, callback) {
|
|
395
|
+
return new Promise(function (resolve, reject) {
|
|
396
|
+
if (activeDevices[deviceid] && activeDevices[deviceid].browse) {
|
|
397
|
+
activeDevices[deviceid].browse(node, callback).then(function (result) {
|
|
398
|
+
resolve(result);
|
|
399
|
+
}).catch(function (err) {
|
|
400
|
+
reject(err);
|
|
401
|
+
});
|
|
402
|
+
} else {
|
|
403
|
+
reject('Device not found!');
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Return Device Tag/Node attribute
|
|
410
|
+
* @param {*} deviceid
|
|
411
|
+
* @param {*} node
|
|
412
|
+
*/
|
|
413
|
+
function readNodeAttribute(deviceid, node) {
|
|
414
|
+
return new Promise(function (resolve, reject) {
|
|
415
|
+
if (activeDevices[deviceid] && activeDevices[deviceid].readNodeAttribute) {
|
|
416
|
+
activeDevices[deviceid].readNodeAttribute(node).then(function (result) {
|
|
417
|
+
resolve(result);
|
|
418
|
+
}).catch(function (err) {
|
|
419
|
+
reject(err);
|
|
420
|
+
});
|
|
421
|
+
} else {
|
|
422
|
+
reject('Device not found!');
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Return Device Tags settings
|
|
429
|
+
* @param {*} deviceId
|
|
430
|
+
*/
|
|
431
|
+
function getDeviceTagsResult(deviceId) {
|
|
432
|
+
return new Promise(function (resolve, reject) {
|
|
433
|
+
if (activeDevices[deviceId] && activeDevices[deviceId].getTagsProperty) {
|
|
434
|
+
activeDevices[deviceId].getTagsProperty().then(function (result) {
|
|
435
|
+
resolve(result);
|
|
436
|
+
}).catch(function (err) {
|
|
437
|
+
reject(err);
|
|
438
|
+
});
|
|
439
|
+
} else {
|
|
440
|
+
reject('Device not found!');
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* Return the property (security mode) supported from device
|
|
447
|
+
* @param {*} endpoint
|
|
448
|
+
* @param {*} type
|
|
449
|
+
*/
|
|
450
|
+
function getSupportedProperty(endpoint, type) {
|
|
451
|
+
return Device.getSupportedProperty(endpoint, type, runtime.plugins.manager);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Return result of request
|
|
456
|
+
* @param {*} property
|
|
457
|
+
*/
|
|
458
|
+
function getRequestResult(property) {
|
|
459
|
+
return Device.getRequestResult(property);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
var devices = module.exports = {
|
|
463
|
+
init: init,
|
|
464
|
+
start: start,
|
|
465
|
+
stop: stop,
|
|
466
|
+
load: load,
|
|
467
|
+
loadDevice: loadDevice,
|
|
468
|
+
update: update,
|
|
469
|
+
updateDevice: updateDevice,
|
|
470
|
+
removeDevice: removeDevice,
|
|
471
|
+
getDevicesStatus: getDevicesStatus,
|
|
472
|
+
getDevicesValues: getDevicesValues,
|
|
473
|
+
getDeviceValue: getDeviceValue,
|
|
474
|
+
getTagValue: getTagValue,
|
|
475
|
+
setTagValue: setTagValue,
|
|
476
|
+
setDeviceValue: setDeviceValue,
|
|
477
|
+
getDeviceIdFromTag: getDeviceIdFromTag,
|
|
478
|
+
browseDevice: browseDevice,
|
|
479
|
+
readNodeAttribute: readNodeAttribute,
|
|
480
|
+
getDeviceTagsResult: getDeviceTagsResult,
|
|
481
|
+
isWoking: isWoking,
|
|
482
|
+
getSupportedProperty: getSupportedProperty,
|
|
483
|
+
getRequestResult: getRequestResult,
|
|
484
|
+
getTagFormat: getTagFormat,
|
|
485
|
+
enableDevice: enableDevice,
|
|
486
|
+
getTagId: getTagId,
|
|
487
|
+
getTagDaqSettings: getTagDaqSettings,
|
|
488
|
+
setTagDaqSettings: setTagDaqSettings,
|
|
489
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
|
|
2
|
+
function _gen(bytes, bFn, WordLen, swapType, toCast = false) {
|
|
3
|
+
return {
|
|
4
|
+
bytes,
|
|
5
|
+
parser: (buffer, offset = 0) => {
|
|
6
|
+
_swap(buffer, swapType, offset);
|
|
7
|
+
var value = buffer['read' + bFn](offset);
|
|
8
|
+
return (toCast) ? Number(value) : value;
|
|
9
|
+
},
|
|
10
|
+
formatter: v => {
|
|
11
|
+
var b = Buffer.allocUnsafe(bytes);//new Buffer(bytes);
|
|
12
|
+
b['write' + bFn](toCast ? BigInt(v) : v);
|
|
13
|
+
_swap(b, swapType);
|
|
14
|
+
return b;
|
|
15
|
+
},
|
|
16
|
+
WordLen
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _swap(buffer, swapType, offset = 0) {
|
|
21
|
+
if (swapType == 2) {
|
|
22
|
+
var temp = buffer[offset + 0];
|
|
23
|
+
buffer[offset + 0] = buffer[offset + 2]; buffer[offset + 2] = temp;
|
|
24
|
+
temp = buffer[offset + 1];
|
|
25
|
+
buffer[offset + 1] = buffer[offset + 3];buffer[offset + 3] = temp;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Datatypes = {
|
|
30
|
+
/**
|
|
31
|
+
* Bool
|
|
32
|
+
*/
|
|
33
|
+
Bool: {
|
|
34
|
+
bytes: 1,
|
|
35
|
+
// parser: (v, bit = 0) => v >> bit & 1 === 1,
|
|
36
|
+
parser: (buffer, offset = 0, bit = 0) => +buffer.readUInt8(offset) >> bit & 1 === 1,
|
|
37
|
+
formatter: v => (v === '1' || v === 1 || v === true) ? 1 : 0,
|
|
38
|
+
WordLen: 1
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Int16
|
|
42
|
+
*/
|
|
43
|
+
Int16: _gen(2, 'Int16BE', 1),
|
|
44
|
+
/**
|
|
45
|
+
* UInt16
|
|
46
|
+
*/
|
|
47
|
+
UInt16: _gen(2, 'UInt16BE', 1),
|
|
48
|
+
/**
|
|
49
|
+
* Int32
|
|
50
|
+
*/
|
|
51
|
+
Int32: _gen(4, 'Int32BE', 2),
|
|
52
|
+
/**
|
|
53
|
+
* UInt32
|
|
54
|
+
*/
|
|
55
|
+
UInt32: _gen(4, 'UInt32BE', 2),
|
|
56
|
+
/**
|
|
57
|
+
* Float32
|
|
58
|
+
*/
|
|
59
|
+
Float32: _gen(4, 'FloatBE', 2),
|
|
60
|
+
/**
|
|
61
|
+
* Float64
|
|
62
|
+
*/
|
|
63
|
+
Float64: _gen(8, 'DoubleBE', 4),
|
|
64
|
+
/**
|
|
65
|
+
* Int64
|
|
66
|
+
*/
|
|
67
|
+
Int64: _gen(8, 'BigInt64BE', 4, 0, true),
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Int16LE
|
|
71
|
+
*/
|
|
72
|
+
Int16LE: _gen(2, 'Int16LE', 1),
|
|
73
|
+
/**
|
|
74
|
+
* UInt16LE
|
|
75
|
+
*/
|
|
76
|
+
UInt16LE: _gen(2, 'UInt16LE', 1),
|
|
77
|
+
/**
|
|
78
|
+
* Int32LE
|
|
79
|
+
*/
|
|
80
|
+
Int32LE: _gen(4, 'Int32LE', 2),
|
|
81
|
+
/**
|
|
82
|
+
* UInt32LE
|
|
83
|
+
*/
|
|
84
|
+
UInt32LE: _gen(4, 'UInt32LE', 2),
|
|
85
|
+
/**
|
|
86
|
+
* Float32LE
|
|
87
|
+
*/
|
|
88
|
+
Float32LE: _gen(4, 'FloatLE', 2),
|
|
89
|
+
/**
|
|
90
|
+
* Float64LE
|
|
91
|
+
*/
|
|
92
|
+
Float64LE: _gen(8, 'DoubleLE', 4),
|
|
93
|
+
/**
|
|
94
|
+
* Int64
|
|
95
|
+
*/
|
|
96
|
+
Int64LE: _gen(8, 'BigInt64LE', 4, 0, true),
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Int32MLE
|
|
100
|
+
*/
|
|
101
|
+
Int32MLE: _gen(4, 'Int32BE', 2, 2),
|
|
102
|
+
/**
|
|
103
|
+
* UInt32MLE
|
|
104
|
+
*/
|
|
105
|
+
UInt32MLE: _gen(4, 'UInt32BE', 2, 2),
|
|
106
|
+
/**
|
|
107
|
+
* Float32MLE
|
|
108
|
+
*/
|
|
109
|
+
Float32MLE: _gen(4, 'FloatBE', 2, 2),
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* String
|
|
113
|
+
*/
|
|
114
|
+
String: {
|
|
115
|
+
bytes: 1,
|
|
116
|
+
parser: (buffer, offset = 0) => buffer.toString('ascii', offset, offset + 1),
|
|
117
|
+
formatter: v => new Buffer(v, 'ascii'),
|
|
118
|
+
WordLen: 1
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
module.exports = Datatypes;
|