node-red-contrib-me-vplc 1.0.0

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.
Files changed (37) hide show
  1. package/README.md +42 -0
  2. package/me-vplc.html +64 -0
  3. package/me-vplc.js +603 -0
  4. package/package.json +26 -0
  5. package/project/README.md +1052 -0
  6. package/project/START_ME_VPLC.cmd +176 -0
  7. package/project/backend/active_project.json +3 -0
  8. package/project/backend/app.py +839 -0
  9. package/project/backend/connector_runtime.py +585 -0
  10. package/project/backend/requirements.txt +3 -0
  11. package/project/backend/st_compiler.py +1415 -0
  12. package/project/frontend/index.html +12 -0
  13. package/project/frontend/package.json +18 -0
  14. package/project/frontend/src/App.jsx +631 -0
  15. package/project/frontend/src/style.css +964 -0
  16. package/project/frontend/vite.config.js +14 -0
  17. package/wheelhouse/Flask_Cors-4.0.1-py2.py3-none-any.whl +0 -0
  18. package/wheelhouse/blinker-1.9.0-py3-none-any.whl +0 -0
  19. package/wheelhouse/click-8.3.3-py3-none-any.whl +0 -0
  20. package/wheelhouse/colorama-0.4.6-py2.py3-none-any.whl +0 -0
  21. package/wheelhouse/flask-3.0.3-py3-none-any.whl +0 -0
  22. package/wheelhouse/itsdangerous-2.2.0-py3-none-any.whl +0 -0
  23. package/wheelhouse/jinja2-3.1.6-py3-none-any.whl +0 -0
  24. package/wheelhouse/markupsafe-3.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl +0 -0
  25. package/wheelhouse/markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl +0 -0
  26. package/wheelhouse/markupsafe-3.0.3-cp310-cp310-win_amd64.whl +0 -0
  27. package/wheelhouse/markupsafe-3.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl +0 -0
  28. package/wheelhouse/markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl +0 -0
  29. package/wheelhouse/markupsafe-3.0.3-cp311-cp311-win_amd64.whl +0 -0
  30. package/wheelhouse/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl +0 -0
  31. package/wheelhouse/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl +0 -0
  32. package/wheelhouse/markupsafe-3.0.3-cp312-cp312-win_amd64.whl +0 -0
  33. package/wheelhouse/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl +0 -0
  34. package/wheelhouse/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl +0 -0
  35. package/wheelhouse/markupsafe-3.0.3-cp313-cp313-win_amd64.whl +0 -0
  36. package/wheelhouse/pymodbus-3.6.9-py3-none-any.whl +0 -0
  37. package/wheelhouse/werkzeug-3.1.8-py3-none-any.whl +0 -0
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # ME vPLC Node-RED Offline-Installer
2
+
3
+ Version 1.0.5 enthält ein integriertes Python-Wheelhouse. Dadurch installiert der Node die Python-Abhängigkeiten beim ersten Start automatisch offline in eine lokale `.venv`.
4
+
5
+ ## Installation Windows
6
+
7
+ ```cmd
8
+ install_node_red_node_windows.cmd
9
+ ```
10
+
11
+ ## Installation Linux / Raspberry Pi
12
+
13
+ ```bash
14
+ chmod +x *.sh
15
+ ./install_node_red_node_linux.sh
16
+ ```
17
+
18
+ ## Ablauf beim ersten Deploy
19
+
20
+ 1. Runtime-Kopie nach `.node-red/me-vplc-runtime/<node-id>`
21
+ 2. Python erkennen
22
+ 3. `.venv` erzeugen
23
+ 4. Requirements mit `pip --no-index --find-links wheelhouse` installieren
24
+ 5. Flask-Backend auf Port 5000 starten
25
+
26
+ ## Enthaltene Wheels
27
+
28
+ Das Wheelhouse enthält die Projekt-Requirements und die nötigen Abhängigkeiten für typische Windows-x64-, Linux-x64- und Raspberry-Pi-aarch64-Installationen mit Python 3.10 bis 3.13.
29
+
30
+ ## Wheelhouse neu erzeugen
31
+
32
+ Windows:
33
+
34
+ ```cmd
35
+ prepare_offline_wheelhouse_windows.cmd
36
+ ```
37
+
38
+ Linux:
39
+
40
+ ```bash
41
+ ./prepare_offline_wheelhouse_linux.sh
42
+ ```
package/me-vplc.html ADDED
@@ -0,0 +1,64 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType("me-vplc", {
3
+ category: "ME vPLC",
4
+ color: "#8cc8ff",
5
+ defaults: {
6
+ name: { value: "ME vPLC" },
7
+ backendPort: { value: 5000, required: true, validate: RED.validators.number() },
8
+ pythonPath: { value: "", required: false },
9
+ autoStart: { value: true },
10
+ copyOnStart: { value: false },
11
+ autoInstallDeps: { value: true }
12
+ },
13
+ inputs: 1,
14
+ outputs: 1,
15
+ icon: "font-awesome/fa-microchip",
16
+ label: function () { return this.name || "ME vPLC"; }
17
+ });
18
+ </script>
19
+
20
+ <script type="text/html" data-template-name="me-vplc">
21
+ <div class="form-row">
22
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
23
+ <input type="text" id="node-input-name" placeholder="ME vPLC">
24
+ </div>
25
+ <div class="form-row">
26
+ <label for="node-input-backendPort"><i class="fa fa-plug"></i> Backend-Port</label>
27
+ <input type="number" id="node-input-backendPort" placeholder="5000">
28
+ </div>
29
+ <div class="form-row">
30
+ <label for="node-input-pythonPath"><i class="fa fa-terminal"></i> Python</label>
31
+ <input type="text" id="node-input-pythonPath" placeholder="leer = Auto-Erkennung: Windows python/py -3, Linux python3">
32
+ </div>
33
+ <div class="form-row">
34
+ <label for="node-input-autoStart"><i class="fa fa-play"></i> Autostart</label>
35
+ <input type="checkbox" id="node-input-autoStart" style="display:inline-block; width:auto; vertical-align:top;">
36
+ <span>Backend beim Deploy automatisch starten</span>
37
+ </div>
38
+ <div class="form-row">
39
+ <label for="node-input-copyOnStart"><i class="fa fa-copy"></i> Projekt kopieren</label>
40
+ <input type="checkbox" id="node-input-copyOnStart" style="display:inline-block; width:auto; vertical-align:top;">
41
+ <span>Runtime-Projekt bei jedem Start neu aus dem Node-Paket kopieren</span>
42
+ </div>
43
+ <div class="form-row">
44
+ <label for="node-input-autoInstallDeps"><i class="fa fa-download"></i> Python Pakete</label>
45
+ <input type="checkbox" id="node-input-autoInstallDeps" style="display:inline-block; width:auto; vertical-align:top;">
46
+ <span>fehlende Python-Abhängigkeiten beim ersten Start automatisch installieren</span>
47
+ </div>
48
+ </script>
49
+
50
+ <script type="text/html" data-help-name="me-vplc">
51
+ <p><b>ME vPLC</b> startet das integrierte Flask/React/ST-Projekt als lokale Runtime aus Node-RED heraus.</p>
52
+ <h3>Voraussetzungen</h3>
53
+ <p>Python muss installiert sein. Leer gelassener Python-Pfad nutzt eine Auto-Erkennung: unter Windows werden <code>python</code>, <code>py -3</code>, <code>py</code> und <code>python3</code> getestet; unter Linux/Raspberry Pi <code>python3</code> und <code>python</code>. Der Node erstellt beim ersten Start automatisch eine lokale Python-Umgebung unter <code>~/.node-red/me-vplc-runtime/&lt;node-id&gt;/.venv</code> und installiert fehlende Python-Pakete aus <code>project/backend/requirements.txt</code>. Für echte Offline-Installationen müssen die passenden Wheels im <code>wheelhouse</code> liegen oder vorher über den Offline-Installer installiert werden.</p>
54
+ <h3>Inputs</h3>
55
+ <ul>
56
+ <li><code>msg.payload = "status"</code> oder leer: Status von <code>/api/status</code></li>
57
+ <li><code>msg.payload = "start"</code>: PLC starten</li>
58
+ <li><code>msg.payload = "stop"</code>: PLC stoppen</li>
59
+ <li><code>msg.payload = "start-backend"</code>: Flask-Backend starten</li>
60
+ <li><code>msg.payload = "stop-backend"</code>: Flask-Backend stoppen</li>
61
+ </ul>
62
+ <h3>Ausgänge</h3>
63
+ <p><code>msg.payload</code> enthält die JSON-Antwort des ME-vPLC-Backends. <code>msg.meVplc.runtimeDir</code> zeigt auf die schreibbare Runtime-Kopie im Node-RED User-Verzeichnis.</p>
64
+ </script>