From a007f22819c1a6bbbb57cd8144329096926c82bd Mon Sep 17 00:00:00 2001 From: mistangl Date: Tue, 15 Jul 2025 17:05:32 +0200 Subject: [PATCH] =?UTF-8?q?Rahmeneintr=C3=A4ge=20mit=20A,B,C,=20usw.=20wer?= =?UTF-8?q?den=20vom=20ioconverter=20in=20Zukunft=20ignoriert.=20Nur=20Rah?= =?UTF-8?q?men=20mit=20IO=20werden=20verwendet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 31 +++++++++++++++++++++++++++++++ lib/portalexport.py | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/.vscode/launch.json b/.vscode/launch.json index be17882..6e44043 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,7 @@ { "version": "0.2.0", "configurations": [ + { "name": "Python Debugger: Current File", "type": "debugpy", @@ -39,6 +40,36 @@ "easy_positions.json" ] }, + { + "name": "getpositions with ST500592_Omniflo.dxf", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "args": [ + "--filename", + "ST500592_Omniflo.dxf", + "--sensors", + "--rack", + "--console", + "--write", + "ST500592_Omniflo_positions.json" + ] + }, + { + "name": "portalexport with ST500592_Omniflo.dxf", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "console": "integratedTerminal", + "args": [ + "--filename", + "ST500592_Omniflo_positions.json", + "--outname", + "ST500592_Omniflo" + ] + }, + call portalexport.bat --filename %JSON_POS% --outname %FILENAME% { "name": "getpositions with ST-Fortna.dxf", "type": "debugpy", diff --git a/lib/portalexport.py b/lib/portalexport.py index ddcdc27..fc2056f 100644 --- a/lib/portalexport.py +++ b/lib/portalexport.py @@ -33,6 +33,8 @@ def prepare_data(rawdata:dict): lsensors = list() for sname, sdata in sensors.items(): + if "IO" not in sdata: + continue csvstr, sps_nr = process_item(sname, sdata) if sps_nr: if sps_nr not in dsensors: @@ -42,6 +44,8 @@ def prepare_data(rawdata:dict): lsensors.append(csvstr) for schaltele, sdata in schaltschrank_elemente.items(): + if "IO" not in sdata: + continue csvstr, sps_nr = process_item(schaltele, sdata) if sps_nr: if sps_nr not in dsensors: