Skip to content

Commit

Permalink
Merge pull request #27 from byuccl/lindy
Browse files Browse the repository at this point in the history
Lindy
  • Loading branch information
jgoeders authored Nov 23, 2024
2 parents 81925bb + c320797 commit e2f829d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name="yinstruments",
packages=find_packages(),
version="1.6.4",
version="1.7.0",
description="Experiment device control scripts for BYU's Configurable Computing Lab (https://ccl.byu.edu/)",
author="Jeff Goeders",
author_email="[email protected]",
Expand Down
8 changes: 5 additions & 3 deletions yinstruments/pdu/lindy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
# standard OID for the functions we will be doing
OID = "iso.3.6.1.4.1.17420.1.2.9.1.13.0"

DEFAULT_COMMAND_DELAY = 5.0 # This is delay needed by the lindy.


class Lindy(PDU):
"""This is the Lindy class"""

def __init__(self, ip_address, port, timeout=3.0):
super().__init__(ip_address, port)
def __init__(self, ip_address, timeout=3.0):
super().__init__(ip_address, command_delay=DEFAULT_COMMAND_DELAY)

def __str__(self):
return f"{self.ip_address}:{self.port}"
return f"{self.ip_address}"

def on(self, port_num):
if int(port_num) > 8: # Since we are working with the LindyIPowerClassic8,
Expand Down
3 changes: 2 additions & 1 deletion yinstruments/pdu/netbooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ def __init__(
"""Netbooter constructor.
ip_address: IP address of the netbooter
port: the TCP port used for the telnet session."""
super().__init__(ip_address, port, timeout, command_delay)
super().__init__(ip_address, timeout, command_delay)
self.telnet = None
self.port = port

def __str__(self):
return f"{self.ip_address}:{self.port}"
Expand Down
7 changes: 2 additions & 5 deletions yinstruments/pdu/pdu.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ class PDU:
"""Generic class for PDU"""

DEFAULT_TIMEOUT_TIME = 3.0 # 3 seconds
DEFAULT_COMMAND_DELAY = (
1.0 # This is the original delay that may be needed by the Lindy. It is probably excessive
)
DEFAULT_COMMAND_DELAY = 0.5

# initializes your PDU with callable characteristics
@abstractmethod
def __init__(
self, ip_address, port, timeout=DEFAULT_TIMEOUT_TIME, command_delay=DEFAULT_COMMAND_DELAY
self, ip_address, timeout=DEFAULT_TIMEOUT_TIME, command_delay=DEFAULT_COMMAND_DELAY
):
self.sleep_time = command_delay
self.timeout = timeout
self.ip_address = ip_address
self.port = port

@abstractmethod
def __str__(self):
Expand Down

0 comments on commit e2f829d

Please sign in to comment.