Neuer Schalter für drawdxf. Anpassung der config aufrufe in routing und getpositions

This commit is contained in:
2025-05-28 16:51:22 +02:00
parent 22767d11d3
commit 7772981870
4 changed files with 140 additions and 49 deletions
+6 -6
View File
@@ -70,8 +70,8 @@ def get_input_positions(msp: ezdxf.document.Drawing.modelspace):
pos = attrib.dxf.insert #Position Ecke unten links von "x"-Marker auslesen
# Hoehe und Breite von "x" addieren, um Mittelpunkt zu finden
breite_marker = config.getfloat("Sensor_Marker", "Breite")
hoehe_marker = config.getfloat("Sensor_Marker", "Hoehe")
breite_marker = config.getfloat("GetPos-Geom-Sensor", "Breite")
hoehe_marker = config.getfloat("GetPos-Geom-Sensor", "Hoehe")
pos_midx = pos.x + breite_marker*0.5
pos_midy = pos.y + hoehe_marker*0.5
@@ -143,7 +143,7 @@ def get_subdistributor_positions(msp, dist2sensors):
ret = dict()
# Alle Texte auf Layer "xy"
all_distributors = dist2sensors.keys()
all_layers = config.items('Layer_Busverteiler')
all_layers = config.items('GetPos-Layer_Distributors')
for (layer,v) in all_layers:
for distname in all_distributors:
selectstr = f'MTEXT[layer=="{layer}"]'
@@ -165,7 +165,7 @@ def get_tunnel_positions(msp):
allTunnels = dict()
tunnel_length = dict()
# Alle Text mit "Tunnel" als Inhalt auf Layer "xy"
all_layers = config.items('Layer_Tunnel')
all_layers = config.items('GetPos-Layer_Tunnel')
for (layer,v) in all_layers:
selectstr = f'MTEXT[layer=="{layer}"]'
for text in msp.query(selectstr):
@@ -209,7 +209,7 @@ def get_rack_positions(msp):
ret = dict()
rack_counter = 1 #Zaehler für Rack Nummerierung
all_layers = list(config.items('Layer_Pritschen'))
all_layers = list(config.items('GetPos-Layer_Racks'))
for (layer,v) in all_layers:
selectstr = f'LWPOLYLINE[layer=="{layer}"]'
for e in msp.query(selectstr):
@@ -286,7 +286,7 @@ if __name__ == '__main__':
config = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
config.optionxform = lambda option: option # preserve case for letters
config.read(os.path.join(config_dir, "getpositions.cfg"))
config.read(os.path.join(config_dir, "allgemein.cfg"))
output_results = dict()
if args.sensors: