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: