diff --git a/config/warning_images/generic/PERVIETÀ.png b/config/warning_images/generic/PERVIETÀ.png index ebd61ce..ae8e268 100644 Binary files a/config/warning_images/generic/PERVIETÀ.png and b/config/warning_images/generic/PERVIETÀ.png differ diff --git a/config/warning_images/generic/PERVIETÀ_2.png b/config/warning_images/generic/PERVIETÀ_2.png new file mode 100644 index 0000000..2e008d7 Binary files /dev/null and b/config/warning_images/generic/PERVIETÀ_2.png differ diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index 586c567..8f58cac 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -209,11 +209,34 @@ class Test_Leak(Test_Test): else: super().visualize(None, img=self.status_imgs_full[None]) else: - # Ensure Free Fall mode is disabled for other steps - self._free_fall_mode = False - self._free_fall_img_scale = None - self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA") - super().visualize(None, img=self.status_imgs_full[None]) + # If the recipe contains a Free Fall test, show the PERVIETÀ image as default even on Leak steps + try: + has_free_fall = any(getattr(s, "step_type", None) == "test_freefall_leak" for s in (self.parent.cycle_steps or [])) + except Exception: + has_free_fall = False + if has_free_fall: + # Reuse Free Fall mode to benefit from special scaling and image persistence + self._free_fall_mode = True + self._free_fall_img_scale = 1.75 + # Keep normal Leak instruction text + self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA") + # Load PERVIETÀ image with fallbacks + pervieta_path_candidates = [ + "config/warning_images/generic/PERVIETÀ_2.png", + "config/warning_images/generic/PERVIETA_2.png", + "config/warning_images/generic/pervieta_2.png", + ] + img_path = next((p for p in pervieta_path_candidates if os.path.exists(p)), None) + if img_path is not None: + super().visualize(None, img=QPixmap(img_path)) + else: + super().visualize(None, img=self.status_imgs_full[None]) + else: + # Ensure Free Fall mode is disabled for other steps + self._free_fall_mode = False + self._free_fall_img_scale = None + self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA") + super().visualize(None, img=self.status_imgs_full[None]) if step.step_type != "test_freefall_leak": self.template_print_l.setVisible(True) self.template_label.setVisible(True) @@ -391,7 +414,16 @@ class Test_Leak(Test_Test): self.stop_b.setEnabled(True) ok = data.get("results", {}).get("ok", None) - super().visualize(data, img=self.status_imgs_full[ok]) + # Preserve PERVIETÀ image during Free Fall-related steps + if getattr(self, "_free_fall_mode", False): + # Keep the current image (likely PERVIETÀ) instead of switching to status icons + cur_img = getattr(self, "img", None) + if cur_img is not None: + super().visualize(data, img=cur_img) + else: + super().visualize(data, img=self.status_imgs_full.get(ok, self.status_imgs_full[None])) + else: + super().visualize(data, img=self.status_imgs_full.get(ok, self.status_imgs_full[None])) def display_text(self,text="", bg_color=None,text_color=None): # Display the message in the parent assembly widget if available