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

Update Crossecho Tango example

parent ce8b7ddf
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="ASCII"?> <?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl"> <pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
<classes name="Crossecho" pogoRevision="9.6"> <classes name="Crossecho" pogoRevision="9.6">
<description description="Implementation of a Tango device on top of an existing OPC-UA server in Python3." title="LOFAR2.0 Station Software" sourcePath="/hosthome/workspace.astron/extern/Tango/tango-workshop/crossechoTangoDev" language="PythonHL" filestogenerate="XMI file,Code files,Python Package,Protected Regions" license="APACHE" copyright="" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false"> <description description="Implementation of a Tango device on top of an existing OPC-UA server in Python3." title="LOFAR2.0 Station Software" sourcePath="/home/tango/tango-workshop/crossechoTangoDev" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="APACHE" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/> <inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at astron.nl - jurges" author="jurges" emailDomain="astron.nl" classFamily="OtherInstruments" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/> <identification contact="at astron.nl - jurges" author="jurges" emailDomain="astron.nl" classFamily="OtherInstruments" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/>
</description> </description>
<deviceProperties name="OPC_Server_Name" description="">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>localhost</DefaultPropValue>
</deviceProperties>
<deviceProperties name="OPC_Server_Port" description="">
<type xsi:type="pogoDsl:StringType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>55555</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"/>
...@@ -25,21 +35,51 @@ ...@@ -25,21 +35,51 @@
</commands> </commands>
<commands name="record_cross" description="" execMethod="record_cross" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> <commands name="record_cross" description="" execMethod="record_cross" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description=""> <argin description="">
<type xsi:type="pogoDsl:EncodedType"/> <type xsi:type="pogoDsl:VoidType"/>
</argin> </argin>
<argout description=""> <argout description="">
<type xsi:type="pogoDsl:EncodedType"/> <type xsi:type="pogoDsl:VoidType"/>
</argout> </argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<excludedStates>OFF</excludedStates>
<excludedStates>INIT</excludedStates>
<excludedStates>FAULT</excludedStates>
</commands> </commands>
<attributes name="crosslet_stat" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="15000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <attributes name="RCU_modes" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1024" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:EncodedType"/> <dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="crosslet_stat" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10240" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:DoubleType"/>
<changeEvent fire="false" libCheckCriteria="false"/> <changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/> <dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> <properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes> </attributes>
<pipes name="xlt_stat" description="" label="xlt" rwType="READ" displayLevel="OPERATOR"/>
<states name="ON" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="OFF" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="INIT" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="FAULT" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="ALARM" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="STANDBY" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="/usr/local/share/pogo/preferences"/> <preferences docHome="./doc_html" makefileHome="/usr/local/share/pogo/preferences"/>
</classes> </classes>
</pogoDsl:PogoSystem> </pogoDsl:PogoSystem>
# -*- coding: utf-8 -*-
#
# This file is part of the Crossecho project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
""" LOFAR2.0 Station Software
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
# PyTango imports
import PyTango
from PyTango import DebugIt
from PyTango.server import run
from PyTango.server import Device, DeviceMeta
from PyTango.server import attribute, command
from PyTango import AttrQuality, DispLevel, DevState
from PyTango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(Crossecho.additionnal_import) ENABLED START #
# PROTECTED REGION END # // Crossecho.additionnal_import
__all__ = ["Crossecho", "main"]
class Crossecho(Device):
"""
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
__metaclass__ = DeviceMeta
# PROTECTED REGION ID(Crossecho.class_variable) ENABLED START #
# PROTECTED REGION END # // Crossecho.class_variable
# ----------
# Attributes
# ----------
crosslet_stat = attribute(
dtype='bytearray',
)
# ---------------
# General methods
# ---------------
def init_device(self):
Device.init_device(self)
# PROTECTED REGION ID(Crossecho.init_device) ENABLED START #
# PROTECTED REGION END # // Crossecho.init_device
def always_executed_hook(self):
# PROTECTED REGION ID(Crossecho.always_executed_hook) ENABLED START #
pass
# PROTECTED REGION END # // Crossecho.always_executed_hook
def delete_device(self):
# PROTECTED REGION ID(Crossecho.delete_device) ENABLED START #
pass
# PROTECTED REGION END # // Crossecho.delete_device
# ------------------
# Attributes methods
# ------------------
def read_crosslet_stat(self):
# PROTECTED REGION ID(Crossecho.crosslet_stat_read) ENABLED START #
return ['', '']
# PROTECTED REGION END # // Crossecho.crosslet_stat_read
# --------
# Commands
# --------
@command(
dtype_in='bytearray',
dtype_out='bytearray',
)
@DebugIt()
def record_cross(self, argin):
# PROTECTED REGION ID(Crossecho.record_cross) ENABLED START #
return "", ""
# PROTECTED REGION END # // Crossecho.record_cross
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(Crossecho.main) ENABLED START #
return run((Crossecho,), args=args, **kwargs)
# PROTECTED REGION END # // Crossecho.main
if __name__ == '__main__':
main()
# -*- coding: utf-8 -*-
#
# This file is part of the Crossecho project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
"""LOFAR2.0 Station Software
Implementation of a Tango device on top of an existing OPC-UA server in Python3.
"""
from . import release
from .Crossecho import Crossecho, main
__version__ = release.version
__version_info__ = release.version_info
__author__ = release.author
# -*- coding: utf-8 -*-
#
# This file is part of the Crossecho project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
from Crossecho import main
main()
# -*- coding: utf-8 -*-
#
# This file is part of the Crossecho project
#
#
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """tangods-crossecho"""
version = "1.0.0"
version_info = version.split(".")
description = """Implementation of a Tango device on top of an existing OPC-UA server in Python3."""
author = "jurges"
author_email = "jurges at astron.nl"
license = """APACHE"""
url = """www.tango-controls.org"""
copyright = """"""
...@@ -39,7 +39,7 @@ class CrossechoDeviceTestCase(DeviceTestCase): ...@@ -39,7 +39,7 @@ class CrossechoDeviceTestCase(DeviceTestCase):
# PROTECTED REGION ID(Crossecho.test_additionnal_import) ENABLED START # # PROTECTED REGION ID(Crossecho.test_additionnal_import) ENABLED START #
# PROTECTED REGION END # // Crossecho.test_additionnal_import # PROTECTED REGION END # // Crossecho.test_additionnal_import
device = Crossecho device = Crossecho
properties = { properties = {'OPC_Server_Name': 'localhost', 'OPC_Server_Port': '55555',
} }
empty = None # Should be [] empty = None # Should be []
...@@ -75,6 +75,12 @@ class CrossechoDeviceTestCase(DeviceTestCase): ...@@ -75,6 +75,12 @@ class CrossechoDeviceTestCase(DeviceTestCase):
self.device.record_cross([""]) self.device.record_cross([""])
# PROTECTED REGION END # // Crossecho.test_record_cross # PROTECTED REGION END # // Crossecho.test_record_cross
def test_RCU_modes(self):
"""Test for RCU_modes"""
# PROTECTED REGION ID(Crossecho.test_RCU_modes) ENABLED START #
self.device.RCU_modes
# PROTECTED REGION END # // Crossecho.test_RCU_modes
def test_crosslet_stat(self): def test_crosslet_stat(self):
"""Test for crosslet_stat""" """Test for crosslet_stat"""
# PROTECTED REGION ID(Crossecho.test_crosslet_stat) ENABLED START # # PROTECTED REGION ID(Crossecho.test_crosslet_stat) ENABLED START #
......
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