Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cb8d46780e
|
|
@ -22,7 +22,7 @@ In addition to leak testing, the software supports many other functions, dependi
|
|||
- On Windows: ./init_win.bat
|
||||
- On Linux: ./init.sh
|
||||
|
||||
## fIX Chrome
|
||||
## FIX Chrome
|
||||
If chrome doesn't start run this command
|
||||
rm ~/.config/google-chrome/SingletonLock
|
||||
## FIX FOR TERMINAL NOT WORKINK FOR WINDOWS 10
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ baudrate: 9600
|
|||
|
||||
[digital_io]
|
||||
id: USB-5862,BID#0
|
||||
keep_true = no
|
||||
|
||||
[vision]
|
||||
neural_network: none
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ risoluzione:300
|
|||
# OUTPUT MAP FOR FIXTURE CONNECTOR
|
||||
id: USB-5862,BID#0
|
||||
first_output: 0
|
||||
|
||||
keep_true = yes
|
||||
|
||||
[fixture_rfid]
|
||||
port: COM5
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class Test_Instructions(Test_Test):
|
|||
self.print_b.setVisible(True)
|
||||
self.print_b.setEnabled(True)
|
||||
self.print_b.clicked.connect(self.print_button)
|
||||
# Read the keep_true configuration flag (defaults to disabled)
|
||||
self.keep_true = str(self.config.get("digital_io", {}).get("keep_true", "no")).lower() in ["yes", "true", "1"]
|
||||
|
||||
def start(self, recipe=None, step=None, pieces=None):
|
||||
show = super().start(recipe=recipe, step=step)
|
||||
|
|
@ -192,10 +194,11 @@ class Test_Instructions(Test_Test):
|
|||
super().get(None, override=override)
|
||||
return
|
||||
|
||||
#check if all sensor are ok
|
||||
# check if all sensor are ok
|
||||
ok = True
|
||||
if len(data[0]["digital_io"])==0:
|
||||
if len(data[0]["digital_io"]) == 0:
|
||||
return
|
||||
|
||||
for sensor in self.monitored_ids:
|
||||
sensor_name = sensor.attrib['id']
|
||||
sensor_index_part = sensor.attrib['id'].split("_")[1]
|
||||
|
|
@ -206,17 +209,26 @@ class Test_Instructions(Test_Test):
|
|||
sensor_index = sensor_index_part
|
||||
|
||||
inverse = 'inv' in sensor_name
|
||||
byte_idx=int(sensor_index/8) if isinstance(sensor_index, int) else None
|
||||
bit_idx=sensor_index%8 if isinstance(sensor_index, int) else None
|
||||
byte_idx = int(sensor_index / 8) if isinstance(sensor_index, int) else None
|
||||
bit_idx = sensor_index % 8 if isinstance(sensor_index, int) else None
|
||||
current_bitstate = data[0]["digital_io"][byte_idx][bit_idx] if isinstance(sensor_index, int) else None
|
||||
|
||||
if 'stat' in sensor_name:
|
||||
continue
|
||||
|
||||
if isinstance(sensor_index, int):
|
||||
if (inverse and current_bitstate != self.expected_input_state) or (not inverse and current_bitstate == self.expected_input_state):
|
||||
self.inputs[sensor_index] = True
|
||||
|
||||
is_expected = (inverse and current_bitstate != self.expected_input_state) or (not inverse and current_bitstate == self.expected_input_state)
|
||||
|
||||
if self.keep_true:
|
||||
# Memorize the True state if the condition is met
|
||||
if is_expected:
|
||||
self.inputs[sensor_index] = True
|
||||
elif sensor_index not in self.inputs:
|
||||
self.inputs[sensor_index] = False
|
||||
else:
|
||||
# Live tracking (Original behavior expectation when keep_true is not enabled)
|
||||
self.inputs[sensor_index] = is_expected
|
||||
|
||||
if not self.inputs.get(sensor_index, False):
|
||||
ok = False
|
||||
else:
|
||||
|
|
@ -234,7 +246,6 @@ class Test_Instructions(Test_Test):
|
|||
|
||||
self.toggle_icons()
|
||||
|
||||
|
||||
def set_done(self):
|
||||
self.done=True
|
||||
self.done_ok=True
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user