Schalter für Einlesen von positions_json in drawdxf etfernt (bat-Datei und Python Skript angepasst)., Sensor dataclass in drawdxf entfernt
get_type_of_name_cfg als Config-basierte Methode statt hardcode geschrieben. map_sensor_to_cable_cfg als config basierte methode mitsamt kürzung de Kabel, etc.. Erstellung von Betriebsmittelkennzeichner Config.
This commit is contained in:
+17
-2
@@ -55,7 +55,7 @@ def get_type_of_name(name):
|
||||
"SF" # Drucktaster
|
||||
]
|
||||
|
||||
prefix = name[0:2]
|
||||
prefix = name[:2]
|
||||
if prefix in SpecialKeys:
|
||||
typ = "Sensor"
|
||||
|
||||
@@ -72,6 +72,16 @@ def get_type_of_name(name):
|
||||
|
||||
return typ
|
||||
|
||||
def get_type_of_name_cfg(name):
|
||||
prefix = name[:2]
|
||||
|
||||
if config_BMK.has_option("Routing-Include", prefix):
|
||||
return "Sensor"
|
||||
elif config_BMK.has_option("Routing-Ignore", prefix):
|
||||
return "Schaltschrankelement"
|
||||
else:
|
||||
return "unknown"
|
||||
|
||||
def get_attributes_of_insert(insert):
|
||||
id = ""
|
||||
ld = dict()
|
||||
@@ -441,10 +451,15 @@ if __name__ == '__main__':
|
||||
|
||||
if args.sensors or args.dists or args.rack:
|
||||
|
||||
# Allgemeine Config Laden
|
||||
config = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
|
||||
config.optionxform = lambda option: option # preserve case for letters
|
||||
|
||||
config.read(os.path.join(config_dir, "allgemein.cfg"))
|
||||
|
||||
# Betriebsmittelkennzeichnungs-Config laden
|
||||
config_BMK = configparser.ConfigParser(allow_no_value=True, delimiters=("="))
|
||||
config_BMK.optionxform = lambda option: option # preserve case for letters
|
||||
config_BMK.read(os.path.join(config_dir, "BMK.cfg"))
|
||||
|
||||
output_results = dict()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user