Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • main
  • release_0_1
  • release_1_0_0
  • release_1_0_1
  • release_1_0_2
  • release_1_0_3
  • release_1_0_4
  • release_2_0_0
  • release_2_0_1
  • release_2_0_2
  • release_2_0_4
  • release_2_1_0
  • v0
13 results

Target

Select target project
  • software-control-system/tango-devices/inputoutput/adlink/singleshotao
1 result
Select Git revision
  • main
  • release_0_1
  • release_1_0_0
  • release_1_0_1
  • release_1_0_2
  • release_1_0_3
  • release_1_0_4
  • release_2_0_0
  • release_2_0_1
  • release_2_0_2
  • release_2_0_4
  • release_2_1_0
  • v0
13 results
Show changes
Commits on Source (37)
......@@ -3,7 +3,7 @@ from conan import ConanFile
class SingleShotAORecipe(ConanFile):
name = "singleshotao"
executable = "ds_SingleShotAO"
version = "2.0.4"
version = "2.1.0"
package_type = "application"
user = "soleil"
python_requires = "base/[>=1.0]@soleil/stable"
......
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<html>
<head>
<P><!-------TITLE------></P>
<title> Tango Device Server User's Guide </title>
</head>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<Br>
<body>
<center>
<h1>
SingleShotAO Generic Device <Br>
Device Attributes Description <Br> <Br>
SingleShotAO Class <Br>
SingleShotAO Generic Device <br>
Device Attributes Description <br><Br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau
</b>
</center>
<table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td COLSPAN=4>
<font Size=+2><center><b>Scalar Attributes</b></center></font>
</td>
</tr>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td>
<center><b>Attribute name</b></center>
</td>
<td>
<center><b>Data Type</b></center>
</td>
<td>
<center><b>R/W Type</b></center>
</td>
<td>
<center><b>Expert</b></center>
</td>
</tr>
<tr>
<td><b>frequency</b>: <font Size=-1>Sampling frequency for
ramp generation on the board output channels, in
Hz.</font>
</td>
<td>
<center>
<font Size=-1>DEV_DOUBLE</font>
</center>
</td>
<td>
<center>
<font Size=-1>READ_WRITE</font>
</center>
</td>
<td>
<center>
<font Size=-1>Yes</font>
</center>
</td>
</tr>
</table>
<Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=4> <Font Size=+2><Center><b>Scalar Attributes</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Attribute name</b></td></Center>
<Td><Center><b>Data Type</b></td></Center>
<Td><Center><b>R/W Type</b></td></Center>
<Td><Center><b>Expert</b></td></Center>
<Tr><Td><b>frequency</b>: <Font Size=-1>Sampling frequency for ramp generation on the board output channels, in Hz.</Font></Td>
<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>READ_WRITE</Font></Center></Td><Td><Center><Font Size=-1>Yes</Font></Center></Td></Tr>
</Table>
</Center>
<Br><Br><Br><Br><Br>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
<table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td COLSPAN=4>
<center>
<font Size=+2><b>Dynamic Scalar Attributes</b></font><br>
X is the channel number ranging from 0 to N-1 (<b>MAO_6208</b>: 8 channels, <b>MAO_6216</b>: 10 channels)
</center>
</td>
</tr>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td>
<center><b>Attribute name</b></center>
</td>
<td>
<center><b>Data Type</b></center>
</td>
<td>
<center><b>R/W Type</b></center>
</td>
<td>
<center><b>Description</b></center>
</td>
</tr>
<tr>
<td><b>channelX</b></td>
<td>
<center>
<font Size=-1>DEV_DOUBLE</font>
</center>
</td>
<td>
<center>
<font Size=-1>READ_WRITE</font>
</center>
</td>
<td>
<font Size=-1>Output value for channel X (in V). Valid range: [-10V, +10V]</font>
</td>
</tr>
<tr>
<td><b>speedX</b></td>
<td>
<center>
<font Size=-1>DEV_DOUBLE</font>
</center>
</td>
<td>
<center>
<font Size=-1>READ_WRITE</font>
</center>
</td>
<td>
<font Size=-1>Speed for ramp generation on channel X (in V/s). If speed is 0, no ramp is generated but direct write on channel output.</font>
</td>
</tr>
<tr>
<td><b>initialX</b></td>
<td>
<center>
<font Size=-1>DEV_DOUBLE</font>
</center>
</td>
<td>
<center>
<font Size=-1>READ_WRITE</font>
</center>
</td>
<td>
<font Size=-1>Initial value for ramp function on channel X (in V). Defaults to last written value in channel attribute.</font>
</td>
</tr>
</table>
</center>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User s Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<html>
<P><!-------TITLE------></P>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
<head>
<title> Tango Device Server User s Guide </title>
</head>
</TD>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</TD>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</TD>
<TD ALIGN="center">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="45"></A>
</TD>
<TD ALIGN="Right">
<H2><FONT COLOR="#7F00FF">
<Br><Center><A HREF="http://www.tango-controls.org/" TARGET="_top"> TANGO </a>
</Center></FONT>
</TD>
</TR>
<TR>
<TD ALIGN="left">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="44"></A>
</TD>
<TD ALIGN="center">
<A HREF="http://www.maxlab.lu.se/maxlab/max4/index.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/maxlab.gif" BORDER=0 Height="40"></A>
</TD>
<TD ALIGN="center">
<A HREF="http://www.frm2.tum.de/en/index.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/frm-2.jpg" BORDER=0 Height="45"></A>
</TD>
<TD>
<!-- Empty -->
</TD>
<TD ALIGN="Right">
<H2><FONT COLOR="#7F00FF">
<Center> Device Servers
</Center></FONT>
</TD>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<HR WIDTH="100%"></H5>
<Br>
<body>
<center>
<h1>
SingleShotAO Generic Device <Br>
Device Description <Br> <Br>
SingleShotAO Class <Br>
SingleShotAO Generic Device <br>
Device Description <br> <br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau
</b>
</center>
<center>
ADLink boards support for single shot AO operations [PCI-6208 and
compatible boards]
</center>
<Center>
ADLink boards support for single shot AO operations [PCI-6208 and compatible boards]
<Br>
<Br>
</Center>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<P><!-------TITLE------></P>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<Br>
<BODY>
<center>
<h1>
SingleShotAO Generic Device <Br>
Device Commands Description <Br> <Br>
SingleShotAO Class <Br>
SingleShotAO Generic Device <br>
Device Commands Description <br> <br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau
</b>
</center>
<Br>
<Br>
<Br>
<A NAME="Init"><!-- --></A>
<A NAME="Init"><!-- --></A>
<h2>1 - Init</h2>
<ul>
<Li><Strong>Description: </Strong> This commands re-initialise a device keeping the same network connection.<Br>
After an Init command executed on a device, it is not necessary for client to re-connect to the device.<Br>
This command first calls the device <i> delete_device() </i>method and then execute its <i> init_device()</i> method.<Br>
For C++ device server, all the memory allocated in the <i> nit_device() </i> method must be freed in the <i> delete_device() </i> method.<Br>
The language device desctructor automatically calls the <i> delete_device() </i> method.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::ON<Li>Tango::INIT<Li>Tango::MOVING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="State"><!-- --></A>
<A NAME="State"><!-- --></A>
<Li><Strong>Description: </Strong><br>
This command re-initialises a device keeping the same network connection. <br>
After an Init command executed on a device, it is not necessary for the client to re-connect to the device. <br>
This command first calls the device <i>delete_device()</i> method and then executes its <i>init_device()</i> method. <br>
For C++ device server, all the memory allocated in the <i>init_device()</i> method must be freed in the <i>delete_device()</i> method.<br>
The language device destructor automatically calls the <i>delete_device()</i> method.<br>
</Li>
<Li><Strong>Argin: DEV_VOID</Strong></Li>
<Li><Strong>Argout: DEV_VOID</Strong></Li>
<Li><Strong>Command allowed for: </Strong>
<Ul>
<Li>Tango::FAULT</Li>
<Li>Tango::ON</Li>
<Li>Tango::INIT</Li>
<Li>Tango::MOVING</Li>
</Ul>
</Li>
</ul>
<h2>2 - State</h2>
<ul>
<Li><Strong>Description: </Strong> This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_STATE</Strong>
: State Code<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::ON<Li>Tango::INIT<Li>Tango::MOVING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Status"><!-- --></A>
<A NAME="Status"><!-- --></A>
<h2>3 - Status</h2>
<ul>
<Li><Strong>Description: </Strong> This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong>
: Status description<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::ON<Li>Tango::INIT<Li>Tango::MOVING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Abort"><!-- --></A>
<A NAME="Abort"><!-- --></A>
<h2>4 - Abort</h2>
<ul>
<Li><Strong>Description: </Strong> Aborts ramps in progress.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::ON<Li>Tango::INIT<Li>Tango::MOVING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<Li><Strong>Description: </Strong> This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller.
<Li><Strong>Argin: DEV_VOID</Strong></Li>
<Li><Strong>Argout: DEV_STATE</Strong></Li>
<Li><Strong>Command allowed for: </Strong>
<Ul>
<Li>Tango::FAULT</Li>
<Li>Tango::ON</Li>
<Li>Tango::INIT</Li>
<Li>Tango::MOVING</Li>
</Ul>
</Li>
</ul>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<h2>3 - Status</h2>
<ul>
<Li><Strong>Description: </Strong> This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller.</Li>
<Li><Strong>Argin: DEV_VOID</Strong></Li>
<Li><Strong>Argout: CONST_DEV_STRING</Strong></Li>
<Li><Strong>Command allowed for: </Strong>
<Ul>
<Li>Tango::FAULT</Li>
<Li>Tango::ON</Li>
<Li>Tango::INIT</Li>
<Li>Tango::MOVING</Li>
</Ul>
</Li>
</ul>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
<h2>4 - Abort</h2>
<ul>
<Li><Strong>Description: </Strong> Aborts ramps in progress.</Li>
<Li><Strong>Argin: DEV_VOID</Strong></Li>
<Li><Strong>Argout: DEV_VOID</Strong></Li>
<Li><Strong>Command allowed for: </Strong>
<Ul>
<Li>Tango::FAULT</Li>
<Li>Tango::ON</Li>
<Li>Tango::INIT</Li>
<Li>Tango::MOVING</Li>
</Ul>
</Li>
</ul>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<html>
<head>
<title> Tango Device Server User's Guide </title>
</head>
<FRAMESET cols="20%,80%">
<FRAME src="DevCommandsList.html" name="DevCommandsList">
<FRAME src="DevCommands.html" name="DevCommands">
</FRAMESET>
<NOFRAMES>
<H2>
Frame Alert</H2>
<frameset cols="20%,80%">
<frame src="DevCommandsList.html" name="DevCommandsList">
<frame src="DevCommands.html" name="DevCommands">
</frameset>
<noframes>
<h2>
Frame Alert</h2>
<P>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
<BR>
Link to <A HREF="DevCommands.html">Non-frame version.</A></NOFRAMES>
</HTML>
<p>
This document is designed to be viewed using the frames feature. If
you see this message, you are using a non-frame-capable web client.
<br>
Link to <a HREF="DevCommands.html">Non-frame version.</a></noframes>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML><HEAD>
<TITLE>Commands
</TITLE></HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" ID="FrameHeadingFont">
<B>Commands:</B></FONT>
<Br>
<Br>
<Br>
<A Href="DevCommands.html#Init" TARGET="DevCommands"> Init</a><Br>
<A Href="DevCommands.html#State" TARGET="DevCommands"> State</a><Br>
<A Href="DevCommands.html#Status" TARGET="DevCommands"> Status</a><Br>
<A Href="DevCommands.html#Abort" TARGET="DevCommands"> Abort</a><Br>
<html><head>
<title>Commands
</title></head>
<body BGCOLOR="white">
<font size="+1" ID="FrameHeadingFont">
<b>Commands:</b></font>
<br>
<br>
<br>
<a Href="DevCommands.html#Init" TARGET="DevCommands"> Init</a><br>
<a Href="DevCommands.html#State" TARGET="DevCommands"> State</a><br>
<a Href="DevCommands.html#Status" TARGET="DevCommands"> Status</a><br>
<a Href="DevCommands.html#Abort" TARGET="DevCommands"> Abort</a><br>
</BODY>
</HTML>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<html>
<P><!-------TITLE------></P>
<head>
<title> Tango Device Server User's Guide </title>
</head>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<Br>
<body>
<center>
<h1>
SingleShotAO Generic Device <Br>
Device Commands Description <Br> <Br>
SingleShotAO Class <Br>
SingleShotAO Generic Device <br>
Device Commands Description <br><br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau
</b>
</center>
<center>
<br><a Href="DevCommandsFrame.html"> More Details on commands.... </a><br><br>
<table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td COLSPAN=3>
<font Size=+2><center>
<b>Device Commands for Operator Level</b>
</center></font>
</td>
</tr>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td><b>Command name</b></td>
<td><b>Argument In</b></td>
<td><b>Argument Out</b></td>
</tr>
<tr>
<td><b>Init</b></td>
<td>DEV_VOID</td>
<td>DEV_VOID</td>
</tr>
<tr>
<td><b>State</b></td>
<td>DEV_VOID</td>
<td>DEV_STATE</td>
</tr>
<tr>
<td><b>Status</b></td>
<td>DEV_VOID</td>
<td>CONST_DEV_STRING</td>
</tr>
<tr>
<td><b>Abort</b></td>
<td>DEV_VOID</td>
<td>DEV_VOID</td>
</tr>
</table>
</center>
<Center>
<Br><Br>
<A Href="DevCommandsFrame.html"> More Details on commands.... </a><Br>
<Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=3> <Font Size=+2><Center><b>Device Commands for Operator Level</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Command name</b></td></Center>
<Td><Center><b>Argument In</b></td></Center>
<Td><Center><b>Argument Out</b></td></Center>
<Tr><Td><b>Init</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Tr><Td><b>State</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEV_STATE</Font></Td>
<Tr><Td><b>Status</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>CONST_DEV_STRING</Font></Td>
<Tr><Td><b>Abort</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
</Table></Center>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<P><!-------TITLE------></P>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<Br>
<BODY>
<center>
<h1>
SingleShotAO Generic Device <Br>
......@@ -54,29 +19,71 @@ Revision: - Author: buteau
<Center>
<Br> <Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=3> <Font Size=+2><Center><b>Device Properties</b></td></Font></Center>
<Td COLSPAN=3>
<Font Size=+2>
<Center><b>Device Properties</b>
</td>
</Font>
</Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Property name</b></td></Center>
<Td><Center><b>Property type</b></td></Center>
<Td><Center><b>Description</b></td></Center>
<Tr><Td><b><a href=#Dev_DefaultValues>BoardNum </a></b></Td>
<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td>
<Td><Font Size=-1>The the board identifier in the cPCI crate [valid range is 0...7 - no default value] .</Font></Td></Tr>
<Td>
<Center><b>Property name</b>
</td>
</Center>
<Td>
<Center><b>Property type</b>
</td>
</Center>
<Td>
<Center><b>Description</b>
</td>
</Center>
<Tr>
<Td><b><a href=#Dev_DefaultValues>BoardNum </a></b></Td>
<Td>
<Font Size=-1>Tango::DEV_SHORT</Font>
</Td>
<Td>
<Font Size=-1>The the board identifier in the cPCI crate [valid range is 0...7 - no default value] .</Font>
</Td>
</Tr>
<Tr><Td><b><a href=#Dev_DefaultValues>BoardType </a></b></Td>
<Td><Font Size=-1>Tango::DEV_STRING</Font></Td>
<Td><Font Size=-1>The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]</Font></Td></Tr>
<Tr>
<Td><b><a href=#Dev_DefaultValues>BoardType </a></b></Td>
<Td>
<Font Size=-1>Tango::DEV_STRING</Font>
</Td>
<Td>
<Font Size=-1>The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]</Font>
</Td>
</Tr>
<Tr>
<Td><b><a href=#Dev_DefaultValues>EnableRamps </a></b></Td>
<Td>
<Font Size=-1>Tango::DEV_BOOLEAN</Font>
</Td>
<Td>
<Font Size=-1>Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true]</Font>
</Td>
</Tr>
<Tr>
<Td><b><a href=#Dev_DefaultValues>OutputMemorizedChannelsAtInit </a></b></Td>
<Td>
<Font Size=-1>Tango::DEV_BOOLEAN</Font>
</Td>
<Td>
<Font Size=-1>Whether to send the memorized values for the channels to the board at the device initialization (the device attribute will show the last memorized value regardless) [true/false - default value is false]</Font>
</Td>
</Tr>
</Table>
</Center>
<Br><Br><Br>
<Br><Br><Br>
<A name=Dev_DefaultValues><!--- ---></a>
<Font Size=+1>Device Properties Default Values:</Font><Br>
<Table Border=2 Cellpadding=2 CELLSPACING=2>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
......@@ -91,6 +98,14 @@ Revision: - Author: buteau
<Td>BoardType</Td>
<td>No default value</td>
</Tr>
<Tr>
<Td>EnableRamps</Td>
<td>true</td>
</Tr>
<Tr>
<Td>OutputMemorizedChannelsAtInit</Td>
<td>false</td>
</Tr>
</Table>
<Br><Br><Br>
......@@ -99,46 +114,7 @@ There is no Class properties.<Br><Br>
</Center></b>
<Br> <Br> <Br>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<html>
<P><!-------TITLE------></P>
<head>
<title> Tango Device Server User's Guide </title>
</head>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<Br>
<body>
<center>
<h1>
SingleShotAO Generic Device <Br>
Device States Description <Br> <Br>
SingleShotAO Class <Br>
SingleShotAO Generic Device <br>
Device States Description <br> <br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau
</b>
</center>
<center>
<table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td COLSPAN=2>
<font Size=+2><center>
<b>States</b>
</center></font>
</td>
</tr>
<tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<td><center><b>Names</b></center></td>
<td><center><b>Descriptions</b></center></td>
</tr>
<tr>
<td><b>FAULT</b></td>
<td><font Size=-1>Hardware / driver failure or fatal error occurred</font></td>
</tr>
<tr>
<td><b>ON</b></td>
<td><font Size=-1>Device ready to execute AO request</font></td>
</tr>
<tr>
<td><b>INIT</b></td>
<td><font Size=-1>Device initialization in progress</font></td>
</tr>
<tr>
<td><b>MOVING</b></td>
<td><font Size=-1>Ramp generation in progress</font></td>
</tr>
</table>
</center>
<Center>
<Br> <Br> <Br>
<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td COLSPAN=2> <Font Size=+2><Center><b>States</b></td></Font></Center>
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Names</b></td></Center>
<Td><Center><b>Descriptions</b></td></Center>
<Tr><Td><b>FAULT</b></Td>
<Td><Font Size=-1>Hardware / driver failure or fatal error occurred</Font></Td></Tr>
<Tr><Td><b>ON</b></Td>
<Td><Font Size=-1>Device ready to execute AO request</Font></Td></Tr>
<Tr><Td><b>INIT</b></Td>
<Td><Font Size=-1>Device initialization in progress</Font></Td></Tr>
<Tr><Td><b>MOVING</b></Td>
<Td><Font Size=-1>Ramp generation in progress</Font></Td></Tr>
</Table>
</Center>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<Title> Tango Device Server User's Guide </Title>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000">
<html>
<P><!-------TITLE------></P>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A>
<head>
<title> Tango Device Server User's Guide </title>
</head>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A>
</Td>
<TD ALIGN="right">
<A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A>
</Td>
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.tango-controls.org/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
</TABLE>
<HR WIDTH="100%"></H5>
<body>
<center>
<h1>
SingleShotAO Generic Device <Br>
User's Guide <Br><Br>
SingleShotAO Class<Br>
SingleShotAO Generic Device <br>
User's Guide <br><Br>
SingleShotAO Class <br>
</h1>
<b>
Revision: - Author: buteau <Br>
Revision: - Author: buteau <br>
Implemented in C++
</b>
</center>
<Br>
<Br>
<Br>
<Br>
<h2>Introduction:</h2>
<ul>
ADLink boards support for single shot AO operations [PCI-6208 and compatible boards]<Br>
<li>ADLink boards support for single shot AO operations [PCI-6208 and compatible boards]</li>
</ul>
<Br><h2>Class Identification:</h2>
<h2>Class Identification:</h2>
<ul>
<li><b>Contact :</b> at synchrotron-soleil.fr - buteau
<li><b>Class Family :</b> InputOutput
<li><b>Platform :</b> All Platforms
<li><b>Bus :</b> Compact PCI
</ul><Br>
<li><b>Contact :</b> at synchrotron-soleil.fr - buteau</li>
<li><b>Class Family :</b> InputOutput</li>
<li><b>Platform :</b> All Platforms</li>
<li><b>Bus :</b> Compact PCI</li>
</ul>
<h2>Class Inheritance:</h2>
<ul>
<li> <a href="http://www.esrf.fr/computing/cs/tango/tango_doc/kernel_doc/cpp_doc/"> TANGO_BASE_CLASS</a></li>
<li> <a
href="http://www.esrf.fr/computing/cs/tango/tango_doc/kernel_doc/cpp_doc/">
TANGO_BASE_CLASS</a></li>
<ul>
<li> SingleShotAO</li>
</ul>
</ul>
</ul>
</ul>
<Br>
<Br>
<h2>Class Description:</h2>
<ul>
<li> <a href=Description.html> Device description.</a>
<li> <a href=Properties.html> Properties description</a>
<li> <a href=TangoDevStates.html> States description</a>
<li> <a href=DevCommandsTable.html> Commands description</a>
<li> <a href=Attributes.html> Attributes description</a>
<li> <a href=Description.html> Device description.</a> </li>
<li> <a href=Properties.html> Properties description</a> </li>
<li> <a href=TangoDevStates.html> States description</a> </li>
<li> <a href=DevCommandsTable.html> Commands description</a> </li>
<li> <a href=Attributes.html> Attributes description</a> </li>
</ul>
<Br>
<Br>
<Br>
<h2>Conclusion:</h2>
<ul>
The device server is ready for distribution application programmers.<Br>
The author will be interested in any feedback which arise from their
usage of this device server.
<li>The device server is ready for distribution application programmers.</li>
<li>The author will be interested in any feedback which arise from their usage of this device server.</li>
</ul>
<Br>
<!--- html Footer --->
<Center>
<Font size=-1>
<br>
<br>
<TABLE BORDER="1" WIDTH="100%">
<Tr>
<!--- Hosted by Sourceforge --->
<Td Align="Center">
<Font size=-1>
<b>TANGO</b> is an open source project hosted by :<br>
<A href="http://sourceforge.net" Target="new">
<IMG title="Sourceforge logo"
alt="Sourceforge logo small"
src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif"
border=0> </a>
</Font>
</Td>
<!--- 2 Sourceforge Repositories --->
<Td Align="Center">
<Font size=-1>
Core and Tools :
<a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-cs" Target=new>
tango-cs project</a>
<br>
Device Servers :
<a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new">
CVS repository</a> on
<a href="https://sourceforge.net/projects/tango-ds" Target=new>
tango-ds project</a>
</Font>
</Td>
</Tr>
</Table>
</Font>
</Center>
</body>
</html>
......@@ -129,7 +129,32 @@ SingleShotAO::SingleShotAO(Tango::DeviceClass *cl,const char *s,const char *d)
//-----------------------------------------------------------------------------
void SingleShotAO::delete_device()
{
DEBUG_STREAM << "SingleShotAO::delete_device(): entering... !" << endl;
// Make sure running processes are aborted properly if channels are running
//--------------------------------------------
try
{
_abort();
}
catch (Tango::DevFailed &df)
{
ERROR_STREAM << df << endl;
RETHROW_DEVFAILED(df,
"DRIVER_FAILURE",
"could not abort [caught Tango::DevFailed]",
"SingleShotAO::delete_device");
}
catch (...)
{
ERROR_STREAM << "SingleShotAO::init::unknown exception caught" << std::endl;
THROW_DEVFAILED("DRIVER_FAILURE",
"could not abort [unknown error]",
"SingleShotAO::delete_device");
}
// Delete device allocated objects
//--------------------------------------------
yat4tango::TraceHelper t("SingleShotAO::delete_device", this);
if (m_manager)
......@@ -138,14 +163,16 @@ void SingleShotAO::delete_device()
m_manager = NULL;
}
//- release the asl::SingleShotAO object
// Release the asl::SingleShotAO object
//--------------------------------------------
if (m_ssao)
{
delete m_ssao;
m_ssao = NULL;
}
// remove dynamic attributes
// Remove dynamic attributes
//--------------------------------------------
if (m_dyn_attr_manager)
{
try
......@@ -165,7 +192,8 @@ void SingleShotAO::delete_device()
m_dyn_attr_manager = NULL;
}
//- remove the inner appender
// Remove the inner appender
//--------------------------------------------
yat4tango::Logging::release(this);
yat4tango::DeviceInfo::release(this);
}
......@@ -188,8 +216,7 @@ void SingleShotAO::init_device()
INFO_STREAM << "Create the DeviceInfo in order to manage info on versions." << endl;
yat4tango::DeviceInfo::initialize(this, YAT_XSTR(PROJECT_NAME), YAT_XSTR(PROJECT_VERSION));
// yat4tango::DeviceInfo::add_dependency(this, "Dependency Name", YAT_XSTR(dependency_name_PROJECT_VERSION));
// TODO: Add dependencies
yat4tango::DeviceInfo::add_dependency(this, "ASL", ">=1.0");
}
catch (Tango::DevFailed &df)
{
......@@ -204,6 +231,30 @@ void SingleShotAO::init_device()
//- trace/profile this method
yat4tango::TraceHelper t("SingleShotAO::init_device", this);
// construct the AO manager
//--------------------------------------------
try
{
m_manager = new SingleShotAOManager(this);
}
catch (...)
{
ERROR_STREAM << "initialization failed - failed to create manager" << std::endl;
m_currStatus = "initialization failed [failed to create manager]. See log for details";
m_state = Tango::FAULT;
return;
}
// test the manager
if (!m_manager)
{
ERROR_STREAM << "initialization failed - the manager is not created" << std::endl;
m_currStatus = "initialization failed [the manager is not created]. See log for details";
m_state = Tango::FAULT;
return;
}
// Initialise variables to default values
//--------------------------------------------
......@@ -226,8 +277,15 @@ void SingleShotAO::init_device()
ERROR_STREAM << "SingleShotAO::init_device::Tango::DevFailed exception caught "
<< "while trying to read device properties from TANGO database"
<< std::endl;
ERROR_STREAM << df << std::endl;
m_currStatus = "Failed to get property. See log for details";
std::string error_msg = df.errors[0].desc;
std::istringstream error_stream(error_msg);
std::string line;
std::getline(error_stream, line); // Read the first line
ERROR_STREAM << line << std::endl;
while (std::getline(error_stream, line)) { // Read the rest of the lines
ERROR_STREAM << " - " << line << std::endl;
}
m_currStatus = error_msg;
m_state = Tango::FAULT;
return;
}
......@@ -291,31 +349,11 @@ void SingleShotAO::init_device()
m_nb_chan = 16;
}
INFO_STREAM << "Board has " << m_nb_chan << " channels" << endl;
// construct the AO manager
//--------------------------------------------
try
{
m_manager = new SingleShotAOManager(this);
}
catch (...)
{
ERROR_STREAM << "initialization failed - failed to create manager" << std::endl;
m_currStatus = "initialization failed [failed to create manager]. See log for details";
m_state = Tango::FAULT;
return;
}
// test the manager
if (!m_manager)
{
ERROR_STREAM << "initialization failed - the manager is not created" << std::endl;
m_currStatus = "initialization failed [the manager is not created]. See log for details";
m_state = Tango::FAULT;
return;
}
// get frequency value in database
//--------------------------------------------
try
{
m_frequency = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, "frequency");
......@@ -323,7 +361,7 @@ void SingleShotAO::init_device()
}
catch (...)
{
DEBUG_STREAM << "Failed to get frequency value. Maybe there is no value yet." << std::endl;
DEBUG_STREAM << "No memorized value found for frequency. Defaulting to " << m_frequency << "." << std::endl;
}
......@@ -331,7 +369,7 @@ void SingleShotAO::init_device()
//--------------------------------------------
try
{
m_manager->init(m_ssao, m_nb_chan, m_frequency);
m_manager->init(m_ssao, m_nb_chan, m_frequency, enableRamps);
}
catch (Tango::DevFailed & df)
{
......@@ -348,6 +386,27 @@ void SingleShotAO::init_device()
return;
}
// Remove existing dynamic attributes to avoid duplicates or other issues
// --------------------------------------------
if (m_dyn_attr_manager)
{
try
{
m_dyn_attr_manager->remove_attributes();
delete m_dyn_attr_manager;
m_dyn_attr_manager = NULL;
DEBUG_STREAM << "Existing dynamic attributes manager cleaned up" << endl;
}
catch (...)
{
ERROR_STREAM << "Error cleaning up existing dynamic attributes manager, continuing..." << endl;
// Continue anyway - we'll create a new one
}
}
// Create dynamic attributes
//--------------------------------------------
// create dynamic attribute manager
try
{
......@@ -368,8 +427,14 @@ void SingleShotAO::init_device()
return;
}
// add dynamic attributes: channel, speed & initial for each channel
std::vector<yat4tango::DynamicAttributeInfo> l_dynAttrList;
// Log how many attributes we're going to create
INFO_STREAM << "Creating dynamic attributes for " << m_nb_chan << " channels.";
INFO_STREAM << "Total attributes: " << m_nb_chan * (enableRamps ? 3 : 1) << endl;
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
{
yat::OSStream oss;
......@@ -394,8 +459,7 @@ void SingleShotAO::init_device()
dai_channel.tai.max_value = "10.0";
dai_channel.tai.min_value = "-10.0";
dai_channel.tai.description = "Output value for channel " + oss.str() + " (in measurementUnit).";
dai_channel.tai.format = "%1.1f";
dai_channel.memorized = true;
dai_channel.tai.format = "%5.3f";
dai_channel.cdb = false;
//- read callback
......@@ -408,6 +472,12 @@ void SingleShotAO::init_device()
l_dynAttrList.push_back(dai_channel);
// if enableRamps if false, skip speed and initial attributes
if (!enableRamps)
{
DEBUG_STREAM << "Ramps are disabled. Skipping speed and initial attributes for channel " << l_cpt << std::endl;
continue;
}
// ╔═══════════════╗
// ║ Speed value ║
......@@ -426,10 +496,9 @@ void SingleShotAO::init_device()
dai_speed.tai.standard_unit = "V/s";
dai_speed.tai.display_unit = "V/s";
dai_speed.tai.description = "Speed for ramp generation, in V/s. If speed is NULL, no ramp generated but direct write on channel output " + oss.str() + " (in measurementUnit).";
dai_speed.tai.format = "%1.1f";
dai_speed.tai.format = "%5.3f";
//- cleanup tango db option: cleanup tango db when removing this dyn. attr. (i.e. erase its properties from db)
dai_speed.memorized = true;
dai_speed.cdb = false;
//- read callback
......@@ -460,10 +529,9 @@ void SingleShotAO::init_device()
dai_initial.tai.standard_unit = "V";
dai_initial.tai.display_unit = "V";
dai_initial.tai.description = "Initial value for ramp function, in V. Defaults to last written value in channel attribute " + oss.str() + ".";
dai_initial.tai.format = "%1.2f";
dai_initial.tai.format = "%5.3f";
//- cleanup tango db option: cleanup tango db when removing this dyn. attr. (i.e. erase its properties from db)
dai_initial.memorized = true;
dai_initial.cdb = false;
//- read callback
......@@ -477,7 +545,51 @@ void SingleShotAO::init_device()
l_dynAttrList.push_back(dai_initial);
}
// Log the size of our attribute list before adding to manager
INFO_STREAM << "Prepared " << l_dynAttrList.size() << " dynamic attributes for creation" << endl;
// Add all attributes
try
{
m_dyn_attr_manager->add_attributes(l_dynAttrList);
INFO_STREAM << "Successfully added all dynamic attributes" << endl;
}
catch (Tango::DevFailed &df)
{
ERROR_STREAM << "Failed to add dynamic attributes: " << df << endl;
m_currStatus = "Failed to add dynamic attributes. See log for details";
m_state = Tango::FAULT;
return;
}
catch (...)
{
ERROR_STREAM << "Unknown exception when adding dynamic attributes" << endl;
m_currStatus = "Failed to add dynamic attributes. Unknown error";
m_state = Tango::FAULT;
return;
}
// Initialize maps in manager class for all channels
try
{
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
{
// Initialize with default values
m_manager->set_channel(l_cpt, 0.0);
if (enableRamps)
{
m_manager->set_speed(l_cpt, 0.0);
m_manager->set_initial(l_cpt, 0.0);
}
}
}
catch (Tango::DevFailed &df)
{
ERROR_STREAM << "Failed to initialize channel maps: " << df << endl;
m_currStatus = "Failed to initialize channel maps. See log for details";
m_state = Tango::FAULT;
return;
}
// Get memorized values from database
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
......@@ -485,34 +597,40 @@ void SingleShotAO::init_device()
yat::OSStream oss;
oss << l_cpt;
// speed value
// Helper function to get and set memorized attributes
auto applyMemorizedAttr = [&](const std::string& attrPrefix,
void (SingleShotAOManager::*setter)(yat::uint16, double))
{
std::string attrName = attrPrefix + oss.str();
try
{
std::string attr_name = kSPEED + oss.str();
std::string name = "__" + attr_name;
double val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, attrName);
DEBUG_STREAM << "Found memorized value for " << attrName << ": " << val << endl;
// Write the value to the manager (that contains the "read" attributes values)
(m_manager->*setter)(l_cpt, val);
double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this, name);
m_manager->set_speed(l_cpt, l_val);
// Write the value to the "write" attributes using helper function
setDynamicAttributeWriteValue(attrName, val);
}
catch (...)
{
// nothing to do
DEBUG_STREAM << "No memorized value found for " << attrName << ". Setting default value." << std::endl;
}
};
// initial value
try
// Get and set memorized values for speed, initial and channel
if (enableRamps)
{
std::string attr_name = kINITIAL + oss.str();
std::string name = "__" + attr_name;
// To be activated with Tango 8
//double l_val = yat4tango::PropertyHelper::get_memorized_attribute<double>(this,name);
double l_val = get_memorized_attribute<double>(name);
m_manager->set_initial(l_cpt, l_val);
applyMemorizedAttr(kSPEED, &SingleShotAOManager::set_speed);
applyMemorizedAttr(kINITIAL, &SingleShotAOManager::set_initial);
}
catch (...)
if (outputMemorizedChannelsAtInit)
{
//nothing to do
applyMemorizedAttr(kCHANNEL, &SingleShotAOManager::write_channel_direct); // write memorized value to board output (directly, without ramp)
} else {
applyMemorizedAttr(kCHANNEL, &SingleShotAOManager::set_channel); // only apply memorized value to the device
}
}
......@@ -542,105 +660,187 @@ void SingleShotAO::init_device()
isInitOk = true;
}
//+----------------------------------------------------------------------------
//
// method : SingleShotAO::get_device_property()
//
// description : Read the device properties from database.
//
//-----------------------------------------------------------------------------
//+------------------------------------------------------------------
/**
* method : SingleShotAO::get_device_property()
*
* description : Read the device properties from database.
*
* @throws DevFailed if any critical property is missing, not set, or invalid
*/
void SingleShotAO::get_device_property()
{
// Initialize your default values here (if not done with POGO).
//------------------------------------------------------------------
// Read device properties from database.(Automatic code generation)
// Read device properties from database
//------------------------------------------------------------------
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum("BoardNum"));
dev_prop.push_back(Tango::DbDatum("BoardType"));
dev_prop.push_back(Tango::DbDatum("EnableRamps"));
dev_prop.push_back(Tango::DbDatum("OutputMemorizedChannelsAtInit"));
// Call database and extract values
//--------------------------------------------
if (Tango::Util::instance()->_UseDb == true)
{
get_db_device()->get_property(dev_prop);
}
Tango::DbDatum def_prop, cl_prop;
SingleShotAOClass *ds_class =
(static_cast<SingleShotAOClass *>(get_device_class()));
SingleShotAOClass *ds_class = (static_cast<SingleShotAOClass *>(get_device_class()));
int i = -1;
//- <BoardNum> -----------------------
// Try to initialize BoardNum from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> boardNum;
else {
if (cl_prop.is_empty() == false)
cl_prop >> boardNum;
else
{
// Try to initialize BoardNum from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> boardNum;
if (def_prop.is_empty() == false)
def_prop >> boardNum;
}
// And try to extract BoardNum value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardNum;
if (dev_prop[i].is_empty() == false)
dev_prop[i] >> boardNum;
INFO_STREAM << "Raw BoardNum parsed: " << boardNum << endl;
//- <BoardType> -----------------------
// Try to initialize BoardType from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> boardType;
else {
if (cl_prop.is_empty() == false)
cl_prop >> boardType;
else
{
// Try to initialize BoardType from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> boardType;
if (def_prop.is_empty() == false)
def_prop >> boardType;
}
// And try to extract BoardType value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardType;
if (dev_prop[i].is_empty() == false)
dev_prop[i] >> boardType;
INFO_STREAM << "Raw BoardType parsed: " << boardType << endl;
//- <EnableRamps> -----------------------
// Try to initialize EnableRamps from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty() == false)
cl_prop >> enableRamps;
else
{
// Try to initialize EnableRamps from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty() == false)
def_prop >> enableRamps;
}
// And try to extract EnableRamps value from database
if (dev_prop[i].is_empty() == false)
dev_prop[i] >> enableRamps;
INFO_STREAM << "EnableRamps parsed: " << (enableRamps ? "true" : "false") << endl;
//- <OutputMemorizedChannelsAtInit> -----------------------
// Try to initialize OutputMemorizedChannelsAtInit from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty() == false)
cl_prop >> outputMemorizedChannelsAtInit;
else
{
// Try to initialize OutputMemorizedChannelsAtInit from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty() == false)
def_prop >> outputMemorizedChannelsAtInit;
}
// And try to extract OutputMemorizedChannelsAtInit value from database
if (dev_prop[i].is_empty() == false)
dev_prop[i] >> outputMemorizedChannelsAtInit;
INFO_STREAM << "OutputMemorizedChannelsAtInit parsed: " << (outputMemorizedChannelsAtInit ? "true" : "false") << endl;
// Get default values from class
//--------------------------------------------
ds_class->get_default_device_property(std::string("BoardNum")) >> boardNum_default;
ds_class->get_default_device_property(std::string("BoardType")) >> boardType_default;
ds_class->get_default_device_property(std::string("EnableRamps")) >> enableRamps_default;
ds_class->get_default_device_property(std::string("OutputMemorizedChannelsAtInit")) >> outputMemorizedChannelsAtInit_default;
// Create properties if empty and set default values
//--------------------------------------------
DEBUG_STREAM << "Creating properties if empty" << endl;
yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, boardNum_default, "BoardNum");
yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, boardType_default, "BoardType");
yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, enableRamps_default, "EnableRamps");
yat4tango::PropertyHelper::create_property_if_empty(this, dev_prop, outputMemorizedChannelsAtInit_default, "OutputMemorizedChannelsAtInit");
// End of Automatic code generation
//------------------------------------------------------------------
// Check critical properties being valid
//--------------------------------------------
DEBUG_STREAM << "Checking if critical properties are valid:" << endl;
critical_properties_missing = false;
yat::OSStream errorMessages;
errorMessages << "Critical properties are missing or invalid:" << endl;
if (dev_prop[0].is_empty())
//- <BoardNum> -----------------------
// Case 1 (error): boardNum is set to the default value in the database
if (boardNum == boardNum_default)
{
ERROR_STREAM << "Required device property <BoardNum> is missing" << endl;
errorMessages << "Device property <BoardNum> is not set (default value " << boardNum_default << " needs to be replaced)" << endl;
critical_properties_missing = true;
}
if (dev_prop[1].is_empty())
// Case 2 (error): boardNum is set to a value outside the valid range
else if (boardNum < 0 || boardNum > 7)
{
ERROR_STREAM << "Required device property <BoardType> is missing" << endl;
boardNum = 0;
errorMessages << "Device property <BoardNum> is invalid. Valid range is [0..7]" << endl;
critical_properties_missing = true;
}
if (critical_properties_missing) {
return;
// Case 3 (ok): boardNum is set to a valid value
else
{
INFO_STREAM << "BoardNum resolved to " << boardNum << endl;
}
//- <BoardNum> -----------------------
if (boardNum > 7)
//- <BoardType> -----------------------
// Case 1 (error): boardType is set to the default value in the database
if (boardType == boardType_default || boardType == "")
{
boardNum = 0;
ERROR_STREAM << "device property <BoardNum> is invalid. Valid range is [0..7]" << endl;
errorMessages << "Device property <BoardType> is not set (default value " << boardType_default << " needs to be replaced)" << endl;
critical_properties_missing = true;
}
//- <BoardType> -----------------------
if (boardType == "MAO_6208")
// Case 2 (ok): boardType is set to a valid
else if (boardType == "MAO_6208")
{
boardType = k6208_BOARD_TYPE;
boardTypeId = adl::PCI6208;
INFO_STREAM << "BoardType resolved to PCI6208" << endl;
}
else if (boardType == "MAO_6216")
{
boardType = k6216_BOARD_TYPE;
boardTypeId = adl::PCI6216;
INFO_STREAM << "BoardType resolved to PCI6216" << endl;
}
// Case 3 (error): boardType is set to an invalid value
else
{
boardType = kDEFAULT_BOARD_TYPE;
boardTypeId = adl::PCI6208;
ERROR_STREAM << "device property <BoardType> is invalid [supported hw: MAO_6208 or MAO_6216]" << endl;
errorMessages << "Device property <BoardType> is invalid [supported hw: MAO_6208 or MAO_6216]" << endl;
critical_properties_missing = true;
}
// If any critical property is missing or invalid, throw an exception
if (critical_properties_missing)
{
DEBUG_STREAM << "Critical properties are missing, throwing exception." << endl;
THROW_DEVFAILED("DEVICE_ERROR", errorMessages.str().c_str(), "SingleShotAO::get_device_property");
}
else
{
DEBUG_STREAM << "All critical properties are valid." << endl;
}
}
......@@ -666,8 +866,7 @@ void SingleShotAO::always_executed_hook()
//-----------------------------------------------------------------------------
void SingleShotAO::read_attr_hardware(vector<long> &attr_list)
{
//DEBUG_STREAM << "SingleShotAO::read_attr_hardware(vector<long> &attr_list) entering... "<< endl;
// Add your own code here
// nothing to do
}
......@@ -680,7 +879,6 @@ void SingleShotAO::read_attr_hardware(vector<long> &attr_list)
//-----------------------------------------------------------------------------
void SingleShotAO::read_frequency(Tango::Attribute &attr)
{
//DEBUG_STREAM << "SingleShotAO::read_frequency(Tango::Attribute &attr) entering... "<< endl;
attr.set_value(&m_frequency);
}
......@@ -759,6 +957,42 @@ Tango::ConstDevString SingleShotAO::dev_status()
}
//+------------------------------------------------------------------
/**
* Extract the number from a dynamic attribute name with a specific prefix.
* Used for parsing dynamic attribute names like "channelX", "speedX", "initialX"
* where X is the channel number.
*
* @param str The input string to search for numbers
* @param prefix The expected prefix (e.g., "channel", "speed", "initial")
* @return The number found after the prefix
* @throws DevFailed if string doesn't start with prefix or no number is found
*/
int extractNumber(const std::string &str, const char* prefix)
{
// Validate string starts with the given prefix
if (str.find(prefix) != 0)
{
THROW_DEVFAILED("DEVICE_ERROR",
"String must start with the expected prefix",
"SingleShotAO::extractNumber");
}
// Find first digit after the prefix
size_t pos = strlen(prefix);
// Extract and convert the number
std::string numberStr = str.substr(pos);
if (numberStr.empty() || !isdigit(numberStr[0]))
{
THROW_DEVFAILED("DEVICE_ERROR",
"No number found after prefix",
"SingleShotAO::extractNumber");
}
return std::stoi(numberStr);
}
//+------------------------------------------------------------------
/**
* method: SingleShotAO::read_channel
......@@ -770,15 +1004,10 @@ Tango::ConstDevString SingleShotAO::dev_status()
void SingleShotAO::read_channel(yat4tango::DynamicAttributeReadCallbackData & cbd)
{
yat::AutoMutex<> guard(m_lock);
std::string l_attr_name = cbd.dya->get_name();
// name will be channelX
std::string l_str = l_attr_name.substr(7, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kCHANNEL); // extract channel nb
CHECK_MANAGER();
// choose tab depending on l_idx
double l_val = m_manager->get_channel(l_idx);
cbd.tga->set_value(&l_val);
}
......@@ -796,12 +1025,10 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
{
double l_val;
cbd.tga->get_write_value(l_val);
cbd.tga->set_write_value(l_val);
std::string l_attr_name = cbd.dya->get_name();
// name will be channelX
std::string l_str = l_attr_name.substr(7, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kCHANNEL); // extract channel nb
CHECK_MANAGER();
try
......@@ -823,6 +1050,16 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
"could not write channel [unknown error]",
"SingleShotAO::write_channel");
}
DEBUG_STREAM << "SingleShotAO::write_channel(): channel " << l_idx << " value set to " << l_val << endl;
yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
// Update the initial attribute to match the channel value
std::string initialAttrName = kINITIAL + std::to_string(l_idx);
yat4tango::PropertyHelper::set_memorized_attribute(this, initialAttrName, l_val);
setDynamicAttributeWriteValue(initialAttrName, l_val);
DEBUG_STREAM << "SingleShotAO::write_channel(): memorized attribute " << l_attr_name << " set to " << l_val << endl;
}
......@@ -837,15 +1074,10 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
void SingleShotAO::read_speed(yat4tango::DynamicAttributeReadCallbackData & cbd)
{
yat::AutoMutex<> guard(m_lock);
std::string l_attr_name = cbd.dya->get_name();
// name will be speedX
std::string l_str = l_attr_name.substr(5, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kSPEED); // extract channel nb
CHECK_MANAGER();
// choose tab depending on l_idx
double l_val = m_manager->get_speed(l_idx);
cbd.tga->set_value(&l_val);
}
......@@ -867,10 +1099,7 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb
cbd.tga->get_write_value(l_val);
std::string l_attr_name = cbd.dya->get_name();
// name will be speedX
std::string l_str = l_attr_name.substr(5, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kSPEED); // extract channel nb
if (l_val < 0)
{
l_val = -l_val;
......@@ -886,20 +1115,18 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb
ERROR_STREAM << df<< endl;
RETHROW_DEVFAILED(df,
"DRIVER_FAILURE",
"could not write initial [caught Tango::DevFailed]",
"SingleShotAO::write_initial");
"could not write speed [caught Tango::DevFailed]",
"SingleShotAO::write_speed");
}
catch(...)
{
ERROR_STREAM << "SingleShotAO::write_initial::unknown exception caught"<<std::endl;
ERROR_STREAM << "SingleShotAO::write_speed::unknown exception caught" << std::endl;
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write initial [unknown error]",
"SingleShotAO::write_initial");
"could not write speed [unknown error]",
"SingleShotAO::write_speed");
}
// To be activated with Tango 8
//yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
std::string name = "__" + l_attr_name;
store_value_as_property(l_val, name);
yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
}
......@@ -914,15 +1141,10 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb
void SingleShotAO::read_initial(yat4tango::DynamicAttributeReadCallbackData & cbd)
{
yat::AutoMutex<> guard(m_lock);
std::string l_attr_name = cbd.dya->get_name();
// name will be initialX
std::string l_str = l_attr_name.substr(7, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kINITIAL); // extract channel nb
CHECK_MANAGER();
// choose tab depending on l_idx
double l_val = m_manager->get_initial(l_idx);
cbd.tga->set_value(&l_val);
}
......@@ -944,10 +1166,7 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
cbd.tga->get_write_value(l_val);
std::string l_attr_name = cbd.dya->get_name();
// name will be initialX
std::string l_str = l_attr_name.substr(7, 2);
yat::uint16 l_idx = atoi(l_str.c_str());
yat::uint16 l_idx = extractNumber(l_attr_name, kINITIAL); // extract channel nb
CHECK_MANAGER();
try
......@@ -969,10 +1188,42 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
"could not write initial [unknown error]",
"SingleShotAO::write_initial");
}
// To be activated with Tango 8
//yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
std::string name = "__" + l_attr_name;
store_value_as_property(l_val, name);
yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
}
//+------------------------------------------------------------------
/**
* set the write value of a dynamic attribute
* used to keep read and write values in sync
*/
bool SingleShotAO::setDynamicAttributeWriteValue(const std::string& attrName, double value)
{
try
{
Tango::DeviceImpl* dev = static_cast<Tango::DeviceImpl*>(this);
Tango::DevDouble val_to_write = value;
// Get the attribute
Tango::WAttribute& attr = dev->get_device_attr()->get_w_attr_by_name(attrName.c_str());
// Set the write value
attr.set_write_value(&val_to_write, 1);
DEBUG_STREAM << "Set write value for " << attrName << " to " << value << endl;
return true;
}
catch (Tango::DevFailed &df)
{
ERROR_STREAM << "Failed to set write value for " << attrName
<< ": " << df << endl;
return false;
}
catch (...)
{
ERROR_STREAM << "Unknown exception setting write value for "
<< attrName << endl;
return false;
}
}
......@@ -983,18 +1234,14 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
* description: method to execute "Abort"
* Aborts ramps in progress.
*
*
*/
//+------------------------------------------------------------------
void SingleShotAO::abort()
{
DEBUG_STREAM << "SingleShotAO::abort(): entering... !" << endl;
// Add your own code to control device here
CHECK_MANAGER();
try
{
m_manager->abort();
_abort();
}
catch(Tango::DevFailed& df)
{
......@@ -1006,12 +1253,37 @@ void SingleShotAO::abort()
}
catch(...)
{
ERROR_STREAM << "SingleShotAOManager::abort::unknown exception caught"<<std::endl;
ERROR_STREAM << "SingleShotAO::abort::unknown exception caught"<< std::endl;
THROW_DEVFAILED("DRIVER_FAILURE",
"could not abort [unknown error]",
"SingleShotAO::abort");
}
}
void SingleShotAO::_abort()
{
CHECK_MANAGER();
// memorize the current initial_values and value of channels
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
{
if (m_manager->is_running(l_cpt))
{
DEBUG_STREAM << "Channel " << l_cpt << " is running. Memorizing values..." << std::endl;
double l_val_channel = m_manager->get_channel(l_cpt);
std::string l_channel_attr_name = kCHANNEL + std::to_string(l_cpt);
yat4tango::PropertyHelper::set_memorized_attribute(this, l_channel_attr_name, l_val_channel);
setDynamicAttributeWriteValue(l_channel_attr_name, l_val_channel);
DEBUG_STREAM << "Memorizing " << l_channel_attr_name << " to " << l_val_channel << std::endl;
std::string l_initial_attr_name = kINITIAL + std::to_string(l_cpt);
yat4tango::PropertyHelper::set_memorized_attribute(this, l_initial_attr_name, l_val_channel);
setDynamicAttributeWriteValue(l_initial_attr_name, l_val_channel);
DEBUG_STREAM << "Memorizing " << l_initial_attr_name << " to " << l_val_channel << std::endl;
}
}
m_manager->abort();
}
} // namespace
......@@ -110,13 +110,37 @@ public :
* The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]
*/
string boardType;
/**
* Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true]
*/
Tango::DevBoolean enableRamps;
/**
* Whether to write the memorized values to the board at the device initialization. [true/false - default value is false]
*/
Tango::DevBoolean outputMemorizedChannelsAtInit;
//@}
/**
* @name Device properties
* Device property member data.
* @name Device properties default values
* Device properties default values.
*/
//@{
/**
* Default value for boardNum property
*/
Tango::DevShort boardNum_default;
/**
* Default value for boardType property
*/
string boardType_default;
/**
* Default value for enableRamps property
*/
Tango::DevBoolean enableRamps_default;
/**
* Default value for outputMemorizedChannelsAtInit property
*/
Tango::DevBoolean outputMemorizedChannelsAtInit_default;
//@}
/**@name Constructors
......@@ -279,76 +303,13 @@ protected :
//- channel number
unsigned short m_nb_chan;
// To be deleted with Tango 8
//- Template class to store a current value in a Device property.
//- \param value Value to store.
//- \param property_name Name to use.
template <class T>
void store_value_as_property(T value, std::string property_name)
{
Tango::DbDatum current_value(property_name);
current_value << value;
Tango::DbData db_data;
db_data.push_back(current_value);
try
{
get_db_device()->put_property(db_data);
}
catch(Tango::DevFailed &df)
{
ERROR_STREAM << df << endl;
RETHROW_DEVFAILED(df,
"SOFTWARE_FAILURE",
"Error while storing properties in database",
"SingleShotAO::store_value_as_property");
}
}
// To be deleted with Tango 8
//- Template class to get a memorized attribute stored as a Device property.
//- \param property_name Name od the property to read.
template <class T>
T get_memorized_attribute(const std::string& property_name)
{
T value;
if (!Tango::Util::instance()->_UseDb)
{
//- throw exception
THROW_DEVFAILED("DEVICE_ERROR",
"No DATA BASE!",
"SingleShotAO::get_memorized_attribute");
}
void _abort();
Tango::DbData dev_prop;
dev_prop.push_back(Tango::DbDatum(property_name));
// set the write value of a dynamic attribute
// used to keep read and write values in sync
bool setDynamicAttributeWriteValue(const std::string& attrName, double value);
try
{
get_db_device()->get_property(dev_prop);
}
catch (Tango::DevFailed &df)
{
//- rethrow exception
RETHROW_DEVFAILED(df,
"DEVICE_ERROR",
"could not get Device properties! [caught Tango::DevFailed]",
"SingleShotAO::get_memorized_attribute");
}
if (dev_prop[0].is_empty()==false)
{
dev_prop[0] >> value;
}
else
{
//- throw exception
THROW_DEVFAILED("DATA_ERROR",
"No property stored in database!",
"SingleShotAO::get_memorized_attribute");
}
return value;
}
};
} // namespace_ns
......
......@@ -87,7 +87,8 @@ __declspec(dllexport)
#endif
Tango::DeviceClass *_create_SingleShotAO_class(const char *name) {
Tango::DeviceClass *_create_SingleShotAO_class(const char *name)
{
return SingleShotAO_ns::SingleShotAOClass::init(name);
}
}
......@@ -369,12 +370,17 @@ void SingleShotAOClass::set_default_property()
string prop_def;
vector<string> vect_data;
// Set Default Class Properties
// ...
// Set Default Device Properties
//- <BoardNum> -----------------------
prop_name = "BoardNum";
prop_desc = "The the board identifier in the cPCI crate [valid range is 0...7 - no default value] .";
prop_def = "";
prop_desc = "The board identifier in the cPCI crate [valid range is 0...7 - no default value].";
prop_def = "-1";
vect_data.clear();
vect_data.push_back("-1");
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
......@@ -385,10 +391,12 @@ void SingleShotAOClass::set_default_property()
else
add_wiz_dev_prop(prop_name, prop_desc);
//- <BoardType> -----------------------
prop_name = "BoardType";
prop_desc = "The board type [MAO_xxxx - where <xxxx> is the ADlink board identifier - e.g. MAO_6208 - no default value]";
prop_def = "";
prop_def = "TO_BE_DEFINED";
vect_data.clear();
vect_data.push_back("TO_BE_DEFINED");
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
......@@ -399,7 +407,40 @@ void SingleShotAOClass::set_default_property()
else
add_wiz_dev_prop(prop_name, prop_desc);
//- <EnableRamps> -----------------------
prop_name = "EnableRamps";
prop_desc = "Whether to enable or disable the ramp generation on the board output channels. If false, the speedX and initialX dynamic attributes will not be created for every channel, and the changes will happen instantly. [true/false - default value is true]";
prop_def = "true";
vect_data.clear();
vect_data.push_back("true");
if (prop_def.length() > 0)
{
Tango::DbDatum data(prop_name);
data << vect_data;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
//- <OutputMemorizedChannelsAtInit> -----------------------
prop_name = "OutputMemorizedChannelsAtInit";
prop_desc = "Whether to send the memorized values for the channels to the board at the device initialization (the device attribute will show the last memorized value regardless) [true/false - default value is false]";
prop_def = "false";
vect_data.clear();
vect_data.push_back("false");
if (prop_def.length() > 0)
{
Tango::DbDatum data(prop_name);
data << vect_data;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
}
//+----------------------------------------------------------------------------
//
// method : SingleShotAOClass::write_class_property
......@@ -432,107 +473,6 @@ void SingleShotAOClass::write_class_property()
description << str_desc;
data.push_back(description);
// put cvs or svn location
string filename(classname);
filename += "Class.cpp";
// Create a string with the class ID to
// get the string into the binary
string class_id(ClassId);
// check for cvs information
string src_path(CvsPath);
start = src_path.find("/");
if (start!=string::npos)
{
end = src_path.find(filename);
if (end>start)
{
string strloc = src_path.substr(start, end-start);
// Check if specific repository
start = strloc.find("/cvsroot/");
if (start!=string::npos && start>0)
{
string repository = strloc.substr(0, start);
if (repository.find("/segfs/")!=string::npos)
strloc = "ESRF:" + strloc.substr(start, strloc.length()-start);
}
Tango::DbDatum cvs_loc("cvs_location");
cvs_loc << strloc;
data.push_back(cvs_loc);
}
}
// check for svn information
else
{
string src_path(SvnPath);
start = src_path.find("://");
if (start!=string::npos)
{
end = src_path.find(filename);
if (end>start)
{
header = "$HeadURL: ";
start = header.length();
string strloc = src_path.substr(start, (end-start));
Tango::DbDatum svn_loc("svn_location");
svn_loc << strloc;
data.push_back(svn_loc);
}
}
}
// Get CVS or SVN revision tag
// CVS tag
string tagname(TagName);
header = "$Name: ";
start = header.length();
string endstr(" $");
end = tagname.find(endstr);
if (end!=string::npos && end>start)
{
string strtag = tagname.substr(start, end-start);
Tango::DbDatum cvs_tag("cvs_tag");
cvs_tag << strtag;
data.push_back(cvs_tag);
}
// SVN tag
string svnpath(SvnPath);
header = "$HeadURL: ";
start = header.length();
end = svnpath.find(endstr);
if (end!=string::npos && end>start)
{
string strloc = svnpath.substr(start, end-start);
string tagstr ("/tags/");
start = strloc.find(tagstr);
if ( start!=string::npos )
{
start = start + tagstr.length();
end = strloc.find(filename);
string strtag = strloc.substr(start, end-start-1);
Tango::DbDatum svn_tag("svn_tag");
svn_tag << strtag;
data.push_back(svn_tag);
}
}
// Get URL location
string httpServ(HttpServer);
if (httpServ.length()>0)
{
Tango::DbDatum db_doc_url("doc_url");
db_doc_url << httpServ;
data.push_back(db_doc_url);
}
// Put inheritance
Tango::DbDatum inher_datum("InheritedFrom");
vector<string> inheritance;
......@@ -540,8 +480,7 @@ void SingleShotAOClass::write_class_property()
inher_datum << inheritance;
data.push_back(inher_datum);
// Call database and and values
//--------------------------------------------
// Call database and add values
get_db_class()->put_property(data);
}
......
......@@ -128,7 +128,7 @@ void SingleShotAOManager::write_frequency(double p_frequency)
// ============================================================================
// SingleShotAOManager::init ()
// ============================================================================
void SingleShotAOManager::init(asl::SingleShotAO * p_ssao, unsigned short p_nb_chan, double p_frequency)
void SingleShotAOManager::init(asl::SingleShotAO * p_ssao, unsigned short p_nb_chan, double p_frequency, bool p_enable_ramps)
{
m_ssao = p_ssao;
CHECK_SSAO();
......@@ -145,6 +145,8 @@ void SingleShotAOManager::init(asl::SingleShotAO * p_ssao, unsigned short p_nb_c
enable_periodic_msg(true);
}
m_enable_ramps = p_enable_ramps;
// initialize channel indexes (-1 means no ramp in progress)
// and ramp states
for (unsigned int l_cpt = 0; l_cpt < m_nb_chan; l_cpt++)
......@@ -180,7 +182,6 @@ void SingleShotAOManager::process_message (yat::Message& msg)
//- THREAD_PERIODIC ------------------
case yat::TASK_PERIODIC:
{
//DEBUG_STREAM << "SingleShotAOManager::handle_message::THREAD_PERIODIC" << std::endl;
periodic_job_i();
}
break;
......@@ -191,12 +192,15 @@ void SingleShotAOManager::process_message (yat::Message& msg)
//- not used in this example
}
break;
//- UNHANDLED MSG --------------------
default:
{
DEBUG_STREAM << "SingleShotAOManager::handle_message::unhandled msg type received" << std::endl;
break;
}
}
}
// ============================================================================
// SingleShotAOManager::periodic_job_i ()
......@@ -207,9 +211,12 @@ void SingleShotAOManager::periodic_job_i()
for (unsigned int l_cpt = 0;l_cpt < m_nb_chan;l_cpt++)
{
// test if a ramp step must occur
if (m_currentIndex[l_cpt] != -1)
if (m_currentIndex[l_cpt] == -1)
{
//DEBUG_STREAM << "Current index for channel" << l_cpt << ": " << m_currentIndex[l_cpt] << endl;
m_isRunning[l_cpt] = false;
continue;
}
m_isRunning[l_cpt] = true;
double l_val = 0;
l_val = m_ramps[l_cpt][m_currentIndex[l_cpt]];
......@@ -243,16 +250,12 @@ void SingleShotAOManager::periodic_job_i()
m_currentIndex[l_cpt] += 1;
if (m_currentIndex[l_cpt] == m_ramps[l_cpt].capacity())
{
DEBUG_STREAM << "Ramp finished for channel" << l_cpt << endl;
m_currentIndex[l_cpt] = -1;
m_initials[l_cpt] = m_channels[l_cpt];
m_ramps[l_cpt].clear();
}
}
else
{
m_isRunning[l_cpt] = false;
}
}
}
// ============================================================================
......@@ -264,13 +267,26 @@ double SingleShotAOManager::get_channel(ChannelId_t p_chIdx)
}
// ============================================================================
// SingleShotAOManager::write_channel ()
// SingleShotAOManager::set_channel ()
// ============================================================================
void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
void SingleShotAOManager::set_channel(ChannelId_t p_chIdx, double p_val)
{
if (m_isRunning[p_chIdx])
{
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write channel : a ramp is still in progress on this channel",
"SingleShotAOManager::set_channel");
}
else
{
DEBUG_STREAM << "write_channel : " << p_chIdx << " : " << p_val << " : " << endl;
m_channels[p_chIdx] = p_val;
}
}
if (m_speeds[p_chIdx] == 0.0)
// ============================================================================
// SingleShotAOManager::write_channel_direct ()
// ============================================================================
void SingleShotAOManager::write_channel_direct(ChannelId_t p_chIdx, double p_val)
{
try
{
......@@ -278,41 +294,33 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
m_ssao->write_scaled_channel((adl::ChanId)p_chIdx, p_val);
m_channels[p_chIdx] = p_val;
m_initials[p_chIdx] = p_val;
DEBUG_STREAM << "Writing directly the value" << std::endl;
}
catch (const asl::DAQException &de)
{
Tango::DevFailed df = daq_to_tango_exception(de);
ERROR_STREAM << df<< endl;
ERROR_STREAM << df << std::endl;
m_state = Tango::FAULT;
RETHROW_DEVFAILED(df,
"DRIVER_FAILURE",
"could not write channel [caught asl::DAQException]",
"SingleShotAOManager::write_channel");
"SingleShotAOManager::write_channel_direct");
}
catch (...)
{
ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught"<<std::endl;
ERROR_STREAM << "SingleShotAOManager::write_channel_direct::unknown exception caught" << std::endl;
m_state = Tango::FAULT;
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write channel [unknown error]",
"SingleShotAOManager::write_channel");
}
"SingleShotAOManager::write_channel_direct");
}
else
{
// check if a ramp is not running
if (!m_isRunning[p_chIdx])
{
// check if initial = channel
if (m_initials[p_chIdx] != p_val)
{
if (m_frequency == 0)
{
THROW_DEVFAILED("DRIVER_FAILURE",
"could not set a ramp on this channel. The frequency is 0",
"SingleShotAOManager::write_channel");
}
// ============================================================================
// SingleShotAOManager::start_channel_ramp ()
// ============================================================================
void SingleShotAOManager::start_channel_ramp(ChannelId_t p_chIdx, double p_val)
{
// ramp determination
double l_delta = p_val - m_initials[p_chIdx];
bool isDown = false;
......@@ -330,18 +338,12 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
l_buffer.force_length(ramp_size);
// check if ramp step is integer or not
bool isDeltaNotInt = false;
if (ramp_size != ((size_t)(floor(l_delta))))
{
isDeltaNotInt = true;
}
bool isDeltaNotInt = (ramp_size != ((size_t)(floor(l_delta))));
DEBUG_STREAM << "Real ramp steps number : " << ramp_size << endl;
for (unsigned int l_cpt = 0; l_cpt < ramp_size; l_cpt++)
{
if ((l_cpt == (ramp_size - 1)) &&
(isDeltaNotInt))
if ((l_cpt == (ramp_size - 1)) && (isDeltaNotInt))
{
// add the setpoint value at the end of table
l_buffer[l_cpt] = p_val;
......@@ -364,16 +366,47 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
m_ramps[p_chIdx].force_length(0);
m_currentIndex[p_chIdx] = 0;
m_ramps[p_chIdx] = l_buffer;
//m_channels[p_chIdx] = m_ramps[p_chIdx][0]; -- soso on ne met rien ici => à l'application
}
// ============================================================================
// SingleShotAOManager::write_channel ()
// ============================================================================
void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
{
DEBUG_STREAM << "write_channel " << p_chIdx << " : " << p_val << endl;
// if the speed is 0, write the value directly and skip ramp
if (m_speeds[p_chIdx] == 0.0 || !m_enable_ramps)
{
write_channel_direct(p_chIdx, p_val);
return;
}
else
// if a ramp is running, error
if (m_isRunning[p_chIdx])
{
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write channel : a ramp is still in progress on this channel",
"SingleShotAOManager::write_channel");
}
// if frequency = 0, error
if (m_frequency == 0)
{
THROW_DEVFAILED("DRIVER_FAILURE",
"could not set a ramp on this channel. The frequency is 0",
"SingleShotAOManager::write_channel");
}
// if initial = channel, skip
if (m_initials[p_chIdx] == p_val)
{
DEBUG_STREAM << "Initial value is the same as the given value, skipping" << endl;
return;
}
// Create and start a ramp
start_channel_ramp(p_chIdx, p_val);
}
// ============================================================================
......@@ -395,6 +428,12 @@ void SingleShotAOManager::set_initial(ChannelId_t p_chIdx, Intial_t p_initial)
"could not write initial : a ramp is still in progress on this channel",
"SingleShotAOManager::set_initial");
}
else if (!m_enable_ramps)
{
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write initial : ramps are disabled",
"SingleShotAOManager::set_initial");
}
else
{
m_initials[p_chIdx] = p_initial;
......@@ -420,12 +459,26 @@ void SingleShotAOManager::set_speed(ChannelId_t p_chIdx, Intial_t p_speed)
"could not write speed : a ramp is still in progress on this channel",
"SingleShotAOManager::set_speed");
}
else if (!m_enable_ramps)
{
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write speed : ramps are disabled",
"SingleShotAOManager::set_speed");
}
else
{
m_speeds[p_chIdx] = p_speed;
}
}
// ============================================================================
// SingleShotAOManager::is_running ()
// ============================================================================
bool SingleShotAOManager::is_running(ChannelId_t p_chIdx)
{
return m_isRunning[p_chIdx];
}
// ============================================================================
// SingleShotAOManager::abort ()
// ============================================================================
......@@ -444,5 +497,5 @@ void SingleShotAOManager::abort()
}
}
}
} // namespace SingleShotAO_ns
} // namespace SingleShotAO_ns
......@@ -48,21 +48,32 @@ public:
std::string get_status ();
//- init
void init(asl::SingleShotAO * p_ssao, unsigned short p_nb_chan, double p_frequency);
void init(asl::SingleShotAO *p_ssao, unsigned short p_nb_chan, double p_frequency, bool p_enable_ramps);
//- get current channel value
double get_channel(ChannelId_t p_chIdx);
//- set channel
// Updates the value for the channel in the device without sending it to hardware
void set_channel(ChannelId_t p_chIdx, double p_val);
//- write channel
// Writes value to the channel to the device and the hardware, with a ramp if speed is not null and EnableRamps property is true
void write_channel(ChannelId_t p_chIdx, double p_val);
//- write a channel directly (without ramp)
void write_channel_direct(ChannelId_t p_chIdx, double p_val);
//- create and start a ramp for channel
void start_channel_ramp(ChannelId_t p_chIdx, double p_val);
//- change period
void write_frequency(double p_frequency);
//- get inital
//- get initial
Intial_t get_initial(ChannelId_t p_chIdx);
//- set inital
//- set initial
void set_initial(ChannelId_t p_chIdx, Intial_t p_initial);
//- get speed
......@@ -71,6 +82,9 @@ public:
//- set speed
void set_speed(ChannelId_t p_chIdx, Intial_t p_speed);
//- is running
bool is_running(ChannelId_t p_chIdx);
//- abort
void abort();
......@@ -95,6 +109,9 @@ private:
//- frequency
double m_frequency;
//-enable ramps
bool m_enable_ramps;
//- initial buffer for all channels
std::map<ChannelId_t, Intial_t> m_initials;
......