From 78a5166a5c82499debf9be7ffb77a0abab3edd01 Mon Sep 17 00:00:00 2001 From: eduar Date: Fri, 27 Mar 2026 09:44:57 +0100 Subject: [PATCH] password ristampa etichetta + log --- src/lib/helpers/recipe_manager.py | 2 +- src/main.py | 12 +++++++++++- src/ui/test/test.py | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/helpers/recipe_manager.py b/src/lib/helpers/recipe_manager.py index 49ec9cb..ced72a5 100644 --- a/src/lib/helpers/recipe_manager.py +++ b/src/lib/helpers/recipe_manager.py @@ -266,7 +266,7 @@ def import_recipes(config, csv_path=None, defaults=None, unsupported_steps=None, "vision": str(row.get("test_visione_abilitato", defaults["test_visione_abilitato"])).strip().lower() in {"si", "s", "x", "yes", "y", "true", "1"} and "vision" not in ( unsupported_steps or []), "test_freefall_leak": len( - row.get("prova_pervieta_abilitata", defaults["prova_pervieta_abilitata"])) and "test_freefall_leak" not in ( + row.get("prova_pervieta_abilitata", defaults.get("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 ( diff --git a/src/main.py b/src/main.py index 0c2ed5d..0df8673 100644 --- a/src/main.py +++ b/src/main.py @@ -322,7 +322,17 @@ try: self.main_window.centralWidget().set_recipe_mode_barcode() def reprint_label(self): - self.main_window.centralWidget().reprint_label() + password, ok = QInputDialog.getText( + self.main_window, + "Ristampa etichetta", + "Inserisci la password:", + QLineEdit.Password + ) + + if ok and password == "neodev123": + self.main_window.centralWidget().reprint_label() + elif ok: + QMessageBox.warning(self.main_window, "Errore", "Password non valida") def tag_write(self): if isinstance(self.main_window.centralWidget().centralWidget.widget, Barcode_Recipe_Selection): diff --git a/src/ui/test/test.py b/src/ui/test/test.py index a83f95c..df60af6 100755 --- a/src/ui/test/test.py +++ b/src/ui/test/test.py @@ -347,6 +347,7 @@ class Test(Widget): self.components["pipe_cutter"].start_cutting() def reprint_label(self): + self.log.info(f"Reprinting label: format={self.print_step.spec.get('template', 'EtichettaR5')}, text={self.last_label}") self.print(self.last_label, self.print_step.spec.get("template", "EtichettaR5")) def fail_cycle(self):