Skip to content
Snippets Groups Projects
Commit 9d7fc612 authored by Taya Snijder's avatar Taya Snijder
Browse files

fixed state bug

parent 99e3d081
No related branches found
No related tags found
2 merge requests!18Resolve #2021 "04 16 branched from master state bug fix",!17Resolve #2021 "04 16 branched from master state bug fix"
......@@ -15,6 +15,7 @@
from tango.server import run
# Additional import
from src.attribute_wrapper import *
from src.hardware_device import *
__all__ = ["HW_dev"]
......
......@@ -112,7 +112,6 @@ class PCC(hardware_device):
# --------
def off(self):
""" user code here. is called when the state is set to OFF """
# Stop keep-alive
self.OPCua_client.stop()
......
from src.comms_client import *
import os
# <class 'numpy.bool_'>
......@@ -28,7 +29,7 @@ class example_client(CommClient):
"""
this function provides a location for the code neccecary to connect to the client
"""
self.streams.debug_stream(os.path.dirname(os.path.abspath(__file__)))
self.streams.debug_stream("the example client doesn't actually connect to anything silly")
self.connected = True # set connected to true
......
......@@ -11,17 +11,22 @@ logger = logging.getLogger()
class attribute_wrapper(attribute):
"""
Wraps all the attributes in a wrapper class to manage most of the redundant code behind the scenes
"""
Wraps all the attributes in a wrapper class to manage most of the redundant code behind the scenes
"""
def __init__(self, comms_annotation=None, datatype=None, dims=(1,), access=AttrWriteType.READ, init_value=None, **kwargs):
"""
wraps around the tango Attribute class. Provides an easier interface for 1d or 2d arrays. Also provides a way to abstract
managing the communications interface.
"""
wraps around the tango Attribute class. Provides an easier interface for 1d or 2d arrays. Also provides a way to abstract
managing the communications interface.
comms_annotation: data passed along to the attribute. can be given any form of data. handling is up to client implementation
datatype: any numpy datatype
dims: dimensions of the
init_value: value
"""
# ensure the type is a numpy array
if "numpy" not in str(datatype) and type(datatype) != str:
if "numpy" not in str(datatype) and datatype != str:
raise TypeError("Attribute needs to be a Tango-supported numpy or str type, but has type \"%s\"" % (datatype,))
self.comms_annotation = comms_annotation # store data that can be used by the comms interface. not used by the wrapper itself
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment