Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 16, 2024
1 parent abe01e6 commit 3746b34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion socs/agents/wiregrid_tiltsensor/agent.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import time

from ocs import ocs_agent, site_config
from ocs.ocs_twisted import TimeoutLock, Pacemaker
from ocs.ocs_twisted import Pacemaker, TimeoutLock

from socs.agents.wiregrid_tiltsensor.drivers import connect


class WiregridTiltSensorAgent:
""" Agent to record the wiregrid tilt sensor data.
The tilt sensor data is sent via serial-to-ethernet converter.
Expand Down
6 changes: 3 additions & 3 deletions socs/agents/wiregrid_tiltsensor/drivers/dwl.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def get_angle(self):
command = b"\x06\x01\x02\xAA\x00\x00\x00\x00\x00\x00\x00\x00"
if self.verbose > 0:
print(f'get_angle() command = {command}')

read = []
SIZE = 12

# write and read serial
self.ser.write(command)
read_hex = self.ser.read(SIZE)
Expand All @@ -54,7 +54,7 @@ def get_angle(self):
if self.verbose > 0:
print(f'read_hex = {read_hex}')
print(f'read = {read}')

# check header matching and calculate the angles
if self.isSingle:
header = ['0x61', '0x11']
Expand Down
6 changes: 3 additions & 3 deletions socs/agents/wiregrid_tiltsensor/drivers/sherborne.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, tcp_ip=None, tcp_port=None, timeout=None, reset_boot=False, v
self.tcp_ip = tcp_ip
self.tcp_port = tcp_port
self.verbose = verbose

# Connect to device
msg = self.__conn(tcp_ip, tcp_port, timeout)
print(msg)
Expand Down Expand Up @@ -58,14 +58,14 @@ def get_angle(self):
value_read_angleY = value_read_angleY.replace('\r', '')
if self.verbose > 0:
print(f'read_angleY = {value_read_angleY}')

self.wait()

val = (value_read_angleX, value_read_angleY)
msg = f"Measured angle: X = {value_read_angleX}, Y = {value_read_angleY}"
if self.verbose > 0:
print(msg)

return msg, val

def __conn(self, tcp_ip, tcp_port, timeout):
Expand Down

0 comments on commit 3746b34

Please sign in to comment.