Skip to content

Commit

Permalink
Fixed my fight with the pre-commit bot
Browse files Browse the repository at this point in the history
  • Loading branch information
mjrand committed Oct 25, 2023
1 parent 06907b9 commit 6c89040
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
Binary file added socs/agents/hi6200/.drivers.py.swm
Binary file not shown.
18 changes: 0 additions & 18 deletions socs/agents/hi6200/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,8 @@ def init(self, session, params=None):
if not acquired:
return False, "Could not acquire lock"


<< << << < HEAD
self.scale = Hi6200Interface(self.ip_address, self.tcp_port)

== == == =
try:
self.scale = Hi6200Interface(self.ip_address, self.tcp_port)

except BaseException:
self.log.error(f"Some unknown error occurred initializing TCP Server")
return False, "TCP Failure"
>>>>>> > refs / remotes / origin / add_Hi6200_Agent
self.log.info("Connected to scale.")

return True, 'Initialized Scale.'
Expand Down Expand Up @@ -80,10 +70,6 @@ def monitor_weight(self, session, params=None):
}

try:
<<<<<<< HEAD
=======

>>>>>>> refs/remotes/origin/add_Hi6200_Agent
data['data']["Gross"] = self.scale.read_scale_gross_weight()
data['data']["Net"] = self.scale.read_scale_net_weight()

Expand All @@ -93,10 +79,6 @@ def monitor_weight(self, session, params=None):
session.data = data

except ValueError as e:
<<<<<<< HEAD
=======

>>>>>>> refs/remotes/origin/add_Hi6200_Agent
self.log.error(f"Scale responded with an anomolous number, ignorning: {e}")

except AttributeError as e:
Expand Down
13 changes: 0 additions & 13 deletions socs/agents/hi6200/drivers.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
import struct

<< << << < HEAD
== == == =
from pyModbusTCP.client import ModbusClient

>>>>>> > refs / remotes / origin / add_Hi6200_Agent


class Hi6200Interface():

"""
The Hi6200 Weight Processor uses a Modbus TCP Interface to communicate.
<<<<<<< HEAD
=======
>>>>>>> refs/remotes/origin/add_Hi6200_Agent
The Gross and Net weight sensors are always available to read on the 8,9 and 6,7 registers respectively.
"""

def __init__(self, ip_address, tcp_port, verbose=False, **kwargs):
"""
Connects to the Hi6200 weight sensor using a TCP Modbus Client with pyModbusTCP.
This works ~similarly to a socket connection using a IP and port.
<<<<<<< HEAD
=======
>>>>>>> refs/remotes/origin/add_Hi6200_Agent
ModbusClient will not throw errors upon incorrect ip_address!
ModbusClient will also allow multiple recconects unlike a socket.
"""
Expand Down

0 comments on commit 6c89040

Please sign in to comment.