diff --git a/config/label_designs/MCLAREN/Mclaren_barcode.nlbl b/config/label_designs/MCLAREN/Mclaren_barcode.nlbl
new file mode 100644
index 0000000..3acdc68
Binary files /dev/null and b/config/label_designs/MCLAREN/Mclaren_barcode.nlbl differ
diff --git a/config/label_templates/st-ten-11/Mclaren_barcode.prn b/config/label_templates/st-ten-11/Mclaren_barcode.prn
new file mode 100644
index 0000000..4958d48
--- /dev/null
+++ b/config/label_templates/st-ten-11/Mclaren_barcode.prn
@@ -0,0 +1,34 @@
+CT~~CD,~CC^~CT~
+^XA
+~TA000
+~JSN
+^LT0
+^MNW
+^MTT
+^PON
+^PMN
+^LH0,0
+^JMA
+^PR2,2
+~SD20
+^JUS
+^LRN
+^CI27
+^PA0,1,1,0
+^XZ
+^XA
+^MMT
+^PW320
+^LL1039
+^LS0
+^FT9,46^A0N,24,23^FH\^CI28^FD{RECIPE}^FS^CI27
+^FT250,38^A0N,16,15^FH\^CI28^FDVEROX^FS^CI27
+^FT9,80^A0N,24,23^FH\^CI28^FDFED^FS^CI27
+^BY2,3,58^FT65,166^BCN,,Y,N
+^FH\^FD>:{RECIPE}^FS
+^BY2,3,54^FT131,259^BCN,,Y,N
+^FH\^FD>:{SN}^FS
+^FT9,316^A0N,24,23^FH\^CI28^FD{DATE}^FS^CI27
+^FT109,321^A0N,24,23^FH\^CI28^FD{SN}^FS^CI27
+^PQ1,0,1,Y
+^XZ
diff --git a/config/machine_settings/test-linux.ini b/config/machine_settings/test-linux.ini
index d5139e7..533934d 100644
--- a/config/machine_settings/test-linux.ini
+++ b/config/machine_settings/test-linux.ini
@@ -15,7 +15,8 @@ tecna_t3: present
vision_saver: absent
vision: absent
screwdriver: absent
-fixture_id: absent
+fixture_id: present
+barcode_recipe_selection: present
digital_io: present
external_flush_blow: absent
@@ -25,11 +26,11 @@ poll_time: 10
hold_time: 10
[tecna_t3]
-port: /dev/ttyUSB0
+port: /dev/ttyUSB1
model: t3p
[fixture_rfid]
-port: COM5
+port: USB0
[digital_io]
# OUTPUT MAP FOR VALVE CONTROL UNITS
diff --git a/src/components/rfid_pn532.py b/src/components/rfid_pn532.py
index 241d79e..7acb93f 100644
--- a/src/components/rfid_pn532.py
+++ b/src/components/rfid_pn532.py
@@ -11,6 +11,7 @@ from src.lib.nfc.clf import RemoteTarget
class RFID_PN532(Component):
new_id_signal = pyqtSignal(str)
+ rfid_error_signal = pyqtSignal(bool)
def __init__(self, config=None, name=None, period=1, lazy=True, paused=False, threaded=True):
super().__init__(config=config, name=name, period=period, lazy=lazy, paused=paused, threaded=threaded)
@@ -49,6 +50,8 @@ class RFID_PN532(Component):
try:
if not self.connected:
self.open_device()
+ if self.connected:
+ self.rfid_error_signal.emit(True)
else:
target = self.clf.sense(RemoteTarget('106A'), RemoteTarget('106B'), RemoteTarget('212F'))
if target is not None:
@@ -61,6 +64,7 @@ class RFID_PN532(Component):
self.log.info(f"new tag detected:{tag_content}")
self.current_data=tag_content
self.new_id_signal.emit(self.current_data)
+ self.rfid_error_signal.emit(self.connected)
else:
self.log.error("tag is not NDEF")
else:
@@ -68,12 +72,15 @@ class RFID_PN532(Component):
self.log.info(f"tag removed:{self.current_data}")
self.current_data = None
self.new_id_signal.emit(None)
+ self.rfid_error_signal.emit(False)
self.log.debug("no target present")
except Exception as e:
self.log.info(f"{e}")
self.connected = False
finally:
+ if not self.connected:
+ self.rfid_error_signal.emit(False)
self.mutex.unlock()
def write_tag(self,data):
diff --git a/src/ui/test/test.py b/src/ui/test/test.py
index 3fff6f1..bbb35c9 100755
--- a/src/ui/test/test.py
+++ b/src/ui/test/test.py
@@ -6,6 +6,7 @@ import weakref
from datetime import datetime, timedelta
from PyQt5.QtCore import QTimer, pyqtSlot
from PyQt5.QtWidgets import QMessageBox
+from component import Component
from lib.db import Archive, Recipes, Users
from lib.helpers import get_shift
from lib.helpers.step import Step
@@ -27,6 +28,7 @@ from ui.test_vision import Test_Vision
from ui.test_warning_img import Test_Warning_Img
from ui.widget import Widget
from components import ArchiveSynchronizer
+from src.components.rfid_pn532 import RFID_PN532
class Test(Widget):
@@ -54,6 +56,10 @@ class Test(Widget):
self.auto_import = Recipe_Selection
self.archive_synch = ArchiveSynchronizer(config=config)
+ self.rfid = RFID_PN532(config=config)
+ self.error_label.setText("")
+ self.error_label.setStyleSheet("QLabel { color: red; }")
+ self.rfid.rfid_error_signal.connect(self.handle_rfid_error)
if self.config["hardware_config"]["barcode_recipe_selection"] == "present":
self.recipe_selection_mode = "barcode"
@@ -170,6 +176,7 @@ class Test(Widget):
if "fixture_id" in self.components.keys():
self.components["fixture_id"].new_id_signal.connect(self.load_recipe_from_rfid)
+ self.components["fixture_id"].rfid_error_signal.connect(self.handle_rfid_error)
self.tag_loaded_recipe = self.main_window.tag_loaded_recipe
# TESTING
@@ -797,3 +804,11 @@ class Test(Widget):
self.tag_loaded_recipe = None
self.fail_cycle()
self.change_recipe()
+
+ @pyqtSlot(bool)
+ def handle_rfid_error(self, connected):
+ if connected:
+ self.error_label.setText("") # Update the label from Designer
+ else:
+ self.error_label.setText("Errore RFID.") # Update the label from Designer
+ self.error_label.setStyleSheet("color: red;")
\ No newline at end of file
diff --git a/src/ui/test/test.ui b/src/ui/test/test.ui
index 326e7f4..195c61a 100755
--- a/src/ui/test/test.ui
+++ b/src/ui/test/test.ui
@@ -6,8 +6,8 @@
0
0
- 1252
- 125
+ 1192
+ 114
@@ -19,7 +19,6 @@
12
- 75
true
@@ -52,33 +51,19 @@
3
- -
-
-
- Qt::Horizontal
-
-
- QSizePolicy::Fixed
-
-
-
- 20
- 20
-
-
-
-
- -
-
+
-
+
12
- 75
true
- OPERATORE:
+ -
+
+
+ Qt::AlignCenter
@@ -87,7 +72,6 @@
12
- 75
true
@@ -96,26 +80,6 @@
- -
-
-
-
- 0
- 0
-
-
-
-
- 12
- 75
- true
-
-
-
- N. DISEGNO:
-
-
-
-
@@ -139,7 +103,6 @@
12
- 75
true
@@ -148,62 +111,6 @@
- -
-
-
-
- 12
- 75
- true
-
-
-
- PROSSIMO AUTOTEST:
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 200
- 40
-
-
-
-
- 12
- 75
- true
-
-
-
- ANNULLA TEST
-
-
-
-
@@ -227,7 +134,6 @@
12
- 75
true
@@ -236,82 +142,16 @@
- -
-
+
-
+
12
- 75
true
- 12345
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 16
- 75
- true
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 12
- 75
- true
-
-
-
- -
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 40
- 20
-
-
-
-
- -
-
-
-
- 12
- 75
- true
-
-
-
- 12345
-567
+ ULTIMO AUTOTEST:
Qt::AlignCenter
@@ -331,51 +171,17 @@
- -
-
+
-
+
12
- 75
true
- PEZZI FATTI
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 12
- 75
- true
-
-
-
- ULTIMO AUTOTEST:
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 12
- 75
- true
-
-
-
- -
+ 12345
+567
Qt::AlignCenter
@@ -388,7 +194,6 @@
DejaVu Sans
11
- 75
true
@@ -398,6 +203,198 @@ CONTATORE
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 12
+ true
+
+
+
+ OPERATORE:
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 12
+ true
+
+
+
+ N. DISEGNO:
+
+
+
+ -
+
+
+
+ 12
+ true
+
+
+
+ 12345
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+
+ 12
+ true
+
+
+
+ PROSSIMO AUTOTEST:
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 12
+ true
+
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 12
+ true
+
+
+
+ PEZZI FATTI
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 200
+ 40
+
+
+
+
+ 12
+ true
+
+
+
+ ANNULLA TEST
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 20
+
+
+
+
+ -
+
+
+
+ 16
+ true
+
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 16
+ true
+
+
+
+ TextLabel
+
+
+