From 26768092165bc1dda12228a3d6f88373abd1acf8 Mon Sep 17 00:00:00 2001 From: germano Date: Tue, 25 Jul 2023 21:18:16 +0200 Subject: [PATCH] fix rfid --- src/components/rfid_pn532.py | 2 +- src/components/tecna_marposs_provaset_t3.py | 4 ++-- src/test/rfid.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/rfid_pn532.py b/src/components/rfid_pn532.py index 86b03d0..3a1e4a0 100644 --- a/src/components/rfid_pn532.py +++ b/src/components/rfid_pn532.py @@ -23,7 +23,7 @@ class RFID_PN532(Component): self.tag_present=False self.current_data=None self.is_win = platform.system().lower() == "windows" - self.dev_list = [f"{self.config['fixture_rfid']['port']}:pn532"] if self.is_win else ['tty:USB0:pn532','tty:USB1:pn532'] + self.dev_list = [f"{'com'if self.is_win else 'tty'}:{self.config['fixture_rfid']['port']}:pn532"] self._period = 1 def open_device(self): diff --git a/src/components/tecna_marposs_provaset_t3.py b/src/components/tecna_marposs_provaset_t3.py index 1decbae..dedd8fc 100644 --- a/src/components/tecna_marposs_provaset_t3.py +++ b/src/components/tecna_marposs_provaset_t3.py @@ -272,9 +272,9 @@ class TecnaMarpossProvasetT3(ModbusComponent): recipe_barcode = f"j{recipe.part_number}"[:16].encode("ascii") recipe_barcode += b"\x00" * (24 - len(recipe_barcode)) test_flags = 0b0110100001010100 if (step.spec.get("autotest", False) in ["ko_check"]) else 0b0110000001010100 - pid_mode = int(step.spec.get("pid_mode",self.config["recipes_defaults"]["pid_mode"]))<<4 + pid_mode = int(self.config["recipes_defaults"]["pid_mode"])<<4 test_flags = test_flags | pid_mode - pid_ramps=0b0000000000000000 | int(step.spec.get("pid_level",self.config["recipes_defaults"]["pid_level"]))<<8 | int(step.spec.get("pid_speed",self.config["recipes_defaults"]["pid_speed"]))<<12 + pid_ramps=0b0000000000000000 | int(self.config["recipes_defaults"]["pid_level"])<<8 | int(self.config["recipes_defaults"]["pid_speed"])<<12 spec = { "Flag: Instrument settings": 0b0000000000000000, "Test program for read/write operation": table, diff --git a/src/test/rfid.py b/src/test/rfid.py index ad48bbd..596632b 100644 --- a/src/test/rfid.py +++ b/src/test/rfid.py @@ -35,7 +35,7 @@ connected=False is_win = platform.system().lower() == "windows" if is_win: - dev_list=['COM5:pn532'] + dev_list=['com:COM1:pn532'] else: dev_list = ['tty:USB0:pn532', 'tty:USB1:pn532', 'tty:USB2:pn532'] while True: