Commit 1510fc28 authored by auke.klazema's avatar auke.klazema

Removed uneeded member variable usage

parent 3c29bfc8
......@@ -38,7 +38,6 @@ class PrologixGpibUsb(PortDevice):
self._find_devices()
else:
self._devices = "Not scanned."
self._hpib_address = -1
def _set_default_platform_values(self):
if platform.system() == "Linux":
......@@ -82,14 +81,14 @@ class PrologixGpibUsb(PortDevice):
def _find_devices(self):
self._devices = []
for self._hpib_address in range(0, 31):
commandStr = "++addr " + str(self._hpib_address) + chr(10) + \
for address in range(0, 31):
commandStr = "++addr " + str(address) + chr(10) + \
"*idn?" + chr(10) + \
"++read" + chr(10)
self._serialPort.write(commandStr)
returnStr = self._serialPort.readline()
if returnStr != "":
self._devices += [self._hpib_address, returnStr]
self._devices += [address, returnStr]
def command(self, hpib_address, command):
if hpib_address != self._hpib_address:
......
......@@ -99,7 +99,7 @@ class PrologixGpibUsbTest(unittest.TestCase):
hpib.PrologixGpibUsb(port="device")
def test_command_prepend_plusplus_addr_if_new_address(self):
address = 2
address = 0
command = "command"
write_mock = self.serial_mock.return_value.write
......@@ -110,7 +110,7 @@ class PrologixGpibUsbTest(unittest.TestCase):
write_mock.assert_called_with("++addr " + str(address) + chr(10) + command + chr(10))
def test_command_no_prepend_plusplus_addr_if_address_already_used(self):
address = 2
address = 0
command = "command"
write_mock = self.serial_mock.return_value.write
......@@ -122,7 +122,7 @@ class PrologixGpibUsbTest(unittest.TestCase):
write_mock.assert_called_with(command + chr(10))
def test_query_prepend_plusplus_addr_if_new_address(self):
address = 2
address = 0
query = "query"
write_mock = self.serial_mock.return_value.write
......@@ -135,7 +135,7 @@ class PrologixGpibUsbTest(unittest.TestCase):
"++read eoi" + chr(10))
def test_query_no_prepend_plusplus_addr_if_address_already_used(self):
address = 2
address = 0
query = "query"
write_mock = self.serial_mock.return_value.write
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment