GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 67a0efd1 authored by bliss administrator's avatar bliss administrator

Added tango server for the HadesPress.

Server will run under windows on wid19hades.
parent 105a1916
# -*- coding: utf-8 -*-
#
# This file is part of the HadesPress project
#
# Copyright (C): 2019
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# France
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
"""
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(HadesPress.additionnal_import) ENABLED START #
# PROTECTED REGION END # // HadesPress.additionnal_import
__all__ = ["HadesPress", "main"]
class HadesPress(Device):
"""
"""
# PROTECTED REGION ID(HadesPress.class_variable) ENABLED START #
# PROTECTED REGION END # // HadesPress.class_variable
# ----------
# Attributes
# ----------
Pressure = attribute(
dtype='DevDouble',
access=AttrWriteType.READ_WRITE,
)
PressLock = attribute(
dtype='DevBoolean',
)
ScanLock = attribute(
dtype='DevBoolean',
access=AttrWriteType.READ_WRITE,
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the HadesPress."""
Device.init_device(self)
# PROTECTED REGION ID(HadesPress.init_device) ENABLED START #
# PROTECTED REGION END # // HadesPress.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(HadesPress.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // HadesPress.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(HadesPress.delete_device) ENABLED START #
# PROTECTED REGION END # // HadesPress.delete_device
# ------------------
# Attributes methods
# ------------------
def read_Pressure(self):
# PROTECTED REGION ID(HadesPress.Pressure_read) ENABLED START #
"""Return the Pressure attribute."""
return self.__pressure
# PROTECTED REGION END # // HadesPress.Pressure_read
def write_Pressure(self, value):
# PROTECTED REGION ID(HadesPress.Pressure_write) ENABLED START #
"""Set the Pressure attribute."""
pass
# PROTECTED REGION END # // HadesPress.Pressure_write
def read_PressLock(self):
# PROTECTED REGION ID(HadesPress.PressLock_read) ENABLED START #
"""Return the PressLock attribute."""
return self.__press_lock
# PROTECTED REGION END # // HadesPress.PressLock_read
def read_ScanLock(self):
# PROTECTED REGION ID(HadesPress.ScanLock_read) ENABLED START #
"""Return the ScanLock attribute."""
return self.__scan_lock
# PROTECTED REGION END # // HadesPress.ScanLock_read
def write_ScanLock(self, value):
# PROTECTED REGION ID(HadesPress.ScanLock_write) ENABLED START #
"""Set the ScanLock attribute."""
pass
# PROTECTED REGION END # // HadesPress.ScanLock_write
# --------
# Commands
# --------
@DebugIt()
def dev_state(self):
# PROTECTED REGION ID(HadesPress.State) ENABLED START #
"""
This command gets the device state (stored in its device_state data member) and returns it to the caller.
:return:'DevState'
Device state
"""
return DevState.UNKNOWN
# PROTECTED REGION END # // HadesPress.State
@DebugIt()
def dev_status(self):
# PROTECTED REGION ID(HadesPress.Status) ENABLED START #
"""
This command gets the device status (stored in its device_status data member) and returns it to the caller.
:return:'ConstDevString'
Device status
"""
return ""
# PROTECTED REGION END # // HadesPress.Status
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the HadesPress module."""
# PROTECTED REGION ID(HadesPress.main) ENABLED START #
return run((HadesPress,), args=args, **kwargs)
# PROTECTED REGION END # // HadesPress.main
if __name__ == '__main__':
main()
<?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">
<classes name="HadesPress" pogoRevision="9.7">
<description description="" title="" sourcePath="/mntdirect/_users/meyer/ID19/hadespress" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="Copyright (C): 2019&#xA; European Synchrotron Radiation Facility&#xA; BP 220, Grenoble 38043&#xA; France" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at esrf.fr - meyer" author="meyer" emailDomain="esrf.fr" classFamily="BeamlineComponents" siteSpecific="" platform="Windows" bus="Not Applicable" manufacturer="none" reference=""/>
</description>
<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" isDynamic="false">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Device state">
<type xsi:type="pogoDsl:StateType"/>
</argout>
<status abstract="true" inherited="true" concrete="true" concreteHere="true"/>
</commands>
<commands name="Status" description="This command gets the device status (stored in its device_status data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Device status">
<type xsi:type="pogoDsl:ConstStringType"/>
</argout>
<status abstract="true" inherited="true" concrete="true" concreteHere="true"/>
</commands>
<attributes name="Pressure" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:DoubleType"/>
<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="PressLock" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<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="ScanLock" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<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>
<states name="ON" description="Hades press has control">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="OFF" description="Bliss has control">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="UNKNOWN" description="Cannot connect to hades press">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="/segfs/tango/cppserver/env"/>
</classes>
</pogoDsl:PogoSystem>
call C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3
call activate bliss_env
echo off
echo Start Hades Press Server
call python C:\users\opid19\server\HadesPress.py id19
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment