diff --git a/config/label_designs/ASTON MARTIN/aston_martin.nlbl b/config/label_designs/ASTON MARTIN/aston_martin.nlbl new file mode 100644 index 0000000..3bcfa48 Binary files /dev/null and b/config/label_designs/ASTON MARTIN/aston_martin.nlbl differ diff --git a/config/label_designs/FERRARI/000746453.nlbl b/config/label_designs/FERRARI/000746453.nlbl new file mode 100644 index 0000000..096ab74 Binary files /dev/null and b/config/label_designs/FERRARI/000746453.nlbl differ diff --git a/config/label_templates/aston_martin.prn b/config/label_templates/aston_martin.prn new file mode 100644 index 0000000..f94107a --- /dev/null +++ b/config/label_templates/aston_martin.prn @@ -0,0 +1,59 @@ +CT~~CD,~CC^~CT~ +^XA +~TA000 +~JSN +^LT0 +^MNW +^MTT +^PON +^PMN +^LH0,0 +^JMA +^PR2,2 +~SD25 +^JUS +^LRN +^CI27 +^PA0,1,1,0 +^XZ +^XA +^MMT +^PW336 +^LL1055 +^LS0 +^FT65,66^A0N,39,38^FH\^CI28^FDERRECINQUE^FS^CI27 +^BY1,3,56^FT52,291^BCN,,N,N +^FH\^FD>:{PART}^FS +^FT23,382^A0N,31,30^FH\^CI28^FDPart number:^FS^CI27 +^FT23,455^A0N,31,30^FH\^CI28^FD{PART}^FS^CI27 +^FT25,101^A0N,17,18^FH\^CI28^FDVia Meucci 31/A - 10079 Mappano(TO)^FS^CI27 +^FT61,173^A0N,39,38^FH\^CI28^FD{CUSTOMER}^FS^CI27 +^FT61,211^A0N,39,38^FH\^CI28^FDLEAK TEST^FS^CI27 +^FT23,921^A0N,23,23^FH\^CI28^FD{DD}/{MO}/{YY}^FS^CI27 +^FT169,921^A0N,23,23^FH\^CI28^FD{HH}:{MI}:{SS}^FS^CI27 +^FT25,1006^A0N,31,30^FH\^CI28^FDCHECK:^FS^CI27 +^FT151,1006^A0N,31,30^FH\^CI28^FDPASSED^FS^CI27 +^FT23,964^A0N,25,25^FH\^CI28^FDOperator:^FS^CI27 +^FT151,964^A0N,25,25^FH\^CI28^FD{OPERATOR}^FS^CI27 +^FT51,323^A0N,31,30^FH\^CI28^FD{PART}^FS^CI27 +^FT23,417^A0N,31,30^FH\^CI28^FD{DESCRIPTION}^FS^CI27 +^FT23,513^A0N,31,30^FH\^CI28^FDSequential number:^FS^CI27 +^FT23,548^A0N,31,30^FH\^CI28^FD{SN5}^FS^CI27 +^FT27,658^A0N,28,28^FH\^CI28^FDTest 1:^FS^CI27 +^FT27,685^A0N,23,23^FH\^CI28^FDMeasured press.:^FS^CI27 +^FT199,687^A0N,20,20^FH\^CI28^FD{RESPSET} mbar^FS^CI27 +^FT27,707^A0N,23,23^FH\^CI28^FDAllowed leak:^FS^CI27 +^FT199,709^A0N,20,20^FH\^CI28^FD{PMIN} mbar^FS^CI27 +^FT27,730^A0N,23,23^FH\^CI28^FDMeasured leak:^FS^CI27 +^FT187,731^A0N,20,20^FH\^CI28^FD{RESLEAK} mbar^FS^CI27 +^FT27,817^A0N,23,23^FH\^CI28^FDMeasure time:^FS^CI27 +^FT215,818^A0N,20,20^FH\^CI28^FD{TTEST} s^FS^CI27 +^FT26,773^A0N,23,23^FH\^CI28^FDFill time:^FS^CI27 +^FT215,770^A0N,20,20^FH\^CI28^FD{TFILL} s^FS^CI27 +^FT27,795^A0N,23,23^FH\^CI28^FDSettling time:^FS^CI27 +^FT215,794^A0N,20,20^FH\^CI28^FD{TSET} s^FS^CI27 +^FT136,658^A0N,28,28^FH\^CI28^FD{PTEST} mbar^FS^CI27 +^FT152,124^A0N,17,18^FH\^CI28^FDItaly^FS^CI27 +^FT27,893^A0N,23,23^FH\^CI28^FDTest date/time:^FS^CI27 +^PQ1,0,1,Y +^XZ diff --git a/config/label_templates/ferrari_stten8.prn b/config/label_templates/ferrari_stten8.prn new file mode 100644 index 0000000..8e49be6 --- /dev/null +++ b/config/label_templates/ferrari_stten8.prn @@ -0,0 +1,58 @@ +CT~~CD,~CC^~CT~ +^XA +~TA000 +~JSN +^LT0 +^MNW +^MTT +^PON +^PMN +^LH0,0 +^JMA +^PR2,2 +~SD25 +^JUS +^LRN +^CI27 +^PA0,1,1,0 +^XZ +^XA +^MMT +^PW336 +^LL1055 +^LS0 +^FT65,66^A0N,39,38^FH\^CI28^FDERRECINQUE^FS^CI27 +^FT52,403^BQN,2,7 +^FH\^FDLA,{PART}^FS +^FT23,436^A0N,31,30^FH\^CI28^FDPart number:^FS^CI27 +^FT23,527^A0N,31,30^FH\^CI28^FD{PART}^FS^CI27 +^FT25,101^A0N,17,18^FH\^CI28^FDVia Meucci 31/A - 10079 Mappano(TO)^FS^CI27 +^FT61,173^A0N,39,38^FH\^CI28^FD{CUSTOMER}^FS^CI27 +^FT61,211^A0N,39,38^FH\^CI28^FDLEAK TEST^FS^CI27 +^FT23,921^A0N,23,23^FH\^CI28^FD{DD}/{MO}/{YY}^FS^CI27 +^FT169,921^A0N,23,23^FH\^CI28^FD{HH}:{MI}:{SS}^FS^CI27 +^FT25,1006^A0N,31,30^FH\^CI28^FDCHECK:^FS^CI27 +^FT151,1006^A0N,31,30^FH\^CI28^FDPASSED^FS^CI27 +^FT23,964^A0N,25,25^FH\^CI28^FDOperator:^FS^CI27 +^FT151,964^A0N,25,25^FH\^CI28^FD{OPERATOR}^FS^CI27 +^FT23,489^A0N,31,30^FH\^CI28^FD{CUSTOMER}^FS^CI27 +^FT23,567^A0N,31,30^FH\^CI28^FDSequential number:^FS^CI27 +^FT23,602^A0N,31,30^FH\^CI28^FD{SN5}^FS^CI27 +^FT27,658^A0N,28,28^FH\^CI28^FDTest 1:^FS^CI27 +^FT27,685^A0N,23,23^FH\^CI28^FDMeasured press.:^FS^CI27 +^FT199,687^A0N,20,20^FH\^CI28^FD{RESPSET} mbar^FS^CI27 +^FT27,707^A0N,23,23^FH\^CI28^FDAllowed leak:^FS^CI27 +^FT199,709^A0N,20,20^FH\^CI28^FD{PMIN} mbar^FS^CI27 +^FT27,730^A0N,23,23^FH\^CI28^FDMeasured leak:^FS^CI27 +^FT187,731^A0N,20,20^FH\^CI28^FD{RESLEAK} mbar^FS^CI27 +^FT27,817^A0N,23,23^FH\^CI28^FDMeasure time:^FS^CI27 +^FT215,818^A0N,20,20^FH\^CI28^FD{TTEST} s^FS^CI27 +^FT26,773^A0N,23,23^FH\^CI28^FDFill time:^FS^CI27 +^FT215,770^A0N,20,20^FH\^CI28^FD{TFILL} s^FS^CI27 +^FT27,795^A0N,23,23^FH\^CI28^FDSettling time:^FS^CI27 +^FT215,794^A0N,20,20^FH\^CI28^FD{TSET} s^FS^CI27 +^FT136,658^A0N,28,28^FH\^CI28^FD{PTEST} mbar^FS^CI27 +^FT151,124^A0N,17,18^FH\^CI28^FDItaly^FS^CI27 +^FT27,893^A0N,23,23^FH\^CI28^FDTest date/time:^FS^CI27 +^PQ1,0,1,Y +^XZ diff --git a/config/machine_settings/st-ten-5.ini b/config/machine_settings/st-ten-5.ini index 0723d56..57656ca 100644 --- a/config/machine_settings/st-ten-5.ini +++ b/config/machine_settings/st-ten-5.ini @@ -93,10 +93,9 @@ settling_pressure_max_percent: 5 test_pressure: 5000 test_time: 10 test_pressure_qpos: 7 -test_pressure_qneg: 10 -test_pressure_tt_qpos: 0 # Q+ Upper test leak limit (tube-tube) -test_pressure_tt_qneg: 5 # Q- Lower test leak limit (tube-tube) - +test_pressure_qneg: 17 +test_pressure_tt_qpos: 1 # Q+ Upper test leak limit (tube-tube) (positive mbar) +test_pressure_tt_qneg: 5 # Q- Lower test leak limit (tube-tube) (negative mbar) flush_time: 1 flush_pressure: 100 relay_config: 1 \ No newline at end of file diff --git a/init.sh b/init.sh index 61b0ecb..9b612e6 100755 --- a/init.sh +++ b/init.sh @@ -4,11 +4,11 @@ here="$(realpath "$(dirname "$0")")" cd "$here" echo "---------- initialize venv ----------" -sudo apt-get install python3-venv +sudo apt-get install python3 python3-venv python-is-python3 python3-pip lsof "./venv/bin/python" | awk 'NR > 1 {print $2}' | xargs kill || : lsof "./venv/Scripts/activate" | awk 'NR > 1 {print $2}' | xargs kill || : python="python" -"${python}" -m pip install --upgrade pip +#"${python}" -m pip install --upgrade pip "${python}" -m venv venv source "./venv/bin/activate" || source "./venv/Scripts/activate" || : "${python}" -m pip install --upgrade pip diff --git a/runme.bat b/runme.bat index 2bd6bf6..a1c7f25 100644 --- a/runme.bat +++ b/runme.bat @@ -1,4 +1,4 @@ echo on SET mypath=%~dp0 cd %mypath% -.\venv\Scripts\activate.bat && python -O "./src/main.py" --no-edgetpu --no-tflite +.\venv\Scripts\activate.bat && python -O "./src/main.py" --no-edgetpu --no-tflite/ diff --git a/src/requirements.txt b/src/requirements.txt index 2ad5bfc..df816cd 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -17,5 +17,5 @@ pyserial pyserial-asyncio requests tensorflow -tflite-runtime +#tflite-runtime zebra diff --git a/src/test/csv_import/st-ten-8.csv b/src/test/csv_import/st-ten-8.csv new file mode 100644 index 0000000..58d70d3 --- /dev/null +++ b/src/test/csv_import/st-ten-8.csv @@ -0,0 +1,8 @@ +codice_ricetta,cliente,codice_prodotto,descrizione,tempo_riempimento,tempo_assestamento,tempo_di_test,percentuale_minima_pressione_assestamento,percentuale_massima_pressione_assestamento,pressione_di_test_delta_minimo,pressione_di_test,pressione_di_test_delta_massimo,modello_etichetta +5803112815,IVECO,5803112815,Daily Automatico,5,10,10,5,5,30,5000,5,ETA30x16.prn +5803112816,IVECO,5803112816,Daily Automatico,5,10,10,5,5,30,5000,5,ETA30x16.prn +000746453,FERRARI,000746453,Daily Automatico,10,30,20,5,5,25,10000,5,EtichettaR5.prn +MY83-6L701-AB,ASTON MARTIN,MY83-6L701-AB,Daily Automatico,5,10,10,5,5,30,5000,5,EtichettaR5.prn +MY83-6L694-AB,ASTON MARTIN,MY83-6L694-AB,Daily Automatico,5,10,10,5,5,30,5000,5,EtichettaR5.prn +MY83-6B747-BA,ASTON MARTIN,MY83-6B747-BA,Daily Automatico,5,10,10,5,5,30,5000,5,EtichettaR5.prn +MY83-6B748-BA,ASTON MARTIN,MY83-6B748-BA,Daily Automatico,5,10,10,5,5,30,5000,5,EtichettaR5.prn \ No newline at end of file diff --git a/src/ui/test/test.py b/src/ui/test/test.py index e2a7eda..9efd6b3 100755 --- a/src/ui/test/test.py +++ b/src/ui/test/test.py @@ -115,7 +115,7 @@ class Test(Widget): self.autotesting_reason = None self.autotest_cycle_steps = None if "--no-autotest" not in sys.argv: - self.autotest_period = 8.5 * 60 * 60 * 1000 # 8.5 HOURS + self.autotest_period = int(8.5 * 60 * 60 * 1000) # 8.5 HOURS # self.autotest_period = 12 * 60 * 60 * 1000 # 12 HOURS #if not self.config["autotest_done"]: # self.request_autotest("init") @@ -226,6 +226,8 @@ class Test(Widget): if action == "change_recipe": self.log.info(f"cycle next: action: {action!r}") self.set_recipe(recipe=None) + self.cycle_available_steps["leak_1"].recipe_written=False + self.cycle_available_steps["leak_2"].recipe_written=False self.step = Steps(type="select_recipe") self.cycle_index = -1 # COUNT RESET diff --git a/src/ui/test_leak/test_leak.py b/src/ui/test_leak/test_leak.py index 00a9b64..6fd9561 100644 --- a/src/ui/test_leak/test_leak.py +++ b/src/ui/test_leak/test_leak.py @@ -13,10 +13,12 @@ VALVE_TIME=0.5 class Test_Leak(Test_Test): def __init__(self, components=None, recipe=None, step=None, pieces=None, run_once=False, reset_on_start=True, enable_override=False,parent=None): super().__init__(components=components, recipe=recipe, step=step, pieces=pieces, run_once=run_once, reset_on_start=reset_on_start, enable_override=enable_override) + self.get_connection = None self.io_ok = True self.blow_on = False self.parent=parent self.step=step + self.recipe_written = False self.start_b.clicked.connect(self.start_test) self.stop_b.clicked.connect(lambda checked, self=weakref.ref(self): self().components["tecna_t3"].stop_test()) self.show_instruction_b.setVisible("show_instructions" in self.parent.config["hardware_config"].keys()) @@ -85,8 +87,14 @@ class Test_Leak(Test_Test): self.recipe_pressure_l.setText(f"{self.step.spec['test_pressure']}") self.leak_min_l.setText(f"{self.step.spec['test_pressure_qneg']}") self.leak_max_l.setText(f"{self.step.spec['test_pressure_qpos']}") - # setup test loop - self.components["tecna_t3"].write_recipe(self.recipe, self.step) + + # SETUP TEST LOOP + if self.step.spec.get("autotest", False) != False: # IF AUTOTESTING UPLOAD RECIPE EVERY TIME + self.recipe_written = False + if not self.recipe_written: + self.components["tecna_t3"].write_recipe(self.recipe, self.step) + self.recipe_written=True + self.get_connection = self.components["tecna_t3"].out.connect(self.get) self.components["tecna_t3"].resume() if self.parent_assembly_widget is not None: @@ -107,9 +115,10 @@ class Test_Leak(Test_Test): QApplication.processEvents() time.sleep(2) - time.sleep(1) # AUTO START SECOND TEST if step.type == "leak_2": + self.recipe_written = False + time.sleep(1) self.start_b.setEnabled(True) self.start_b.click() @@ -121,8 +130,6 @@ class Test_Leak(Test_Test): self.components["tecna_t3"].pause() self.disconnect(self.get_connection) super().stop() - #if self.parent_assembly_widget is not None: - # self.parent_assembly_widget().set_text(text="WAIT") self.start_b.setEnabled(False) self.stop_b.setEnabled(False)