@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,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculator for DAQ value array (integrale, max, min, average...)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const utils = require("../utils");
|
|
8
|
+
|
|
9
|
+
function getFunctionValues(values, fromts, tots, fnc, interval, format) {
|
|
10
|
+
if (fnc === ReportFunctionType.min) {
|
|
11
|
+
return getMin(values, fromts, tots, interval);
|
|
12
|
+
} else if (fnc === ReportFunctionType.max) {
|
|
13
|
+
return getMax(values, fromts, tots, interval);
|
|
14
|
+
} else if (fnc === ReportFunctionType.average) {
|
|
15
|
+
return getAverage(values, fromts, tots, interval, format);
|
|
16
|
+
} else if (fnc === ReportFunctionType.sum) {
|
|
17
|
+
return getSum(values, fromts, tots, interval);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {*} values
|
|
24
|
+
* @param {*} fnc
|
|
25
|
+
* @param {*} intervalType hour / day
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
function getMin(timeserie, fromts, tots, intervalType) {
|
|
29
|
+
let result = getInterval(fromts, tots, intervalType, Number.MAX_VALUE);
|
|
30
|
+
// sort to start with the oldest
|
|
31
|
+
let sorted = timeserie.sort(function (a, b) {
|
|
32
|
+
return a.dt - b.dt;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
let addToInterval = (intervals, intervalIndex, value) => {
|
|
36
|
+
if (!intervals[intervalIndex]) {
|
|
37
|
+
intervals[intervalIndex] = Number.MAX_VALUE;
|
|
38
|
+
} else if (intervals[intervalIndex] > value) {
|
|
39
|
+
intervals[intervalIndex] = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
44
|
+
let intervalIndex = getIntervalTime(sorted[i].dt, intervalType, false).getTime();
|
|
45
|
+
addToInterval(result, intervalIndex, utils.parseFloat(sorted[i].value, 5));
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getMax(timeserie, fromts, tots, intervalType) {
|
|
51
|
+
let result = getInterval(fromts, tots, intervalType, utils.SMALLEST_NEGATIVE_INTEGER);
|
|
52
|
+
// sort to start with the oldest
|
|
53
|
+
let sorted = timeserie.sort(function (a, b) {
|
|
54
|
+
return a.dt - b.dt;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
let addToInterval = (intervals, intervalIndex, value) => {
|
|
58
|
+
if (!intervals[intervalIndex]) {
|
|
59
|
+
intervals[intervalIndex] = utils.SMALLEST_NEGATIVE_INTEGER;
|
|
60
|
+
} else if (intervals[intervalIndex] < value) {
|
|
61
|
+
intervals[intervalIndex] = value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
66
|
+
let intervalIndex = getIntervalTime(sorted[i].dt, intervalType, false).getTime();
|
|
67
|
+
addToInterval(result, intervalIndex, utils.parseFloat(sorted[i].value, 5));
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function getAverage(timeserie, fromts, tots, intervalType, format) {
|
|
73
|
+
let result = getInterval(fromts, tots, intervalType, null);
|
|
74
|
+
let counts = getInterval(fromts, tots, intervalType, 0);
|
|
75
|
+
// sort to start with the oldest
|
|
76
|
+
let sorted = timeserie.sort(function (a, b) {
|
|
77
|
+
return a.dt - b.dt;
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
let addToInterval = (intervals, counters, intervalIndex, value) => {
|
|
81
|
+
if (utils.isNullOrUndefined(intervals[intervalIndex])) {
|
|
82
|
+
intervals[intervalIndex] = value;
|
|
83
|
+
} else {
|
|
84
|
+
intervals[intervalIndex] += value;
|
|
85
|
+
}
|
|
86
|
+
counters[intervalIndex]++;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
90
|
+
let intervalIndex = getIntervalTime(sorted[i].dt, intervalType, false).getTime();
|
|
91
|
+
addToInterval(result, counts, intervalIndex, parseFloat(sorted[i].value));
|
|
92
|
+
}
|
|
93
|
+
// average
|
|
94
|
+
Object.keys(result).forEach(k => {
|
|
95
|
+
if (counts[k]) {
|
|
96
|
+
result[k] = utils.parseFloat(result[k] / counts[k], format || 5);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function getSum(timeserie, fromts, tots, intervalType) {
|
|
103
|
+
let result = getInterval(fromts, tots, intervalType, 0);
|
|
104
|
+
// sort to start with the oldest
|
|
105
|
+
let sorted = timeserie.sort(function (a, b) {
|
|
106
|
+
return a.dt - b.dt;
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
let addToInterval = (intervals, intervalIndex, value) => {
|
|
110
|
+
if (utils.isNullOrUndefined(intervals[intervalIndex])) {
|
|
111
|
+
intervals[intervalIndex] = 0;
|
|
112
|
+
} else {
|
|
113
|
+
intervals[intervalIndex] += value;
|
|
114
|
+
intervals[intervalIndex] = utils.parseFloat(intervals[intervalIndex], 5)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
119
|
+
let intervalIndex = getIntervalTime(sorted[i].dt, intervalType, false).getTime();
|
|
120
|
+
addToInterval(result, intervalIndex, parseFloat(sorted[i].value));
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
function getIntegral(timeserie, fromts, tots, intervalType) {
|
|
127
|
+
let result = getInterval(fromts, tots, intervalType, Number.MAX_VALUE);
|
|
128
|
+
// sort to start with the oldest
|
|
129
|
+
let sorted = timeserie.sort(function (a, b) {
|
|
130
|
+
return a.dt - b.dt;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
let addToInterval = (intervals, intervalIndex, value) => {
|
|
134
|
+
if (!intervals[intervalIndex]) {
|
|
135
|
+
intervals[intervalIndex] = value;
|
|
136
|
+
} else if (intervals[intervalIndex] > value) {
|
|
137
|
+
intervals[intervalIndex] += value;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
let lastRecord = null;// : TimeValue { dt: number, value: number };
|
|
142
|
+
let lastIntervalIndex = null;
|
|
143
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
144
|
+
let intervalIndex = getIntervalTime(sorted[i].dt, intervalType, false).getTime();
|
|
145
|
+
// check missing value to fill intervalsIndex
|
|
146
|
+
while (lastIntervalIndex && lastIntervalIndex < intervalIndex) {
|
|
147
|
+
let nextIntervalIndex = getIntervalTime(lastRecord.dt, intervalType, true).getTime();
|
|
148
|
+
let delta = nextIntervalIndex - lastRecord.dt;
|
|
149
|
+
addToInterval(result, nextIntervalIndex, parseFloat(lastRecord.value) * (delta / 1000));
|
|
150
|
+
lastIntervalIndex = nextIntervalIndex;
|
|
151
|
+
lastRecord.dt = nextIntervalIndex;
|
|
152
|
+
}
|
|
153
|
+
// sum left => skip the first one
|
|
154
|
+
if (lastRecord) {
|
|
155
|
+
let delta = sorted[i].dt - lastRecord.dt;
|
|
156
|
+
addToInterval(result, intervalIndex, parseFloat(sorted[i].value) * (delta / 1000));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
lastRecord = sorted[i];
|
|
160
|
+
lastIntervalIndex = intervalIndex;
|
|
161
|
+
}
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function getInterval(fromts, tots, type, defvalue) {
|
|
166
|
+
let result = {};
|
|
167
|
+
let dt = getStepDate(fromts, type, 0);
|
|
168
|
+
while (dt.getTime() < tots) {
|
|
169
|
+
result[dt.getTime()] = defvalue;
|
|
170
|
+
dt = getStepDate(dt, type, 1);
|
|
171
|
+
}
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function getIntervalTime(millyDt, _interval, next) {
|
|
176
|
+
let dt = new Date(millyDt);
|
|
177
|
+
let toadd = (next) ? 1 : 0;
|
|
178
|
+
return getStepDate(dt, _interval, toadd);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function getStepDate(ts, type, toadd) {
|
|
182
|
+
var dtRange;
|
|
183
|
+
let dt = new Date(ts);
|
|
184
|
+
if (type === ReportIntervalType.day) {
|
|
185
|
+
dtRange = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), 0, 0, 0);
|
|
186
|
+
dtRange.setDate(dt.getDate() + toadd);
|
|
187
|
+
} else if (type === ReportIntervalType.hour) {
|
|
188
|
+
dtRange = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), 0, 0);
|
|
189
|
+
dtRange.setHours(dt.getHours() + toadd);
|
|
190
|
+
} else if (type === ReportIntervalType.min30) {
|
|
191
|
+
dtRange = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), 0, 0);
|
|
192
|
+
var minutesRange = parseInt(dt.getMinutes() / 30);
|
|
193
|
+
dtRange.setMinutes((minutesRange + toadd) * 30);
|
|
194
|
+
} else if (type === ReportIntervalType.min10) {
|
|
195
|
+
dtRange = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), 0, 0);
|
|
196
|
+
var minutesRange = parseInt(dt.getMinutes() / 10);
|
|
197
|
+
dtRange.setMinutes((minutesRange + toadd) * 10);
|
|
198
|
+
} else { //if (type === ReportIntervalType.min5) {
|
|
199
|
+
dtRange = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate(), dt.getHours(), 0, 0);
|
|
200
|
+
var minutesRange = parseInt(dt.getMinutes() / 5);
|
|
201
|
+
dtRange.setMinutes((minutesRange + toadd) * 5);
|
|
202
|
+
}
|
|
203
|
+
return dtRange;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
module.exports = {
|
|
207
|
+
getFunctionValues: getFunctionValues,
|
|
208
|
+
getMin: getMin,
|
|
209
|
+
getMax: getMax,
|
|
210
|
+
getAverage: getAverage,
|
|
211
|
+
getSum: this.getSum,
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
const ReportIntervalType = {
|
|
215
|
+
min5: 'min5',
|
|
216
|
+
min10: 'min10',
|
|
217
|
+
min30: 'min30',
|
|
218
|
+
hour: 'hour',
|
|
219
|
+
day: 'day',
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const ReportFunctionType = {
|
|
223
|
+
min: 'min',
|
|
224
|
+
max: 'max',
|
|
225
|
+
average: 'average',
|
|
226
|
+
sum: 'sum',
|
|
227
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module to manage the DAQ datastore with daqnode
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const SqliteDB = require("./sqlite");
|
|
10
|
+
const InfluxDB = require("./influxdb");
|
|
11
|
+
const TDengine =require("./tdengine");
|
|
12
|
+
const CurrentStorage = require("./sqlite/currentstorage");
|
|
13
|
+
// var DaqNode = require('./daqnode');
|
|
14
|
+
var calculator = require('./calculator');
|
|
15
|
+
var utils = require('../utils');
|
|
16
|
+
|
|
17
|
+
var daqStoreType;
|
|
18
|
+
|
|
19
|
+
var settings;
|
|
20
|
+
var logger;
|
|
21
|
+
var daqDB = {}; // list of daqDB node: SQlite one pro device, influxDB only one
|
|
22
|
+
var currentStorateDB;
|
|
23
|
+
|
|
24
|
+
function init(_settings, _log) {
|
|
25
|
+
settings = _settings;
|
|
26
|
+
logger = _log;
|
|
27
|
+
logger.info("daqstorage: init successful!", true);
|
|
28
|
+
currentStorateDB = CurrentStorage.create(_settings, _log);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function reset() {
|
|
32
|
+
daqStoreType = _getDbType();
|
|
33
|
+
for (var id in daqDB) {
|
|
34
|
+
daqDB[id].close();
|
|
35
|
+
}
|
|
36
|
+
daqDB = {};
|
|
37
|
+
logger.info("daqstorage reset!", true);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function addDaqNode(_id, fncgetprop) {
|
|
41
|
+
var id = _id;
|
|
42
|
+
const dbType = _getDbType();
|
|
43
|
+
if (dbType === DaqStoreTypeEnum.influxDB || dbType === DaqStoreTypeEnum.influxDB18 || dbType === DaqStoreTypeEnum.TDengine) {
|
|
44
|
+
id = dbType;
|
|
45
|
+
}
|
|
46
|
+
if (!daqDB[id]) {
|
|
47
|
+
if (id === DaqStoreTypeEnum.influxDB || id === DaqStoreTypeEnum.influxDB18) {
|
|
48
|
+
daqDB[id] = InfluxDB.create(settings, logger, currentStorateDB);
|
|
49
|
+
} else if(id === DaqStoreTypeEnum.TDengine){
|
|
50
|
+
daqDB[id] = TDengine.create(settings, logger, currentStorateDB);
|
|
51
|
+
} else {
|
|
52
|
+
daqDB[id] = SqliteDB.create(settings, logger, id, currentStorateDB);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return daqDB[id].setCall(fncgetprop);
|
|
56
|
+
// return daqnodes[id].addDaqValue;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function getNodeValues(tagid, fromts, tots) {
|
|
60
|
+
return new Promise(function (resolve, reject) {
|
|
61
|
+
var daqnode = _getDaqNode(tagid);
|
|
62
|
+
if (daqnode) {
|
|
63
|
+
resolve(daqnode.getDaqValue(tagid, fromts, tots));
|
|
64
|
+
} else {
|
|
65
|
+
resolve([]);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Return tags values,
|
|
72
|
+
* if with options then return function array [{DD/MM/YYYY mm:HH, ...values}]
|
|
73
|
+
* else for chart object {tagId} [{Date, value}]
|
|
74
|
+
* @param {*} tagsid
|
|
75
|
+
* @param {*} fromts
|
|
76
|
+
* @param {*} tots
|
|
77
|
+
* @param {*} options
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
function getNodesValues(tagsid, fromts, tots, options) {
|
|
81
|
+
return new Promise(async function (resolve, reject) {
|
|
82
|
+
try {
|
|
83
|
+
var dbfncs = [];
|
|
84
|
+
for (let i = 0; i < tagsid.length; i++) {
|
|
85
|
+
dbfncs.push(await getNodeValues(tagsid[i], fromts, tots));
|
|
86
|
+
}
|
|
87
|
+
Promise.all(dbfncs).then(values => {
|
|
88
|
+
if (!values || values.length < 1) { // (0)[]
|
|
89
|
+
resolve(['', ...tagsid.map(col => '')]);
|
|
90
|
+
} else if (options) {
|
|
91
|
+
let calcValues = [];
|
|
92
|
+
for (let idx = 0 ; idx < values.length; idx++) {
|
|
93
|
+
if (options.functions[idx]) {
|
|
94
|
+
calcValues.push(calculator.getFunctionValues(values[idx], fromts, tots, options.functions[idx], options.interval, options.formats[idx]));
|
|
95
|
+
} else {
|
|
96
|
+
calcValues.push(calculator.getFunctionValues(values[idx], fromts, tots));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
let keys = Object.keys(calcValues[0]).map(ts => Number(ts));
|
|
100
|
+
let mergeValues = Object.keys(calcValues[0]).map(ts => [utils.getFormatDate(new Date(Number(ts))), _getValue(calcValues[0][ts])]);
|
|
101
|
+
for (let x = 1; x < calcValues.length; x++) {
|
|
102
|
+
let y = 0;
|
|
103
|
+
keys.forEach(k => {
|
|
104
|
+
mergeValues[y++].push(_getValue(calcValues[x][k]));
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
resolve(mergeValues);
|
|
108
|
+
} else {
|
|
109
|
+
var result = {};
|
|
110
|
+
for (let i = 0; i < tagsid.length; i++) {
|
|
111
|
+
result[tagsid[i]] = values[i].map(v => { return { x: new Date(v.dt), y: v.value} });
|
|
112
|
+
result[tagsid[i]].push({ x: new Date(tots), y: null});
|
|
113
|
+
result[tagsid[i]].unshift({ x: new Date(fromts), y: null});
|
|
114
|
+
}
|
|
115
|
+
resolve(result);
|
|
116
|
+
}
|
|
117
|
+
}, reason => {
|
|
118
|
+
reject(reason);
|
|
119
|
+
});
|
|
120
|
+
} catch (err) {
|
|
121
|
+
reject(['ERR', ...tagsid.map(col => 'ERR')]);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function checkRetention() {
|
|
127
|
+
return new Promise(async function (resolve, reject) {
|
|
128
|
+
if (settings.daqstore && _getDbType() === DaqStoreTypeEnum.SQlite && settings.daqstore.retention !== 'none') {
|
|
129
|
+
try {
|
|
130
|
+
SqliteDB.checkRetention(utils.getRetentionLimit(settings.daqstore.retention), settings.dbDir,
|
|
131
|
+
(fileDeleted) => {
|
|
132
|
+
logger.info(`daqstorage.checkRetention file ${fileDeleted} removed`);
|
|
133
|
+
},
|
|
134
|
+
(err) => {
|
|
135
|
+
logger.error(`daqstorage.checkRetention remove file failed! ${err}`);
|
|
136
|
+
});
|
|
137
|
+
} catch (err) {
|
|
138
|
+
logger.error(err);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
logger.info(`daqstorage.checkRetention processed`);
|
|
142
|
+
resolve();
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function getCurrentStorageFnc() {
|
|
147
|
+
return currentStorateDB.getValuesByDeviceId;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function _getDaqNode(tagid) {
|
|
151
|
+
var nodes = Object.values(daqDB);
|
|
152
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
153
|
+
if (nodes[i].getDaqMap(tagid)[tagid]) {
|
|
154
|
+
return nodes[i];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function _getDbType() {
|
|
160
|
+
if (settings.daqstore && settings.daqstore.type) {
|
|
161
|
+
return settings.daqstore.type;
|
|
162
|
+
}
|
|
163
|
+
return DaqStoreTypeEnum.SQlite;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
var DaqStoreTypeEnum = {
|
|
167
|
+
SQlite: 'SQlite',
|
|
168
|
+
influxDB: 'influxDB',
|
|
169
|
+
influxDB18: 'influxDB18',
|
|
170
|
+
TDengine: 'TDengine',
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function _getValue(value) {
|
|
174
|
+
if (value == Number.MAX_VALUE || value === utils.SMALLEST_NEGATIVE_INTEGER || value == null) {
|
|
175
|
+
return '';
|
|
176
|
+
}
|
|
177
|
+
return value.toString();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
module.exports = {
|
|
181
|
+
init: init,
|
|
182
|
+
reset: reset,
|
|
183
|
+
addDaqNode: addDaqNode,
|
|
184
|
+
getNodeValues: getNodeValues,
|
|
185
|
+
getNodesValues: getNodesValues,
|
|
186
|
+
checkRetention: checkRetention,
|
|
187
|
+
getCurrentStorageFnc: getCurrentStorageFnc,
|
|
188
|
+
};
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module to manage the DAQ with influxdb
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
|
|
7
|
+
var utils = require('../../utils');
|
|
8
|
+
const influx = require('influx');
|
|
9
|
+
const { URL } = require('url');
|
|
10
|
+
var { InfluxDB, Point, flux } = require('@influxdata/influxdb-client');
|
|
11
|
+
|
|
12
|
+
const VERSION_18_FLUX = '1.8-flux';
|
|
13
|
+
const VERSION_20 = '2.0';
|
|
14
|
+
|
|
15
|
+
function Influx(_settings, _log, _currentStorate) {
|
|
16
|
+
|
|
17
|
+
var settings = _settings; // Application settings
|
|
18
|
+
var logger = _log; // Application logger
|
|
19
|
+
var currentStorage = _currentStorate // Database to set the last value (current)
|
|
20
|
+
var status = InfluxDBStatusEnum.CLOSE;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var influxError = { error: null, timestamp: 0 };
|
|
24
|
+
var influxdbVersion = VERSION_20;
|
|
25
|
+
var client = null;
|
|
26
|
+
var clientOptions = null
|
|
27
|
+
var writeApi = null
|
|
28
|
+
var queryApi = null
|
|
29
|
+
|
|
30
|
+
this.init = function () {
|
|
31
|
+
|
|
32
|
+
if (settings.daqstore.type === 'influxDB18') {
|
|
33
|
+
influxdbVersion = VERSION_18_FLUX;
|
|
34
|
+
}
|
|
35
|
+
if (settings.daqstore.credentials && influxdbVersion === VERSION_20) {
|
|
36
|
+
const token = settings.daqstore.credentials.token;
|
|
37
|
+
clientOptions = {
|
|
38
|
+
url: settings.daqstore.url,
|
|
39
|
+
// rejectUnauthorized: n.rejectUnauthorized,
|
|
40
|
+
token
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
client = new InfluxDB(clientOptions);
|
|
44
|
+
writeApi = client.getWriteApi(settings.daqstore.organization, settings.daqstore.bucket, 's');
|
|
45
|
+
queryApi = client.getQueryApi(settings.daqstore.organization);
|
|
46
|
+
status = InfluxDBStatusEnum.OPEN;
|
|
47
|
+
} catch (error) {
|
|
48
|
+
logger.error('influxdb-init failed! ' + error.message);
|
|
49
|
+
}
|
|
50
|
+
} else if (influxdbVersion === VERSION_18_FLUX) {
|
|
51
|
+
try {
|
|
52
|
+
const parsedUrl = new URL(settings.daqstore.url);
|
|
53
|
+
const [host] = parsedUrl.host.split(':');
|
|
54
|
+
const [protocol] = parsedUrl.protocol.split(':');
|
|
55
|
+
clientOptions = {
|
|
56
|
+
host: host,
|
|
57
|
+
port: parsedUrl.port || 8086,
|
|
58
|
+
protocol: protocol || 'http',
|
|
59
|
+
database: settings.daqstore.database,
|
|
60
|
+
username: settings.daqstore.credentials.username,
|
|
61
|
+
password: settings.daqstore.credentials.password,
|
|
62
|
+
}
|
|
63
|
+
} catch (error) {
|
|
64
|
+
logger.error(`influxdb-init failed! ${error}`);
|
|
65
|
+
reject(error);
|
|
66
|
+
}
|
|
67
|
+
client = new influx.InfluxDB(clientOptions);
|
|
68
|
+
status = InfluxDBStatusEnum.OPEN;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
this.close = function () {
|
|
73
|
+
try {
|
|
74
|
+
status = InfluxDBStatusEnum.CLOSE;
|
|
75
|
+
client.close().then(() => {
|
|
76
|
+
logger.info('influxdb-close FINISHED');
|
|
77
|
+
})
|
|
78
|
+
.catch((e) => {
|
|
79
|
+
logger.error(`influxdb-close failed! ${e}`);
|
|
80
|
+
});
|
|
81
|
+
} catch (error) {
|
|
82
|
+
logger.error(`influxdb-close failed! ${error}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
this.setCall = function (_fncGetProp) {
|
|
87
|
+
fncGetTagProp = _fncGetProp;
|
|
88
|
+
return this.addDaqValues;
|
|
89
|
+
}
|
|
90
|
+
var fncGetTagProp = null;
|
|
91
|
+
|
|
92
|
+
this.addDaqValue = function (tagId, tagValue) {
|
|
93
|
+
logger.error('influxdb-addDaqValue Not supported!');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.addDaqValues = function (tagsValues, deviceName, deviceId) {
|
|
97
|
+
var dataToWrite = [];
|
|
98
|
+
var dataToRestore = [];
|
|
99
|
+
for (var tagid in tagsValues) {
|
|
100
|
+
let tag = tagsValues[tagid];
|
|
101
|
+
if (!tag.daq || utils.isNullOrUndefined(tag.value) || Number.isNaN(tag.value)) {
|
|
102
|
+
if (tag.daq.restored) {
|
|
103
|
+
dataToRestore.push({id: tag.id, deviceId: deviceId, value: tag.value});
|
|
104
|
+
}
|
|
105
|
+
if (!tag.daq.enabled) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (influxdbVersion === VERSION_18_FLUX) {
|
|
110
|
+
const tags = {
|
|
111
|
+
id: tag.id,
|
|
112
|
+
devicename: deviceName
|
|
113
|
+
}
|
|
114
|
+
const fields = {
|
|
115
|
+
value: utils.isBoolean(tag.value) ? tag.value * 1 : tag.value
|
|
116
|
+
}
|
|
117
|
+
dataToWrite.push({
|
|
118
|
+
measurement: tag.id,
|
|
119
|
+
tags,
|
|
120
|
+
fields,
|
|
121
|
+
timestamp: new Date(tag.timestamp || new Date().getTime())
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
const point = new Point(tag.id)
|
|
125
|
+
.tag('id', tag.id)
|
|
126
|
+
.tag('name', tag.name || tag.tagref.name)
|
|
127
|
+
.tag('type', tag.type)
|
|
128
|
+
.timestamp(new Date(tag.timestamp || new Date().getTime()));
|
|
129
|
+
if (deviceName) {
|
|
130
|
+
point.tag('device', deviceName);
|
|
131
|
+
}
|
|
132
|
+
if (utils.isBoolean(tag.value)) {
|
|
133
|
+
point.booleanField('value', tag.value);
|
|
134
|
+
} else {
|
|
135
|
+
point.floatField('value', tag.value)
|
|
136
|
+
}
|
|
137
|
+
dataToWrite.push(point);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
if (dataToWrite.length) {
|
|
141
|
+
writePoints(dataToWrite);
|
|
142
|
+
}
|
|
143
|
+
if (dataToRestore.length && currentStorage) {
|
|
144
|
+
currentStorage.setValues(dataToRestore);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
this.getDaqMap = function (tagid) {
|
|
149
|
+
var dummy = {};
|
|
150
|
+
dummy[tagid] = true;
|
|
151
|
+
return dummy;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
this.getDaqValue = function (tagid, fromts, tots) {
|
|
155
|
+
return new Promise(function (resolve, reject) {
|
|
156
|
+
try {
|
|
157
|
+
if (influxdbVersion === VERSION_18_FLUX) {
|
|
158
|
+
fromts *= 1000000;
|
|
159
|
+
tots *= 1000000;
|
|
160
|
+
const query = `SELECT * FROM "${tagid}" WHERE time >= ${fromts} AND time <= ${tots}`;
|
|
161
|
+
client.query(query).then((result) => {
|
|
162
|
+
resolve(result.map(row => {
|
|
163
|
+
return {
|
|
164
|
+
dt: new Date(row.time).getTime(),
|
|
165
|
+
value: row.value
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
})
|
|
169
|
+
.catch((error) => {
|
|
170
|
+
logger.error(`influxdb-getDaqValue failed! ${error}`);
|
|
171
|
+
reject(error);
|
|
172
|
+
});
|
|
173
|
+
} else {
|
|
174
|
+
const query = flux`from(bucket: "${settings.daqstore.bucket}") |> range(start: ${new Date(fromts)}, stop: ${new Date(tots)}) |> filter(fn: (r) => r.id == "${tagid}")`;
|
|
175
|
+
var result = [];
|
|
176
|
+
queryApi.queryRows(query, {
|
|
177
|
+
next(row, tableMeta) {
|
|
178
|
+
const o = tableMeta.toObject(row);
|
|
179
|
+
result = result.concat({ dt: new Date(o._time).getTime(), value: o._value });
|
|
180
|
+
},
|
|
181
|
+
error(error) {
|
|
182
|
+
logger.error(`influxdb-getDaqValue failed! ${error}`);
|
|
183
|
+
reject(error);
|
|
184
|
+
},
|
|
185
|
+
complete() {
|
|
186
|
+
resolve(result);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
} catch (error) {
|
|
192
|
+
logger.error(`influxdb-getDaqValue failed! ${error}`);
|
|
193
|
+
reject(error);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function writePoints(points) {
|
|
199
|
+
try {
|
|
200
|
+
if (influxdbVersion === VERSION_18_FLUX) {
|
|
201
|
+
client.writePoints(points)
|
|
202
|
+
.catch((error) => {
|
|
203
|
+
logger.error(`influxdb-writePoints failed! ${error}`);
|
|
204
|
+
});
|
|
205
|
+
} else {
|
|
206
|
+
writeApi.writePoints(points);
|
|
207
|
+
writeApi.flush(true).then(() => {
|
|
208
|
+
// reset last error ;
|
|
209
|
+
}).catch(err => {
|
|
210
|
+
logger.error(`influxdb-writePoints error! ${err}`);
|
|
211
|
+
setError(err);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (currentStorage) {
|
|
215
|
+
currentStorage.setValues(points);
|
|
216
|
+
}
|
|
217
|
+
} catch (error) {
|
|
218
|
+
logger.error(`influxdb-writePoints failed! ${error}`);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function setError(error) {
|
|
223
|
+
influxError.error = error;
|
|
224
|
+
influxError.timestamp = new Date().getTime();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
this.init();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
module.exports = {
|
|
232
|
+
create: function (data, logger, currentStorate) {
|
|
233
|
+
return new Influx(data, logger, currentStorate);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
var InfluxDBStatusEnum = {
|
|
238
|
+
OPEN: 'open',
|
|
239
|
+
CLOSE: 'close',
|
|
240
|
+
}
|