Skip to content
Snippets Groups Projects
Commit ef3bfad3 authored by BRONES Romain's avatar BRONES Romain
Browse files

Add sync command

* For now it times out
parent 9350cb27
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ from tango import AttrQuality, DispLevel, DevState ...@@ -22,6 +22,7 @@ from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType from tango import AttrWriteType, PipeWriteType
# Additional import # Additional import
#----- PROTECTED REGION ID(DG_PY_FOFBTool.additionnal_import) ENABLED START -----# #----- PROTECTED REGION ID(DG_PY_FOFBTool.additionnal_import) ENABLED START -----#
import FofbTool
import FofbTool.Operation import FofbTool.Operation
import FofbTool.Configuration import FofbTool.Configuration
import logging import logging
...@@ -146,6 +147,10 @@ class DG_PY_FOFBTool(Device): ...@@ -146,6 +147,10 @@ class DG_PY_FOFBTool(Device):
access=AttrWriteType.READ_WRITE, access=AttrWriteType.READ_WRITE,
) )
FofbToolVersion = attribute(
dtype='DevString',
)
# --------------- # ---------------
# General methods # General methods
# --------------- # ---------------
...@@ -155,6 +160,8 @@ class DG_PY_FOFBTool(Device): ...@@ -155,6 +160,8 @@ class DG_PY_FOFBTool(Device):
Device.init_device(self) Device.init_device(self)
#----- PROTECTED REGION ID(DG_PY_FOFBTool.init_device) ENABLED START -----# #----- PROTECTED REGION ID(DG_PY_FOFBTool.init_device) ENABLED START -----#
self.info_stream("FofbTool {}".format(FofbTool.__version__))
logger = logging.getLogger("FofbTool") logger = logging.getLogger("FofbTool")
try: try:
fh=logging.FileHandler(self.logfilepath) fh=logging.FileHandler(self.logfilepath)
...@@ -200,6 +207,12 @@ class DG_PY_FOFBTool(Device): ...@@ -200,6 +207,12 @@ class DG_PY_FOFBTool(Device):
pass pass
# PROTECTED REGION END # // DG_PY_FOFBTool.includeLBP_write # PROTECTED REGION END # // DG_PY_FOFBTool.includeLBP_write
def read_FofbToolVersion(self):
# PROTECTED REGION ID(DG_PY_FOFBTool.FofbToolVersion_read) ENABLED START #
"""Return the FofbToolVersion attribute."""
return FofbTool.__version__
# PROTECTED REGION END # // DG_PY_FOFBTool.FofbToolVersion_read
# -------- # --------
# Commands # Commands
# -------- # --------
...@@ -277,6 +290,27 @@ class DG_PY_FOFBTool(Device): ...@@ -277,6 +290,27 @@ class DG_PY_FOFBTool(Device):
pass pass
# PROTECTED REGION END # // DG_PY_FOFBTool.start # PROTECTED REGION END # // DG_PY_FOFBTool.start
@command(
)
@DebugIt()
def sync(self):
# PROTECTED REGION ID(DG_PY_FOFBTool.sync) ENABLED START #
"""
:return:None
"""
db = tango.Database()
self.debug_stream("Building list form FREE PROPERTIES")
bpmidlist = [(int(n.split(':')[0]), n.split(':')[2]) for n in db.get_property("FOFB", "bpmlist")['bpmlist'] if 'LIBERA' in n]
tlocal = [n.split(':')[2] for n in db.get_property("FOFB", 'TimingBoardList')['TimingBoardList'] if "LOCAL" in n]
lbpevrx = db.get_property("FOFB", 'LBPEVRX')['LBPEVRX']
# This will timeout
FofbTool.Operation.sync_bpm(bpmidlist, lbpevrx, tlocal, self.tangopath_centraltiming)
# PROTECTED REGION END # // DG_PY_FOFBTool.sync
# ---------- # ----------
# Run server # Run server
# ---------- # ----------
......
...@@ -90,6 +90,15 @@ ...@@ -90,6 +90,15 @@
</argout> </argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands> </commands>
<commands name="sync" description="" execMethod="sync" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<attributes name="includeLBP" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <attributes name="includeLBP" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/> <dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/> <changeEvent fire="false" libCheckCriteria="false"/>
...@@ -98,6 +107,14 @@ ...@@ -98,6 +107,14 @@
<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>
<attributes name="FofbToolVersion" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<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>
<preferences docHome="../doc/doc_html" makefileHome="$(TANGO_HOME)"/> <preferences docHome="../doc/doc_html" makefileHome="$(TANGO_HOME)"/>
</classes> </classes>
</pogoDsl:PogoSystem> </pogoDsl:PogoSystem>
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