Skip to content
Snippets Groups Projects
Commit f0b8cfd9 authored by Thomas Juerges's avatar Thomas Juerges
Browse files

Add properties with default values for R/W attributes

The attributes cannot be used before they get written to or otherwise
somehow magically updated.  Therefore I added peoprties with default
values that I assign in the init_device method.
parent 4be9267c
No related branches found
No related tags found
No related merge requests found
...@@ -44,6 +44,12 @@ class StatsCrosslet(Device): ...@@ -44,6 +44,12 @@ class StatsCrosslet(Device):
- Type:'DevULong' - Type:'DevULong'
OPC_time_out OPC_time_out
- Type:'DevULong' - Type:'DevULong'
Default_pause_time
- Type:'DevDouble'
Default_subband
- Type:'DevULong'
Default_integration_time
- Type:'DevDouble'
""" """
# PROTECTED REGION ID(StatsCrosslet.class_variable) ENABLED START # # PROTECTED REGION ID(StatsCrosslet.class_variable) ENABLED START #
client = 0 client = 0
...@@ -97,6 +103,21 @@ class StatsCrosslet(Device): ...@@ -97,6 +103,21 @@ class StatsCrosslet(Device):
default_value=1000 default_value=1000
) )
Default_pause_time = device_property(
dtype='DevDouble',
default_value=60.0
)
Default_subband = device_property(
dtype='DevULong',
default_value=150
)
Default_integration_time = device_property(
dtype='DevDouble',
default_value=1.0
)
# ---------- # ----------
# Attributes # Attributes
# ---------- # ----------
...@@ -158,6 +179,12 @@ class StatsCrosslet(Device): ...@@ -158,6 +179,12 @@ class StatsCrosslet(Device):
ns = self.client.get_namespace_index("http://lofar.eu") ns = self.client.get_namespace_index("http://lofar.eu")
self.obj = self.client.get_root_node().get_child(["0:Objects", "{}:StationMetrics".format(ns), "{}:RCU".format(ns)]) self.obj = self.client.get_root_node().get_child(["0:Objects", "{}:StationMetrics".format(ns), "{}:RCU".format(ns)])
self.record_cross = "{}:record_cross".format(ns) self.record_cross = "{}:record_cross".format(ns)
# Set default values in the read/write attributes
self._pause_time = self.Default_pause_time
self._integration_time = self.Default_integration_time
self._subband = self.Default_subband
self.data_read_loop = threading.Thread(target = self.read_data) self.data_read_loop = threading.Thread(target = self.read_data)
self.data_acquisition_is_active.set() self.data_acquisition_is_active.set()
self.stop_data_read_loop.clear() self.stop_data_read_loop.clear()
......
...@@ -20,6 +20,21 @@ ...@@ -20,6 +20,21 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>1000</DefaultPropValue> <DefaultPropValue>1000</DefaultPropValue>
</deviceProperties> </deviceProperties>
<deviceProperties name="Default_pause_time" description="">
<type xsi:type="pogoDsl:DoubleType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>60.0</DefaultPropValue>
</deviceProperties>
<deviceProperties name="Default_subband" description="">
<type xsi:type="pogoDsl:UIntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>150</DefaultPropValue>
</deviceProperties>
<deviceProperties name="Default_integration_time" description="">
<type xsi:type="pogoDsl:DoubleType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>1.0</DefaultPropValue>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0"> <commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none"> <argin description="none">
<type xsi:type="pogoDsl:VoidType"/> <type xsi:type="pogoDsl:VoidType"/>
......
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