@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,95 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const utils = require('../utils');
|
|
3
|
+
const dayjs = require('dayjs');
|
|
4
|
+
const duration = require('dayjs/plugin/duration');
|
|
5
|
+
dayjs.extend(duration);
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
|
|
9
|
+
tagDaqToSave: function (tag, timestamp) {
|
|
10
|
+
if (tag.daq && (tag.daq.enabled || tag.daq.restored)) {
|
|
11
|
+
tag.timestamp = timestamp;
|
|
12
|
+
if (tag.changed && (tag.daq.changed || tag.daq.restored)) {
|
|
13
|
+
return true;
|
|
14
|
+
} else if (!tag.daq.lastDaqSaved || (tag.daq.interval && timestamp - parseInt(tag.daq.interval) * 1000 > tag.daq.lastDaqSaved)) {
|
|
15
|
+
tag.daq.lastDaqSaved = timestamp;
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
tagValueCompose: function (value, tag) {
|
|
23
|
+
var obj = {value: null };
|
|
24
|
+
if (tag && utils.isNumber(value, obj)) {
|
|
25
|
+
try {
|
|
26
|
+
value = obj.value;
|
|
27
|
+
if (tag.scale) {
|
|
28
|
+
if (tag.scale.mode === 'linear') {
|
|
29
|
+
value = (tag.scale.scaledHigh - tag.scale.scaledLow) * (value - tag.scale.rawLow) / (tag.scale.rawHigh - tag.scale.rawLow) + tag.scale.scaledLow;
|
|
30
|
+
} else if (tag.scale.mode === 'convertDateTime' && tag.scale.dateTimeFormat) {
|
|
31
|
+
value = dayjs(value).format(tag.scale.dateTimeFormat);
|
|
32
|
+
} else if (tag.scale.mode === 'convertTickTime' && tag.scale.dateTimeFormat) {
|
|
33
|
+
value = durationToTimeFormat(dayjs.duration(value), tag.scale.dateTimeFormat);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (tag.format) {
|
|
37
|
+
value = +value.toFixed(tag.format);
|
|
38
|
+
}
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error(err);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
tagRawCalculator: function (value, tag) {
|
|
47
|
+
var obj = {value: null };
|
|
48
|
+
if (tag && utils.isNumber(value, obj)) {
|
|
49
|
+
try {
|
|
50
|
+
value = obj.value;
|
|
51
|
+
if (tag.scale && tag.scale.mode === 'linear') {
|
|
52
|
+
value = tag.scale.rawLow + ((tag.scale.rawHigh - tag.scale.rawLow) * (value - tag.scale.scaledLow)) / (tag.scale.scaledHigh - tag.scale.scaledLow);
|
|
53
|
+
}
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.error(err);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const durationToTimeFormat = (duration, format) => {
|
|
63
|
+
const pattern = /^([H]+)?([:|-])?([m]+)?([:|-])?([s]+)?$/;
|
|
64
|
+
const match = format.match(pattern);
|
|
65
|
+
|
|
66
|
+
if (!match) {
|
|
67
|
+
return null; // Format not valid
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const [, hoursPart, separator1, minutePart, separator2, secondPart] = match;
|
|
71
|
+
|
|
72
|
+
const nbDays = duration.get('days');
|
|
73
|
+
const nbHours = duration.get('hours');
|
|
74
|
+
const nbMinutes = duration.get('minute');
|
|
75
|
+
const nbSeconds = duration.get('seconds');
|
|
76
|
+
|
|
77
|
+
var count = nbDays * 24 + nbHours;
|
|
78
|
+
var result = '';
|
|
79
|
+
if (hoursPart) {
|
|
80
|
+
result += `${count.toString().padStart(hoursPart.length, '0')}${separator1 ?? ''}`;
|
|
81
|
+
count = nbMinutes;
|
|
82
|
+
} else {
|
|
83
|
+
count = count * 60 + nbMinutes;
|
|
84
|
+
}
|
|
85
|
+
if (minutePart) {
|
|
86
|
+
result += `${count.toString().padStart(minutePart.length, '0')}${separator2 ?? ''}`;
|
|
87
|
+
count = nbSeconds;
|
|
88
|
+
} else {
|
|
89
|
+
count = count * 60 + nbSeconds;
|
|
90
|
+
}
|
|
91
|
+
if (secondPart) {
|
|
92
|
+
result += `${count.toString().padStart(secondPart.length, '0')}`;
|
|
93
|
+
}
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Device interface managed with StateMachine INIT/IDLE/POLLING
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
var S7client = require('./s7');
|
|
7
|
+
var OpcUAclient = require('./opcua');
|
|
8
|
+
var MODBUSclient = require('./modbus');
|
|
9
|
+
var BACNETclient = require('./bacnet');
|
|
10
|
+
var HTTPclient = require('./httprequest');
|
|
11
|
+
var MQTTclient = require('./mqtt');
|
|
12
|
+
var EthernetIPclient = require('./ethernetip');
|
|
13
|
+
var FuxaServer = require('./fuxaserver');
|
|
14
|
+
var ODBCclient = require('./odbc');
|
|
15
|
+
// var TEMPLATEclient = require('./template');
|
|
16
|
+
|
|
17
|
+
const path = require('path');
|
|
18
|
+
const utils = require('../utils');
|
|
19
|
+
|
|
20
|
+
var deviceCloseTimeout = 1000;
|
|
21
|
+
var DEVICE_CHECK_STATUS_INTERVAL = 5000;
|
|
22
|
+
var SERVER_POLLING_INTERVAL = 1000; // with DAQ enabled, will be saved only changed values in this interval
|
|
23
|
+
var DEVICE_POLLING_INTERVAL = 3000; // with DAQ enabled, will be saved only changed values in this interval
|
|
24
|
+
|
|
25
|
+
var fncGetDeviceProperty;
|
|
26
|
+
|
|
27
|
+
function Device(data, runtime) {
|
|
28
|
+
var property = { id: data.id, name: data.name }; // Device property (name, id)
|
|
29
|
+
var status = DeviceStatusEnum.INIT; // Current status (StateMachine)
|
|
30
|
+
var logger = runtime.logger; // Logger
|
|
31
|
+
var events = runtime.events; // Events to commit change to runtime
|
|
32
|
+
var manager = runtime.plugins.manager; // Plugins manager
|
|
33
|
+
var currentCmd = null; // Current Command (StateMachine)
|
|
34
|
+
var deviceCheckStatus = null; // TimerInterval to check Device status (connection)
|
|
35
|
+
var devicePolling = null; // TimerInterval to polling read device value
|
|
36
|
+
var connectionStatus = ConnectionStatusEnum.OFF; // Connection status depending of read tag value response
|
|
37
|
+
var pollingInterval = DEVICE_POLLING_INTERVAL;
|
|
38
|
+
var sharedDevices = data.sharedDevices;
|
|
39
|
+
var tryToConnect = 0;
|
|
40
|
+
var comm; // Interface to OPCUA/S7/.. Device
|
|
41
|
+
// required: connect, disconnect, isConnected, polling, init, load, getValue,
|
|
42
|
+
// getValues, getStatus, setValue, bindAddDaq, getTagProperty,
|
|
43
|
+
fncGetDeviceProperty = runtime.project.getDeviceProperty;
|
|
44
|
+
|
|
45
|
+
if (data.type === DeviceEnum.S7) {
|
|
46
|
+
if (!S7client) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
comm = S7client.create(data, logger, events, manager);
|
|
50
|
+
} else if (data.type === DeviceEnum.OPCUA) {
|
|
51
|
+
if (!OpcUAclient) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
comm = OpcUAclient.create(data, logger, events, manager);
|
|
55
|
+
} else if (data.type === DeviceEnum.ModbusRTU || data.type === DeviceEnum.ModbusTCP) {
|
|
56
|
+
if (!MODBUSclient) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
comm = MODBUSclient.create(data, logger, events, manager);
|
|
60
|
+
} else if (data.type === DeviceEnum.BACnet) {
|
|
61
|
+
if (!BACNETclient) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
comm = BACNETclient.create(data, logger, events, manager);
|
|
65
|
+
} else if (data.type === DeviceEnum.WebAPI) {
|
|
66
|
+
if (!HTTPclient) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
comm = HTTPclient.create(data, logger, events, manager);
|
|
70
|
+
} else if (data.type === DeviceEnum.MQTTclient) {
|
|
71
|
+
if (!MQTTclient) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
data.certificatesDir = path.resolve(runtime.settings.appDir, '_certificates');
|
|
75
|
+
comm = MQTTclient.create(data, logger, events, runtime);
|
|
76
|
+
} else if (data.type === DeviceEnum.EthernetIP) {
|
|
77
|
+
if (!EthernetIPclient) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
comm = EthernetIPclient.create(data, logger, events, manager);
|
|
81
|
+
} else if (data.type === DeviceEnum.FuxaServer) {
|
|
82
|
+
if (!FuxaServer) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
comm = FuxaServer.create(data, logger, events, manager);
|
|
86
|
+
} else if (data.type === DeviceEnum.ODBC) {
|
|
87
|
+
if (!ODBCclient) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
comm = ODBCclient.create(data, logger, events, manager);
|
|
91
|
+
}
|
|
92
|
+
// else if (data.type === DeviceEnum.Template) {
|
|
93
|
+
// if (!TEMPLATEclient) {
|
|
94
|
+
// return null;
|
|
95
|
+
// }
|
|
96
|
+
// comm = TEMPLATEclient.create(data, logger, events, manager);
|
|
97
|
+
// }
|
|
98
|
+
if (!comm) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Start StateMachine, init and start TimerInterval to check Device status
|
|
103
|
+
*/
|
|
104
|
+
this.start = function () {
|
|
105
|
+
currentCmd = DeviceCmdEnum.START;
|
|
106
|
+
if (status === DeviceStatusEnum.INIT) {
|
|
107
|
+
logger.info(`'${property.name}' start`);
|
|
108
|
+
this.restoreValues();
|
|
109
|
+
var self = this;
|
|
110
|
+
this.checkStatus();
|
|
111
|
+
deviceCheckStatus = setInterval(function () {
|
|
112
|
+
self.checkStatus();
|
|
113
|
+
}, DEVICE_CHECK_STATUS_INTERVAL);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Stop StateMachine, Close Device connection, break all TimerInterval (Device status/polling)
|
|
119
|
+
*/
|
|
120
|
+
this.stop = function () {
|
|
121
|
+
return new Promise(function (resolve, reject) {
|
|
122
|
+
currentCmd = DeviceCmdEnum.STOP;
|
|
123
|
+
logger.info(`'${property.name}' stop`);
|
|
124
|
+
if (devicePolling) {
|
|
125
|
+
clearInterval(devicePolling);
|
|
126
|
+
devicePolling = null;
|
|
127
|
+
}
|
|
128
|
+
if (deviceCheckStatus) {
|
|
129
|
+
clearInterval(deviceCheckStatus);
|
|
130
|
+
deviceCheckStatus = null;
|
|
131
|
+
}
|
|
132
|
+
connectionStatus = ConnectionStatusEnum.OFF;
|
|
133
|
+
comm.disconnect().then(function () {
|
|
134
|
+
status = DeviceStatusEnum.INIT;
|
|
135
|
+
resolve();
|
|
136
|
+
}).catch(function (err) {
|
|
137
|
+
reject(err);
|
|
138
|
+
});;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Check the Device connection, Reconnect
|
|
144
|
+
*/
|
|
145
|
+
this.checkStatus = function () {
|
|
146
|
+
if (status === DeviceStatusEnum.INIT && currentCmd === DeviceCmdEnum.START) {
|
|
147
|
+
const self = this;
|
|
148
|
+
this.connect().then(() => {
|
|
149
|
+
tryToConnect = 0;
|
|
150
|
+
status = DeviceStatusEnum.IDLE;
|
|
151
|
+
}).catch(function (err) {
|
|
152
|
+
logger.error(`'${property.name}' connect error! ${err} (${tryToConnect})`);
|
|
153
|
+
if (tryToConnect++ > 3) {
|
|
154
|
+
tryToConnect = 0;
|
|
155
|
+
self.disconnect().then(() => {});
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
} else if (status === DeviceStatusEnum.IDLE && !comm.isConnected()) {
|
|
159
|
+
status = DeviceStatusEnum.INIT;
|
|
160
|
+
if (devicePolling) {
|
|
161
|
+
clearInterval(devicePolling);
|
|
162
|
+
devicePolling = null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// check connection status
|
|
166
|
+
const now = Date.now();
|
|
167
|
+
var lastRead = comm.lastReadTimestamp() || 0;
|
|
168
|
+
if (lastRead < now - pollingInterval * 5) {
|
|
169
|
+
connectionStatus = ConnectionStatusEnum.OFF;
|
|
170
|
+
} else if (lastRead < now - pollingInterval * 2) {
|
|
171
|
+
connectionStatus = ConnectionStatusEnum.WARNING;
|
|
172
|
+
} else {
|
|
173
|
+
connectionStatus = ConnectionStatusEnum.ON;
|
|
174
|
+
}
|
|
175
|
+
if (this.updateConnectionStatus) {
|
|
176
|
+
this.updateConnectionStatus(property.id, connectionStatus);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Call Device to polling
|
|
182
|
+
*/
|
|
183
|
+
this.polling = function () {
|
|
184
|
+
comm.polling();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Call Device to connect and start TimerInterval for read value polling
|
|
189
|
+
*/
|
|
190
|
+
this.connect = function () {
|
|
191
|
+
var self = this;
|
|
192
|
+
if (data.type === DeviceEnum.ModbusRTU) {
|
|
193
|
+
comm.init(MODBUSclient.ModbusTypes.RTU);
|
|
194
|
+
} else if (data.type === DeviceEnum.ModbusTCP) {
|
|
195
|
+
comm.init(MODBUSclient.ModbusTypes.TCP);
|
|
196
|
+
}
|
|
197
|
+
return comm.connect().then(function () {
|
|
198
|
+
devicePolling = setInterval(function () {
|
|
199
|
+
self.polling();
|
|
200
|
+
}, pollingInterval);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Call Device to disconnect
|
|
206
|
+
*/
|
|
207
|
+
this.disconnect = function () {
|
|
208
|
+
return comm.disconnect();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Call Device to load Tags propperty in local for polling read values
|
|
213
|
+
*/
|
|
214
|
+
this.load = function (data) {
|
|
215
|
+
pollingInterval = data.polling || ((data.type === DeviceEnum.FuxaServer) ? SERVER_POLLING_INTERVAL : DEVICE_POLLING_INTERVAL);
|
|
216
|
+
data.polling = pollingInterval;
|
|
217
|
+
return comm.load(data);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Call Device to retrun Tags with values
|
|
222
|
+
*/
|
|
223
|
+
this.getValues = function () {
|
|
224
|
+
return comm.getValues();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Call Device to get Tag value with Timestamp
|
|
229
|
+
*/
|
|
230
|
+
this.getValue = function (id, value) {
|
|
231
|
+
return comm.getValue(id);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Call Device to return current status
|
|
236
|
+
*/
|
|
237
|
+
this.getStatus = function () {
|
|
238
|
+
return comm.getStatus();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Call Device to set Tag value
|
|
243
|
+
*/
|
|
244
|
+
this.setValue = function (id, value, fnc) {
|
|
245
|
+
var fncvalue = this.getValueInFunction(this.getValue(id), value, fnc);
|
|
246
|
+
return comm.setValue(id, value);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Call Device to return browser result Tags/Nodes (only OPCUA)
|
|
251
|
+
*/
|
|
252
|
+
this.browse = function (path, callback) {
|
|
253
|
+
return new Promise(function (resolve, reject) {
|
|
254
|
+
if (data.type === DeviceEnum.OPCUA) {
|
|
255
|
+
comm.browse(path).then(function (result) {
|
|
256
|
+
resolve(result);
|
|
257
|
+
}).catch(function (err) {
|
|
258
|
+
reject(err);
|
|
259
|
+
});
|
|
260
|
+
} else if (data.type === DeviceEnum.BACnet) {
|
|
261
|
+
comm.browse(path).then(function (result) {
|
|
262
|
+
resolve(result);
|
|
263
|
+
}).catch(function (err) {
|
|
264
|
+
reject(err);
|
|
265
|
+
});
|
|
266
|
+
} else if (data.type === DeviceEnum.MQTTclient) {
|
|
267
|
+
comm.browse(path, callback).then(function (result) {
|
|
268
|
+
resolve(result);
|
|
269
|
+
}).catch(function (err) {
|
|
270
|
+
reject(err);
|
|
271
|
+
});
|
|
272
|
+
} else if (data.type === DeviceEnum.ODBC) {
|
|
273
|
+
comm.browse(path, callback).then(function (result) {
|
|
274
|
+
resolve(result);
|
|
275
|
+
}).catch(function (err) {
|
|
276
|
+
reject(err);
|
|
277
|
+
});
|
|
278
|
+
} else {
|
|
279
|
+
reject('Browse not supported!');
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Call Device to return Tag/Node attribute (only OPCUA)
|
|
286
|
+
*/
|
|
287
|
+
this.readNodeAttribute = function(node) {
|
|
288
|
+
return new Promise(function (resolve, reject) {
|
|
289
|
+
if (data.type === DeviceEnum.OPCUA) {
|
|
290
|
+
comm.readAttribute(node).then(function (result) {
|
|
291
|
+
resolve(result);
|
|
292
|
+
}).catch(function (err) {
|
|
293
|
+
reject(err);
|
|
294
|
+
});
|
|
295
|
+
} else {
|
|
296
|
+
reject('Read Node attribute not supported!');
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Call Device to return Tags property (WebAPI)
|
|
303
|
+
*/
|
|
304
|
+
this.getTagsProperty = function() {
|
|
305
|
+
return new Promise(function (resolve, reject) {
|
|
306
|
+
if (data.type === DeviceEnum.WebAPI && comm.getTagsProperty) {
|
|
307
|
+
comm.getTagsProperty().then(function (result) {
|
|
308
|
+
resolve(result);
|
|
309
|
+
}).catch(function (err) {
|
|
310
|
+
reject(err);
|
|
311
|
+
});
|
|
312
|
+
} else {
|
|
313
|
+
reject('Get Tags Property not supported!');
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Call Device to bind the DAQ store function
|
|
320
|
+
*/
|
|
321
|
+
this.bindSaveDaqValue = function (fnc) {
|
|
322
|
+
comm.bindAddDaq(fnc);
|
|
323
|
+
//return comm.addDaq = fnc;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
this.bindGetDaqValueToRestore = function (fnc) {
|
|
327
|
+
this.getDaqValueToRestore = fnc;
|
|
328
|
+
}
|
|
329
|
+
this.getDaqValueToRestore = null; // Function to get current value to restore by start
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Call Device to return Tag property
|
|
333
|
+
*/
|
|
334
|
+
this.getTagProperty = function (id) {
|
|
335
|
+
return comm.getTagProperty(id);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Bind function to ask project stored property (security)
|
|
340
|
+
*/
|
|
341
|
+
this.bindGetProperty = function (fnc) {
|
|
342
|
+
if (data.type === DeviceEnum.OPCUA || data.type === DeviceEnum.MQTTclient || data.type === DeviceEnum.ODBC) {
|
|
343
|
+
comm.bindGetProperty(fnc);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Bind function to update connection status to server
|
|
349
|
+
*/
|
|
350
|
+
this.bindUpdateConnectionStatus = function (fnc) {
|
|
351
|
+
this.updateConnectionStatus = fnc;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
this.updateConnectionStatus = null;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Set connection status of device in FuxaServer
|
|
358
|
+
* used only from FuxaServer device
|
|
359
|
+
* @param {*} deviceId
|
|
360
|
+
* @param {*} status
|
|
361
|
+
*/
|
|
362
|
+
this.setDeviceConnectionStatus = function (deviceId, status) {
|
|
363
|
+
comm.setConnectionStatus(deviceId, status);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* return the value calculated with the function if defined
|
|
368
|
+
*/
|
|
369
|
+
this.getValueInFunction = function (current, value, fnc) {
|
|
370
|
+
try {
|
|
371
|
+
if (!fnc || fnc.length < 2) return value;
|
|
372
|
+
if (!current) {
|
|
373
|
+
current = 0;
|
|
374
|
+
}
|
|
375
|
+
if (fnc[0] === 'add') {
|
|
376
|
+
return parseFloat(current) + parseFloat(fnc[1]);
|
|
377
|
+
} else if (fnc[0] === 'remove') {
|
|
378
|
+
return parseFloat(current) - parseFloat(fnc[1]);
|
|
379
|
+
}
|
|
380
|
+
} catch (err) {
|
|
381
|
+
logger.error(err);
|
|
382
|
+
}
|
|
383
|
+
return value;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
this.restoreValues = function() {
|
|
387
|
+
try {
|
|
388
|
+
if (this.getDaqValueToRestore) {
|
|
389
|
+
var self = this;
|
|
390
|
+
this.getDaqValueToRestore(property.id).then((toRestore) => {
|
|
391
|
+
var restored = 0;
|
|
392
|
+
toRestore.forEach(element => {
|
|
393
|
+
if (element.id && !utils.isNullOrUndefined(element.value)) {
|
|
394
|
+
if (self.setValue(element.id, element.value)) {
|
|
395
|
+
restored++;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
});
|
|
399
|
+
logger.info(`'${property.name}' restored ${restored}/${toRestore.length} values`);
|
|
400
|
+
}).catch((err) => {
|
|
401
|
+
logger.error(`'${property.name}' restore error! ${err}`);
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
} catch (err) {
|
|
405
|
+
logger.error(`'${property.name}' restore error! ${err}`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
this.getTagDaqSettings = (tagId) => {
|
|
410
|
+
return comm.getTagDaqSettings ? comm.getTagDaqSettings(tagId) : null;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
this.setTagDaqSettings = (tagId, settings) => {
|
|
414
|
+
return comm.setTagDaqSettings ? comm.setTagDaqSettings(tagId, settings) : null;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
this.load(data);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Return the property (security mode) supported from device
|
|
422
|
+
* @param {*} endpoint
|
|
423
|
+
* @param {*} type
|
|
424
|
+
*/
|
|
425
|
+
function getSupportedProperty(endpoint, type, packagerManager) {
|
|
426
|
+
var self = this;
|
|
427
|
+
return new Promise(function (resolve, reject) {
|
|
428
|
+
if (type === DeviceEnum.OPCUA) {
|
|
429
|
+
OpcUAclient.getEndPoints(endpoint).then(function (result) {
|
|
430
|
+
resolve(result);
|
|
431
|
+
}).catch(function (err) {
|
|
432
|
+
reject(err);
|
|
433
|
+
});
|
|
434
|
+
} else if (type === DeviceEnum.ODBC) {
|
|
435
|
+
ODBCclient.getTables(endpoint, fncGetDeviceProperty, packagerManager).then(function (result) {
|
|
436
|
+
resolve(result);
|
|
437
|
+
}).catch(function (err) {
|
|
438
|
+
reject(err);
|
|
439
|
+
});
|
|
440
|
+
} else {
|
|
441
|
+
reject('getSupportedProperty not supported!');
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Return the result of request
|
|
448
|
+
* @param {*} property
|
|
449
|
+
*/
|
|
450
|
+
function getRequestResult(property) {
|
|
451
|
+
return new Promise(function (resolve, reject) {
|
|
452
|
+
if (HTTPclient) {
|
|
453
|
+
HTTPclient.getRequestResult(property).then(function (result) {
|
|
454
|
+
resolve(result);
|
|
455
|
+
}).catch(function (err) {
|
|
456
|
+
reject(err);
|
|
457
|
+
});
|
|
458
|
+
} else {
|
|
459
|
+
reject('getRequestResult not supported!');
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Load the plugin library
|
|
466
|
+
* @param {*} type
|
|
467
|
+
*/
|
|
468
|
+
function loadPlugin(type, module) {
|
|
469
|
+
if (type === DeviceEnum.S7) {
|
|
470
|
+
S7client = require(module);
|
|
471
|
+
} else if (type === DeviceEnum.OPCUA) {
|
|
472
|
+
OpcUAclient = require(module);
|
|
473
|
+
} else if (DeviceEnum.ModbusTCP.startsWith(type)) {
|
|
474
|
+
MODBUSclient = require(module);
|
|
475
|
+
} else if (type === DeviceEnum.BACnet) {
|
|
476
|
+
BACNETclient = require(module);
|
|
477
|
+
} else if (type === DeviceEnum.WebAPI) {
|
|
478
|
+
HTTPclient = require(module);
|
|
479
|
+
} else if (type === DeviceEnum.MQTTclient) {
|
|
480
|
+
MQTTclient = require(module);
|
|
481
|
+
} else if (type === DeviceEnum.EthernetIP) {
|
|
482
|
+
EthernetIPclient = require(module);
|
|
483
|
+
} else if (type === DeviceEnum.FuxaServer) {
|
|
484
|
+
FuxaServer = require(module);
|
|
485
|
+
} else if (type === DeviceEnum.ODBC) {
|
|
486
|
+
ODBCclient = require(module);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function isInternal(device) {
|
|
491
|
+
return (device.type === DeviceEnum.internal);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
module.exports = {
|
|
495
|
+
init: function (settings) {
|
|
496
|
+
// deviceCloseTimeout = settings.deviceCloseTimeout || 15000;
|
|
497
|
+
},
|
|
498
|
+
create: function (data, runtime) {
|
|
499
|
+
return new Device(data, runtime);
|
|
500
|
+
},
|
|
501
|
+
getSupportedProperty: getSupportedProperty,
|
|
502
|
+
getRequestResult: getRequestResult,
|
|
503
|
+
loadPlugin: loadPlugin,
|
|
504
|
+
isInternal: isInternal,
|
|
505
|
+
|
|
506
|
+
get DeviceType() { return DeviceEnum }
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Device type supported
|
|
511
|
+
*/
|
|
512
|
+
var DeviceEnum = {
|
|
513
|
+
S7: 'SiemensS7',
|
|
514
|
+
OPCUA: 'OPCUA',
|
|
515
|
+
ModbusRTU: 'ModbusRTU',
|
|
516
|
+
ModbusTCP: 'ModbusTCP',
|
|
517
|
+
BACnet: 'BACnet',
|
|
518
|
+
WebAPI: 'WebAPI',
|
|
519
|
+
MQTTclient: 'MQTTclient',
|
|
520
|
+
EthernetIP: 'EthernetIP',
|
|
521
|
+
FuxaServer: 'FuxaServer',
|
|
522
|
+
ODBC: 'ODBC',
|
|
523
|
+
// Template: 'template'
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* State of StateMachine
|
|
528
|
+
*/
|
|
529
|
+
var DeviceStatusEnum = {
|
|
530
|
+
INIT: 'init',
|
|
531
|
+
IDLE: 'idle',
|
|
532
|
+
POLLING: 'polling'
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Command of StateMachine
|
|
537
|
+
*/
|
|
538
|
+
var DeviceCmdEnum = {
|
|
539
|
+
STOP: 'stop',
|
|
540
|
+
START: 'start',
|
|
541
|
+
CONNECT: 'connect'
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* State of Connection
|
|
546
|
+
*/
|
|
547
|
+
var ConnectionStatusEnum = {
|
|
548
|
+
OFF: 0,
|
|
549
|
+
WARNING: 3, // up to 5 times the polling interval without response
|
|
550
|
+
ON: 5,
|
|
551
|
+
}
|