diff --git a/config/csv_import/freefall.csv b/config/csv_import/freefall.csv new file mode 100644 index 0000000..952d0a6 --- /dev/null +++ b/config/csv_import/freefall.csv @@ -0,0 +1,3 @@ +codice_ricetta,cliente,part_number,dimensione_lotto_abilitata,dimensione_lotto,verifica_connettore_abilitata,connettore,verifica_codice_a_barre_abilitata,codice_a_barre,verifica_resistenza_connettore_abilitata,scala_resistenza,r nominale,tolleranza_resistenza_pos,tolleranza_resistenza_neg,avvitatura_abilitata,viti,prova_tenuta_abilitata,tempo_pre_riempimento,pressione_pre_riempimento,tempo_riempimento,tempo_assestamento,percentuale_minima_pressione_assestamento,percentuale_massima_pressione_assestamento,tempo_di_test,pressione_di_test_delta_minimo,pressione_di_test,pressione_di_test_delta_massimo,tempo_svuotamento,pressione_svuotamento,prova_pervieta_abilitata,tempo_riempimento_free_fall,pressione_riempimento_free_fall,pressione_min_free_fall,pressione_max_free_fall,riempimento_continuo_free_fall,prova_tenuta_abilitata_2,tempo_pre_riempimento_2,pressione_pre_riempimento_2,tempo_riempimento_2,tempo_assestamento_2,percentuale_minima_pressione_assestamento_2,percentuale_massima_pressione_assestamento_2,tempo_di_test_2,pressione_di_test_delta_minimo_2,pressione_di_test_2,pressione_di_test_delta_massimo_2,tempo_svuotamento_2,pressione_svuotamento_2,test_visione_abilitato,ricetta_visione,stampa_etichetta_abilitata,modello_etichetta,labeltxt_1,labeltxt_2,labeltxt_3,labeltxt_4,labeltxt_5,printer_selection +test,test,test,,,,,,,,,,,,,,x,0,1000,15,15,5,5,10,30,7000,30,0,100,x,15,,0,0,,,0,1000,20,20,5,5,10,30,15000,30,0,100,False,,x,ERRECINQUE_flag_qr_only.prn,,,,,,203 +test2,test2,test2,,,,,,,,,,,,,,x,0,1000,15,15,5,5,10,30,7000,30,0,100,,15,0,0,0,,,0,1000,20,20,5,5,10,30,15000,30,0,100,False,,x,ERRECINQUE_flag_qr_only.prn,,,,,,203 diff --git a/config/machine_settings/st-ten-11.ini b/config/machine_settings/st-ten-11.ini index cd2e413..50efb51 100644 --- a/config/machine_settings/st-ten-11.ini +++ b/config/machine_settings/st-ten-11.ini @@ -78,6 +78,11 @@ pressione_di_test_delta_massimo: 30 tempo_svuotamento: 0 pressione_svuotamento: 100 canale_di_prova: 1 +tempo_pre_riempimento_free_fall: 0 +pressione_riempimento_free_fall: 1000 +pressione_min_free_fall: +pressione_max_free_fall: +riempimento_continuo_free_fall: prova_tenuta_abilitata_2: tempo_pre_riempimento_2: 0 pressione_pre_riempimento_2: 1000 diff --git a/src/lib/helpers/recipe_manager.py b/src/lib/helpers/recipe_manager.py index 37f7c47..d42c5ba 100644 --- a/src/lib/helpers/recipe_manager.py +++ b/src/lib/helpers/recipe_manager.py @@ -298,7 +298,7 @@ def import_recipes(config, csv_path=None, defaults=None, unsupported_steps=None, row.get("test_visione_abilitato", defaults["test_visione_abilitato"])) and "vision" not in ( unsupported_steps or []), "test_freefall_leak": len( - row.get("prova_tenuta_abilitata", defaults["prova_tenuta_abilitata"])) and "test_freefall_leak" not in ( + row.get("prova_pervieta_abilitata", defaults["prova_pervieta_abilitata"])) and "test_freefall_leak" not in ( unsupported_steps or []), "leak_1": len( row.get("prova_tenuta_abilitata", defaults["prova_tenuta_abilitata"])) and "leak_1" not in ( @@ -428,12 +428,12 @@ def export_recipes(config, csv_path=None, logger=None): if "test_freefall_leak" in steps: # Ensure enable flag present even if leak_1 absent exportable.update({ - "prova_pervieta_abilitata": exportable.get("prova_pervieta_abilitata", ""), - "tempo_riempimento_free_fall": steps["test_freefall_leak"].spec.get("filling_time", 0), - "pressione_riempimento_free_fall": steps["test_freefall_leak"].spec.get("filling_pressure", 0), - "pressione_min_free_fall": steps["test_freefall_leak"].spec.get("pressure_min", 0), - "pressione_max_free_fall": steps["test_freefall_leak"].spec.get("pressure_max", 0), - "riempimento_continuo_free_fall": "x" if steps["test_freefall_leak"].spec.get("continuous_filling") else "", + "prova_pervieta_abilitata": "x", + "tempo_riempimento_free_fall": steps["test_freefall_leak"].spec["filling_time"], + "pressione_riempimento_free_fall": steps["test_freefall_leak"].spec["filling_pressure"], + "pressione_min_free_fall": steps["test_freefall_leak"].spec["pressure_min"], + "pressione_max_free_fall": steps["test_freefall_leak"].spec["pressure_max"], + "riempimento_continuo_free_fall": "x" if steps["test_freefall_leak"].spec["continuous_filling"] else "", }) fieldnames.update([ "prova_pervieta_abilitata", diff --git a/src/ui/recipe_selection/recipe_selection.py b/src/ui/recipe_selection/recipe_selection.py index b74b423..130cd78 100755 --- a/src/ui/recipe_selection/recipe_selection.py +++ b/src/ui/recipe_selection/recipe_selection.py @@ -163,7 +163,7 @@ class Recipe_Selection(Widget): "pipe_cutter": len(self.config.get("recipes_defaults", noner)["tagliatubi_abilitata"]) and "pipe_cutter" not in self.unsupported_steps, "vision": len(self.config.get("recipes_defaults", noner)["test_visione_abilitato"]) and "vision" not in self.unsupported_steps, "leak_1": len(self.config.get("recipes_defaults", noner)["prova_tenuta_abilitata"]) and "leak_1" not in self.unsupported_steps, - "test_freefall_leak": len(self.config.get("recipes_defaults", noner)["prova_tenuta_abilitata"]) and "test_freefall_leak" not in self.unsupported_steps, + "test_freefall_leak": len(self.config.get("recipes_defaults", noner)["prova_pervieta_abilitata"]) and "test_freefall_leak" not in self.unsupported_steps, "leak_2": (self.second_leak_test_enabled and len(self.config.get("recipes_defaults", noner)["prova_tenuta_abilitata_2"]) and "leak_2" not in self.unsupported_steps), "print": len(self.config.get("recipes_defaults", noner)["stampa_etichetta_abilitata"]) and "print" not in self.unsupported_steps, "step_editors": step_defaults, @@ -546,6 +546,12 @@ class Recipe_Selection(Widget): "pressione_di_test_delta_massimo", "tempo_svuotamento", "pressione_svuotamento", + "prova_pervieta_abilitata", + "tempo_riempimento_free_fall", + "pressione_riempimento_free_fall", + "pressione_min_free_fall", + "pressione_max_free_fall", + "riempimento_continuo_free_fall", "prova_tenuta_abilitata_2", "tempo_pre_riempimento_2", "pressione_pre_riempimento_2", @@ -632,6 +638,12 @@ class Recipe_Selection(Widget): "pressione_di_test_delta_massimo_2": steps.get("leak_2",Step()).spec.get("test_pressure_qpos",""), "tempo_svuotamento_2": steps.get("leak_2",Step()).spec.get("flush_time",""), "pressione_svuotamento_2": steps.get("leak_2",Step()).spec.get("flush_pressure",""), + "prova_pervieta_abilitata": "x" if recipe.spec.get("test_freefall_leak", False) in ("x",True,"true","True") else "", + "tempo_riempimento_free_fall": steps.get("test_freefall_leak", Step()).spec.get("filling_time", ""), + "pressione_riempimento_free_fall": steps.get("test_freefall_leak", Step()).spec.get("pre_filling_pressure", ""), + "pressione_min_free_fall": steps.get("test_freefall_leak", Step()).spec.get("pressure_min", ""), + "pressione_max_free_fall": steps.get("test_freefall_leak", Step()).spec.get("pressure_max", ""), + "riempimento_continuo_free_fall": "x" if steps.get("test_freefall_leak", Step()).spec.get("continuous_filling", False) in ("x",True,"true","True") else "", "test_visione_abilitato": recipe.spec.get("vision",""), "ricetta_visione": steps.get("vision",Step()).spec.get("recipe",""), "stampa_etichetta_abilitata": "x" if recipe.spec.get("print",False) else "",