diff --git a/devices/HW_device_template.py b/devices/HW_device_template.py index 950faf39daf790962ef1f4cc3b93fb00382533fb..2b2b0a648d260917fd0f3d973b77cb04674ab613 100644 --- a/devices/HW_device_template.py +++ b/devices/HW_device_template.py @@ -15,6 +15,7 @@ from tango.server import run # Additional import +from src.attribute_wrapper import * from src.hardware_device import * __all__ = ["HW_dev"] diff --git a/devices/PCC.py b/devices/PCC.py index 9e605cac2f33983c12d70f2a3d41fb6b2b9cd00f..d6b255335f50e75b49ff8d2898ed59f085d86246 100644 --- a/devices/PCC.py +++ b/devices/PCC.py @@ -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() diff --git a/devices/clients/test_client.py b/devices/clients/test_client.py index ff85522d37518708831c6b0be4e9ba13b6128463..4227ac2922ccf40d6fdb947ccc4dcaf25d980174 100644 --- a/devices/clients/test_client.py +++ b/devices/clients/test_client.py @@ -1,5 +1,12 @@ from src.comms_client import * +<<<<<<< HEAD +<<<<<<< HEAD +import os +======= +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug +======= +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug # <class 'numpy.bool_'> @@ -28,7 +35,14 @@ class example_client(CommClient): """ this function provides a location for the code neccecary to connect to the client """ - +<<<<<<< HEAD +<<<<<<< HEAD + self.streams.debug_stream(os.path.dirname(os.path.abspath(__file__))) +======= +======= +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug + +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug self.streams.debug_stream("the example client doesn't actually connect to anything silly") self.connected = True # set connected to true diff --git a/devices/src/attribute_wrapper.py b/devices/src/attribute_wrapper.py index 35670b0705e75668e628283198daba26107e78a2..039849c32376ec83073d236427b5e715675ca9b3 100644 --- a/devices/src/attribute_wrapper.py +++ b/devices/src/attribute_wrapper.py @@ -11,6 +11,32 @@ logger = logging.getLogger() class attribute_wrapper(attribute): """ +<<<<<<< HEAD +<<<<<<< HEAD + 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. + + 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 + """ +======= + 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. + """ +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug +======= Wraps all the attributes in a wrapper class to manage most of the redundant code behind the scenes """ @@ -19,9 +45,10 @@ class attribute_wrapper(attribute): 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. """ +>>>>>>> 99e3d08... fixed 'illegal state transition' bug and off->initialise state bug # 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