ricette benedetti

This commit is contained in:
edo-neo 2025-10-15 09:44:50 +02:00
parent 9e77a7424f
commit f0fb7a47d1
8 changed files with 115 additions and 1 deletions

View File

@ -5,6 +5,7 @@ image_for_warning= st-ten-11
[hardware_config]
archive_synchronizer: present
free_fall: present
archive_synchronizer_extra: present
uvc_camera: absent
label_printer: present

View File

@ -106,6 +106,44 @@ def read_steps(row, config, defaults=None, unsupported_steps=None):
row.get("pid_pressure_correction", defaults["pid_pressure_correction"])),
"pid_mod_config": safe_parse(row.get("pid_mod_config", defaults["pid_mod_config"])),
},
"test_freefall_leak": {
"pre_filling_time": safe_parse(row.get("tempo_pre_riempimento", defaults["tempo_pre_riempimento"])),
"pre_filling_pressure": safe_parse(
row.get("pressione_pre_riempimento", defaults["pressione_pre_riempimento"]))
,
"filling_time": safe_parse(row.get("tempo_riempimento", defaults["tempo_riempimento"])),
"settling_time": safe_parse(get_default_value(row, "tempo_assestamento")),
"settling_pressure_min_percent": safe_parse(
row.get("percentuale_minima_pressione_assestamento",
defaults["percentuale_minima_pressione_assestamento"]))
,
"settling_pressure_max_percent": safe_parse(
row.get("percentuale_massima_pressione_assestamento",
defaults["percentuale_massima_pressione_assestamento"]))
,
"test_time": safe_parse(row.get("tempo_di_test", defaults["tempo_di_test"])),
"test_pressure_qneg": safe_parse(
row.get("pressione_di_test_delta_minimo", defaults["pressione_di_test_delta_minimo"]))
,
"test_pressure": safe_parse(row.get("pressione_di_test", defaults["pressione_di_test"])),
"test_pressure_qpos": safe_parse(
row.get("pressione_di_test_delta_massimo", defaults["pressione_di_test_delta_massimo"]))
,
"flush_time": safe_parse(row.get("tempo_svuotamento", defaults["tempo_svuotamento"])),
"flush_pressure": safe_parse(row.get("pressione_svuotamento", defaults["pressione_svuotamento"]))
,
"chan_sel": safe_parse(row.get("canale_di_prova", defaults["canale_di_prova"]))
,
"ext_flush_time": safe_parse(row.get("tempo_svuotamento_esterno", defaults["tempo_svuotamento_esterno"]))
,
"ext_blow_time": safe_parse(row.get("tempo_soffiaggio_esterno", defaults["tempo_soffiaggio_esterno"]))
,
"pid_pressure_correction": safe_parse(
row.get("pid_pressure_correction", defaults["pid_pressure_correction"]))
,
"pid_mod_config": safe_parse(row.get("pid_mod_config", defaults["pid_mod_config"]))
,
},
"leak_2": {
"pre_filling_time": safe_parse(row.get("tempo_pre_riempimento_2", defaults["tempo_pre_riempimento_2"])),
"pre_filling_pressure": safe_parse(
@ -254,6 +292,9 @@ def import_recipes(config, csv_path=None, defaults=None, unsupported_steps=None,
"vision": len(
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 (
unsupported_steps or []),
"leak_1": len(
row.get("prova_tenuta_abilitata", defaults["prova_tenuta_abilitata"])) and "leak_1" not in (
unsupported_steps or []),

View File

@ -40,6 +40,9 @@ class Recipe_Selection(Widget):
self.second_leak_test_enabled = self.config["hardware_config"].get("second_leak_test", "absent") == "present"
self.defaults = self.config.get("recipes_defaults", noner)
self.unsupported_steps = set(unsupported_steps or set())
# Gate Free Fall feature by hardware_config flag
if self.config.get("hardware_config", {}).get("free_fall", "absent") != "present":
self.unsupported_steps.add("test_freefall_leak")
# Hide instruction_extra entirely unless explicitly enabled in recipes_defaults (istruzione_abilitata_extra: x)
try:
instr_extra_enabled = str(self.config.get("recipes_defaults", noner)["istruzione_abilitata_extra"]).strip().lower() == "x"
@ -158,6 +161,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,
"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,

View File

@ -81,6 +81,13 @@ class Recipe_Spec_And_Step_Editor(Editor):
"editor": Leak_Step_Editor(),
"tab": self.leak_1_t,
},
"test_freefall_leak": {
"type": "test_freefall_leak",
"enable": self.free_fall_enabled_cb,
"widget": "free_fall_editor_w",
"editor": Leak_Step_Editor(),
"tab": self.free_fall_t,
},
"leak_2": {
"type": "leak_2",
"enable": self.leak_enabled_2_cb,

View File

@ -434,6 +434,49 @@ Fasi di Test</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="free_fall_t">
<attribute name="title">
<string>Free Fall</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_free_fall">
<item row="0" column="0">
<spacer name="horizontalSpacer_ff_left">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="free_fall_enabled_cb">
<property name="text">
<string>Fase Abilitata</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_ff_right">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0" colspan="3">
<widget class="QWidget" name="free_fall_editor_w" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="leak_2_t">
<attribute name="title">
<string>Test caduta pressione 2</string>

View File

@ -14,6 +14,7 @@ class Step_Spec_JEDECW(QPushButton, Cell):
self.editors = {
"vision": Vision_Step_Editor(cell_widget=self),
"leak_1": Leak_Step_Editor(cell_widget=self),
"test_freefall_leak": Leak_Step_Editor(cell_widget=self),
"leak_2": Leak_Step_Editor(cell_widget=self),
}
self.editor = None
@ -77,6 +78,7 @@ class Steps_Management(Widget):
autocomplete={
"type": [
"leak_1",
"test_freefall_leak",
"leak_2",
"vision",
],

View File

@ -127,6 +127,7 @@ class Test(Widget):
"screws": {"screwdriver", "tecna_t3", },
"resistance": {"multicomp", },
"leak_1": {self.tester_component, },
"test_freefall_leak": {self.tester_component, },
"leak_2": {self.tester_component, },
"pipe_cutter": {"pipe_cutter"},
"vision": {("uvc_camera", "galaxy_camera","hikrobot_sc"), "vision", "vision_saver", }, # "neo_pixels", },
@ -164,6 +165,8 @@ class Test(Widget):
text=u"EMERGENZA INTERVENUTA - RIPRISTINARE PULSANTE E SELEZIONARE \"RESET EMERGENZA\" DAL MEN\u00d9 \"STRUMENTI\"", widget=None),
"fail": Test_Assembly(img_path=self.select_step_img("fail"), text=u"CICLO INTERROTTO, PREMERE CONTINUA PER COMINCIARE UN NUOVO CICLO", widget=Test_Fail(parent=self)),
"blow": Test_Assembly(img_path=None, text=u"SOFFIAGGIO TUBO IN CORSO - ATTENDERE...", widget=Test_Warning_Img(components=self.components, recipe=self.recipe, step=self.step)),
"test_freefall_leak": Test_Assembly(img_path=None, text=None, widget=Test_Leak(config=self.config,components=self.components, recipe=self.recipe, step=self.step, pieces=self.pieces, parent=self))
if self.config["hardware_config"]["tecna_t3"] != "absent" or self.config["hardware_config"]["furness_controls"] !="absent" else None,
"leak_1": Test_Assembly(img_path=None, text=None, widget=Test_Leak(config=self.config,components=self.components, recipe=self.recipe, step=self.step, pieces=self.pieces, parent=self))
if self.config["hardware_config"]["tecna_t3"] != "absent" or self.config["hardware_config"]["furness_controls"] !="absent" else None,
"leak_2": Test_Assembly(img_path=None, text=None, widget=Test_Leak(config=self.config,components=self.components, recipe=self.recipe, step=self.step, pieces=self.pieces, parent=self))
@ -637,7 +640,17 @@ class Test(Widget):
if step.step_type in ("leak_1", "leak_2"):
self.leak_step = step
# Ensure Free Fall leak test appears before leak_1 when both are enabled
step_types = [step.step_type for step in steps]
if "test_freefall_leak" in step_types and "leak_1" in step_types:
ff_index = step_types.index("test_freefall_leak")
l1_index = step_types.index("leak_1")
if ff_index > l1_index:
# Move Free Fall step to be immediately before leak_1
steps.insert(l1_index, steps.pop(ff_index))
# Recompute step_types after reordering
step_types = [step.step_type for step in steps]
if "leak_1" in step_types and "leak_2" in step_types:
leak1_index = step_types.index("leak_1")
leak2_index = step_types.index("leak_2")

View File

@ -152,7 +152,10 @@ class Test_Leak(Test_Test):
bg_color="blue", text_color="white")
super().visualize(None, img=self.status_imgs_full["calibrated-leak"])
else:
self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA")
if step.step_type == "test_freefall_leak":
self.display_text(text="COLLAUDARE USANDO IL SISTEMA DI FLUSSAGGIO ALLA FINE DELLA PROVA POSIZIONRE IL PEZZO PER LA PROVATENUTA")
else:
self.display_text(text="COLLEGARE GLI ATTACCHI PNEUMATICI E PREMERE START PER INIZIARE LA PROVA TENUTA")
self.template_print_l.setVisible(True)
self.template_label.setVisible(True)
if self.simulate: