Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions gpib_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"""


KNOWN_DEVICE_TYPES = ('GPIB', 'TCPIP', 'USB')


class GPIBBusServer(LabradServer):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: two blank lines around top level definitions (https://google.github.io/styleguide/pyguide.html#Blank_Lines)

"""Provides direct access to GPIB-enabled devices."""
name = '%LABRADNODE% GPIB Bus'
Expand Down Expand Up @@ -107,15 +110,9 @@ def refreshDevices(self):
deletions = set(self.devices.keys()) - set(addresses)
for addr in additions:
try:
if addr.startswith('GPIB'):
instName = addr
elif addr.startswith('TCPIP'):
instName = addr
elif addr.startswith('USB'):
instName = addr + '::INSTR'
else:
if not addr.startswith(KNOWN_DEVICE_TYPES):
continue
instr = rm.get_instrument(instName)
instr = rm.get_instrument(addr)
instr.write_termination = ''
instr.clear()
if addr.endswith('SOCKET'):
Expand Down