From 58b16509da62b8dab3f6c57c65d60fe27eba6aa8 Mon Sep 17 00:00:00 2001 From: Simon Steuer Date: Sun, 27 Apr 2025 17:36:41 +0200 Subject: [PATCH] =?UTF-8?q?Basierend=20auf=20Commit=20d905896=20werden=20n?= =?UTF-8?q?un=20Teilenummern,=20die=20in=20$CREMIG=5FCFG/BOM-Settings.cfg?= =?UTF-8?q?=20->=20Sektion=20'ExcludedIDsInBOM'=20definiert=20sind=20aus?= =?UTF-8?q?=20der=20Darstellung=20des=20Treeviews=20ausgeschlossen.=20Dar?= =?UTF-8?q?=C3=BCber=20hinaus=20wird=20nun=20bei=20Ausf=C3=BChrung=20von?= =?UTF-8?q?=20'Lade=20lokal'=20in=20der=20GUI=20die=20lokale=20Teilestamm-?= =?UTF-8?q?CSV=20gezogen.=20Bisher=20wurde=20immer=20vom=20Server=20generi?= =?UTF-8?q?ert,=20was=20vor=20allem=20bei=20Tests=20=C3=BCber=20einen=20Re?= =?UTF-8?q?moteclient=20sehr=20langsam=20ist.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/CreoMigrateGui.py | 2 +- lib/controller.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/CreoMigrateGui.py b/lib/CreoMigrateGui.py index 7b968cc..a7d125f 100644 --- a/lib/CreoMigrateGui.py +++ b/lib/CreoMigrateGui.py @@ -28,7 +28,7 @@ def build_gui(model, configs, env, sivasid=None, uselocal=True): controller.set_env(env) controller.set_config(configs) if sivasid: - controller.get_csv_files_of_asm(sivasid, uselocal) + controller.get_csv_files_of_asm(sivasid, load_local_bom=uselocal, load_local_teilestamm=uselocal, load_local_rd_ids=uselocal) logic = GuiLogic(model, configs) model.add_logic(logic) diff --git a/lib/controller.py b/lib/controller.py index e90d1e1..f2294c7 100644 --- a/lib/controller.py +++ b/lib/controller.py @@ -115,21 +115,23 @@ class Controller(Observer): orange[red] = True return orange - def get_csv_files_of_asm(self, asm_id, load_local_asm_json=False, load_local_rd_dbase=False): + def get_csv_files_of_asm(self, asm_id, load_local_bom=False, load_local_teilestamm=False, load_local_rd_ids=False): """ Holt sich die Metadaten der Stücklistenpositionen als CSV""" data_dir = self.get_env("data") rd_dbase_filename = self.get_env("rd_dbase_filename") - sivas_bom = SivasBOM(data_dir, asm_id + '.json', load_local_asm_json) + excluded_bom_ids = self._config.bom_config.get_excluded_ids("ExcludedPartnumbersInBOM") + + sivas_bom = SivasBOM(asm_id, data_dir, asm_id + '.json', load_local_bom, excluded_bom_ids) sivas_bom.extend_asm_bom(asm_id, {"Parent": None, "Position": "10/0"}) # Ergänzt Stücklistendaten um eine fiktive Baugruppe "None", in der die Haupt-Teilenummer als Pos. 1 vorliegt. Dadurch können auch Teilenummern ohne Stückliste korrekt abgebildet werden - rd_data = RuleDesignerDatabaseConfig(data_dir, rd_dbase_filename, load_local_rd_dbase) + rd_data = RuleDesignerDatabaseConfig(data_dir, rd_dbase_filename, load_local_rd_ids) migration_status = MigrationStatus(sivas_bom.child_ids, rd_data.ids) pending_ids = migration_status.ids_pending - sivas_teilestamm = SivasTeilestamm(data_dir, asm_id + '.csv') + sivas_teilestamm = SivasTeilestamm(data_dir, asm_id + '.csv', load_local_csv=load_local_teilestamm) sivas_teilestamm.create_csvs(pending_ids) self._model.set_red_ids(pending_ids) @@ -154,11 +156,11 @@ class Controller(Observer): def get_current_asm_id(self): self._model.get_asm_id() - def set_current_asm_id(self, asm_id, load_local_asm_json=False, load_local_rd_dbase=False): + def set_current_asm_id(self, asm_id, load_local_bom=False, load_local_teilestamm=False, load_local_rd_ids=False): # TODO save current given data. In case, ask whether you should save or drop self._model.set_asm_id(asm_id) # hole alle Daten vom Server - self.get_csv_files_of_asm(asm_id, load_local_asm_json, load_local_rd_dbase) + self.get_csv_files_of_asm(asm_id, load_local_bom, load_local_teilestamm, load_local_rd_ids) def set_current_item_id(self, cid): """setze eine neue Item ID """ @@ -289,7 +291,7 @@ class Controller(Observer): elif key == 'cb_ladelokal_asm': current_asmid = self.data_from_view('asm_id') # hole dir nur die lokalen Daten. Keine Datenbankabfrage - self.set_current_asm_id(current_asmid, load_local_asm_json=True, load_local_rd_dbase=True) + self.set_current_asm_id(current_asmid, load_local_bom=True, load_local_teilestamm=True, load_local_rd_ids=True) elif key == 'cb_3dsuchen': self.suche_3d()