diff --git a/pyvisa_sim/channels.py b/pyvisa_sim/channels.py index d204dca..2816efc 100644 --- a/pyvisa_sim/channels.py +++ b/pyvisa_sim/channels.py @@ -71,7 +71,6 @@ class Channels(Component): can_select: bool def __init__(self, device: "Device", ids: List[str], can_select: bool): - super(Channels, self).__init__() self.can_select: bool = can_select self._selected = None @@ -194,9 +193,9 @@ def _match_setters(self, query: bytes) -> Optional[OptionalBytes]: try: if isinstance(parsed, dict) and "ch_id" in parsed: self._selected = parsed["ch_id"] - self._properties[name].set_value(parsed["0"]) + self._properties[name].set_value(str(parsed["0"])) else: - self._properties[name].set_value(parsed) + self._properties[name].set_value(str(parsed)) return response except ValueError: if isinstance(error_response, bytes): diff --git a/pyvisa_sim/devices.py b/pyvisa_sim/devices.py index 70a046b..ba4a197 100644 --- a/pyvisa_sim/devices.py +++ b/pyvisa_sim/devices.py @@ -122,7 +122,6 @@ class Device(Component): delimiter: bytes def __init__(self, name: str, delimiter: bytes) -> None: - super(Device, self).__init__() self.name = name self.delimiter = delimiter diff --git a/pyvisa_sim/sessions/gpib.py b/pyvisa_sim/sessions/gpib.py index d18e1ee..ded9110 100644 --- a/pyvisa_sim/sessions/gpib.py +++ b/pyvisa_sim/sessions/gpib.py @@ -15,7 +15,6 @@ @session.Session.register(constants.InterfaceType.gpib, "INSTR") class GPIBInstrumentSession(session.Session): - parsed: rname.GPIBInstr def after_parsing(self) -> None: diff --git a/pyvisa_sim/sessions/serial.py b/pyvisa_sim/sessions/serial.py index f6416ce..f1dbbf0 100644 --- a/pyvisa_sim/sessions/serial.py +++ b/pyvisa_sim/sessions/serial.py @@ -16,7 +16,6 @@ @session.Session.register(constants.InterfaceType.asrl, "INSTR") class SerialInstrumentSession(session.Session): - parsed: rname.ASRLInstr def after_parsing(self) -> None: @@ -25,7 +24,6 @@ def after_parsing(self) -> None: ) def read(self, count: int) -> Tuple[bytes, constants.StatusCode]: - # TODO: Implement VI_ATTR_SUPPRESS_END_EN end_in, _ = self.get_attribute(constants.ResourceAttribute.asrl_end_in) @@ -56,7 +54,6 @@ def read(self, count: int) -> Tuple[bytes, constants.StatusCode]: return out, constants.StatusCode.success_termination_character_read elif end_in == constants.SerialTermination.last_bit: - if common.last_int(out) & mask: return out, constants.StatusCode.success @@ -90,7 +87,6 @@ def write(self, data: bytes) -> Tuple[int, constants.StatusCode]: for val in common.iter_bytes(data, mask, send_end): self.device.write(val) else: - for i in range(len(data)): self.device.write(data[i : i + 1]) diff --git a/pyvisa_sim/sessions/tcpip.py b/pyvisa_sim/sessions/tcpip.py index ae42eab..b9fb231 100644 --- a/pyvisa_sim/sessions/tcpip.py +++ b/pyvisa_sim/sessions/tcpip.py @@ -59,7 +59,6 @@ def write(self, data: bytes) -> Tuple[int, constants.StatusCode]: @session.Session.register(constants.InterfaceType.tcpip, "INSTR") class TCPIPInstrumentSession(BaseTCPIPSession): - parsed: rname.TCPIPInstr def after_parsing(self) -> None: @@ -74,7 +73,6 @@ def after_parsing(self) -> None: @session.Session.register(constants.InterfaceType.tcpip, "SOCKET") class TCPIPSocketSession(BaseTCPIPSession): - parsed: rname.TCPIPSocket def after_parsing(self) -> None: diff --git a/pyvisa_sim/sessions/usb.py b/pyvisa_sim/sessions/usb.py index 63674d6..8042b3b 100644 --- a/pyvisa_sim/sessions/usb.py +++ b/pyvisa_sim/sessions/usb.py @@ -75,7 +75,6 @@ def write(self, data: bytes) -> Tuple[int, constants.StatusCode]: @session.Session.register(constants.InterfaceType.usb, "RAW") class USBRawSession(session.Session): - parsed: rname.USBRaw def after_parsing(self) -> None: