fco730 alpha
This commit is contained in:
parent
f2075d1c76
commit
464d8d532e
Binary file not shown.
|
|
@ -21,11 +21,12 @@
|
|||
^PW256
|
||||
^LL144
|
||||
^LS0
|
||||
^FT29,119^BQN,2,3
|
||||
^FH\^FDLA,{PART}{SN5}{DATE}{TIME}^FS
|
||||
^FT237,104^A0I,23,23^FH\^CI28^FD{PART}^FS^CI27
|
||||
^FT237,75^A0I,23,23^FH\^CI28^FDNum:{SN5}^FS^CI27
|
||||
^FT237,47^A0I,23,23^FH\^CI28^FD{DATE}^FS^CI27
|
||||
^FT237,18^A0I,23,23^FH\^CI28^FD{TIME}^FS^CI27
|
||||
^FT156,132^BQN,2,3
|
||||
^FH\^FDLA,{PART}_{SN5}_{DATE}_{TIME}^FS
|
||||
^FT61,47^A0N,23,23^FH\^CI28^FD{PART}^FS^CI27
|
||||
^FT19,72^A0N,23,23^FH\^CI28^FDNum:{SN5}^FS^CI27
|
||||
^FT19,97^A0N,23,23^FH\^CI28^FD{DATE}^FS^CI27
|
||||
^FT19,122^A0N,23,23^FH\^CI28^FD{TIME}^FS^CI27
|
||||
^FO19,21^GFA,169,248,8,:Z64:eJxFz7ENAyEMBdCPrnCZEVgjRQQrUaY46RjtRmGElFec4vgbrNA82Rhji+qAnax60ar6pbulaAOkT7dzmsIxBX0v7X3Y2+zrRv656trf6BP9/T/rl+kLopyjQG6fs28fKgMeW1SoRV6Pyis7j56i0BdLa0Ec7g8asjdJ:20D6
|
||||
^PQ1,0,1,Y
|
||||
^XZ
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ warning_img:
|
|||
pid_mode: 0 # 0=FAST 1=MEDIUM 2=SLOW 4 = FIXED 5 = AUTOMATIC 6 = FLOW 7 = LEAK WITH FLOW
|
||||
pid_level: 1
|
||||
pid_speed: 1
|
||||
tecna_discharge_enable: no
|
||||
tester_discharge_enable: no
|
||||
|
||||
tempo_pre_riempimento: 0
|
||||
pressione_pre_riempimento: 1000
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ pressione_di_test_delta_massimo: 30
|
|||
tempo_svuotamento: 1
|
||||
pressione_svuotamento: 100
|
||||
canale_di_prova: 0
|
||||
tecna_discharge_enable: yes
|
||||
tester_discharge_enable: yes
|
||||
|
||||
[autotest_leak]
|
||||
enabled: true
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ pressione_di_test_delta_massimo: 30
|
|||
tempo_svuotamento: 1
|
||||
pressione_svuotamento: 100
|
||||
canale_di_prova: 0
|
||||
tecna_discharge_enable: yes
|
||||
tester_discharge_enable: yes
|
||||
|
||||
[autotest_leak]
|
||||
enabled: true
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ pressione_di_test_delta_massimo: 30
|
|||
tempo_svuotamento: 1
|
||||
pressione_svuotamento: 100
|
||||
canale_di_prova: 0
|
||||
tecna_discharge_enable: yes
|
||||
tester_discharge_enable: yes
|
||||
|
||||
[autotest_leak]
|
||||
enabled: true
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ pressione_di_test_delta_massimo: 30
|
|||
tempo_svuotamento: 1
|
||||
pressione_svuotamento: 100
|
||||
canale_di_prova: 0
|
||||
tecna_discharge_enable: yes
|
||||
tester_discharge_enable: yes
|
||||
|
||||
[autotest_leak]
|
||||
enabled: true
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ label_template_field: modello_etichetta
|
|||
description_field: descrizione
|
||||
|
||||
[recipes_defaults]
|
||||
tecna_discharge_enable: yes
|
||||
tester_discharge_enable: yes
|
||||
dimensione_lotto_abilitata: x
|
||||
tempo_pre_riempimento: 0
|
||||
pressione_pre_riempimento: 1000
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
[machine]
|
||||
description = ST-TEN-9 SATIL SRL - BANCO COLLAUDO TUBI R5
|
||||
description = ST-TEN-9 SATIL SRL - BANCO PROVA TENUTA 10 BAR
|
||||
|
||||
[hardware_config]
|
||||
archive_synchronizer: present
|
||||
archive_synchronizer: absent
|
||||
label_printer: present
|
||||
remote_api: absent
|
||||
tecna_t3: absent
|
||||
|
|
@ -47,8 +47,8 @@ label_template_field: modello_etichetta
|
|||
description_field: descrizione
|
||||
|
||||
[recipes_defaults]
|
||||
tecna_discharge_enable: yes
|
||||
dimensione_lotto_abilitata: x
|
||||
tester_discharge_enable: yes
|
||||
dimensione_lotto_abilitata:
|
||||
tempo_pre_riempimento: 0
|
||||
pressione_pre_riempimento: 0
|
||||
tempo_riempimento: 5
|
||||
|
|
@ -62,17 +62,17 @@ pressione_di_test_delta_massimo: 20 # -mbar
|
|||
tempo_svuotamento: 1
|
||||
pressione_svuotamento: 100
|
||||
canale_di_prova: 1
|
||||
modello_etichetta: satil_30x17.prn
|
||||
modello_etichetta: R5_30x17_203dpi.prn
|
||||
|
||||
[autotest_leak]
|
||||
enabled: true
|
||||
pre_filling_time: 0
|
||||
pre_filling_pressure: 1000
|
||||
pre_filling_pressure: 0
|
||||
filling_time: 10
|
||||
settling_time: 10
|
||||
settling_pressure_min_percent: 5
|
||||
settling_pressure_max_percent: 5
|
||||
test_pressure: 7000
|
||||
test_pressure: 5000
|
||||
test_time: 10
|
||||
test_pressure_qpos: 10 #Q+ Upper test leak limit
|
||||
test_pressure_qneg: 30 #Q- Lower test leak limit
|
||||
|
|
|
|||
1
open_osk.bat
Normal file
1
open_osk.bat
Normal file
|
|
@ -0,0 +1 @@
|
|||
osk
|
||||
|
|
@ -59,14 +59,23 @@ registers = {
|
|||
'4': 'ATTESA RESET',
|
||||
'5': 'ATTESA START',
|
||||
'6': 'ERRORE',
|
||||
'7': 'pressure_high',
|
||||
'8': 'pressure_low',
|
||||
'7': 'PRESSIONE ALTA',
|
||||
'8': 'PRESSIONE BASSA',
|
||||
'9': 'jig_delay',
|
||||
'10': 'prefilling',
|
||||
'11': 'SCARICO',
|
||||
'12': 'reserverd',
|
||||
'13': 'sequence_delay',
|
||||
'14': 'jig_open'
|
||||
},
|
||||
"status_result":{
|
||||
'0': 'PASSED',
|
||||
'1': 'NEGATIVE FAIL',
|
||||
'2': 'POSITIVE FAIL',
|
||||
'3': 'RESERVED',
|
||||
'4': 'PRESSURE GROSS FAIL',
|
||||
'5': 'RESET DURING TEST',
|
||||
'6': 'GLOBAL FAIL',
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,19 +3,22 @@ import sys
|
|||
import time
|
||||
from collections import OrderedDict
|
||||
|
||||
from PyQt5.QtCore import QMutex
|
||||
|
||||
from components.component import Component
|
||||
from components.furness_controls_fco730_registers import registers as fco730_registers
|
||||
from components.furness_controls_fco780_registers import registers as fco780_registers
|
||||
|
||||
if "--sim-furness-controls" in sys.argv:
|
||||
from components.dummies.serial import serial
|
||||
else:
|
||||
import serial
|
||||
|
||||
ETX=b'\x03'
|
||||
EOT=b'\x04'
|
||||
ENQ=b'\x05'
|
||||
ACK=b'\x06'
|
||||
NACK=b'\x15'
|
||||
ETX = b'\x03'
|
||||
EOT = b'\x04'
|
||||
ENQ = b'\x05'
|
||||
ACK = b'\x06'
|
||||
NACK = b'\x15'
|
||||
|
||||
|
||||
class FurnessControlsLeakTester(Component):
|
||||
|
|
@ -29,14 +32,15 @@ class FurnessControlsLeakTester(Component):
|
|||
self.timeout = None
|
||||
self.parity = None
|
||||
self.conn = None
|
||||
self.lock = QMutex()
|
||||
self.stopbits = None
|
||||
self.baudrate = None
|
||||
self.port = None
|
||||
self.model = None
|
||||
self.settings = None
|
||||
self.commands = None
|
||||
self.id1=b'0'
|
||||
self.id2=b'1'
|
||||
self.id1 = b'0'
|
||||
self.id2 = b'1'
|
||||
|
||||
def config_changed(self):
|
||||
super().config_changed()
|
||||
|
|
@ -77,22 +81,30 @@ class FurnessControlsLeakTester(Component):
|
|||
@Component.reconfig_on_error
|
||||
def _get(self):
|
||||
# READ INFO
|
||||
current_status=self.get_status()
|
||||
current_status = self.get_status()
|
||||
info = {
|
||||
"Real time test pressure output":current_status["pressure_reading"],
|
||||
"Real time differential pressure output":0,
|
||||
"Real time pressure line regulator":0,
|
||||
"Active alarm flags":0,
|
||||
"Active test program number":0,
|
||||
"Running test: active phase":current_status["current_stage"],
|
||||
"Running test: measured leak":current_status["leak_reading"],
|
||||
"Running test: test type":0,
|
||||
"Running test: sequence index":0,
|
||||
"Digital inputs status (mask)":0,
|
||||
"Real time test pressure output": current_status["pressure_reading"],
|
||||
"Real time differential pressure output": 0,
|
||||
"Real time pressure line regulator": 0,
|
||||
"Active alarm flags": 0,
|
||||
"Active test program number": 0,
|
||||
"Running test: active phase": current_status["current_stage"],
|
||||
"Running test: measured leak": current_status["leak_reading"],
|
||||
"Running test: test type": 0,
|
||||
"Running test: sequence index": 0,
|
||||
"Digital inputs status (mask)": 0,
|
||||
}
|
||||
|
||||
if current_status['new_result_available'] == '1': # NEW TEST RESULT AVAILABLE
|
||||
last_test_result = self.get_last_result() # READ RESULT TO RESET AVAILABLE FLAG
|
||||
info.update({"Running test: result": last_test_result['status'],
|
||||
"Running test: filling pressure": current_status["pressure_reading"],
|
||||
"Running test: pressure at the end of settling": current_status["pressure_reading"],
|
||||
|
||||
})
|
||||
for round_me in ["measured leak"]:
|
||||
if round_me in info.keys():
|
||||
info.update({round_me:float(f"{info[round_me]:.2f}")})
|
||||
info.update({round_me: float(f"{info[round_me]:.2f}")})
|
||||
self.log.debug(str(info))
|
||||
super()._get([info])
|
||||
|
||||
|
|
@ -101,63 +113,99 @@ class FurnessControlsLeakTester(Component):
|
|||
self.send_command("start_test")
|
||||
|
||||
def stop_test(self):
|
||||
self.log.warning("stopping test")
|
||||
self.current_status = self.get_status()
|
||||
if self.current_status['current_stage'] in ('standby','awaiting_start'):
|
||||
self.log.warning("resetting state...")
|
||||
current_status = self.get_status()
|
||||
if current_status['status'] in ('ready_to_start',):
|
||||
self.log.info("ready to start")
|
||||
elif current_status['status'] in ('pressure_high', 'pressure_low', 'fault'):
|
||||
self.log.info(f"{current_status['status']}, performing self check to reset")
|
||||
elif current_status['status'] == "testing":
|
||||
self.log.info("stop running test")
|
||||
self.send_command("reset_test")
|
||||
else:
|
||||
self.log.warning("not ready to start, performing self check to reset")
|
||||
self.send_command("self_check")
|
||||
self.log.error(f"unknown state {current_status['status']}")
|
||||
|
||||
time.sleep(2)
|
||||
|
||||
def get_status(self):
|
||||
status_str=str(self.send_enquiry("current_status"),encoding="ascii")
|
||||
status_str+='z' # dummy terminator
|
||||
status_vars=OrderedDict(
|
||||
{
|
||||
'a':'counter',
|
||||
'b':'product_number',
|
||||
'c':'step_number',
|
||||
'd':'new_result_available',
|
||||
'e':'mode',
|
||||
'f':'status',
|
||||
'g':'pressure_reading',
|
||||
'i':'leak_reading',
|
||||
'k':'current_stage',
|
||||
'z':'dummy'
|
||||
})
|
||||
status_decoded={}
|
||||
for tag,param in status_vars.items():
|
||||
next_tag=list(status_vars)[list(status_vars.keys()).index(tag) + 1]
|
||||
match=re.search(f"{tag}([0-9.-]+){next_tag}",status_str)
|
||||
value=None
|
||||
status_str = str(self.send_enquiry("current_status"), encoding="ascii")
|
||||
status_str += 'z' # dummy terminator
|
||||
status_vars = OrderedDict(
|
||||
{
|
||||
'a': 'counter',
|
||||
'b': 'product_number',
|
||||
'c': 'step_number',
|
||||
'd': 'new_result_available',
|
||||
'e': 'mode',
|
||||
'f': 'status',
|
||||
'g': 'pressure_reading',
|
||||
'h': 'pressure_units',
|
||||
'i': 'leak_reading',
|
||||
'j': 'leak_offset',
|
||||
'k': 'current_stage',
|
||||
'z': 'dummy'
|
||||
})
|
||||
status_decoded = {}
|
||||
for tag, param in status_vars.items():
|
||||
next_tag = list(status_vars)[list(status_vars.keys()).index(tag) + 1]
|
||||
match = re.search(f"{tag}([0-9.-]+){next_tag}", status_str)
|
||||
value = None
|
||||
if match is not None:
|
||||
value=match.group(1)
|
||||
value = match.group(1)
|
||||
if param == 'status':
|
||||
value = self.enums['status_status'][value]
|
||||
if param == 'current_stage':
|
||||
elif param == 'current_stage':
|
||||
value = self.enums['status_current_stage'][value]
|
||||
elif param == 'pressure_reading':
|
||||
value = f"{float(value) * 1000:.1f}"
|
||||
|
||||
status_decoded[param]=value
|
||||
if next_tag =='z':
|
||||
status_decoded[param] = value
|
||||
if next_tag == 'z':
|
||||
break
|
||||
|
||||
return status_decoded
|
||||
|
||||
def get_last_result(self):
|
||||
res_str = str(self.send_enquiry("last_test_result"), encoding="ascii")
|
||||
res_str += 'z' # dummy terminator
|
||||
status_vars = OrderedDict(
|
||||
{
|
||||
'a': 'counter',
|
||||
'b': 'step_number',
|
||||
'c': 'product_number',
|
||||
'd': 'status',
|
||||
'z': 'dummy'
|
||||
})
|
||||
res_decoded = {}
|
||||
for tag, param in status_vars.items():
|
||||
next_tag = list(status_vars)[list(status_vars.keys()).index(tag) + 1]
|
||||
match = re.search(f"{tag}([0-9.-]+){next_tag}", res_str)
|
||||
value = None
|
||||
if match is not None:
|
||||
value = match.group(1)
|
||||
if param == 'status':
|
||||
value = self.enums['status_result'].get(value, 'NOK')
|
||||
|
||||
res_decoded[param] = value
|
||||
if next_tag == 'z':
|
||||
break
|
||||
|
||||
return res_decoded
|
||||
|
||||
def write_recipe(self, recipe, step, table=None):
|
||||
# PREPARE DATA
|
||||
product_id='"'+recipe.part_number[:16]+'"'
|
||||
product_id=product_id.encode("ascii")
|
||||
test_press_bar=step.spec["test_pressure"]/1000
|
||||
prefill_press_bar=step.spec["pre_filling_pressure"]/1000
|
||||
tolerance=int(step.spec["settling_pressure_min_percent"])
|
||||
fail_pos=test_press_bar+(int(step.spec["test_pressure_qpos"])/1000)
|
||||
fail_neg=test_press_bar+(int(step.spec["test_pressure_qneg"])/1000)
|
||||
fill_time=float(step.spec["filling_time"])
|
||||
stab_time=float(step.spec["settling_time"])
|
||||
test_time=float(step.spec["test_time"])
|
||||
prefill_time=float(step.spec["pre_filling_time"])
|
||||
vent_time=float(step.spec["flush_time"])
|
||||
product_id = '"' + recipe.part_number[:16] + '"'
|
||||
product_id = product_id.encode("ascii")
|
||||
test_press_bar = step.spec["test_pressure"] / 1000
|
||||
prefill_press_bar = step.spec["pre_filling_pressure"] / 1000
|
||||
tolerance = int(step.spec["settling_pressure_min_percent"])
|
||||
fail_pos = test_press_bar + (int(step.spec["test_pressure_qpos"]) / 1000)
|
||||
fail_neg = test_press_bar + (int(step.spec["test_pressure_qneg"]) / 1000)
|
||||
fill_time = float(step.spec["filling_time"])
|
||||
stab_time = float(step.spec["settling_time"])
|
||||
test_time = float(step.spec["test_time"])
|
||||
prefill_time = float(step.spec["pre_filling_time"])
|
||||
vent_time = float(step.spec["flush_time"])
|
||||
# SEND RECIPE PARAMETERS
|
||||
self.send_command("change_cur_prod_50")
|
||||
self.send_product_tag("product_id", product_id)
|
||||
|
|
@ -175,57 +223,60 @@ class FurnessControlsLeakTester(Component):
|
|||
self.send_product_tag("fail_low", f"{fail_neg:3.1f}")
|
||||
self.send_product_tag("outputs_a_h", f"{int(0b01000000)}")
|
||||
|
||||
self.get_last_result() # CLEAR POSSIBLE NEW RESULT AVAILABLE FLAG
|
||||
|
||||
def send_command(self,command):
|
||||
def send_command(self, command):
|
||||
if type(command) is str:
|
||||
command=self.commands[command]
|
||||
out_bytes= bytearray()
|
||||
command = self.commands[command]
|
||||
out_bytes = bytearray()
|
||||
out_bytes.extend(EOT)
|
||||
out_bytes.extend(self.id1)
|
||||
out_bytes.extend(self.id2)
|
||||
out_bytes.extend(command)
|
||||
out_bytes.extend(ETX)
|
||||
checksum=self.calc_checksum(out_bytes)
|
||||
checksum = self.calc_checksum(out_bytes)
|
||||
out_bytes.append(checksum)
|
||||
|
||||
self.lock.lock()
|
||||
self.conn.write(out_bytes)
|
||||
response = self.conn.read(100)
|
||||
response = self.conn.read(1)
|
||||
self.lock.unlock()
|
||||
if response == ACK:
|
||||
return True
|
||||
else:
|
||||
self.log.error(f"SEND COMMAND({command}):{response}")
|
||||
return None
|
||||
|
||||
def send_enquiry(self,enquiry):
|
||||
def send_enquiry(self, enquiry):
|
||||
if type(enquiry) is str:
|
||||
enquiry=self.commands[enquiry]
|
||||
out_bytes=bytearray(EOT)
|
||||
enquiry = self.commands[enquiry]
|
||||
out_bytes = bytearray(EOT)
|
||||
out_bytes.extend(self.id1)
|
||||
out_bytes.extend(self.id2)
|
||||
out_bytes.extend(enquiry)
|
||||
out_bytes.extend(ENQ)
|
||||
checksum = self.calc_checksum(out_bytes)
|
||||
out_bytes.append(checksum)
|
||||
|
||||
self.lock.lock()
|
||||
self.conn.write(out_bytes)
|
||||
response = self.conn.read(100)
|
||||
self.lock.unlock()
|
||||
if len(response):
|
||||
read_checksum = response[-1]
|
||||
else:
|
||||
read_checksum = None
|
||||
calculated_checksum = self.calc_checksum(response[0:-1],start_idx=0)
|
||||
calculated_checksum = self.calc_checksum(response[0:-1], start_idx=0)
|
||||
if read_checksum != calculated_checksum:
|
||||
self.log.error(f"SEND ENQUIRY:{response}")
|
||||
self.log.error(f"ENQUIRY RESPONSE CHECKSUM:{read_checksum}!={calculated_checksum}")
|
||||
return None
|
||||
else:
|
||||
response = response[:-2] #strip checksum & ETX
|
||||
response = response[:-2] # strip checksum & ETX
|
||||
return response
|
||||
|
||||
def send_product_tag(self,tag,tag_data):
|
||||
def send_product_tag(self, tag, tag_data):
|
||||
self.log.info(f"Sending tag:{tag}={tag_data}")
|
||||
command=bytearray(self.commands["product_data"])
|
||||
command = bytearray(self.commands["product_data"])
|
||||
if type(tag_data) is str:
|
||||
tag_data=bytearray(tag_data,encoding="ascii")
|
||||
tag_data = bytearray(tag_data, encoding="ascii")
|
||||
command.extend(self.product_tags[tag])
|
||||
command.extend(tag_data)
|
||||
self.send_command(command)
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ class TecnaMarpossProvasetT3(ModbusComponent):
|
|||
"PSQ - Next sequence program PSOUT mode": 0,
|
||||
"RAMPS: T1 configuration": pid_ramps,
|
||||
"PID: pressure correction": 100,
|
||||
"Various flags": 0b0000000000010000 if self.config["recipes_defaults"]["tecna_discharge_enable"]=="yes" else 0b0000000000000000
|
||||
"Various flags": 0b0000000000010000 if self.config["recipes_defaults"]["tester_discharge_enable"]=="yes" else 0b0000000000000000
|
||||
|
||||
}
|
||||
if self.model == "t3p":
|
||||
|
|
|
|||
|
|
@ -78,41 +78,27 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>Telefono:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>+39 0118000876</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>P.IVA:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>11836090016</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Indirizzo:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Via Vittime delle Foibe, 10 10036 - Settimo Torinese (TO)
|
||||
|
|
|
|||
BIN
src/ui/imgs/r5.png
Normal file
BIN
src/ui/imgs/r5.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
|
|
@ -60,4 +60,4 @@ class Login(Widget):
|
|||
def show_osk(self):
|
||||
self.password_le.setFocus()
|
||||
if platform.system().lower() == 'windows':
|
||||
subprocess.Popen(["osk.bat"]) # OPEN ON SCREEN KEYBOARD
|
||||
subprocess.Popen(["open_osk.bat"]) # OPEN ON SCREEN KEYBOARD
|
||||
|
|
|
|||
|
|
@ -57,6 +57,13 @@ class Recipe_Selection(Widget):
|
|||
}
|
||||
filters = {"archived": False}
|
||||
step_defaults = self.read_steps(self.config.get("recipes_defaults", noner), noner)
|
||||
custom_label_folder=f"config/label_templates/{str(self.config.machine_id)}/"
|
||||
standard_label_folder=f"config/label_templates/"
|
||||
if os.path.exists(custom_label_folder):
|
||||
label_folder = custom_label_folder
|
||||
else:
|
||||
label_folder = standard_label_folder
|
||||
|
||||
step_defaults.update({
|
||||
"vision": {
|
||||
# "recipe": sorted(glob("*.ini", root_dir="./config/vision/recipes/")), # only in python3.10
|
||||
|
|
@ -64,7 +71,7 @@ class Recipe_Selection(Widget):
|
|||
},
|
||||
"print": {
|
||||
# "template": sorted(glob("*.prn", root_dir="./config/label_templates/")), # only in python3.10
|
||||
"template": sorted(map(os.path.basename, glob("./config/label_templates/*.prn"))),
|
||||
"template": sorted(map(os.path.basename, glob(f"{label_folder}*.prn"))),
|
||||
},
|
||||
}),
|
||||
self.crud = Crud(
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ class Test(Widget):
|
|||
self.cycle_steps = None
|
||||
self.cycle_index = -1
|
||||
self.print_step = None
|
||||
self.last_label = None
|
||||
self.require_discard_piece = False
|
||||
# SETUP AUTOTEST
|
||||
self.autotest_request = False
|
||||
|
|
@ -193,7 +194,7 @@ class Test(Widget):
|
|||
self.recipe_selection_mode = "barcode"
|
||||
self.change_recipe()
|
||||
def reprint_label(self):
|
||||
self.print(self.archived, self.print_step.spec.get("template", "EtichettaR5"))
|
||||
self.print(self.last_label, self.print_step.spec.get("template", "EtichettaR5"))
|
||||
|
||||
def fail_cycle(self):
|
||||
self.next(action="fail")
|
||||
|
|
@ -326,6 +327,7 @@ class Test(Widget):
|
|||
self.next_timer.start(0)
|
||||
if self.step.type == "done":
|
||||
self.archived = self.done()
|
||||
self.last_label=copy.deepcopy(self.archived)
|
||||
self.next_timer.start(500)
|
||||
elif self.step.type == "print":
|
||||
compiled_label = self.print(self.archived, self.step.spec.get("template", "EtichettaR5"))
|
||||
|
|
@ -532,9 +534,9 @@ class Test(Widget):
|
|||
self.data.get("recipe",{}).get("spec",{}).pop("available_steps",None)
|
||||
for leak in ["leak_1","leak_2"]:
|
||||
if leak in self.data.keys():
|
||||
results={k:self.data[leak]["results"]["tecna_t3"][k] for k in ["Running test: result"]}
|
||||
results={k:self.data[leak]["results"][self.tester_component][k] for k in ["Running test: result"]}
|
||||
|
||||
results.update({k:round(float(self.data[leak]["results"]["tecna_t3"][k]),2) for k in ["Running test: filling pressure",
|
||||
results.update({k:round(float(self.data[leak]["results"][self.tester_component][k]),2) for k in ["Running test: filling pressure",
|
||||
"Running test: measured leak",
|
||||
"Running test: pressure at the end of settling"]}
|
||||
)
|
||||
|
|
@ -586,9 +588,13 @@ class Test(Widget):
|
|||
|
||||
def print(self, archived, label):
|
||||
self.log.info("cycle print")
|
||||
if archived is None:
|
||||
self.log.error("attempting to print empty label")
|
||||
return None
|
||||
|
||||
if archived.label is not None:
|
||||
# raise AssertionError("this should never happen")
|
||||
self.log.debug("ERROR cycle printed already compiled label")
|
||||
self.log.info("printing already compiled label")
|
||||
|
||||
# LABEL PRINT
|
||||
recipe = archived.test_data.get("recipe", {})
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class Test_Leak(Test_Test):
|
|||
if self.step.spec.get("autotest", False): # IF AUTOTESTING UPLOAD RECIPE EVERY TIME
|
||||
self.recipe_written = False
|
||||
|
||||
if self.parent.config["hardware_config"].get("second_leak_test", None): # IF SECOND LEAK TEST ENABLED UPLOAD RECIPE EVERY TIME
|
||||
if self.parent.config["hardware_config"].get("second_leak_test", "absent") == "present": # IF SECOND LEAK TEST ENABLED UPLOAD RECIPE EVERY TIME
|
||||
self.recipe_written = False
|
||||
|
||||
if not self.recipe_written:
|
||||
|
|
@ -253,6 +253,10 @@ class Test_Leak(Test_Test):
|
|||
"ATTESA START",
|
||||
"END TEST, WAITING THE START OF A NEW TEST"
|
||||
"FINE TEST",
|
||||
"STANDBY",
|
||||
"PRESSIONE BASSA",
|
||||
"PRESSIONE ALTA",
|
||||
"ERRORE"
|
||||
}:
|
||||
|
||||
self.start_b.setEnabled(True)
|
||||
|
|
|
|||
|
|
@ -491,6 +491,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -961,6 +962,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1437,6 +1439,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1468,6 +1471,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1487,6 +1491,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1534,6 +1539,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1552,6 +1558,7 @@
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1570,6 +1577,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1589,6 +1597,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1613,6 +1622,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1631,6 +1641,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1644,6 +1655,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1663,6 +1675,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1703,6 +1716,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1720,7 +1734,8 @@ border: 1px solid black;
|
|||
<widget class="QLabel" name="test_phase_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1739,6 +1754,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1752,6 +1768,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1771,6 +1788,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1806,6 +1824,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1828,6 +1847,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1864,6 +1884,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>48</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1885,6 +1906,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1901,6 +1923,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1917,6 +1940,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1930,6 +1954,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1946,6 +1971,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1962,6 +1988,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1975,6 +2002,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -1991,6 +2019,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2013,6 +2042,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2031,6 +2061,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2044,6 +2075,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2066,6 +2098,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2090,6 +2123,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2108,6 +2142,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2121,6 +2156,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2133,7 +2169,8 @@ border: 1px solid black;
|
|||
<widget class="QLabel" name="test_type_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2151,7 +2188,8 @@ border: 1px solid black;
|
|||
<widget class="QLabel" name="sequence_index_l">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<pointsize>20</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2170,6 +2208,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2186,6 +2225,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
@ -2202,6 +2242,7 @@ border: 1px solid black;
|
|||
<property name="font">
|
||||
<font>
|
||||
<pointsize>16</pointsize>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user