Skip to content
Snippets Groups Projects
Commit efa8632b authored by Claudio Scafuri's avatar Claudio Scafuri :speech_balloon:
Browse files

imported from CVS release_15

parent 58bb7e60
No related branches found
Tags 1.0.0
No related merge requests found
Showing
with 2034 additions and 0 deletions
CVS
*.pyc
core
.project
.pydevproject
.idea
#!/usr/bin/env python
# $Author: claudio $
#
# $Name: $
#
# $Log: FRTND_E.py,v $
# Revision 1.3 2017-02-13 09:30:51 claudio
# revision tag
#
#
import sys
from PyQt4 import QtCore, QtGui
#from ui_frntd_e import Ui_frntd_e
from active_frntd_e import active_frntd_e
app = QtGui.QApplication(sys.argv)
window = QtGui.QDialog()
#ui = Ui_frntd_e()
ui=active_frntd_e()
#ui.setupUi(window)
ui.setup(window)
window.show()
sys.exit(app.exec_())
#makefile for PyQt4 panel
ui_frntd_e.py::frntd_e.ui
pyuic4 frntd_e.ui >ui_frntd_e.py
\ No newline at end of file
# deirved class to which active beahvoirou is delegated
# the fatehr class is re-generated by the designer
# $Author: claudio $
#
# $Name: $
#
# $Log: active_frntd_e.py,v $
# Revision 1.5 2019-06-20 08:14:21 claudio
# #8957, #8947: add new stopper syrmep, tango controlled
#
# Revision 1.4 2017-02-13 09:30:51 claudio
# revision tag
#
#
from PyQt4 import QtCore, QtGui
from ui_frntd_e import *
import blfe
import tango
class Worker(QtCore.QThread):
def __init__(self, parent=None):
QtCore.QThread.__init__(self, parent)
self.BL = blfe.blfe()
self.exiting = False
self.mode = 'update'
# tango device for syrmep - geco device
self.syrmepstopper = 0
self.syrmepstopperindex = 0
self.stopper_value = -1 # 0: closed , 1:open, -1 : unknown
try:
self.syrmepstopper = tango.DeviceProxy('syrmep-control-01.blcs.elettra.trieste.it:20000/syrmep/beamline/geco')
except:
self.syrmepstopper = 0
def run(self):
if self.mode == 'update':
self.update()
if self.mode == 'execute':
self.execute()
def update(self):
self.BL.read()
self.emit(QtCore.SIGNAL("UpdateThread(PyQt_PyObject)"), self.BL)
# read tango status
try:
self.stopper_value = self.syrmepstopper.r_bs4_v
except:
self.stopper_value = -1
def execute(self):
errtable = self.BL.closeall()
#close tango controlloed syrme stopper
try:
self.syrmepstopper.r_bs4_v=0
except:
self.emit(QtCore.SIGNAL("ExecuteError(PyQt_PyObject,PyQt_PyObject)"), self.BL, 'geco/r_bs4_v failed')
if errtable is None:
self.emit(QtCore.SIGNAL("ExecuteThread(PyQt_PyObject)"), self.BL)
else:
self.emit(QtCore.SIGNAL("ExecuteError(PyQt_PyObject,PyQt_PyObject)"), self.BL, errtable)
class active_frntd_e(Ui_frntd_e, QtCore.QObject):
# ovverride setupUI: create graphics and active object, worker thread , then connects signals and start timer
def setup(self, father):
# create ancesstor graphic objetcs
ui = self.setupUi(father)
self.ui = ui
self.msgbox = None
# connect to slots of this class
self.connect(self.pushClose, QtCore.SIGNAL("clicked()"), self.slot_do_close)
self.connect(self.tableWidget, QtCore.SIGNAL("destroyed()"), self.slot_quit)
# create worker thread - does all the slow network activities
self.thread = Worker()
self.connect(self.thread, QtCore.SIGNAL("UpdateThread(PyQt_PyObject)"), self.slot_thread_update)
self.connect(self.thread, QtCore.SIGNAL("ExecuteThread(PyQt_PyObject)"), self.slot_thread_execute)
self.connect(self.thread, QtCore.SIGNAL("ExecuteError(PyQt_PyObject,PyQt_PyObject)"), self.slot_thread_execute_error)
self.connect(self.thread, QtCore.SIGNAL("ExecuteError(PyQt_PyObject,PyQt_PyObject)"), self.slot_thread_tango_error)
# get reference of BL object from thread
# since the class only reads form BL object non synch primitives are used
# N.B. python copyes object references
self.BL = self.thread.BL
# configure table widget and create color brushes
self.yellowbrush = QtGui.QBrush(QtGui.QColor("yellow"))
self.greenbrush = QtGui.QBrush(QtGui.QColor("green"))
self.redbrush = QtGui.QBrush(QtGui.QColor("red"))
self.graybrush = QtGui.QBrush(QtGui.QColor("gray"))
n = self.BL.nentries
self.tableWidget.setRowCount(n + 1)
row = 0
for entry in self.BL.bltable:
bname = entry[2]
objname = entry[0]
stname = entry[4]
col0 = QtGui.QTableWidgetItem(bname, 0)
col1 = QtGui.QTableWidgetItem(objname, 1)
col2 = QtGui.QTableWidgetItem(stname, 2)
col2.setBackground(self.graybrush)
self.tableWidget.setItem(row, 0, col0)
self.tableWidget.setItem(row, 1, col1)
self.tableWidget.setItem(row, 2, col2)
self.tableWidget.setRowHeight(row, 22)
row = row + 1
# add Tango managed entries - different
bname = 'Syrmep'
objname = 'geco/r_bs4_v'
stname = 'UNKNOWN'
col0 = QtGui.QTableWidgetItem(bname, 0)
col1 = QtGui.QTableWidgetItem(objname, 1)
col2 = QtGui.QTableWidgetItem(stname, 2)
col2.setBackground(self.graybrush)
self.tableWidget.setItem(row, 0, col0)
self.tableWidget.setItem(row, 1, col1)
self.tableWidget.setItem(row, 2, col2)
self.tableWidget.setRowHeight(row, 22)
self.thread.syrmepstopperindex = row
self.syrmepstopperindex = row
row = row + 1
palette = self.label.palette()
palette.setBrush(QtGui.QPalette.Window, self.graybrush)
self.label.setPalette(palette)
self.label.setAutoFillBackground(1)
self.label.setText('UNKNOWN')
# resize columns
self.tableWidget.setColumnWidth(0, 130)
self.tableWidget.setColumnWidth(1, 310)
# do first table update
self.update_table()
# start timer
self.timer = QtCore.QTimer(self)
self.connect(self.timer, QtCore.SIGNAL("timeout()"), self.update_table)
self.timer.start(3000)
return ui
def update_table(self):
# configure and start thread
self.thread.mode = 'update'
self.thread.start()
def redraw_table(self, myBL):
# redraw informations
row = 0
for entry in myBL.bltable:
stname = entry[4]
item = self.tableWidget.item(row, 2)
item.setText(stname)
if stname == 'OPEN':
item.setBackground(self.redbrush)
if stname == 'CLOSED':
item.setBackground(self.greenbrush)
if stname == 'ERROR':
item.setBackground(self.yellowbrush)
if stname == 'UNKNOWN':
item.setBackground(self.graybrush)
# self.tableWidget.setItem(row,2,item)
row = row + 1
# check syrmep tango reading
idx = self.thread.syrmepstopperindex
item = self.tableWidget.item(idx, 2)
if self.thread.stopper_value == 1:
item.setBackground(self.redbrush)
item.setText('OPEN')
if self.thread.stopper_value == 0:
item.setBackground(self.greenbrush)
item.setText('CLOSED')
if self.thread.stopper_value == -1:
item.setBackground(self.graybrush)
item.setText('UNKNOWN')
palette = self.label.palette()
if (myBL.allclosed() == 1 and self.thread.stopper_value == 0):
palette.setBrush(QtGui.QPalette.Window, self.greenbrush)
self.label.setText('ALL CLOSED')
else:
palette.setBrush(QtGui.QPalette.Window, self.redbrush)
self.label.setText('OPEN/CLOSED')
self.label.setPalette(palette)
self.label.setAutoFillBackground(1)
def slot_do_close(self):
# first stop aqcusition thread
self.timer.stop()
self.thread.wait()
# start execution thread
self.thread.mode = 'execute'
self.thread.start()
# post dialog box since there is some time to wait
if self.msgbox is None:
self.msgbox = QtGui.QProgressDialog('Closing front-ends...', '', 0, 0)
self.msgbox.setLabelText('Closing front-ends...')
self.msgbox.setCancelButtonText('')
self.msgbox.setWindowTitle('BEAMLINE FRONT END')
self.msgbox.setModal(True)
# How do you remove a button in a dialog????
# butt=self.msgbox.button(QtGui.QMessageBox.Close)
# as a work-aroud, remove cancel functionality
QtCore.QObject.disconnect(self.msgbox, QtCore.SIGNAL('canceled()'), self.msgbox, QtCore.SLOT('cancel()'))
self.msgbox.show()
QtCore.SIGNAL
else:
self.msgbox.show()
def slot_thread_update(self, myBL):
# slot called when read is terminated
self.redraw_table(myBL)
def slot_thread_execute(self, myBL):
# called when execution thread is terminated normally
self.msgbox.close()
self.redraw_table(myBL)
self.timer.start(3000)
def slot_thread_execute_error(self, myBL, myerrtable):
# called when execution thread is terminated with error
self.msgbox.close()
self.redraw_table(myBL)
self.timer.start(3000)
# shuold improve formatting of beamline errors...
QtGui.QMessageBox.critical(self.ui, 'front-end close', repr(myerrtable))
def slot_thread_tango_error(self, myBL, msg):
# called when execution thread is terminated with error
self.msgbox.close()
self.redraw_table(myBL)
self.timer.start(3000)
# shuold improve formatting of beamline errors...
QtGui.QMessageBox.critical(self.ui, 'syrmep front-end close', msg)
def slot_quit(self):
self.timer.stop()
self.thread.wait()
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>frntd_e</class>
<widget class="QDialog" name="frntd_e">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>702</width>
<height>1021</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="windowTitle">
<string>BEAMLINE FRONT END</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QGridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>ALL CLOSED</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="margin">
<number>1</number>
</property>
<property name="textInteractionFlags">
<set>Qt::NoTextInteraction</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushClose">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>CLOSE ALL</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QTableWidget" name="tableWidget">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="autoScroll">
<bool>false</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="textElideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="cornerButtonEnabled">
<bool>false</bool>
</property>
<column>
<property name="text">
<string>Beamline</string>
</property>
</column>
<column>
<property name="text">
<string>Point Name</string>
</property>
</column>
<column>
<property name="text">
<string>Status</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'frntd_e.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_frntd_e(object):
def setupUi(self, frntd_e):
frntd_e.setObjectName(_fromUtf8("frntd_e"))
frntd_e.resize(702, 1021)
font = QtGui.QFont()
font.setPointSize(10)
frntd_e.setFont(font)
frntd_e.setSizeGripEnabled(True)
self.gridlayout = QtGui.QGridLayout(frntd_e)
self.gridlayout.setObjectName(_fromUtf8("gridlayout"))
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName(_fromUtf8("hboxlayout"))
self.vboxlayout = QtGui.QVBoxLayout()
self.vboxlayout.setObjectName(_fromUtf8("vboxlayout"))
self.label = QtGui.QLabel(frntd_e)
font = QtGui.QFont()
font.setPointSize(10)
font.setBold(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setFrameShape(QtGui.QFrame.Panel)
self.label.setFrameShadow(QtGui.QFrame.Sunken)
self.label.setLineWidth(1)
self.label.setTextFormat(QtCore.Qt.PlainText)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setTextInteractionFlags(QtCore.Qt.NoTextInteraction)
self.label.setObjectName(_fromUtf8("label"))
self.vboxlayout.addWidget(self.label)
self.pushClose = QtGui.QPushButton(frntd_e)
font = QtGui.QFont()
font.setPointSize(10)
self.pushClose.setFont(font)
self.pushClose.setObjectName(_fromUtf8("pushClose"))
self.vboxlayout.addWidget(self.pushClose)
spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
self.vboxlayout.addItem(spacerItem)
self.hboxlayout.addLayout(self.vboxlayout)
self.tableWidget = QtGui.QTableWidget(frntd_e)
font = QtGui.QFont()
font.setPointSize(9)
self.tableWidget.setFont(font)
self.tableWidget.setAutoFillBackground(True)
self.tableWidget.setLineWidth(1)
self.tableWidget.setAutoScroll(False)
self.tableWidget.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers)
self.tableWidget.setTabKeyNavigation(False)
self.tableWidget.setProperty("showDropIndicator", False)
self.tableWidget.setDragDropOverwriteMode(False)
self.tableWidget.setAlternatingRowColors(True)
self.tableWidget.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
self.tableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.tableWidget.setTextElideMode(QtCore.Qt.ElideNone)
self.tableWidget.setWordWrap(False)
self.tableWidget.setCornerButtonEnabled(False)
self.tableWidget.setObjectName(_fromUtf8("tableWidget"))
self.tableWidget.setColumnCount(3)
self.tableWidget.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(2, item)
self.hboxlayout.addWidget(self.tableWidget)
self.gridlayout.addLayout(self.hboxlayout, 0, 0, 1, 1)
self.retranslateUi(frntd_e)
QtCore.QMetaObject.connectSlotsByName(frntd_e)
def retranslateUi(self, frntd_e):
frntd_e.setWindowTitle(_translate("frntd_e", "BEAMLINE FRONT END", None))
self.label.setText(_translate("frntd_e", "ALL CLOSED", None))
self.pushClose.setText(_translate("frntd_e", "CLOSE ALL", None))
self.tableWidget.setSortingEnabled(False)
item = self.tableWidget.horizontalHeaderItem(0)
item.setText(_translate("frntd_e", "Beamline", None))
item = self.tableWidget.horizontalHeaderItem(1)
item.setText(_translate("frntd_e", "Point Name", None))
item = self.tableWidget.horizontalHeaderItem(2)
item.setText(_translate("frntd_e", "Status", None))
Il servzio TCPS viene gestito da un certo numero di istanze differenti con port number assegnato in modo da ripartire il carico,
le uscite da bending - per ora - leggono tutte dalla stessa istanza.
Le porte vanno assegnate per corrispondere al range di bcs da 1.1 (11) A 11.2 (112)
011 TWIN mIC : 20011
012 FEL - Nanospectroscopy : 20012
022 SuperESCA - Escamicroscopy : 20022
032 VUV photoemission - Spectromicroscopy : 20032
042 Circularly Polarized : 20042
052 X-ray diffraction - SAXS : 20052
061 SYRMEP - MSB : 20061
062 Gas Phase : 20062
072 ALOISA : 20072
081 Lilit - BEAR : 20081
082 Bach : 20082
092 APE : 20092
101 Microfabrication : 20101
102 Iuvs BaDElph : 20102
111 Exsafs : 20111
112 Xrd2 : 20112 (previsto ma non attivato, ci sara' un srver tango diretto)
\ No newline at end of file
File added
# parse,check,translate TCPS to tango
# and exec tabled actions
import string
import sys
import PyTango
#module wide constants
okmsg = 'Command execution OK'
errmsg_header = '*** ERROR'
term = "\r\n"
#################################################################################################
#utilities - taken from tangoclient.py to prpperly convert/assign types to command and attributes
#from strings
def convertToAttributeValue(pars, info, logger):
logger.debug( 'ConvertToAttribute() entering...')
#val = PyTango.AttributeValue()
#val.name = info.name
logger.debug( 'ConvertToAttribute() entered...')
if info.data_format == PyTango.SCALAR:
if info.data_type == PyTango.DevBoolean:
if pars[0] == '0' or pars[0].lower() == 'false':
value = False
else:
value = True
elif info.data_type == PyTango.DevFloat or info.data_type == PyTango.DevDouble:
value = float(pars[0])
elif info.data_type == PyTango.ConstDevString or info.data_type == PyTango.DevString or info.data_type == PyTango.DevUChar:
value = pars[0]
elif info.data_type == PyTango.DevLong or info.data_type == PyTango.DevShort or info.data_type == PyTango.DevULong or info.data_type == PyTango.DevUShort:
value = int(pars[0])
elif info.data_format == PyTango.SPECTRUM:
temp = list()
if info.data_type == PyTango.DevBoolean:
for p in pars:
if p == '0' or p.lower() == 'false':
temp.append(False)
else:
temp.append(True)
elif info.data_type == PyTango.DevFloat or info.data_type == PyTango.DevDouble:
for p in pars:
temp.append(float(p))
elif info.data_type == PyTango.ConstDevString or info.data_type == PyTango.DevString or info.data_type == PyTango.DevUChar:
temp = pars
elif info.data_type == PyTango.DevLong or info.data_type == PyTango.DevShort or info.data_type == PyTango.DevULong or info.data_type == PyTango.DevUShort:
temp.append(int(p))
value = temp
return value
####---------------------------------------------------------------------------------------------
def convertToCommandInput(pars, mtype):
if mtype == PyTango.DevBoolean:
if pars[0] == '0' or pars[0].lower() == 'false':
return False
else:
return True
elif mtype == PyTango.DevFloat or mtype == PyTango.DevDouble:
return float(pars[0])
elif mtype == PyTango.ConstDevString or mtype == PyTango.DevString or mtype == PyTango.DevUChar:
return pars[0]
elif mtype == PyTango.DevLong or mtype == PyTango.DevShort or mtype == PyTango.DevULong or mtype == PyTango.DevUShort:
return int(pars[0])
if mtype == PyTango.DevVarBooleanArray:
temp = list()
for p in pars:
if p == '0' or p.lower() == 'false':
temp.append(False)
else:
temp.append(True)
return temp
elif mtype == PyTango.DevVarFloatArray or mtype == PyTango.DevVarDoubleArray:
temp = list()
for p in pars:
temp.append(float(p))
return temp
elif mtype == PyTango.DevVarStringArray:
return pars
elif mtype == PyTango.DevVarLongArray or mtype == PyTango.DevVarShortArray or mtype == PyTango.DevVarULongArray or mtype == PyTango.DevVarUShortArray:
temp = list()
for p in pars:
temp.append(int(p))
return temp
else:
return None
#################################################################################################
class ProxyContainer(object):
"""
This class parses the configuration files,
build the approriate TCPSproxyes and inserts the in a map.
:version:
:author:
"""
def __init__(self):
#init to empty dictionaries the two main dispatch tables
self.get_dict = {}
self.set_dict = {}
def add_logger(self, addedlogger):
self.logger = addedlogger
def parse_conf_file(self, fname):
"""
@param string fname :
@return :
@author
"""
self.logger.debug('ProxyContainer.parse_conf_file() parsing: '+fname)
try:
conf_file = open(fname,'r')
except:
self.logger.fatal( 'ProxyContainer.parse_conf_file() fatal error opening conf_file: '+fname)
raise #impossible to continue....
count = 0
result = True
for rawline in conf_file.readlines():
if not rawline.strip():
continue #discard empty lines
count = count+1
line=' '.join(rawline.split()) # collapse multiple white spaces into single white space
if(line[0]=='#' or line[0]=='*' or not line.strip()) : #discard comment and empyt lines
continue
datum=string.split(line,' ')
if (datum[0]!='GET' and datum[0] !='SET'):
result = False
self.logger.error( 'ProxyContainer: parse_conf_file error on line '+repr(count) +' '+ datum[0])
return result
if(datum[0]=='GET'):
if datum[1] not in self.get_dict:
tangostring = datum[-1]
if tangostring.count('->') ==1:
px = ProxyCommand(tangostring.strip(),self.logger)
elif tangostring.count('/') >=3:
px = ProxyAttribute(tangostring.strip(),self.logger)
self.get_dict[datum[1]] = px
else:
result=False
self.logger.error( 'ProxyContainer: parse_conf_file error on line '+repr(count)+' : SET duplicate '+datum[1])
return result
if(datum[0]=='SET'):
#create special keys for searching - must include also list of parameter names
skey = datum[1]
for s in datum[2:-1]:
skey = skey+'_'+s
if skey not in self.set_dict:
tangostring = datum[-1]
if tangostring.count('->') ==1:
px = ProxyCommand(tangostring.strip(),self.logger)
elif tangostring.count('/') >=3:
self.logger.debug('Inserting SET attribute '+tangostring.strip()+' with key: '+skey)
px = ProxyAttribute(tangostring.strip(),self.logger)
self.set_dict[skey] = px
else:
result=False
self.logger.error( 'ProxyContainer: parse_conf_file error on line '+repr(count)+' : SET duplicate '+repr(datum))
return result
return result
def dispatch_call(self, data):
"""
use "data" for finding the appropriate TCPSproxy, then invoches the appropriate
operation to it.
@param string data :
@return string :
@author
"""
#print 'ProxyContainer: dispacth_call '+data
self.logger.debug('processing '+data)
try:
cleandata=' '.join(data.split()) # collapse multiple white spaces into single white space
selector=string.split(cleandata," ")
self.logger.debug('processing selector ' +selector[0])
except:
self.logger.error('message not correctly configured:'+data)
return errmsg_header + ' message not correctly configured'+term
try:
if selector[0]=='GET':
if self.get_dict.has_key(selector[1]):
handler=self.get_dict[selector[1]]
resp=handler.get()
if(resp==None):
self.logger.error('not correctly handled: '+data)
return errmsg_header +' not correctly handled'+term
return resp
else:
self.logger.error(selector[1] + ' is not configured as GET point')
return errmsg_header + ' ' +selector[1]+' is not configured as GET point'+term
elif selector[0]=='SET':
self.logger.debug('processing SET...selector : '+selector[1])
skey=selector[1]
valuelist=[]
for s in selector[2:]:
arg=s.split(',')
cmd=arg[0]
for v in arg[1:]:
valuelist.append(v)
self.logger.debug('processing SET..adding to valuelist: '+v)
skey=skey+'_'+cmd
self.logger.debug('processing SET...searching for '+skey)
if self.set_dict.has_key(skey):
handler=self.set_dict[skey]
if (handler==None):
self.logger.error('SET: handler not found for: '+skey)
self.logger.debug('processing SET...calling set() for device... ')
resp=handler.set(valuelist)
self.logger.debug('processing SET..set() called or device... ')
if(resp==None):
self.logger.error('not correctly handled: '+data)
return errmsg_header + ' not correctly handled'+term
return resp
else:
self.logger.debug(selector[1] + ' is not configured as SET point')
return errmsg_header +' '+selector[1] +' is not configured as SET point'+term
# first field is neither SET nor GET... error!
self.logger.error('not correctly configured: '+data)
return errmsg_header +' not correctly configured'+term
except:
self.logger.error('exception processing data:' + data)
##########################################################################################
# 'abstract' class for Proxy Objects
class Proxy(object):
def get(self):
pass
def set(self,data):
pass
##########################################################################################
class ProxyAttribute(Proxy):
def __init__(self, attrname, log):
pos=attrname.rfind('/')
self.__attribute=attrname[(pos+1):].strip() #get read of terminating chrartcers if left
self.__devname=attrname[:pos]
self.__attrinfo=0
self.logger=log
try:
self.__device=PyTango.DeviceProxy(self.__devname)
#self.__attrinfo=self.__device.get_attribute_config(self.__attribute)
except:
self.logger.error( 'ProxyAttribute.init(): failed to create '+self.__devname+' for: '+attrname)
return None
try:
self.__attrinfo=self.__device.get_attribute_config(self.__attribute)
except:
self.__attrinfo=0
self.logger.error( 'ProxyAttribute.init(): failed to create self.__attrinfo for: '+self.__devname+'/'+self.__attribute)
return None
self.logger.debug('ProxyAttribute init() OK: '+self.__devname+'/'+self.__attribute)
def get(self):
error=False
if self.__attrinfo==0:
try:
self.logger.debug( 'ProxyAttribute.get(): getting attr config for : '+self.__devname+'/'+self.__attribute)
self.__attrinfo=self.__device.get_attribute_config(self.__attribute)
except:
self.logger.error( 'ProxyAttribute.get(): failed to create self.__attrinfo for: '+self.__devname+'/'+self.__attribute)
self.__attrinfo=0
error=True
#rstat='BEN-------' #simplicistic error notification !
#resp='R'+','+'?'+','+rstat+','+0+term
return 'R,?,BEN------,0'+term
try:
#self.logger.debug( 'ProxyAttribute.get(): reading : '+self.__devname)
attr=self.__device.read_attribute(self.__attribute) #read_attribute_as_string ????
val=attr.value
#self.logger.debug( 'ProxyAttribute.get(): reading value ok')
except PyTango.DevFailed,myex:
des0=myex[0].desc
self.logger.error ('GET: '+self.__devname+'/'+self.__attribute+' failed with exception '+des0)
#print 'ProxyAttribute: get() '+self.__attribute+' ERROR'
val=0
error=True
# analyze result and prepare answer
rtype='?'
racq='R' #fixed
if self.__attrinfo.data_format == PyTango.SCALAR:
if self.__attrinfo.data_type == PyTango.DevBoolean:
rtype='D'
if val:
rvalue='1,'+self.__attrinfo.unit
else:
rvalue='0,'+self.__attrinfo.unit
if self.__attrinfo.data_type == PyTango.DevDouble or self.__attrinfo.data_type == PyTango.DevFloat:
self.logger.debug( 'ProxyAttribute.get(): processing float...')
rtype='A'
rvalue=self.__attrinfo.format % val + ','+self.__attrinfo.unit
self.logger.debug( 'ProxyAttribute.get(): processing float:'+rvalue)
if self.__attrinfo.data_type == PyTango.DevLong or self.__attrinfo.data_type == PyTango.DevShort or self.__attrinfo.data_type == PyTango.DevULong or self.__attrinfo.data_type == PyTango.DevUShort:
rtype='I'
rvalue=self.__attrinfo.format % val + ','+self.__attrinfo.unit
if self.__attrinfo.data_type== 19: #pyTango.DevState
rtype='I'
rvalue= '%d'% int(val) + ','+self.__attrinfo.unit
if(error):
rstat='BEN-------' #simplicistic error notification !
else:
rstat='----------'
elif self.__attrinfo.data_format == PyTango.SPECTRUM and self.__attrinfo.data_type == PyTango.DevBoolean:
# special handling of bool spectrum - which are turned into bit masks or Bitmap
rtype='B'
longval=0
mask=0x1
count = 0
#if self.__attrinfo.writable==PyTango._PyTango.AttrWriteType.READ_WRITE :
numbits=attr.dim_x #make sure to get ALWAY the Read values, also with READ_WRITE attributes
if self.__devname.rfind('vlvfe') > 0: #workaround for different bitmaps of new valves. Dirty but... C.S. nov. 2016
numbits=3 #show only open close local bits - better solution must implelemented
for p in val:
count = count + 1
if count >32 or count > numbits:
break
# stuff bits into bitmap - max 64 bits
if p:
longval= longval | mask
mask = mask << 1
rvalue= '%d' % longval +','+self.__attrinfo.unit
if(error):
rstat='BEN-------' #simplicistic error notification !
else:
rstat='----------'
resp=racq+','+rtype+','+rstat+','+rvalue+term
self.logger.debug( 'ProxyAttribute.get(): about to return:'+resp)
return resp
#------------------------------------------------------------------
# set takes value in imput - use python list for arrays
def set(self,data):
self.logger.debug( 'ProxyAttribute.set() entering for '+self.__devname+'/'+self.__attribute)
if self.__attrinfo==0:
try:
self.__attrinfo=self.__device.get_attribute_config(self.__attribute)
except PyTango.DevFailed,e:
des=e[0].desc
errmsg= errmsg_header+ ' in perform command : '+des
self.logger.error( 'ProxyAttribute.set(): failed to create self.__attrinfo for: '+self.__devname+'/'+self.__attribute)
self.__attrinfo=0
return errmsg+des+term
try:
#self.logger.debug( 'ProxyAttribute.set(): converting attribute for '+self.__devname+'/'+self.__attribute)
val=convertToAttributeValue(data,self.__attrinfo,self.logger)
self.logger.debug( 'ProxyAttribute.set(): for '+self.__devname+'/'+self.__devname+'/'+self.__attribute)
self.__device.write_attribute(self.__attrinfo,val)
self.logger.info( 'SET: ACCEPT'+self.__devname+'/'+self.__attribute+' '+data[0])
return okmsg+term
except PyTango.DevFailed,myex:
des0=myex[0].desc
self.logger.debug ('SET: '+self.__devname+'/'+self.__attribute+' failed with exception '+des0)
msg = errmsg_header +' in perform command : '
self.logger.debug('msg:'+msg)
if des0.find('RESPINTA')>1:
msg = errmsg_header + ' in access violation : '
self.logger.info( 'SET: REJECT '+self.__devname+'/'+self.__attribute+' '+data[0])
else:
msg = errmsg_header + ' in perform command : '
self.logger.info ('SET: '+self.__devname+'/'+self.__attribute+' failed with exception '+des0)
return msg+des0+term
########################################################################################
class ProxyCommand(Proxy):
def __init__(self,cmdname,log):
pos=cmdname.rfind('->')
self.__command=cmdname[(pos+2):].strip()
self.__devname=cmdname[:pos]
self.logger=log
try:
self.__device=PyTango.DeviceProxy(self.__devname)
self.type=self.__device.command_query(self.__command)
except:
self.logger.error('ProxyCommand(): failed to create '+self.__devname)
########################################################################################
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Project SYSTEM "Project-4.6.dtd">
<!-- eric4 project file for project TCPSserver -->
<!-- Saved: 2012-02-24, 14:20:40 -->
<!-- Copyright (C) 2012 , -->
<Project version="4.6">
<Language></Language>
<ProgLanguage mixed="0">Python</ProgLanguage>
<ProjectType>Console</ProjectType>
<Description></Description>
<Version>0.1</Version>
<Author></Author>
<Email></Email>
<Sources>
<Source>TCPStwserver.py</Source>
<Source>TCPS2tango.py</Source>
</Sources>
<Forms>
</Forms>
<Translations>
</Translations>
<Resources>
</Resources>
<Interfaces>
</Interfaces>
<Others>
</Others>
<MainScript>TCPStwserver.py</MainScript>
<Vcs>
<VcsType>CVS</VcsType>
<VcsOptions>
<dict>
<key>
<string>add</string>
</key>
<value>
<list>
<string></string>
</list>
</value>
<key>
<string>checkout</string>
</key>
<value>
<list>
<string></string>
</list>
</value>
<key>
<string>commit</string>
</key>
<value>
<list>
<string></string>
</list>
</value>
<key>
<string>diff</string>
</key>
<value>
<list>
<string>-u3</string>
<string>-p</string>
</list>
</value>
<key>
<string>export</string>
</key>
<value>
<list>
<string></string>
</list>
</value>
<key>
<string>global</string>
</key>
<value>
<list>
<string>-f</string>
<string>-z3</string>
</list>
</value>
<key>
<string>history</string>
</key>
<value>
<list>
<string>-e</string>
<string>-a</string>
</list>
</value>
<key>
<string>log</string>
</key>
<value>
<list>
<string></string>
</list>
</value>
<key>
<string>remove</string>
</key>
<value>
<list>
<string>-f</string>
</list>
</value>
<key>
<string>status</string>
</key>
<value>
<list>
<string>-v</string>
</list>
</value>
<key>
<string>tag</string>
</key>
<value>
<list>
<string>-c</string>
</list>
</value>
<key>
<string>update</string>
</key>
<value>
<list>
<string>-dP</string>
</list>
</value>
</dict>
</VcsOptions>
<VcsOtherData>
<dict>
</dict>
</VcsOtherData>
</Vcs>
<FiletypeAssociations>
<FiletypeAssociation pattern="*.pyw" type="SOURCES" />
<FiletypeAssociation pattern="*.idl" type="INTERFACES" />
<FiletypeAssociation pattern="*.py" type="SOURCES" />
<FiletypeAssociation pattern="*.ptl" type="SOURCES" />
</FiletypeAssociations>
<Checkers>
<CheckersParams>
<dict>
<key>
<string>PYLINT</string>
</key>
<value>
<dict>
<key>
<string>dialogReport</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableBasic</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableClasses</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableDesign</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableExceptions</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableFormat</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableImports</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableMetrics</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableMiscellaneous</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableNewstyle</string>
</key>
<value>
<bool>False</bool>
</value>
<key>
<string>enableRPython</string>
</key>
<value>
<bool>False</bool>
</value>
<key>
<string>enableSimilarities</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableTypecheck</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>enableVariables</string>
</key>
<value>
<bool>True</bool>
</value>
<key>
<string>htmlReport</string>
</key>
<value>
<bool>False</bool>
</value>
<key>
<string>reportFile</string>
</key>
<value>
<unicode>pylint.html</unicode>
</value>
<key>
<string>txtReport</string>
</key>
<value>
<bool>False</bool>
</value>
</dict>
</value>
</dict>
</CheckersParams>
</Checkers>
</Project>
\ No newline at end of file
#!/usr/bin/env python
# TCPS server-bridge based on twisted
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
import time
import sys
import TCPS2tango
import logging
import logging.handlers
#obsolete! must be switched to argparse
import optparse
global_logging=logging.getLogger('TCPS')
# there should be a cleaner way ... but now I use a GLOBAL.....
#--------------------------------------------------------------
class twistedTCPS(Protocol):
'adapter of TCPS protocol for twisted package'
def __init__(self):
self.__myname='default TCPS server'
def connectionMade(self):
if(self.factory._timeout):
self.transport.socket.settimeout(self.factory._timeout) # it is possible to set timeouts!!
self.__peer=self.transport.getPeer()
global_logging.info ('new connection: ' + self.__peer.host + ':' + repr(self.__peer.port))
def connectionLost(self, reason):
self.transport.loseConnection()
global_logging.info('connection closed/lost: ' + self.__peer.host + ':' + repr(self.__peer.port))
def dataReceived(self, data):
try:
resp=self.factory.handler.dispatch_call(data.strip())
self.transport.write(resp)
except:
global_logging.error ('exception writing data to ' + self.__peer.host + ':' + repr(self.__peer.port))
# method to associate TCPS object and other initialization data
def makeTCPSFactory(fname,logger,timeout=None,):
factory=Factory()
factory.protocol=twistedTCPS
factory._fname=fname
factory._timeout=timeout
factory.handler=TCPS2tango.ProxyContainer()
factory.handler.add_logger(logger)
factory.handler.parse_conf_file(fname)
return factory
#-----------------------------------------------------------------
#remeber to switch use argparse for configuring cmd line options with python > 2.7
def main(argv=None):
if argv is None:
argv = sys.argv # argv for initializing , etc
#parse comnd line and prepare optinal arguments
parser = optparse.OptionParser(description='TCPStwserver options')
parser.add_option('-f','--configfile',help='config_file')
parser.add_option('-p', '--port', help='tpc port number [20000]')
parser.add_option('-l','--logfile',help='log_file')
parser.add_option('-v','--loglevel',help='log_level [debug|info|warning|error|critical]')
parser.add_option('-s','--logsize',help='log_file_size')
parser.add_option('-V','--verbose',help='echo debug to console')
(options,argmy) = parser.parse_args()
if options.configfile:
fname=options.configfile
else:
print 'usage: '+sys.argv[0] + ' --configfile= '
return 1
if options.port:
tcpport=int(options.port)
else:
tcpport=20000
if options.logfile:
lfile=options.logfile
else:
lfile='/dev/null'
if options.loglevel:
lev=options.loglevel
level=-1
if lev=='debug':
level=logging.DEBUG
elif lev=='info':
level=logging.INFO
elif lev=='warning':
level=logging.WARNING
elif lev=='error':
level=logging.ERROR
elif lev=='critical':
level=logging.CRITICAL
elif lev=='notset':
level==logging.NOTSET
else:
lev='notset'
level=logging.NOTSET
if options.logsize:
mBytes=int(options.logsize)
else:
mBytes=2196608
if options.verbose:
verbose=True
else:
verbose=False
# Set up a specific logger with our desired output level
# use INFO for for tracking all SET operations
# use ERROR and CRITICAL for errors (non-fatal and fatal)
# use INFO and DEBUG for diagnostics
# info is set with -V
#debug is set
logger = logging.getLogger('TCPS')
logger.setLevel(level) #default level is NOTSET
formatter = logging.Formatter("%(asctime)s\t%(levelname)s\t%(message)s")
# Add the log message handler to the logger
handler = logging.handlers.RotatingFileHandler(lfile, maxBytes=mBytes, backupCount=5)
# create and add formatter to logger
handler.setFormatter(formatter)
logger.addHandler(handler)
if verbose:
ch = logging.StreamHandler()
ch.setLevel(level)
ch.setFormatter(formatter)
logger.addHandler(ch)
logger.info('debug echo to console')
# use special builder to associate our data to TCPS object
# extra arguments are:
# 'internal name'
# timeout for network calls
logger.info('using config file '+fname)
factory=makeTCPSFactory(fname,logger)
# 20000 is the port assigned to TPCS - 30 seconds timeount
reactor.listenTCP(tcpport, factory,30.0)
# we can also open on multiple ports, just make another instance another reactor object
#reactor.listenTCP(30000, factory,30.0)
logger.debug('entering loop')
reactor.run()
logger.debug('exit loop')
if __name__ == "__main__":
sys.exit(main())
- analizzare "exception processing data"
- Transient CORBA excpetion:come si alza il timeout?
\ No newline at end of file
This diff is collapsed.
#configuration file for elettra-Tango to BCS bridge
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET FRONTEND_MACHINE_MACHINE_1_P120S011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s01.03/Pressure
GET FRONTEND_MACHINE_MACHINE_1_P400S011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s01.01/Pressure
#front-end VLVFE readings
GET FRONTEND_MACHINE_MACHINE_1_VALVE011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s1.1m/StatRF
#front-end PHOTON SHUTTER readings
GET FRONTEND_MACHINE_MACHINE_1_SHUT011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s1.1m/StatRF
GET 011F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_SS1
GET 011F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_SS1
GET 011F_MACHINE_MACHINE_1_XANGL sr/diagnostics/bpmid/XP_SS1
GET 011F_MACHINE_MACHINE_1_YANGL sr/diagnostics/bpmid/YP_SS1
#ID12 twin apu readings
GET FRONTEND_MACHINE_MACHINE_1_HIGHENPOS sr/id/id_s12.01/UserPositionHigh
GET FRONTEND_MACHINE_MACHINE_1_LOWENPOS sr/id/id_s12.01/UserPositionLow
GET FRONTEND_MACHINE_MACHINE_1_LOWEN011 sr/id/id_s12.01/LowEnergy
GET FRONTEND_MACHINE_MACHINE_1_HIGHEN011 sr/id/id_s12.01/HighEnergy
GET FRONTEND_MACHINE_MACHINE_1_GAPS010 sr/id/id_s12.01/StatRF
#ID12 twin apu settings
SET FRONTEND_MACHINE_MACHINE_1_LOWENPOS LOWENPOS sr/id/id_s12.01/UserPositionLow
SET FRONTEND_MACHINE_MACHINE_1_HIGHENPOS HIGHENPOS sr/id/id_s12.01/UserPositionHigh
#configuration file for elettra-Tango to BCS bridge
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_USERBEAM tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET FRONTEND_MACHINE_MACHINE_1_P120S011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s01.03/Pressure
GET FRONTEND_MACHINE_MACHINE_1_P400S011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s01.01/Pressure
#front-end VLVFE readings
GET FRONTEND_MACHINE_MACHINE_1_VALVE011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s1.1m/StatRF
#front-end PHOTON SHUTTER readings
GET FRONTEND_MACHINE_MACHINE_1_SHUT011 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s1.1m/StatRF
GET 011F_MACHINE_MACHINE_1_XPOS011 sr/diagnostics/bpmid/X_S1
GET 011F_MACHINE_MACHINE_1_YPOS011 sr/diagnostics/bpmid/Y_S1
GET 011F_MACHINE_MACHINE_1_XANGL011 sr/diagnostics/bpmid/XP_S1
GET 011F_MACHINE_MACHINE_1_YANGL011 sr/diagnostics/bpmid/YP_S1
#ID12 twin apu readings
GET FRONTEND_MACHINE_MACHINE_1_HIGHENPOS sr/id/id_s12.01/UserPositionHigh
GET FRONTEND_MACHINE_MACHINE_1_LOWENPOS sr/id/id_s12.01/UserPositionLow
GET FRONTEND_MACHINE_MACHINE_1_LOWEN011 sr/id/id_s12.01/LowEnergy
GET FRONTEND_MACHINE_MACHINE_1_HIGHEN011 sr/id/id_s12.01/HighEnergy
GET FRONTEND_MACHINE_MACHINE_1_GAPS010 sr/id/id_s12.01/StatRF
#ID12 twin apu settings
SET FRONTEND_MACHINE_MACHINE_1_LOWENPOS LOWENPOS sr/id/id_s12.01/UserPositionLow
#configuration file for elettra-Tango to BCS bridge - FEL - Nanospectroscopy : 20012
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET FRONTEND_MACHINE_MACHINE_1_P120S012 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s01.07/Pressure
GET FRONTEND_MACHINE_MACHINE_1_P400S012 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s01.01/Pressure
#questo puo' essere diffente dal vecchio SIP400_S1.2_PRES_RR che non esiet piu'
#front-end VLVFE readings
#GET FRONTEND_MACHINE_MACHINE_1_VALVE01M tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s1.1m/StatRF
GET FRONTEND_MACHINE_MACHINE_1_VALVE012 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s1.2/StatRF
#front-end PHOTON SHUTTER readings
#GET FRONTEND_MACHINE_MACHINE_1_SHUT01M tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s1.1m/StatRF
GET FRONTEND_MACHINE_MACHINE_1_SHUT012 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s1.2/StatRF
#beam positions and angles at centre of straigth sections
GET 012F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_S1
GET 012F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_S1
GET 012F_MACHINE_MACHINE_1_XANGLE sr/diagnostics/bpmid/XP_S1
GET 012F_MACHINE_MACHINE_1_YANGLE sr/diagnostics/bpmid/YP_S1
#ID1 readings
GET FRONTEND_MACHINE_MACHINE_1_GAP011 sr/id/id_s1.1/Gap
GET FRONTEND_MACHINE_MACHINE_1_GAP012 sr/id/id_s1.2/Gap
GET FRONTEND_MACHINE_MACHINE_1_PHA011 sr/id/id_s1.1/Phase
GET FRONTEND_MACHINE_MACHINE_1_PHA012 sr/id/id_s1.2/Phase
GET FRONTEND_MACHINE_MACHINE_1_GAPS011 sr/id/id_s1.1/StatRF
GET FRONTEND_MACHINE_MACHINE_1_GAPS012 sr/id/id_s1.2/StatRF
#ID1 settings
SET FRONTEND_MACHINE_MACHINE_1_GAP011 GAP011 sr/id/id_s1.1/Gap
SET FRONTEND_MACHINE_MACHINE_1_GAP012 GAP012 sr/id/id_s1.2/Gap
SET FRONTEND_MACHINE_MACHINE_1_PHA011 PHA011 sr/id/id_s1.1/Phase
SET FRONTEND_MACHINE_MACHINE_1_PHA012 PHA012 sr/id/id_s1.2/Phase
#PSMOD1 readings
GET FRONTEND_MACHINE_MACHINE_1_IM012 sr/id/psmod_s1/Current
GET FRONTEND_MACHINE_MACHINE_1_M012 sr/id/psmod_s1/StatRF
#PSMOD1 settings
SET FRONTEND_MACHINE_MACHINE_1_IM012 IM012 sr/id/psmod_s1/Current
#configuration file for elettra-Tango to BCS bridge 022 SuperESCA - Escamicroscopy : 20022
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET 022F_MACHINE_MACHINE_1_P120S022 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s02.07/Pressure
GET 022F_MACHINE_MACHINE_1_P400S022 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s02.02/Pressure
#front-end VLVFE readings
GET 022F_MACHINE_MACHINE_1_VALVE022 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s2.2/StatRF
#front-end PHOTON SHUTTER readings
GET 022F_MACHINE_MACHINE_1_SHUT022 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s2.2/StatRF
#beam positions and angles at centre of straigth sections
GET 022F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_S2
GET 022F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_S2
GET 022F_MACHINE_MACHINE_1_XANGLE sr/diagnostics/bpmid/XP_S2
GET 022F_MACHINE_MACHINE_1_YANGLE sr/diagnostics/bpmid/YP_S2
#beam positions and angles at short straight sections
#ID2 readings
GET 022F_MACHINE_MACHINE_1_GAP021 blproxy/id/id_s2/Gap
GET 022F_MACHINE_MACHINE_1_TAP021 blproxy/id/id_s2/Tapering
GET 022F_MACHINE_MACHINE_1_GAPS020 blproxy/id/id_s2/StatRF
#ID2 settings
SET 022F_MACHINE_MACHINE_1_GAP021 VALGAP blproxy/id/id_s2/Gap
SET 022F_MACHINE_MACHINE_1_TAP021 VALGAP blproxy/id/id_s2/Tapering
#configuration file for elettra-Tango to BCS bridge 032 VUV photoemission - Spectromicroscopy : 20032
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET 032F_MACHINE_MACHINE_1_P120S032 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s03.07/Pressure
GET 032F_MACHINE_MACHINE_1_P400S032 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s03.02/Pressure
#front-end VLVFE readings
GET 032F_MACHINE_MACHINE_1_VALVE032 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s3.2/StatRF
#front-end PHOTON SHUTTER readings
GET 032F_MACHINE_MACHINE_1_SHUT032 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s3.2/StatRF
#beam positions and angles at centre of straigth sections
GET 032F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_S3
GET 032F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_S3
GET 032F_MACHINE_MACHINE_1_XANGLE sr/diagnostics/bpmid/XP_S3
GET 032F_MACHINE_MACHINE_1_YANGLE sr/diagnostics/bpmid/YP_S3
#ID3 readings
GET 032F_MACHINE_MACHINE_1_GAP031 sr/id/id_s3/Gap1
GET 032F_MACHINE_MACHINE_1_GAP032 sr/id/id_s3/Gap2
GET 032F_MACHINE_MACHINE_1_GAP033 sr/id/id_s3/Gap3
GET 032F_MACHINE_MACHINE_1_GAPS030 sr/id/id_s3/StatRF
#ID3 settings
SET 032F_MACHINE_MACHINE_1_GAP031 GAP031 sr/id/id_s3/Gap1
SET 032F_MACHINE_MACHINE_1_GAP032 GAP032 sr/id/id_s3/Gap2
SET 032F_MACHINE_MACHINE_1_GAP033 GAP033 sr/id/id_s3/Gap3
SET 032F_MACHINE_MACHINE_1_GAP030 VALUE sr/id/id_s3/Gapall
#configuration file for elettra-Tango to BCS bridge 042 Circularly Polarized : 20042
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET FRONTEND_MACHINE_MACHINE_1_P120S042 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip120_s04.07/Pressure
GET FRONTEND_MACHINE_MACHINE_1_P400S042 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/sip400_s04.02/Pressure
#front-end VLVFE readings
GET FRONTEND_MACHINE_MACHINE_1_VALVE042 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/vlvfe_s4.2/StatRF
#front-end PHOTON SHUTTER readings
GET FRONTEND_MACHINE_MACHINE_1_SHUT042 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s4.2/StatRF
#beam positions and angles at centre of straigth sections
GET 042F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_S4
GET 042F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_S4
GET 042F_MACHINE_MACHINE_1_XANGLE sr/diagnostics/bpmid/XP_S4
GET 042F_MACHINE_MACHINE_1_YANGLE sr/diagnostics/bpmid/YP_S4
#ID4 readings
GET FRONTEND_MACHINE_MACHINE_1_IH042 sr/id/id_s4/CurrentH
GET FRONTEND_MACHINE_MACHINE_1_IV042 sr/id/id_s4/CurrentV
GET FRONTEND_MACHINE_MACHINE_1_IHSET042 sr/id/id_s4/CurrentH
GET FRONTEND_MACHINE_MACHINE_1_IVSET042 sr/id/id_s4/CurrentV
GET FRONTEND_MACHINE_MACHINE_1_IVST042 sr/id/id_s4/FlagV
GET FRONTEND_MACHINE_MACHINE_1_IHST042 sr/id/id_s4/FlagH
GET PSEWH_S4_CURSET_RR sr/id/id_s4/CurrentH
GET PSEWV_S4_CURSET_RR sr/id/id_s4/CurrentV
GET PSEWV_S4_STAT_RF sr/id/id_s4/FlagV
GET PSEWH_S4_STAT_RF sr/id/id_s4/FlagH
#id4 settings
SET FRONTEND_MACHINE_MACHINE_1_IH042 GAP040 sr/id/id_s4/CurrentH
SET FRONTEND_MACHINE_MACHINE_1_IV042 GAP041 sr/id/id_s4/CurrentV
SET FRONTEND_MACHINE_MACHINE_1_IHSET042 GAP040 sr/id/id_s4/CurrentH
SET FRONTEND_MACHINE_MACHINE_1_IVSET042 GAP041 sr/id/id_s4/CurrentV
#configuration file for elettra-Tango to BCS bridge 052 X-ray diffraction - SAXS : 20052
#main beam parameters
GET FRONTEND_MACHINE_MACHINE_1_ACCUCURR tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Current
GET FRONTEND_MACHINE_MACHINE_1_EENERGY tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Energy
GET FRONTEND_MACHINE_MACHINE_1_LIFETIME tango://tom.ecs.elettra.trieste.it:20000/sr/diagnostics/dcct_s4/Lifetime
#topup bits reading reading
GET FRONTEND_MACHINE_MACHINE_1_TOPUSTA tango://ecsproxy:11111/info/sr/1#dbase=no/Topupbits
#BeamON reading
GET FRONTEND_MACHINE_MACHINE_1_BEAMON tango://ecsproxy:11111/info/sr/1#dbase=no/beamON
#vacuum redings SIP120-SIP400
GET 052F_MACHINE_MACHINE_1_P120S052 tango://tom.ecs.elettra.trieste.it:20000/rpcbridge/rpc2tangobridge/sip120/SIP120_S5.7_PRES_RR
GET 052F_MACHINE_MACHINE_1_P400S052 tango://tom.ecs.elettra.trieste.it:20000/rpcbridge/rpc2tangobridge/sip400/SIP400_S5.2_PRES_RR
#front-end VLVFE readings
GET 052F_MACHINE_MACHINE_1_VALVE052 tango://tom.ecs.elettra.trieste.it:20000/rpcbridge/rpc2tangobridge/vlvfe/VLVFE_S5.2_STAT_RF
#front-end PHOTON SHUTTER readings
GET 052F_MACHINE_MACHINE_1_SHUT052 tango://tom.ecs.elettra.trieste.it:20000/sr/vacuum/phbsh_s5.2/StatRF
#beam positions and angles at centre of straigth sections
GET 052F_MACHINE_MACHINE_1_XPOS sr/diagnostics/bpmid/X_S5
GET 052F_MACHINE_MACHINE_1_YPOS sr/diagnostics/bpmid/Y_S5
GET 052F_MACHINE_MACHINE_1_XANGLE sr/diagnostics/bpmid/XP_S5
GET 052F_MACHINE_MACHINE_1_YANGLE sr/diagnostics/bpmid/YP_S5
#ID5 readings
GET 052F_MACHINE_MACHINE_1_GAP051 sr/id/id_s5/Gap1
GET 052F_MACHINE_MACHINE_1_GAP052 sr/id/id_s5/Gap2
GET 052F_MACHINE_MACHINE_1_GAP053 sr/id/id_s5/Gap3
GET 052F_MACHINE_MACHINE_1_GAPS050 sr/id/id_s5/StatRF
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