dev free_fall
This commit is contained in:
parent
95e99e8653
commit
26f3402fe4
Binary file not shown.
|
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 730 KiB |
BIN
config/warning_images/generic/PERVIETÀ_2.png
Normal file
BIN
config/warning_images/generic/PERVIETÀ_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 730 KiB |
|
|
@ -208,6 +208,29 @@ class Test_Leak(Test_Test):
|
|||
super().visualize(None, img=QPixmap(ff_img))
|
||||
else:
|
||||
super().visualize(None, img=self.status_imgs_full[None])
|
||||
else:
|
||||
# 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user