diff --git a/doc/doc_html/Attributes.html b/doc/doc_html/Attributes.html index 70c5c1b662736bd7b9430c246ab5c5cb88eaf3c8..cc58b1177716590ac3a38958e6eb6ea72ba6cbac 100644 --- a/doc/doc_html/Attributes.html +++ b/doc/doc_html/Attributes.html @@ -2,33 +2,49 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> -<HR WIDTH="100%"></H5> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> +<HR WIDTH="100%"></H5> <Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Device Attributes Description +Retriggered Continuous Anolog Output <Br> +Device Attributes Description <Br> <Br> +RetrigAO Class <Br> </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois </b> </center> @@ -42,35 +58,49 @@ Revision: 1.6 - Author: abeilleg <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><Center>errorCounter</b><Br>( Errors occuring during the waveform generation. )</Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>bufferDepth</b>: <Font Size=-1>The buffer depth for <b>one channel</b></Font></Td> +<Td><Center><Font Size=-1>DEV_USHORT</Font></Center></Td><Td><Center><Font Size=-1>READ_WRITE</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>useBoardFifo</b><Br>( Set to 1 if data have been loaded in FIFO. Set to 0 if data is continuously tranfered through DMA (possible underrun) )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>errorCounter</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel0Enable</b><Br>( If equals to 1, data is output on channel 0, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>useBoardFifo</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel1Enable</b><Br>( If equals to 1, data is output on channel 1, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel0Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel2Enable</b><Br>( If equals to 1, data is output on channel 2, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel1Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel3Enable</b><Br>( If equals to 1, data is output on channel 3, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel2Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel4Enable</b><Br>( If equals to 1, data is output on channel 4, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel3Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel5Enable</b><Br>( If equals to 1, data is output on channel 5, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel4Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel6Enable</b><Br>( If equals to 1, data is output on channel 6, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel5Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel7Enable</b><Br>( If equals to 1, data is output on channel 7, otherwise the channel is disable. )</Center></Td> -<Td><Center>DEV_SHORT</Center></Td><Td><Center>READ</Center></Td><Td><Center>No</Center></Td></Tr> +<Font Size=-1> +<Tr><Td><b>channel6Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> + +<Font Size=-1> +<Tr><Td><b>channel7Enable</b></Td> +<Td><Center><Font Size=-1>DEV_SHORT</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> </Table> </Center> @@ -83,47 +113,38 @@ Revision: 1.6 - Author: abeilleg <Td><Center><b>Data Type</b></td></Center> <Td><Center><b>X Data Length</b></td></Center> <Td><Center><b>Expert</b></td></Center> -<Tr><Td><b><Center>channel0</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel0</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel1</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel1</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel2</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel2</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel3</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel3</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel4</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel4</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel5</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel5</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel6</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel6</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> -<Tr><Td><b><Center>channel7</b></Center></Td> -<Td><Center>DEV_DOUBLE</Center></Td><Td><Center>1000000</Center></Td><Td><Center>No</Center></Td></Tr> +<Tr><Td><b>channel7</b></Td> +<Td><Center><Font Size=-1>DEV_DOUBLE</Font></Center></Td><Td><Center><Font Size=-1>1000000</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> </Table> </Center> <Br><Br><Br><Br><Br> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/doc/doc_html/Description.html b/doc/doc_html/Description.html index 27eb2df8f8fb28b6f6f40e272ec2b212f90a4fc1..ee4f18cd4dadad901168c259da856cdcfd53f2d2 100644 --- a/doc/doc_html/Description.html +++ b/doc/doc_html/Description.html @@ -2,21 +2,39 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Servers + </Center></FONT> + </Td> + </TR> +</TABLE> +<Br> + <HR WIDTH="100%"></H5> @@ -40,8 +58,7 @@ Revision: 1.6 - Author: abeilleg <Br> <Br> <Br> -This Page Must Be Filled by <Br> -The Programmer +Perform continuous anolog ouput (waveform generation) on the selected outputs. </Center> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> diff --git a/doc/doc_html/DevCommands.html b/doc/doc_html/DevCommands.html index 55f704049bb97450626a6cd7cdc0cbc49c1b95eb..604102a31af91a010472a7ba80467855c52bef87 100644 --- a/doc/doc_html/DevCommands.html +++ b/doc/doc_html/DevCommands.html @@ -2,33 +2,49 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> -<HR WIDTH="100%"></H5> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> +<HR WIDTH="100%"></H5> <Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Device Commands Description +Retriggered Continuous Anolog Output <Br> +Device Commands Description <Br> <Br> +RetrigAO Class <Br> </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois </b> </center> @@ -76,7 +92,7 @@ The language device desctructor automatically calls the <i> delete_device() </i> <Li><Strong>Argin:<Br>DEV_VOID</Strong> : none.<Br>  <Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong> - : Status descrition<Br>  + : Status description<Br>  <Li><Strong>Command allowed for: </Strong><Ul> <Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul> <Br>  @@ -124,20 +140,11 @@ The language device desctructor automatically calls the <i> delete_device() </i> <Br>  </ul><Br> <Br> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/doc/doc_html/DevCommandsFrame.html b/doc/doc_html/DevCommandsFrame.html index 039ee3311d80a9af10034080ac4d9588e93ca491..a696d50e0bf0b56077f6f4addb65cdd9084e6d4e 100644 --- a/doc/doc_html/DevCommandsFrame.html +++ b/doc/doc_html/DevCommandsFrame.html @@ -2,7 +2,6 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> <FRAMESET cols="20%,80%"> diff --git a/doc/doc_html/DevCommandsTable.html b/doc/doc_html/DevCommandsTable.html index 921dd8fb1faf0c6f87172482a10e41eab098d78b..9a4ee60a480125c25aaeba0cd78bf151847073e8 100644 --- a/doc/doc_html/DevCommandsTable.html +++ b/doc/doc_html/DevCommandsTable.html @@ -2,33 +2,49 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> -<HR WIDTH="100%"></H5> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> +<HR WIDTH="100%"></H5> <Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Device Commands Description +Retriggered Continuous Anolog Output <Br> +Device Commands Description <Br> <Br> +RetrigAO Class <Br> </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois </b> </center> @@ -44,42 +60,33 @@ Revision: 1.6 - Author: abeilleg <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>Init</Td> -<Td>DEV_VOID</Td> -<Td>DEV_VOID</Td> -<Tr><Td>State</Td> -<Td>DEV_VOID</Td> -<Td>DEV_STATE</Td> -<Tr><Td>Status</Td> -<Td>DEV_VOID</Td> -<Td>CONST_DEV_STRING</Td> -<Tr><Td>Start</Td> -<Td>DEV_VOID</Td> -<Td>DEV_VOID</Td> -<Tr><Td>Stop</Td> -<Td>DEV_VOID</Td> -<Td>DEV_VOID</Td> -<Tr><Td>SetAOScaledData</Td> -<Td>DEVVAR_DOUBLESTRINGARRAY</Td> -<Td>DEV_VOID</Td> +<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>Start</b></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>Stop</b></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>SetAOScaledData</b></Td> +<Td><Font Size=-1>DEVVAR_DOUBLESTRINGARRAY</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> </Table></Center> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/doc/doc_html/Properties.html b/doc/doc_html/Properties.html index d42fab108d897c6ee5a5796f016f9e3f2e5de62c..24085b1dc647d6b0bfc2a699ac55b4cc20975b44 100644 --- a/doc/doc_html/Properties.html +++ b/doc/doc_html/Properties.html @@ -2,33 +2,49 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> -<HR WIDTH="100%"></H5> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> +<HR WIDTH="100%"></H5> <Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Properties Description +Retriggered Continuous Anolog Output <Br> +Properties Description <Br> <Br> +RetrigAO Class <Br> </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois </b> </center> @@ -43,154 +59,275 @@ Revision: 1.6 - Author: abeilleg <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>BoardNum</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>The number of the board in the chassis cPCI.</Td></Tr> - -<Tr><Td>Frequency</Td> -<Td>Tango::DEV_DOUBLE</Td> -<Td>The output frequency (the rate the samples are outputed).</Td></Tr> - -<Tr><Td>TriggerMode</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>Trigger mode: POST trigger or DELAY trigger.</Td></Tr> - -<Tr><Td>TriggerSource</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>The trigger source.The possible values are internal trigger INTRIG, digital trigger -DTRIG or analog trigger ATRIG.</Td></Tr> - -<Tr><Td>ATRIGSelection</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel) -or can be ABOVE (trigger occurs above ATRIGLevel).</Td></Tr> - -<Tr><Td>ATRIGLevel</Td> -<Td>Tango::DEV_DOUBLE</Td> -<Td>The analog trigger level in volts.</Td></Tr> - -<Tr><Td>DTRIGPolarity</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>The edges on which the trigger are detected. Can be RISING or FALLING.</Td></Tr> - -<Tr><Td>AORefA</Td> -<Td>Tango::DEV_DOUBLE</Td> -<Td>The value of the reference voltage gave on pin AORefA.</Td></Tr> - -<Tr><Td>AORefB</Td> -<Td>Tango::DEV_DOUBLE</Td> -<Td>The value of the reference voltage gave on pin AORefB.</Td></Tr> - -<Tr><Td>Polarity</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>BP for unipolar outputs or UP for bipolar outputs.</Td></Tr> - -<Tr><Td>AORefSource</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>Select the internal reference (10.0 volts) with INTERN or the external references -AORefA and AORefB with EXTERN.</Td></Tr> - -<Tr><Td>Channel0Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 0, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel1Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 1, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel2Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 2, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel3Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 3, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel4Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 4, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel5Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 5, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel6Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 6, 0 otherwise.</Td></Tr> - -<Tr><Td>Channel7Enable</Td> -<Td>Tango::DEV_SHORT</Td> -<Td>1 if enable channel 7, 0 otherwise.</Td></Tr> - -<Tr><Td>BufferDepth</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>The buffer depth for <b>one channel</b></Td></Tr> - -<Tr><Td>Delay</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>If trigger mode is delay, configure the delay in seconds.</Td></Tr> - -<Tr><Td>Channel0Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 0 (attribute persistency).</Td></Tr> - -<Tr><Td>Channel1Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 1 (attribute persistency).</Td></Tr> - -<Tr><Td>Channel2Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 2 (attribute persistency).</Td></Tr> - -<Tr><Td>Channel3Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 3 (attribute persistency).</Td></Tr> +<Tr><Td><b><a href=#Dev_DefaultValues>BoardNum </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>The number of the board in the chassis cPCI.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Frequency </a></b></Td> +<Td><Font Size=-1>Tango::DEV_DOUBLE</Font></Td> +<Td><Font Size=-1>The output frequency (the rate the samples are outputed).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>TriggerMode </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>Trigger mode: POST trigger or DELAY trigger.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>TriggerSource </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>The trigger source.The possible values are internal trigger INTRIG, digital trigger +DTRIG or analog trigger ATRIG.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>ATRIGSelection </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel) +or can be ABOVE (trigger occurs above ATRIGLevel).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>ATRIGLevel </a></b></Td> +<Td><Font Size=-1>Tango::DEV_DOUBLE</Font></Td> +<Td><Font Size=-1>The analog trigger level in volts.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>DTRIGPolarity </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>The edges on which the trigger are detected. Can be RISING or FALLING.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>AORefA </a></b></Td> +<Td><Font Size=-1>Tango::DEV_DOUBLE</Font></Td> +<Td><Font Size=-1>The value of the reference voltage gave on pin AORefA.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>AORefB </a></b></Td> +<Td><Font Size=-1>Tango::DEV_DOUBLE</Font></Td> +<Td><Font Size=-1>The value of the reference voltage gave on pin AORefB.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Polarity </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>BP for unipolar outputs or UP for bipolar outputs.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>AORefSource </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>Select the internal reference (10.0 volts) with INTERN or the external references +AORefA and AORefB with EXTERN.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel0Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 0, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel1Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 1, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel2Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 2, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel3Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 3, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel4Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 4, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel5Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 5, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel6Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 6, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel7Enable </a></b></Td> +<Td><Font Size=-1>Tango::DEV_SHORT</Font></Td> +<Td><Font Size=-1>1 if enable channel 7, 0 otherwise.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Delay </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>If trigger mode is delay, configure the delay in seconds.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel0Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 0 (attribute persistency).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel1Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 1 (attribute persistency).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel2Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 2 (attribute persistency).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel3Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 3 (attribute persistency).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel4Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 4 (attribute persistency).</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Channel5Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 5 (attribute persistency).</Font></Td></Tr> -<Tr><Td>Channel4Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 4 (attribute persistency).</Td></Tr> +<Tr><Td><b><a href=#Dev_DefaultValues>Channel6Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 6 (attribute persistency).</Font></Td></Tr> -<Tr><Td>Channel5Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 5 (attribute persistency).</Td></Tr> +<Tr><Td><b><a href=#Dev_DefaultValues>Channel7Waveform </a></b></Td> +<Td><Font Size=-1>Array of double</Font></Td> +<Td><Font Size=-1>The waveform for channel 7 (attribute persistency).</Font></Td></Tr> -<Tr><Td>Channel6Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 6 (attribute persistency).</Td></Tr> +<Tr><Td><b><a href=#Dev_DefaultValues>FilePath </a></b></Td> +<Td><Font Size=-1>Tango::DEV_STRING</Font></Td> +<Td><Font Size=-1>The path to waveforms persistancy files</Font></Td></Tr> -<Tr><Td>Channel7Waveform</Td> -<Td>Array of double</Td> -<Td>The waveform for channel 7 (attribute persistency).</Td></Tr> +<Tr><Td><b><a href=#Dev_DefaultValues>ConversionSource </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>Set the AO conversion signal source (i.e. DAC sampling source). +Use one of the following: INTERNAL, EXTSAMPLING.</Font></Td></Tr> -<Tr><Td>FilePath</Td> -<Td>string</Td> -<Td>The path to waveforms persistancy files</Td></Tr> +</Table> -<Tr><Td>ConversionSource</Td> -<Td>Tango::DEV_USHORT</Td> -<Td>Set the AO conversion signal source (i.e. DAC sampling source). -Use one of the following: INTERNAL, EXTSAMPLING.</Td></Tr> +</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"> + <Td><b>Property Name</b></td> + <td><b>Default Values</b></td> + </Tr> + <Tr> + <Td>BoardNum</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Frequency</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>TriggerMode</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>TriggerSource</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>ATRIGSelection</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>ATRIGLevel</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>DTRIGPolarity</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>AORefA</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>AORefB</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Polarity</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>AORefSource</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel0Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel1Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel2Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel3Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel4Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel5Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel6Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel7Enable</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Delay</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel0Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel1Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel2Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel3Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel4Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel5Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel6Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Channel7Waveform</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>FilePath</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>ConversionSource</Td> + <td>No default value</td> + </Tr> </Table> <Br><Br><Br> <Center><b> There is no Class properties.<Br><Br> </Center></b> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> +<Br> <Br> <Br> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/doc/doc_html/TangoDevStates.html b/doc/doc_html/TangoDevStates.html index 284fcb5ec68c83c8fa253b535d109464f718825c..8e290aebe2b0ea74ca6a69495085377138014056 100644 --- a/doc/doc_html/TangoDevStates.html +++ b/doc/doc_html/TangoDevStates.html @@ -2,33 +2,49 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> -<HR WIDTH="100%"></H5> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> +<HR WIDTH="100%"></H5> <Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Device States Description +Retriggered Continuous Anolog Output <Br> +Device States Description <Br> <Br> +RetrigAO Class <Br> </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois </b> </center> @@ -41,37 +57,28 @@ Revision: 1.6 - Author: abeilleg <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <Td><Center><b>Names</b></td></Center> <Td><Center><b>Descriptions</b></td></Center> -<Tr><Td>UNKNOWN</Td> -<Td></Td></Tr> +<Tr><Td><b>UNKNOWN</b></Td> +<Td><Font Size=-1></Font></Td></Tr> -<Tr><Td>STANDBY</Td> -<Td></Td></Tr> +<Tr><Td><b>STANDBY</b></Td> +<Td><Font Size=-1></Font></Td></Tr> -<Tr><Td>RUNNING</Td> -<Td></Td></Tr> +<Tr><Td><b>RUNNING</b></Td> +<Td><Font Size=-1></Font></Td></Tr> -<Tr><Td>FAULT</Td> -<Td></Td></Tr> +<Tr><Td><b>FAULT</b></Td> +<Td><Font Size=-1></Font></Td></Tr> </Table> </Center> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/doc/doc_html/index.html b/doc/doc_html/index.html index ecf0e9209f93d871797a75c6c50ecfd82c8492a0..a036ccd525e5c2e0e228bc2cdad4e38b7ada57fb 100644 --- a/doc/doc_html/index.html +++ b/doc/doc_html/index.html @@ -2,85 +2,103 @@ <HTML> <HEAD> <Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> </HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> +<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#7F00FF" ALINK="#FF0000"> <P><!-------TITLE------></P> -<table width="100%" height="20%"><tr> -<td align=LEFT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Synchrotron </FONT></FONT> -<FONT COLOR="#0000FF"><FONT SIZE=+4>Soleil</FONT></FONT> -<H5>Saint-Aubin - BP 48 91192 GIF-sur-YVETTE CEDEX<BR> -</td><td> -<A href="http://www.synchrotron-soleil.fr/"> -<IMG SRC="http://controle/images/logo-150.gif" - ALT="SOLEIL Logo" ALIGN=RIGHT border="0"></A> -</td></tr></table> +<TABLE BORDER="0" WIDTH="100%"> + <TR> + <TD ALIGN="left"> + <A HREF="http://www.esrf.fr/" TARGET=new> + <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="center"> + <A HREF="http://www.elettra.trieste.it/" TARGET=new> + <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + + </Td> + <TD ALIGN="center"> + <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> + <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.cells.es/" TARGET=new> + <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + </Td> + <Td> + <H2><FONT COLOR="#7F00FF"> + <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + TANGO </a> <Br> Device Server + </Center></FONT> + </Td> + </TR> +</TABLE> <HR WIDTH="100%"></H5> -<Br> <center> <h1> -Retriggered Continuous Anolog Output<Br> -Device Server User's Guide +Retriggered Continuous Anolog Output <Br> +User's Guide <Br><Br> +RetrigAO Class<Br> + </h1> -<Br> <b> -Revision: 1.6 - Author: abeilleg +Revision: - Author: flanglois <Br> + Implemented in C++ - CVS repository: sourceforge(tango-ds) </b> </center> <Br> <Br> <Br> <Br> -<Br> -<Br> <h2>Introduction:</h2> -Perform continuous anolog ouput (waveform generation) on the selected outputs.<Br> +<ul> + Perform continuous anolog ouput (waveform generation) on the selected outputs.<Br> +</ul> +<Br> +<h2>Class Inheritance:</h2> + <ul> + <li> <a href="http://www.esrf.fr/computing/cs/tango/tango_doc/kernel_doc/cpp_doc/classTango_1_1Device__3Impl.html"> Tango::Device_3Impl</a></li> + <ul> + <li> RetrigAO</li> + </ul> + </ul> + </ul> +</ul> <Br> <Br> <h2>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=DevCommandsFrame.html> Commands description</a> - <li> <a href=Attributes.html> Attributes description</a> + <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> </ul> <Br> <Br> <Br> -<h2>Extented User's guide (available only for complex DeviceServers): Available in French OR English versions</h2> +<!--------------h2>Programmer's guide:</h2> <ul> - <li> <a href="..\DeviceServerUsersGuide.doc"> In French word format.</a> - <li> <a href="..\DeviceServerUsersGuide.pdf"> In French PDF format.</a> - <li> <a href="..\DeviceServerUsersGuide_en.doc"> In English word format.</a> - <li> <a href="..\DeviceServerUsersGuide_en.pdf"> In English PDF format.</a> + <li> <a href="html/index.html"> Software description.</a> </ul> -<Br> +<Br------> <Br> <Br> <h2>Conclusion:</h2> -The device server is ready for distribution application programmers.<Br> -The author will be interested inany feedback which arise from their usage of this device server. +<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. +</ul> <Br> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> -<HTML> -<HEAD> -<Title> Tango Device Server User's Guide </Title> - <META NAME="GENERATOR" CONTENT="Mozilla/3.01Gold (X11; I; HP-UX B.10.20 9000/735) [Netscape]"> -</HEAD> -<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#FF0000" ALINK="#FF0000"> - -<P><!-------TITLE------></P> <Center> <Br> <HR WIDTH="100%"></H5> -<H3>(c) SOLEIL : Groupe ICA Contr�le et Acquisitions </H33> +<H3> ESRF - Software Engineering Group </H3> </Center> </body> </html> diff --git a/scripts/load_sine_chan4.py b/scripts/load_sine_chan4.py index f0eca18b0b999befedc60c5acaad5895e0a7a14a..19447a9d856358217b4b2dbde770fc83f0bdc8e1 100644 --- a/scripts/load_sine_chan4.py +++ b/scripts/load_sine_chan4.py @@ -6,12 +6,12 @@ import math try: #TODO: put the desired device proxy - contAO = DeviceProxy("generic/acq/RetrigAO") + contAO = DeviceProxy("disco/srcd/retrigao.1") ###############load a sine signal on channel 4#################### #TODO: put the correct BufferDepth (same as in the property of the device) - BufferDepth = 1000 + BufferDepth = 200 #TODO: put the desired voltage in volts (verify the the input range is coherent with this value) # The input range is gave by properties Polarity, AORefA, AORefB, AORefSource diff --git a/src/ClassFactory.cpp b/src/ClassFactory.cpp index b1a5af8e38287f2b3beaed8eb44cf08608431d0a..a51396554f7d8aa3bf42f0a487e02aad7fadb12d 100644 --- a/src/ClassFactory.cpp +++ b/src/ClassFactory.cpp @@ -1,4 +1,4 @@ -static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/ClassFactory.cpp,v 1.1.1.1 2004-12-06 10:23:37 syldup Exp $"; +static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/ClassFactory.cpp,v 1.2 2009-09-16 08:10:54 anoureddine Exp $"; //+============================================================================= // // file : ClassFactory.cpp @@ -10,11 +10,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD // // project : TANGO Device Server // -// $Author: syldup $ +// $Author: anoureddine $ // -// $Revision: 1.1.1.1 $ +// $Revision: 1.2 $ // // $Log: not supported by cvs2svn $ +// Revision 1.1.1.1 2004/12/06 10:23:37 syldup +// initial import +// // // copyleft : Synchrotron SOLEIL // L'Orme des Merisiers @@ -35,13 +38,13 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD /** * Create ContinuousAOClass singleton and store it in DServer object. * - * @author $Author: syldup $ - * @version $Revision: 1.1.1.1 $ $ + * @author $Author: anoureddine $ + * @version $Revision: 1.2 $ $ */ void Tango::DServer::class_factory() { - add_class(RetrigAO::RetrigAOClass::init("RetrigAO")); + add_class(RetrigAO_ns::RetrigAOClass::init("RetrigAO")); } diff --git a/src/Makefile.VC b/src/Makefile.VC index c027126957b0b6ed2c5c73ca1a2d6e5380059054..125cbbaef6afcb7b6bd63f4f68c85a88f216c064 100644 --- a/src/Makefile.VC +++ b/src/Makefile.VC @@ -23,6 +23,7 @@ pdb_name= $(TEMPLIBDIR)\$(device_server).pdb LISTEOBJ = \ $(OBJDIR)\ADLinkContinuousAO.OBJ\ $(OBJDIR)\$(device_server).OBJ\ + $(OBJDIR)\$(device_server)StateMachine.OBJ\ $(OBJDIR)\ClassFactory.OBJ\ $(OBJDIR)\main.OBJ\ $(OBJDIR)\$(device_server)Class.OBJ diff --git a/src/RetrigAO.cpp b/src/RetrigAO.cpp index 92594d861939619f6fee69d66dba7d16e0457e8d..86d0475258bdbdc91dc24065bc0547b1419ce30d 100644 --- a/src/RetrigAO.cpp +++ b/src/RetrigAO.cpp @@ -1,4 +1,4 @@ -static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAO.cpp,v 1.12 2009-07-31 06:53:51 flanglois Exp $"; +static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAO.cpp,v 1.13 2009-09-16 08:10:54 anoureddine Exp $"; //+============================================================================= // // file : RetrigAO.cpp @@ -11,11 +11,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD // // project : TANGO Device Server // -// $Author: flanglois $ +// $Author: anoureddine $ // -// $Revision: 1.12 $ +// $Revision: 1.13 $ // // $Log: not supported by cvs2svn $ +// Revision 1.12 2009/07/31 06:53:51 flanglois +// - support external sampling (conversionSource) +// // Revision 1.11 2007/06/29 15:45:57 abeilleg // bug fix on properties management. // @@ -63,26 +66,28 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD //=================================================================== // -// The folowing table gives the correspondance -// between commands and method's name. +// The following table gives the correspondence +// between commands and method name. // -// Command's name | Method's name +// Command name | Method name // ---------------------------------------- -// State | dev_state() -// Status | dev_status() -// Start | start() -// Stop | stop() -// SetAOScaledData | set_aoscaled_data() +// State | dev_state() +// Status | dev_status() +// Start | start() +// Stop | stop() +// SetAOScaledData | set_aoscaled_data() // //=================================================================== +//#include "ADLinkContinuousAO.h" #include <RetrigAO.h> +#include <RetrigAOClass.h> #include <asl/ASLExceptionsHandler.h> #include <TangoExceptionsHelper.h> #include <asl/AOData.h> #include <math.h> #include <xstring.h> -namespace RetrigAO +namespace RetrigAO_ns { //+---------------------------------------------------------------------------- @@ -95,18 +100,18 @@ namespace RetrigAO // - s : Device name // //----------------------------------------------------------------------------- -RetrigAO::RetrigAO(Tango::DeviceClass *cl,string &s):Tango::Device_2Impl(cl,s.c_str()) +RetrigAO::RetrigAO(Tango::DeviceClass *cl,string &s):Tango::Device_3Impl(cl,s.c_str()) { init_device(); } -RetrigAO::RetrigAO(Tango::DeviceClass *cl,const char *s):Tango::Device_2Impl(cl,s) +RetrigAO::RetrigAO(Tango::DeviceClass *cl,const char *s):Tango::Device_3Impl(cl,s) { init_device(); } RetrigAO::RetrigAO(Tango::DeviceClass *cl,const char *s,const char *d) -:Tango::Device_2Impl(cl,s,d) +:Tango::Device_3Impl(cl,s,d) { init_device(); } @@ -127,42 +132,42 @@ void RetrigAO::delete_device() } if(ch0) { - delete ch0; + delete[] ch0; ch0 = 0; } if(ch1) { - delete ch1; + delete[] ch1; ch1 = 0; } if(ch2) { - delete ch2; + delete[] ch2; ch2 = 0; } if(ch3) { - delete ch3; + delete[] ch3; ch3 = 0; } if(ch4) { - delete ch4; + delete[] ch4; ch4 = 0; } if(ch5) { - delete ch5; + delete[] ch5; ch5 = 0; } if(ch6) { - delete ch6; + delete[] ch6; ch6 = 0; } if(ch7) { - delete ch7; + delete[] ch7; ch7 = 0; } } @@ -187,476 +192,13 @@ void RetrigAO::init_device() ch5 = 0; ch6 = 0; ch7 = 0; - + bufferDepth = 4096; // Initialise variables to default values //-------------------------------------------- get_device_property(); - //- create a continuous analog output daq - ao = new ADLinkContinuousAO(this); - - //- check memory allocation - if (ao == 0) - { - this->set_internal_state(); - Tango::Except::throw_exception( - (const char*)("OUT_OF_MEMORY"), - (const char*)("out of memory error"), - (const char*)("RetrigAO::init_device") - ); - } - - asl::ContinuousAOConfig _config; - ch0 = new double[bufferDepth]; - ch1 = new double[bufferDepth]; - ch2 = new double[bufferDepth]; - ch3 = new double[bufferDepth]; - ch4 = new double[bufferDepth]; - ch5 = new double[bufferDepth]; - ch6 = new double[bufferDepth]; - ch7 = new double[bufferDepth]; - if(ch0 == 0 || ch1 == 0 || ch2 == 0 || ch3 == 0 || ch4 == 0 || ch5 == 0 ||ch6 == 0 || ch7 == 0) - { - this->set_internal_state(); - this->delete_device(); - Tango::Except::throw_exception( - (const char*)("OUT_OF_MEMORY"), - (const char*)("out of memory error"), - (const char*)("RetrigAO::init_device") - ); - } - - - // default waveform for group A (channel 0 to 3) - asl::AOScaledData default_waveformA(bufferDepth); - double max_valA; - if(aORefSource == adl::external_reference) - max_valA = aORefA ; - else - max_valA = 10.0; - - // fill buffer with a sin signal - for (unsigned long i = 0; i < bufferDepth; i++) - { - (default_waveformA)[i] = ::sin((double)i * 2. * 3.14159 / (double) bufferDepth) * max_valA; - } - - ACE_OS::memcpy(this->ch0, default_waveformA.base(), default_waveformA.size()); - ACE_OS::memcpy(this->ch1, default_waveformA.base(), default_waveformA.size()); - ACE_OS::memcpy(this->ch2, default_waveformA.base(), default_waveformA.size()); - ACE_OS::memcpy(this->ch3, default_waveformA.base(), default_waveformA.size()); - - // default waveform for group B (channel 4 to 7) - asl::AOScaledData default_waveformB(bufferDepth); - double max_valB; - if(aORefSource == adl::external_reference) - max_valB = aORefB; - else - max_valB = 10.0; - - // fill buffer with a square signal - for (i = 0; i < bufferDepth/2; i++) - { - default_waveformB[i] = max_valB - 0.01; - } - for (i = bufferDepth/2; i < bufferDepth; i++) - { - default_waveformB[i] = -max_valB + 0.01; - } - ACE_OS::memcpy(this->ch4, default_waveformB.base(), default_waveformB.size()); - ACE_OS::memcpy(this->ch5, default_waveformB.base(), default_waveformB.size()); - ACE_OS::memcpy(this->ch6, default_waveformB.base(), default_waveformB.size()); - ACE_OS::memcpy(this->ch7, default_waveformB.base(), default_waveformB.size()); - - //--------------------------channels config------------------------------------ - asl::ActiveAOChannel ac; - - // configure all channels - ac.polarity = (adl::OutputPolarity)polarity; - ac.volt_ref_src = (adl::VoltageReferenceSource)aORefSource; - ac.volt_ref = 10.0; - - //------active/config. channel 0--------- - if(channel0Enable) - { - ac.id = 0; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefA; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch0[i] = 0; - - this->load_waveform(ch0,"Channel0Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch0[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(0, data); - - /* - if(channel0Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 0, using a default one"<<endl; - _config.set_channel_periodic_data(0, default_waveformA); - } - else if(channel0Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 0 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(0, default_waveformA); - } - else //put waveform of the Tango database in ch0 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel0Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(0, data); - //cpy data in the attribute of the device - ::memcpy(ch0, data.base(), data.size()); - }*/ - - } - //------active/config. channel 1--------- - if(channel1Enable) - { - ac.id = 1; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefA; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch1[i] = 0; - - this->load_waveform(ch1,"Channel1Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch1[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(1, data); - /*if(channel1Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 1, using a default one"<<endl; - _config.set_channel_periodic_data(1, default_waveformA); - } - else if(channel1Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 1 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(1, default_waveformA); - } - else //put waveform of the Tango database in ch1 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel1Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(1, data); - //cpy data in the attribute of the device - ::memcpy(ch1, data.base(), data.size()); - }*/ - } - //------active/config. channel 2--------- - if(channel2Enable) - { - ac.id = 2; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefA; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch2[i] = 0; - - this->load_waveform(ch2,"Channel2Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch2[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(2, data); - - /* if(channel2Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 2, using a default one"<<endl; - _config.set_channel_periodic_data(2, default_waveformA); - } - else if(channel2Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 2 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(2, default_waveformA); - } - else //put waveform of the Tango database in ch2 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel2Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(2, data); - //cpy data in the attribute of the device - ::memcpy(ch2, data.base(), data.size()); - }*/ - } - //------active/config. channel 3--------- - if(channel3Enable) - { - ac.id = 3; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefA; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch3[i] = 0; - this->load_waveform(ch3,"Channel3Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch3[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(3, data); - - /*if(channel3Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 3, using a default one"<<endl; - _config.set_channel_periodic_data(3, default_waveformA); - } - else if(channel3Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 3 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(3, default_waveformA); - } - else //put waveform of the Tango database in ch3 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel3Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(3, data); - //cpy data in the attribute of the device - ::memcpy(ch3, data.base(), data.size()); - }*/ - } - //------active/config. channel 4--------- - if(channel4Enable) - { - ac.id = 4; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefB; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch4[i] = 0; - - this->load_waveform(ch4,"Channel4Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch4[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(4, data); - - /*if(channel4Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 4, using a default one"<<endl; - _config.set_channel_periodic_data(4, default_waveformB); - } - else if(channel4Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 4 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(4, default_waveformB); - } - else //put waveform of the Tango database in ch4 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel4Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(4, data); - //cpy data in the attribute of the device - ::memcpy(ch4, data.base(), data.size()); - }*/ - } - //------active/config. channel 5--------- - if(channel5Enable) - { - ac.id = 5; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefB; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch5[i] = 0; - - this->load_waveform(ch5,"Channel5Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch5[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(5, data); - - /* if(channel5Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 5, using a default one"<<endl; - _config.set_channel_periodic_data(5, default_waveformB); - } - else if(channel5Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 5 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(5, default_waveformB); - } - else //put waveform of the Tango database in ch5 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel5Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(5, data); - //cpy data in the attribute of the device - ::memcpy(ch5, data.base(), data.size()); - }*/ - } - //------active/config. channel 6--------- - if(channel6Enable) - { - ac.id = 6; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefB; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch6[i] = 0; - - this->load_waveform(ch6,"Channel6Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch6[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(6, data); - /*if(channel6Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 6, using a default one"<<endl; - _config.set_channel_periodic_data(6, default_waveformB); - } - else if(channel6Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 6 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(6, default_waveformB); - } - else //put waveform of the Tango database in ch6 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel6Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(6, data); - //cpy data in the attribute of the device - ::memcpy(ch6, data.base(), data.size()); - }*/ - } - //------active/config. channel 7--------- - if(channel7Enable) - { - ac.id = 7; - if(aORefSource == adl::external_reference) - ac.volt_ref = aORefB; - _config.add_active_channel(ac); - - for (int i = 0; i < bufferDepth; i++) - ch7[i] = 0; - - this->load_waveform(ch7,"Channel7Waveform"); - asl::AOScaledData data(bufferDepth); - for(i=0; i<bufferDepth; i++) - data[i] = ch7[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(7, data); - - /* if(channel7Waveform.empty()) - { - WARN_STREAM<<"No waveform is saved in database for channel 7, using a default one"<<endl; - _config.set_channel_periodic_data(7, default_waveformB); - } - else if(channel7Waveform.size() != bufferDepth) - { - WARN_STREAM<<"The waveform saved in database for channel 7 has a different size from property BufferDepth, "<< - "using default waveform"<<endl; - _config.set_channel_periodic_data(7, default_waveformB); - } - else //put waveform of the Tango database in ch7 - { - // copy the input data in a buffer of type asl::AOScaledData - asl::AOScaledData data(bufferDepth); - for(int i=0; i<bufferDepth; i++) - data[i] = channel7Waveform[i]; - // put the waveform in the configuration - _config.set_channel_periodic_data(7, data); - //cpy data in the attribute of the device - }*/ - } - //--------------------------------trigger config--------------------------------- - _config.enable_retrigger(); - - _config.set_trigger_source((adl::AIOTriggerSource)triggerSource); - _config.set_trigger_mode((adl::AOTriggerMode)triggerMode); - _config.set_nb_waveforms(1); - - if(triggerMode == adl::ao_delay) - { - //cout<<"delay: "<<delay<<endl; - _config.set_delay_counter(delay); - } - if(triggerSource == adl::external_digital) - { - _config.set_trigger_polarity((adl::AOTriggerPolarity)dTRIGPolarity); - } - else if(triggerSource == adl::external_analog) - { - _config.set_analog_trigger_source(adl::analog_trigger_ext); - _config.set_analog_trigger_condition((adl::AnalogTriggerCondition)aTRIGSelection); - unsigned short level; - if(aTRIGLevel>=0) - level = (aTRIGLevel / 0.078125) + 127; - else // v < 0 - level = (-aTRIGLevel / 0.078125); - _config.set_analog_low_level_condition(level); - _config.set_analog_high_level_condition(level); - } - - _config.set_output_rate(frequency); - - // configure the conversion source (sampling timer) - _config.set_conversion_source((adl::AOConversionSource)conversionSource); - - //when stop command will be call, the waveform will be generated until its end before stopping - //config.set_stop_mode (adl::wait_end_waveform); - - DEBUG_STREAM<<"RetrigAO::init_device : init acq"<<std::endl; - _ASL_TRY_ACTION - ( - ao->init(adl::DAQ2502, boardNum), - "init", - "RetrigAO::init_device", - this->set_internal_state() - ); + this->init_board(); - this->config = _config; - /*DEBUG_STREAM<<"RetrigAO::init_device : config acq"<<std::endl; - _ASL_TRY_ACTION - ( - ao->configure(_config), - "configure", - "RetrigAO::init_device", - this->set_internal_state() - ); */ } @@ -706,7 +248,6 @@ void RetrigAO::get_device_property() channel6Enable = 0; channel7Enable = 0; - bufferDepth = 4096; double default_delay = 0.001638375; //secs delay = 65535; // counts @@ -717,73 +258,377 @@ void RetrigAO::get_device_property() // Read device properties from database.(Automatic code generation) //------------------------------------------------------------- - Tango::DbData data; - data.push_back(Tango::DbDatum("BoardNum")); - data.push_back(Tango::DbDatum("Frequency")); - data.push_back(Tango::DbDatum("TriggerMode")); - data.push_back(Tango::DbDatum("TriggerSource")); - data.push_back(Tango::DbDatum("ATRIGSelection")); - data.push_back(Tango::DbDatum("ATRIGLevel")); - data.push_back(Tango::DbDatum("DTRIGPolarity")); - data.push_back(Tango::DbDatum("AORefA")); - data.push_back(Tango::DbDatum("AORefB")); - data.push_back(Tango::DbDatum("Polarity")); - data.push_back(Tango::DbDatum("AORefSource")); - data.push_back(Tango::DbDatum("Channel0Enable")); - data.push_back(Tango::DbDatum("Channel1Enable")); - data.push_back(Tango::DbDatum("Channel2Enable")); - data.push_back(Tango::DbDatum("Channel3Enable")); - data.push_back(Tango::DbDatum("Channel4Enable")); - data.push_back(Tango::DbDatum("Channel5Enable")); - data.push_back(Tango::DbDatum("Channel6Enable")); - data.push_back(Tango::DbDatum("Channel7Enable")); - data.push_back(Tango::DbDatum("BufferDepth")); - data.push_back(Tango::DbDatum("Delay")); - data.push_back(Tango::DbDatum("Channel0Waveform")); - data.push_back(Tango::DbDatum("Channel1Waveform")); - data.push_back(Tango::DbDatum("Channel2Waveform")); - data.push_back(Tango::DbDatum("Channel3Waveform")); - data.push_back(Tango::DbDatum("Channel4Waveform")); - data.push_back(Tango::DbDatum("Channel5Waveform")); - data.push_back(Tango::DbDatum("Channel6Waveform")); - data.push_back(Tango::DbDatum("Channel7Waveform")); - data.push_back(Tango::DbDatum("FilePath")); - data.push_back(Tango::DbDatum("ConversionSource")); + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum("BoardNum")); + dev_prop.push_back(Tango::DbDatum("Frequency")); + dev_prop.push_back(Tango::DbDatum("TriggerMode")); + dev_prop.push_back(Tango::DbDatum("TriggerSource")); + dev_prop.push_back(Tango::DbDatum("ATRIGSelection")); + dev_prop.push_back(Tango::DbDatum("ATRIGLevel")); + dev_prop.push_back(Tango::DbDatum("DTRIGPolarity")); + dev_prop.push_back(Tango::DbDatum("AORefA")); + dev_prop.push_back(Tango::DbDatum("AORefB")); + dev_prop.push_back(Tango::DbDatum("Polarity")); + dev_prop.push_back(Tango::DbDatum("AORefSource")); + dev_prop.push_back(Tango::DbDatum("Channel0Enable")); + dev_prop.push_back(Tango::DbDatum("Channel1Enable")); + dev_prop.push_back(Tango::DbDatum("Channel2Enable")); + dev_prop.push_back(Tango::DbDatum("Channel3Enable")); + dev_prop.push_back(Tango::DbDatum("Channel4Enable")); + dev_prop.push_back(Tango::DbDatum("Channel5Enable")); + dev_prop.push_back(Tango::DbDatum("Channel6Enable")); + dev_prop.push_back(Tango::DbDatum("Channel7Enable")); + dev_prop.push_back(Tango::DbDatum("Delay")); + dev_prop.push_back(Tango::DbDatum("Channel0Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel1Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel2Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel3Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel4Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel5Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel6Waveform")); + dev_prop.push_back(Tango::DbDatum("Channel7Waveform")); + dev_prop.push_back(Tango::DbDatum("FilePath")); + dev_prop.push_back(Tango::DbDatum("ConversionSource")); // Call database and extract values //-------------------------------------------- - get_db_device()->get_property(data); - if (data[0].is_empty()==false) data[0] >> boardNum; - if (data[1].is_empty()==false) data[1] >> frequency; - if (data[2].is_empty()==false) data[2] >> triggerMode; - if (data[3].is_empty()==false) data[3] >> triggerSource; - if (data[4].is_empty()==false) data[4] >> aTRIGSelection; - if (data[5].is_empty()==false) data[5] >> aTRIGLevel; - if (data[6].is_empty()==false) data[6] >> dTRIGPolarity; - if (data[7].is_empty()==false) data[7] >> aORefA; - if (data[8].is_empty()==false) data[8] >> aORefB; - if (data[9].is_empty()==false) data[9] >> polarity; - if (data[10].is_empty()==false) data[10] >> aORefSource; - if (data[11].is_empty()==false) data[11] >> channel0Enable; - if (data[12].is_empty()==false) data[12] >> channel1Enable; - if (data[13].is_empty()==false) data[13] >> channel2Enable; - if (data[14].is_empty()==false) data[14] >> channel3Enable; - if (data[15].is_empty()==false) data[15] >> channel4Enable; - if (data[16].is_empty()==false) data[16] >> channel5Enable; - if (data[17].is_empty()==false) data[17] >> channel6Enable; - if (data[18].is_empty()==false) data[18] >> channel7Enable; - if (data[19].is_empty()==false) data[19] >> bufferDepth; - if (data[20].is_empty()==false) data[20] >> delay; - if (data[21].is_empty()==false) data[21] >> channel0Waveform; - if (data[22].is_empty()==false) data[22] >> channel1Waveform; - if (data[23].is_empty()==false) data[23] >> channel2Waveform; - if (data[24].is_empty()==false) data[24] >> channel3Waveform; - if (data[25].is_empty()==false) data[25] >> channel4Waveform; - if (data[26].is_empty()==false) data[26] >> channel5Waveform; - if (data[27].is_empty()==false) data[27] >> channel6Waveform; - if (data[28].is_empty()==false) data[28] >> channel7Waveform; - if (data[29].is_empty()==false) data[29] >> filePath; - if (data[30].is_empty()==false) data[30] >> conversionSource; + if (Tango::Util::instance()->_UseDb==true) + get_db_device()->get_property(dev_prop); + Tango::DbDatum def_prop, cl_prop; + RetrigAOClass *ds_class = + (static_cast<RetrigAOClass *>(get_device_class())); + int i = -1; + + // 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 { + // 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; + } + // And try to extract BoardNum value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> boardNum; + + // Try to initialize Frequency from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> frequency; + else { + // Try to initialize Frequency from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> frequency; + } + // And try to extract Frequency value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> frequency; + + // Try to initialize TriggerMode from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> triggerMode; + else { + // Try to initialize TriggerMode from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> triggerMode; + } + // And try to extract TriggerMode value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> triggerMode; + + // Try to initialize TriggerSource from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> triggerSource; + else { + // Try to initialize TriggerSource from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> triggerSource; + } + // And try to extract TriggerSource value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> triggerSource; + + // Try to initialize ATRIGSelection from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> aTRIGSelection; + else { + // Try to initialize ATRIGSelection from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> aTRIGSelection; + } + // And try to extract ATRIGSelection value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> aTRIGSelection; + + // Try to initialize ATRIGLevel from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> aTRIGLevel; + else { + // Try to initialize ATRIGLevel from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> aTRIGLevel; + } + // And try to extract ATRIGLevel value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> aTRIGLevel; + + // Try to initialize DTRIGPolarity from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> dTRIGPolarity; + else { + // Try to initialize DTRIGPolarity from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> dTRIGPolarity; + } + // And try to extract DTRIGPolarity value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> dTRIGPolarity; + + // Try to initialize AORefA from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> aORefA; + else { + // Try to initialize AORefA from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> aORefA; + } + // And try to extract AORefA value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> aORefA; + + // Try to initialize AORefB from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> aORefB; + else { + // Try to initialize AORefB from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> aORefB; + } + // And try to extract AORefB value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> aORefB; + + // Try to initialize Polarity from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> polarity; + else { + // Try to initialize Polarity from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> polarity; + } + // And try to extract Polarity value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> polarity; + + // Try to initialize AORefSource from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> aORefSource; + else { + // Try to initialize AORefSource from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> aORefSource; + } + // And try to extract AORefSource value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> aORefSource; + + // Try to initialize Channel0Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel0Enable; + else { + // Try to initialize Channel0Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel0Enable; + } + // And try to extract Channel0Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel0Enable; + + // Try to initialize Channel1Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel1Enable; + else { + // Try to initialize Channel1Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel1Enable; + } + // And try to extract Channel1Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel1Enable; + + // Try to initialize Channel2Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel2Enable; + else { + // Try to initialize Channel2Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel2Enable; + } + // And try to extract Channel2Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel2Enable; + + // Try to initialize Channel3Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel3Enable; + else { + // Try to initialize Channel3Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel3Enable; + } + // And try to extract Channel3Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel3Enable; + + // Try to initialize Channel4Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel4Enable; + else { + // Try to initialize Channel4Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel4Enable; + } + // And try to extract Channel4Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel4Enable; + + // Try to initialize Channel5Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel5Enable; + else { + // Try to initialize Channel5Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel5Enable; + } + // And try to extract Channel5Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel5Enable; + + // Try to initialize Channel6Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel6Enable; + else { + // Try to initialize Channel6Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel6Enable; + } + // And try to extract Channel6Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel6Enable; + + // Try to initialize Channel7Enable from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel7Enable; + else { + // Try to initialize Channel7Enable from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel7Enable; + } + // And try to extract Channel7Enable value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel7Enable; + + // Try to initialize Delay from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> delay; + else { + // Try to initialize Delay from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> delay; + } + // And try to extract Delay value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> delay; + + // Try to initialize Channel0Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel0Waveform; + else { + // Try to initialize Channel0Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel0Waveform; + } + // And try to extract Channel0Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel0Waveform; + + // Try to initialize Channel1Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel1Waveform; + else { + // Try to initialize Channel1Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel1Waveform; + } + // And try to extract Channel1Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel1Waveform; + + // Try to initialize Channel2Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel2Waveform; + else { + // Try to initialize Channel2Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel2Waveform; + } + // And try to extract Channel2Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel2Waveform; + + // Try to initialize Channel3Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel3Waveform; + else { + // Try to initialize Channel3Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel3Waveform; + } + // And try to extract Channel3Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel3Waveform; + + // Try to initialize Channel4Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel4Waveform; + else { + // Try to initialize Channel4Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel4Waveform; + } + // And try to extract Channel4Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel4Waveform; + + // Try to initialize Channel5Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel5Waveform; + else { + // Try to initialize Channel5Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel5Waveform; + } + // And try to extract Channel5Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel5Waveform; + + // Try to initialize Channel6Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel6Waveform; + else { + // Try to initialize Channel6Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel6Waveform; + } + // And try to extract Channel6Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel6Waveform; + + // Try to initialize Channel7Waveform from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> channel7Waveform; + else { + // Try to initialize Channel7Waveform from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> channel7Waveform; + } + // And try to extract Channel7Waveform value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> channel7Waveform; + + // Try to initialize FilePath from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> filePath; + else { + // Try to initialize FilePath from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> filePath; + } + // And try to extract FilePath value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> filePath; + + // Try to initialize ConversionSource from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> conversionSource; + else { + // Try to initialize ConversionSource from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> conversionSource; + } + // And try to extract ConversionSource value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> conversionSource; + // End of Automatic code generation @@ -791,10 +636,10 @@ void RetrigAO::get_device_property() Tango::DbData data_put; //------------------------------------------------------------- - if (data[0].is_empty()==false) + if (dev_prop[0].is_empty()==false) { unsigned short bnum; - data[0] >> bnum; + dev_prop[0] >> bnum; //check value if(bnum<0 || bnum>= 7)//num max of boards in chassis { @@ -815,9 +660,9 @@ void RetrigAO::get_device_property() <<boardNum<<endl; } //------------------------------------------------------------- - if (data[1].is_empty()==false) + if (dev_prop[1].is_empty()==false) { - data[1] >> frequency; + dev_prop[1] >> frequency; } else { @@ -828,10 +673,10 @@ void RetrigAO::get_device_property() <<frequency<<endl; } //------------------------------------------------------------- - if (data[2].is_empty()==false) + if (dev_prop[2].is_empty()==false) { string trig; - data[2] >> trig; + dev_prop[2] >> trig; if(trig == "POST") triggerMode = adl::ao_post; else if(trig == "DELAY") @@ -849,10 +694,10 @@ void RetrigAO::get_device_property() <<default_trig_mode<<endl; } //------------------------------------------------------------- - if (data[3].is_empty()==false) + if (dev_prop[3].is_empty()==false) { string trig_src; - data[3] >> trig_src; + dev_prop[3] >> trig_src; if(trig_src == "DTRIG") triggerSource = adl::external_digital; else if(trig_src == "ATRIG") @@ -873,10 +718,10 @@ void RetrigAO::get_device_property() <<default_trig_source<<endl; } //------------------------------------------------------------- - if (data[4].is_empty()==false) + if (dev_prop[4].is_empty()==false) { string atrig_select; - data[4] >> atrig_select; + dev_prop[4] >> atrig_select; if(atrig_select == "BELOW") aTRIGSelection = adl::below_low_level; else if(atrig_select == "ABOVE") @@ -894,9 +739,9 @@ void RetrigAO::get_device_property() <<default_atrig_select<<endl; } //------------------------------------------------------------- - if (data[5].is_empty()==false) + if (dev_prop[5].is_empty()==false) { - data[5] >> aTRIGLevel; + dev_prop[5] >> aTRIGLevel; } else { @@ -907,10 +752,10 @@ void RetrigAO::get_device_property() <<aTRIGLevel<<endl; } //------------------------------------------------------------- - if (data[6].is_empty()==false) + if (dev_prop[6].is_empty()==false) { string dtrig_pol; - data[6] >> dtrig_pol; + dev_prop[6] >> dtrig_pol; if(dtrig_pol == "RISING") dTRIGPolarity = adl::ao_rising_edge; else if(dtrig_pol == "FALLING") @@ -928,10 +773,10 @@ void RetrigAO::get_device_property() <<default_dtrig_pol<<endl; } //------------------------------------------------------------- - if (data[7].is_empty()==false) + if (dev_prop[7].is_empty()==false) { double ref; - data[7] >> ref; + dev_prop[7] >> ref; if(ref >= -10.0 || ref <= 10.0) aORefA = ref; else @@ -947,10 +792,10 @@ void RetrigAO::get_device_property() <<aORefA<<endl; } //------------------------------------------------------------- - if (data[8].is_empty()==false) + if (dev_prop[8].is_empty()==false) { double ref; - data[8] >> ref; + dev_prop[8] >> ref; if(ref >= -10.0 || ref <= 10.0) aORefB = ref; else @@ -966,10 +811,10 @@ void RetrigAO::get_device_property() <<aORefB<<endl; } //------------------------------------------------------------- - if (data[9].is_empty()==false) + if (dev_prop[9].is_empty()==false) { string pol; - data[9] >> pol; + dev_prop[9] >> pol; if(pol == "BP") polarity = adl::bipolar; else if(pol == "UP") @@ -987,10 +832,10 @@ void RetrigAO::get_device_property() <<default_pol<<endl; } //------------------------------------------------------------- - if (data[10].is_empty()==false) + if (dev_prop[10].is_empty()==false) { string aoref; - data[10] >> aoref; + dev_prop[10] >> aoref; if(aoref == "INTERN") aORefSource = adl::internal_reference; else if(aoref == "EXTERN") @@ -1008,9 +853,9 @@ void RetrigAO::get_device_property() <<default_aoref<<endl; } //------------------------------------------------------------- - if (data[11].is_empty()==false) + if (dev_prop[11].is_empty()==false) { - data[11] >> channel0Enable; + dev_prop[11] >> channel0Enable; } else { @@ -1021,9 +866,9 @@ void RetrigAO::get_device_property() <<channel0Enable<<endl; } //------------------------------------------------------------- - if (data[12].is_empty()==false) + if (dev_prop[12].is_empty()==false) { - data[12] >> channel1Enable; + dev_prop[12] >> channel1Enable; } else { @@ -1034,9 +879,9 @@ void RetrigAO::get_device_property() <<channel1Enable<<endl; } //------------------------------------------------------------- - if (data[13].is_empty()==false) + if (dev_prop[13].is_empty()==false) { - data[13] >> channel2Enable; + dev_prop[13] >> channel2Enable; } else { @@ -1047,9 +892,9 @@ void RetrigAO::get_device_property() <<channel2Enable<<endl; } //------------------------------------------------------------- - if (data[14].is_empty()==false) + if (dev_prop[14].is_empty()==false) { - data[14] >> channel3Enable; + dev_prop[14] >> channel3Enable; } else { @@ -1060,9 +905,9 @@ void RetrigAO::get_device_property() <<channel3Enable<<endl; } //------------------------------------------------------------- - if (data[15].is_empty()==false) + if (dev_prop[15].is_empty()==false) { - data[15] >> channel4Enable; + dev_prop[15] >> channel4Enable; } else { @@ -1073,9 +918,9 @@ void RetrigAO::get_device_property() <<channel4Enable<<endl; } //------------------------------------------------------------- - if (data[16].is_empty()==false) + if (dev_prop[16].is_empty()==false) { - data[16] >> channel5Enable; + dev_prop[16] >> channel5Enable; } else { @@ -1086,9 +931,9 @@ void RetrigAO::get_device_property() <<channel5Enable<<endl; } //------------------------------------------------------------- - if (data[17].is_empty()==false) + if (dev_prop[17].is_empty()==false) { - data[17] >> channel6Enable; + dev_prop[17] >> channel6Enable; } else { @@ -1099,9 +944,9 @@ void RetrigAO::get_device_property() <<channel6Enable<<endl; } //------------------------------------------------------------- - if (data[18].is_empty()==false) + if (dev_prop[18].is_empty()==false) { - data[18] >> channel7Enable; + dev_prop[18] >> channel7Enable; } else { @@ -1112,23 +957,10 @@ void RetrigAO::get_device_property() <<channel7Enable<<endl; } //------------------------------------------------------------- - if (data[19].is_empty()==false) - { - data[19] >> bufferDepth; - } - else - { - Tango::DbDatum property("BufferDepth"); - property << bufferDepth; - data_put.push_back(property); - WARN_STREAM<<"BufferDepth property is not set in database, loading default value in database:" - <<bufferDepth<<endl; - } - //------------------------------------------------------------- - if (data[20].is_empty()==false) + if (dev_prop[19].is_empty()==false) { double delay_secs; - data[20] >> delay_secs; + dev_prop[19] >> delay_secs; if(delay_secs * (double)AD2502_CLOCK_FREQ < 1 || delay_secs * (double)AD2502_CLOCK_FREQ >65535) { WARN_STREAM<<"Delay property is not set in database, loading default value in database:" @@ -1148,16 +980,16 @@ void RetrigAO::get_device_property() <<default_delay<<endl; } //------------------------------------------------------------- - if (data[29].is_empty()==false) + if (dev_prop[28].is_empty()==false) { - data[29] >> filePath; + dev_prop[28] >> filePath; } //------------------------------------------------------------- - if (data[30].is_empty()==false) + if (dev_prop[29].is_empty()==false) { string conv; - data[30] >> conv; + dev_prop[29] >> conv; if(conv == "INTERNAL") conversionSource = adl::ao_internal_timer; else if(conv == "EXTSAMPLING") @@ -1174,14 +1006,14 @@ void RetrigAO::get_device_property() WARN_STREAM<<"ConversionSource property is not set in database, loading default value in database:"<<default_conv_src<<endl; } //-----------------------attribute persistancy------------------ - /* if (data[21].is_empty()==false) data[21] >> channel0Waveform; - if (data[22].is_empty()==false) data[22] >> channel1Waveform; - if (data[23].is_empty()==false) data[23] >> channel2Waveform; - if (data[24].is_empty()==false) data[24] >> channel3Waveform; - if (data[25].is_empty()==false) data[25] >> channel4Waveform; - if (data[26].is_empty()==false) data[26] >> channel5Waveform; - if (data[27].is_empty()==false) data[27] >> channel6Waveform; - if (data[28].is_empty()==false) data[28] >> channel7Waveform;*/ + /* if (data[21].is_empty()==false) data[20] >> channel0Waveform; + if (data[22].is_empty()==false) data[21] >> channel1Waveform; + if (data[23].is_empty()==false) data[22] >> channel2Waveform; + if (data[24].is_empty()==false) data[23] >> channel3Waveform; + if (data[25].is_empty()==false) data[24] >> channel4Waveform; + if (data[26].is_empty()==false) data[25] >> channel5Waveform; + if (data[27].is_empty()==false) data[26] >> channel6Waveform; + if (data[28].is_empty()==false) data[27] >> channel7Waveform;*/ //update database for not initiliazed properties get_db_device()->put_property(data_put); @@ -1219,134 +1051,297 @@ void RetrigAO::read_attr_hardware(vector<long> &attr_list) ao->unlock_data(); } +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_bufferDepth +// +// description : Extract real attribute values for bufferDepth acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_bufferDepth(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_bufferDepth(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&bufferDepth); +} //+---------------------------------------------------------------------------- // -// method : RetrigAO::read_attr() +// method : RetrigAO::write_bufferDepth // -// description : Extract real attribute values from -// hardware acquisition result. +// description : Write bufferDepth attribute values to hardware. // //----------------------------------------------------------------------------- -void RetrigAO::read_attr(Tango::Attribute &attr) +void RetrigAO::write_bufferDepth(Tango::WAttribute &attr) { - string &attr_name = attr.get_name(); + DEBUG_STREAM << "RetrigAO::write_bufferDepth(Tango::WAttribute &attr) entering... "<< endl; + attr.get_write_value(bufferDepth); + this->init_board(); +} - DEBUG_STREAM << "In read_attr for attribute " << attr_name << endl; +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_errorCounter +// +// description : Extract real attribute values for errorCounter acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_errorCounter(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_errorCounter(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&err_ctr); +} - // Switch on attribute name - //--------------------------------- - if (attr_name == "channel0") - { - if(channel0Enable) - attr.set_value(ch0, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel1") - { - if(channel1Enable) - attr.set_value(ch1, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel2") - { - if(channel2Enable) - attr.set_value(ch2, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel3") - { - if(channel3Enable) - attr.set_value(ch3, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel4") - { - if(channel4Enable) - attr.set_value(ch4, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel5") - { - if(channel5Enable) - attr.set_value(ch5, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel6") - { - if(channel6Enable) - attr.set_value(ch6, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "channel7") - { - - if(channel7Enable) - attr.set_value(ch7, bufferDepth); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else if (attr_name == "errorCounter") - { - attr.set_value(&err_ctr); - } - else if (attr_name == "useBoardFifo") - { - // the information about data loading on fifo in available only after Start command. - if(this->get_state() == Tango::RUNNING) - attr.set_value(&use_fifo); - else - attr.set_quality(Tango::ATTR_INVALID); - } - else - if (attr_name == "channel0Enable") - { - attr.set_value(&channel0Enable); - } - else - if (attr_name == "channel1Enable") - { - attr.set_value(&channel1Enable); - } - else - if (attr_name == "channel2Enable") - { - attr.set_value(&channel2Enable); - } - else - if (attr_name == "channel3Enable") - { - attr.set_value(&channel3Enable); - } - else - if (attr_name == "channel4Enable") - { - attr.set_value(&channel4Enable); - } - else - if (attr_name == "channel5Enable") - { - attr.set_value(&channel5Enable); - } - else - if (attr_name == "channel6Enable") - { - attr.set_value(&channel6Enable); - } - else - if (attr_name == "channel7Enable") - { - attr.set_value(&channel7Enable); - } +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_useBoardFifo +// +// description : Extract real attribute values for useBoardFifo acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_useBoardFifo(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_useBoardFifo(Tango::Attribute &attr) entering... "<< endl; + // the information about data loading on fifo in available only after Start command. + if(this->get_state() == Tango::RUNNING) + attr.set_value(&use_fifo); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel0Enable +// +// description : Extract real attribute values for channel0Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel0Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel0Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel0Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel1Enable +// +// description : Extract real attribute values for channel1Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel1Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel1Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel1Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel2Enable +// +// description : Extract real attribute values for channel2Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel2Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel2Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel2Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel3Enable +// +// description : Extract real attribute values for channel3Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel3Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel3Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel3Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel4Enable +// +// description : Extract real attribute values for channel4Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel4Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel4Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel4Enable); } +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel5Enable +// +// description : Extract real attribute values for channel5Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel5Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel5Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel5Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel6Enable +// +// description : Extract real attribute values for channel6Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel6Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel6Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel6Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel7Enable +// +// description : Extract real attribute values for channel7Enable acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel7Enable(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel7Enable(Tango::Attribute &attr) entering... "<< endl; + attr.set_value(&channel7Enable); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel0 +// +// description : Extract real attribute values for channel0 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel0(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel0(Tango::Attribute &attr) entering... "<< endl; + if(channel0Enable) + attr.set_value(ch0, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel1 +// +// description : Extract real attribute values for channel1 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel1(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel1(Tango::Attribute &attr) entering... "<< endl; + if(channel1Enable) + attr.set_value(ch1, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel2 +// +// description : Extract real attribute values for channel2 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel2(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel2(Tango::Attribute &attr) entering... "<< endl; + if(channel2Enable) + attr.set_value(ch2, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel3 +// +// description : Extract real attribute values for channel3 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel3(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel3(Tango::Attribute &attr) entering... "<< endl; + if(channel3Enable) + attr.set_value(ch3, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel4 +// +// description : Extract real attribute values for channel4 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel4(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel4(Tango::Attribute &attr) entering... "<< endl; + if(channel4Enable) + attr.set_value(ch4, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel5 +// +// description : Extract real attribute values for channel5 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel5(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel5(Tango::Attribute &attr) entering... "<< endl; + if(channel5Enable) + attr.set_value(ch5, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel6 +// +// description : Extract real attribute values for channel6 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel6(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel6(Tango::Attribute &attr) entering... "<< endl; + if(channel6Enable) + attr.set_value(ch6, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAO::read_channel7 +// +// description : Extract real attribute values for channel7 acquisition result. +// +//----------------------------------------------------------------------------- +void RetrigAO::read_channel7(Tango::Attribute &attr) +{ + DEBUG_STREAM << "RetrigAO::read_channel7(Tango::Attribute &attr) entering... "<< endl; + + if(channel7Enable) + attr.set_value(ch7, bufferDepth); + else + attr.set_quality(Tango::ATTR_INVALID); +} + + //+------------------------------------------------------------------ /** * method: RetrigAO::start @@ -1488,6 +1483,482 @@ void RetrigAO::stop_with_zero_forcing() this->set_internal_state() ); } + +//+------------------------------------------------------------------ +/** + * method: RetrigAI::init_board + */ +//+------------------------------------------------------------------ +void RetrigAO::init_board(void) +{ + + this->delete_device(); + //- create a continuous analog output daq + ao = new ADLinkContinuousAO(this); + + //- check memory allocation + if (ao == 0) + { + this->set_internal_state(); + Tango::Except::throw_exception( + (const char*)("OUT_OF_MEMORY"), + (const char*)("out of memory error"), + (const char*)("RetrigAO::init_device") + ); + } + + asl::ContinuousAOConfig _config; + ch0 = new double[bufferDepth]; + ch1 = new double[bufferDepth]; + ch2 = new double[bufferDepth]; + ch3 = new double[bufferDepth]; + ch4 = new double[bufferDepth]; + ch5 = new double[bufferDepth]; + ch6 = new double[bufferDepth]; + ch7 = new double[bufferDepth]; + if(ch0 == 0 || ch1 == 0 || ch2 == 0 || ch3 == 0 || ch4 == 0 || ch5 == 0 ||ch6 == 0 || ch7 == 0) + { + this->set_internal_state(); + this->delete_device(); + Tango::Except::throw_exception( + (const char*)("OUT_OF_MEMORY"), + (const char*)("out of memory error"), + (const char*)("RetrigAO::init_device") + ); + } + + + // default waveform for group A (channel 0 to 3) + asl::AOScaledData default_waveformA(bufferDepth); + double max_valA; + if(aORefSource == adl::external_reference) + max_valA = aORefA ; + else + max_valA = 10.0; + + // fill buffer with a sin signal + for (unsigned long i = 0; i < bufferDepth; i++) + { + (default_waveformA)[i] = ::sin((double)i * 2. * 3.14159 / (double) bufferDepth) * max_valA; + } + + ACE_OS::memcpy(this->ch0, default_waveformA.base(), default_waveformA.size()); + ACE_OS::memcpy(this->ch1, default_waveformA.base(), default_waveformA.size()); + ACE_OS::memcpy(this->ch2, default_waveformA.base(), default_waveformA.size()); + ACE_OS::memcpy(this->ch3, default_waveformA.base(), default_waveformA.size()); + + // default waveform for group B (channel 4 to 7) + asl::AOScaledData default_waveformB(bufferDepth); + double max_valB; + if(aORefSource == adl::external_reference) + max_valB = aORefB; + else + max_valB = 10.0; + + // fill buffer with a square signal + for (i = 0; i < bufferDepth/2; i++) + { + default_waveformB[i] = max_valB - 0.01; + } + for (i = bufferDepth/2; i < bufferDepth; i++) + { + default_waveformB[i] = -max_valB + 0.01; + } + ACE_OS::memcpy(this->ch4, default_waveformB.base(), default_waveformB.size()); + ACE_OS::memcpy(this->ch5, default_waveformB.base(), default_waveformB.size()); + ACE_OS::memcpy(this->ch6, default_waveformB.base(), default_waveformB.size()); + ACE_OS::memcpy(this->ch7, default_waveformB.base(), default_waveformB.size()); + + //--------------------------channels config------------------------------------ + asl::ActiveAOChannel ac; + + // configure all channels + ac.polarity = (adl::OutputPolarity)polarity; + ac.volt_ref_src = (adl::VoltageReferenceSource)aORefSource; + ac.volt_ref = 10.0; + + //------active/config. channel 0--------- + if(channel0Enable) + { + ac.id = 0; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefA; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch0[i] = 0; + + this->load_waveform(ch0,"Channel0Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch0[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(0, data); + + /* + if(channel0Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 0, using a default one"<<endl; + _config.set_channel_periodic_data(0, default_waveformA); + } + else if(channel0Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 0 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(0, default_waveformA); + } + else //put waveform of the Tango database in ch0 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel0Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(0, data); + //cpy data in the attribute of the device + ::memcpy(ch0, data.base(), data.size()); + }*/ + + } + //------active/config. channel 1--------- + if(channel1Enable) + { + ac.id = 1; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefA; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch1[i] = 0; + + this->load_waveform(ch1,"Channel1Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch1[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(1, data); + /*if(channel1Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 1, using a default one"<<endl; + _config.set_channel_periodic_data(1, default_waveformA); + } + else if(channel1Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 1 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(1, default_waveformA); + } + else //put waveform of the Tango database in ch1 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel1Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(1, data); + //cpy data in the attribute of the device + ::memcpy(ch1, data.base(), data.size()); + }*/ + } + //------active/config. channel 2--------- + if(channel2Enable) + { + ac.id = 2; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefA; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch2[i] = 0; + + this->load_waveform(ch2,"Channel2Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch2[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(2, data); + + /* if(channel2Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 2, using a default one"<<endl; + _config.set_channel_periodic_data(2, default_waveformA); + } + else if(channel2Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 2 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(2, default_waveformA); + } + else //put waveform of the Tango database in ch2 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel2Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(2, data); + //cpy data in the attribute of the device + ::memcpy(ch2, data.base(), data.size()); + }*/ + } + //------active/config. channel 3--------- + if(channel3Enable) + { + ac.id = 3; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefA; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch3[i] = 0; + this->load_waveform(ch3,"Channel3Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch3[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(3, data); + + /*if(channel3Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 3, using a default one"<<endl; + _config.set_channel_periodic_data(3, default_waveformA); + } + else if(channel3Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 3 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(3, default_waveformA); + } + else //put waveform of the Tango database in ch3 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel3Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(3, data); + //cpy data in the attribute of the device + ::memcpy(ch3, data.base(), data.size()); + }*/ + } + //------active/config. channel 4--------- + if(channel4Enable) + { + ac.id = 4; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefB; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch4[i] = 0; + + this->load_waveform(ch4,"Channel4Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch4[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(4, data); + + /*if(channel4Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 4, using a default one"<<endl; + _config.set_channel_periodic_data(4, default_waveformB); + } + else if(channel4Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 4 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(4, default_waveformB); + } + else //put waveform of the Tango database in ch4 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel4Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(4, data); + //cpy data in the attribute of the device + ::memcpy(ch4, data.base(), data.size()); + }*/ + } + //------active/config. channel 5--------- + if(channel5Enable) + { + ac.id = 5; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefB; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch5[i] = 0; + + this->load_waveform(ch5,"Channel5Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch5[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(5, data); + + /* if(channel5Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 5, using a default one"<<endl; + _config.set_channel_periodic_data(5, default_waveformB); + } + else if(channel5Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 5 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(5, default_waveformB); + } + else //put waveform of the Tango database in ch5 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel5Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(5, data); + //cpy data in the attribute of the device + ::memcpy(ch5, data.base(), data.size()); + }*/ + } + //------active/config. channel 6--------- + if(channel6Enable) + { + ac.id = 6; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefB; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch6[i] = 0; + + this->load_waveform(ch6,"Channel6Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch6[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(6, data); + /*if(channel6Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 6, using a default one"<<endl; + _config.set_channel_periodic_data(6, default_waveformB); + } + else if(channel6Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 6 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(6, default_waveformB); + } + else //put waveform of the Tango database in ch6 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel6Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(6, data); + //cpy data in the attribute of the device + ::memcpy(ch6, data.base(), data.size()); + }*/ + } + //------active/config. channel 7--------- + if(channel7Enable) + { + ac.id = 7; + if(aORefSource == adl::external_reference) + ac.volt_ref = aORefB; + _config.add_active_channel(ac); + + for (int i = 0; i < bufferDepth; i++) + ch7[i] = 0; + + this->load_waveform(ch7,"Channel7Waveform"); + asl::AOScaledData data(bufferDepth); + for(i=0; i<bufferDepth; i++) + data[i] = ch7[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(7, data); + + /* if(channel7Waveform.empty()) + { + WARN_STREAM<<"No waveform is saved in database for channel 7, using a default one"<<endl; + _config.set_channel_periodic_data(7, default_waveformB); + } + else if(channel7Waveform.size() != bufferDepth) + { + WARN_STREAM<<"The waveform saved in database for channel 7 has a different size from property BufferDepth, "<< + "using default waveform"<<endl; + _config.set_channel_periodic_data(7, default_waveformB); + } + else //put waveform of the Tango database in ch7 + { + // copy the input data in a buffer of type asl::AOScaledData + asl::AOScaledData data(bufferDepth); + for(int i=0; i<bufferDepth; i++) + data[i] = channel7Waveform[i]; + // put the waveform in the configuration + _config.set_channel_periodic_data(7, data); + //cpy data in the attribute of the device + }*/ + } + //--------------------------------trigger config--------------------------------- + _config.enable_retrigger(); + + _config.set_trigger_source((adl::AIOTriggerSource)triggerSource); + _config.set_trigger_mode((adl::AOTriggerMode)triggerMode); + _config.set_nb_waveforms(1); + + if(triggerMode == adl::ao_delay) + { + //cout<<"delay: "<<delay<<endl; + _config.set_delay_counter(delay); + } + if(triggerSource == adl::external_digital) + { + _config.set_trigger_polarity((adl::AOTriggerPolarity)dTRIGPolarity); + } + else if(triggerSource == adl::external_analog) + { + _config.set_analog_trigger_source(adl::analog_trigger_ext); + _config.set_analog_trigger_condition((adl::AnalogTriggerCondition)aTRIGSelection); + unsigned short level; + if(aTRIGLevel>=0) + level = (aTRIGLevel / 0.078125) + 127; + else // v < 0 + level = (-aTRIGLevel / 0.078125); + _config.set_analog_low_level_condition(level); + _config.set_analog_high_level_condition(level); + } + + _config.set_output_rate(frequency); + + // configure the conversion source (sampling timer) + _config.set_conversion_source((adl::AOConversionSource)conversionSource); + + //when stop command will be call, the waveform will be generated until its end before stopping + //config.set_stop_mode (adl::wait_end_waveform); + + DEBUG_STREAM<<"RetrigAO::init_device : init acq"<<std::endl; + _ASL_TRY_ACTION + ( + ao->init(adl::DAQ2502, boardNum), + "init", + "RetrigAO::init_device", + this->set_internal_state() + ); + + this->config = _config; + /*DEBUG_STREAM<<"RetrigAO::init_device : config acq"<<std::endl; + _ASL_TRY_ACTION + ( + ao->configure(_config), + "configure", + "RetrigAO::init_device", + this->set_internal_state() + ); */ +} //+------------------------------------------------------------------ /** * method: RetrigAO::set_aoscaled_data @@ -1800,4 +2271,9 @@ void RetrigAO::load_waveform(double* waveform, string wfm_channel) INFO_STREAM << "Data retrieved"<<wfm_channel<<" in file "<<file_name<< endl; } + + + + + } // namespace diff --git a/src/RetrigAO.h b/src/RetrigAO.h index b2713d2b54c240ff30b7b803648e970f7c7b1821..e6c5a28ace68d314996f01a2bcaa4d48f4f91d98 100644 --- a/src/RetrigAO.h +++ b/src/RetrigAO.h @@ -6,11 +6,14 @@ // // project : Retriggered Continuous Anolog Output // -// $Author: flanglois $ +// $Author: anoureddine $ // -// $Revision: 1.7 $ +// $Revision: 1.8 $ // // $Log: not supported by cvs2svn $ +// Revision 1.7 2009/07/31 06:53:51 flanglois +// - support external sampling (conversionSource) +// // Revision 1.6 2007/06/25 10:19:06 abeilleg // save data in files+bug fix on config cpy // @@ -50,17 +53,17 @@ //using namespace Tango; - +//class ADLinkContinuousAO; /** - * @author $Author: flanglois $ - * @version $Revision: 1.7 $ $ + * @author $Author: anoureddine $ + * @version $Revision: 1.8 $ $ */ // Add your own constants definitions here. //----------------------------------------------- -namespace RetrigAO +namespace RetrigAO_ns { /** @@ -70,14 +73,14 @@ namespace RetrigAO /* * Device States Description: - * Tango::UNKNOWN : - * Tango::STANDBY : - * Tango::RUNNING : - * Tango::FAULT : +* Tango::UNKNOWN : +* Tango::STANDBY : +* Tango::RUNNING : +* Tango::FAULT : */ -class RetrigAO: public Tango::Device_2Impl +class RetrigAO: public Tango::Device_3Impl { public : // Add your own data members here @@ -91,14 +94,8 @@ public : * Attributs member data. */ //@{ - Tango::DevDouble *attr_channel0_read; - Tango::DevDouble *attr_channel1_read; - Tango::DevDouble *attr_channel2_read; - Tango::DevDouble *attr_channel3_read; - Tango::DevDouble *attr_channel4_read; - Tango::DevDouble *attr_channel5_read; - Tango::DevDouble *attr_channel6_read; - Tango::DevDouble *attr_channel7_read; + Tango::DevUShort *attr_bufferDepth_read; + Tango::DevUShort attr_bufferDepth_write; Tango::DevDouble *attr_errorCounter_read; Tango::DevShort *attr_useBoardFifo_read; Tango::DevShort *attr_channel0Enable_read; @@ -109,6 +106,14 @@ public : Tango::DevShort *attr_channel5Enable_read; Tango::DevShort *attr_channel6Enable_read; Tango::DevShort *attr_channel7Enable_read; + Tango::DevDouble *attr_channel0_read; + Tango::DevDouble *attr_channel1_read; + Tango::DevDouble *attr_channel2_read; + Tango::DevDouble *attr_channel3_read; + Tango::DevDouble *attr_channel4_read; + Tango::DevDouble *attr_channel5_read; + Tango::DevDouble *attr_channel6_read; + Tango::DevDouble *attr_channel7_read; //@} /** @@ -195,10 +200,6 @@ public : * 1 if enable channel 7, 0 otherwise. */ Tango::DevShort channel7Enable; -/** - * The buffer depth for <b>one channel</b> - */ - Tango::DevUShort bufferDepth; /** * If trigger mode is delay, configure the delay in seconds. */ @@ -255,14 +256,14 @@ public : * @param cl Class. * @param s Device Name */ - RetrigAO(Tango::DeviceClass *,string &); + RetrigAO(Tango::DeviceClass *cl,string &s); /** * Constructs a newly allocated Command object. * * @param cl Class. * @param s Device Name */ - RetrigAO(Tango::DeviceClass *,const char *); + RetrigAO(Tango::DeviceClass *cl,const char *s); /** * Constructs a newly allocated Command object. * @@ -270,7 +271,7 @@ public : * @param s Device name * @param d Device description. */ - RetrigAO(Tango::DeviceClass *,const char *,const char *); + RetrigAO(Tango::DeviceClass *cl,const char *s,const char *d); //@} /**@name Destructor @@ -310,9 +311,173 @@ public : */ virtual void read_attr_hardware(vector<long> &attr_list); /** - * Extract real attribute values from hardware acquisition result. + * Extract real attribute values for bufferDepth acquisition result. + */ + virtual void read_bufferDepth(Tango::Attribute &attr); +/** + * Write bufferDepth attribute values to hardware. + */ + virtual void write_bufferDepth(Tango::WAttribute &attr); +/** + * Extract real attribute values for errorCounter acquisition result. + */ + virtual void read_errorCounter(Tango::Attribute &attr); +/** + * Extract real attribute values for useBoardFifo acquisition result. + */ + virtual void read_useBoardFifo(Tango::Attribute &attr); +/** + * Extract real attribute values for channel0Enable acquisition result. + */ + virtual void read_channel0Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel1Enable acquisition result. + */ + virtual void read_channel1Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel2Enable acquisition result. + */ + virtual void read_channel2Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel3Enable acquisition result. + */ + virtual void read_channel3Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel4Enable acquisition result. + */ + virtual void read_channel4Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel5Enable acquisition result. + */ + virtual void read_channel5Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel6Enable acquisition result. + */ + virtual void read_channel6Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel7Enable acquisition result. + */ + virtual void read_channel7Enable(Tango::Attribute &attr); +/** + * Extract real attribute values for channel0 acquisition result. + */ + virtual void read_channel0(Tango::Attribute &attr); +/** + * Extract real attribute values for channel1 acquisition result. + */ + virtual void read_channel1(Tango::Attribute &attr); +/** + * Extract real attribute values for channel2 acquisition result. + */ + virtual void read_channel2(Tango::Attribute &attr); +/** + * Extract real attribute values for channel3 acquisition result. + */ + virtual void read_channel3(Tango::Attribute &attr); +/** + * Extract real attribute values for channel4 acquisition result. + */ + virtual void read_channel4(Tango::Attribute &attr); +/** + * Extract real attribute values for channel5 acquisition result. + */ + virtual void read_channel5(Tango::Attribute &attr); +/** + * Extract real attribute values for channel6 acquisition result. + */ + virtual void read_channel6(Tango::Attribute &attr); +/** + * Extract real attribute values for channel7 acquisition result. + */ + virtual void read_channel7(Tango::Attribute &attr); +/** + * Read/Write allowed for bufferDepth attribute. + */ + virtual bool is_bufferDepth_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for errorCounter attribute. + */ + virtual bool is_errorCounter_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for useBoardFifo attribute. + */ + virtual bool is_useBoardFifo_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel0Enable attribute. + */ + virtual bool is_channel0Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel1Enable attribute. + */ + virtual bool is_channel1Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel2Enable attribute. + */ + virtual bool is_channel2Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel3Enable attribute. + */ + virtual bool is_channel3Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel4Enable attribute. + */ + virtual bool is_channel4Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel5Enable attribute. + */ + virtual bool is_channel5Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel6Enable attribute. + */ + virtual bool is_channel6Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel7Enable attribute. + */ + virtual bool is_channel7Enable_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel0 attribute. + */ + virtual bool is_channel0_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel1 attribute. + */ + virtual bool is_channel1_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel2 attribute. + */ + virtual bool is_channel2_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel3 attribute. + */ + virtual bool is_channel3_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel4 attribute. + */ + virtual bool is_channel4_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel5 attribute. + */ + virtual bool is_channel5_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel6 attribute. + */ + virtual bool is_channel6_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for channel7 attribute. + */ + virtual bool is_channel7_allowed(Tango::AttReqType type); +/** + * Execution allowed for Start command. + */ + virtual bool is_Start_allowed(const CORBA::Any &any); +/** + * Execution allowed for Stop command. + */ + virtual bool is_Stop_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetAOScaledData command. */ - virtual void read_attr(Tango::Attribute &attr); + virtual bool is_SetAOScaledData_allowed(const CORBA::Any &any); /** * start the generation. * @exception DevFailed @@ -355,8 +520,10 @@ protected : double* ch7; double err_ctr; short use_fifo; + unsigned short bufferDepth; void save_waveform(double* waveform, string wfm_channel); void load_waveform(double* waveform, string wfm_channel); + void init_board(void); asl::ContinuousAOConfig config; asl::ContinuousAOConfig stop_config; }; diff --git a/src/RetrigAOClass.cpp b/src/RetrigAOClass.cpp index 8b702a33c283618a85ce17a36efe672f1690e873..4aa805f9038285fbb388ee59d95fb6f72a12d53d 100644 --- a/src/RetrigAOClass.cpp +++ b/src/RetrigAOClass.cpp @@ -1,4 +1,4 @@ -static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAOClass.cpp,v 1.2 2005-06-15 09:18:01 abeilleg Exp $"; +static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/RetrigAO/src/RetrigAOClass.cpp,v 1.3 2009-09-16 08:10:54 anoureddine Exp $"; static const char *TagName = "$Name: not supported by cvs2svn $"; @@ -18,11 +18,14 @@ static const char *RCSfile = "$RCSfile: RetrigAOClass.cpp,v $"; // // project : TANGO Device Server // -// $Author: abeilleg $ +// $Author: anoureddine $ // -// $Revision: 1.2 $ +// $Revision: 1.3 $ // // $Log: not supported by cvs2svn $ +// Revision 1.2 2005/06/15 09:18:01 abeilleg +// attributes channelXEnable added. +// // Revision 1.1.1.1 2004/12/06 10:23:38 syldup // initial import // @@ -45,63 +48,10 @@ static const char *RCSfile = "$RCSfile: RetrigAOClass.cpp,v $"; #include <RetrigAOClass.h> -namespace RetrigAO +namespace RetrigAO_ns { -//+---------------------------------------------------------------------------- -// -// method : StartCmd::StartCmd() -// -// description : constructor for the command of the RetrigAO. -// -// In : - name : The command name -// - in : The input parameter type -// - out : The output parameter type -// - in_desc : The input parameter description -// - out_desc : The output parameter description -// -//----------------------------------------------------------------------------- -StartCmd::StartCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) -:Command(name,in,out,in_desc,out_desc, level) -{ -} -// -// Constructor without in/out parameters description -// -StartCmd::StartCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) -:Command(name,in,out) -{ -} -//+---------------------------------------------------------------------------- -// -// method : StartCmd::is_allowed() -// -// description : method to test whether command is allowed or not in this -// state. In this case, the command is allowed only if -// the device is in ON state -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : boolean - true == is allowed , false == not allowed -// -//----------------------------------------------------------------------------- -bool StartCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- // // method : StartCmd::execute() // @@ -117,7 +67,7 @@ bool StartCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any) CORBA::Any *StartCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { - cout2 << "DevTemplateCmd::execute(): arrived" << endl; + cout2 << "StartCmd::execute(): arrived" << endl; ((static_cast<RetrigAO *>(device))->start()); return new CORBA::Any(); @@ -125,59 +75,6 @@ CORBA::Any *StartCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any -//+---------------------------------------------------------------------------- -// -// method : StopCmd::StopCmd() -// -// description : constructor for the command of the RetrigAO. -// -// In : - name : The command name -// - in : The input parameter type -// - out : The output parameter type -// - in_desc : The input parameter description -// - out_desc : The output parameter description -// -//----------------------------------------------------------------------------- -StopCmd::StopCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) -:Command(name,in,out,in_desc,out_desc, level) -{ -} -// -// Constructor without in/out parameters description -// -StopCmd::StopCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) -:Command(name,in,out) -{ -} -//+---------------------------------------------------------------------------- -// -// method : StopCmd::is_allowed() -// -// description : method to test whether command is allowed or not in this -// state. In this case, the command is allowed only if -// the device is in ON state -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : boolean - true == is allowed , false == not allowed -// -//----------------------------------------------------------------------------- -bool StopCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- // // method : StopCmd::execute() // @@ -193,66 +90,13 @@ bool StopCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any) CORBA::Any *StopCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { - cout2 << "DevTemplateCmd::execute(): arrived" << endl; + cout2 << "StopCmd::execute(): arrived" << endl; ((static_cast<RetrigAO *>(device))->stop()); return new CORBA::Any(); } -//+---------------------------------------------------------------------------- -// -// method : SetAOScaledDataCmd::SetAOScaledDataCmd() -// -// description : constructor for the command of the RetrigAO. -// -// In : - name : The command name -// - in : The input parameter type -// - out : The output parameter type -// - in_desc : The input parameter description -// - out_desc : The output parameter description -// -//----------------------------------------------------------------------------- -SetAOScaledDataCmd::SetAOScaledDataCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out, - const char *in_desc, - const char *out_desc, - Tango::DispLevel level) -:Command(name,in,out,in_desc,out_desc, level) -{ -} -// -// Constructor without in/out parameters description -// -SetAOScaledDataCmd::SetAOScaledDataCmd( const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) -:Command(name,in,out) -{ -} -//+---------------------------------------------------------------------------- -// -// method : SetAOScaledDataCmd::is_allowed() -// -// description : method to test whether command is allowed or not in this -// state. In this case, the command is allowed only if -// the device is in ON state -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : boolean - true == is allowed , false == not allowed -// -//----------------------------------------------------------------------------- -bool SetAOScaledDataCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any &in_any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} - //+---------------------------------------------------------------------------- // // method : SetAOScaledDataCmd::execute() @@ -269,7 +113,7 @@ bool SetAOScaledDataCmd::is_allowed(Tango::DeviceImpl *device, const CORBA::Any CORBA::Any *SetAOScaledDataCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) { - cout2 << "DevTemplateCmd::execute(): arrived" << endl; + cout2 << "SetAOScaledDataCmd::execute(): arrived" << endl; const Tango::DevVarDoubleStringArray *argin; extract(in_any, argin); @@ -298,6 +142,8 @@ RetrigAOClass::RetrigAOClass(string &s):DeviceClass(s) { cout2 << "Entering RetrigAOClass constructor" << endl; + set_default_property(); + get_class_property(); write_class_property(); cout2 << "Leaving RetrigAOClass constructor" << endl; @@ -384,6 +230,54 @@ void RetrigAOClass::command_factory() } } +//+---------------------------------------------------------------------------- +// +// method : RetrigAOClass::get_class_property +// +// description : Get the class property for specified name. +// +// in : string name : The property name +// +//+---------------------------------------------------------------------------- +Tango::DbDatum RetrigAOClass::get_class_property(string &prop_name) +{ + for (unsigned int i=0 ; i<cl_prop.size() ; i++) + if (cl_prop[i].name == prop_name) + return cl_prop[i]; + // if not found, return an empty DbDatum + return Tango::DbDatum(prop_name); +} +//+---------------------------------------------------------------------------- +// +// method : RetrigAOClass::get_default_device_property() +// +// description : Return the default value for device property. +// +//----------------------------------------------------------------------------- +Tango::DbDatum RetrigAOClass::get_default_device_property(string &prop_name) +{ + for (unsigned int i=0 ; i<dev_def_prop.size() ; i++) + if (dev_def_prop[i].name == prop_name) + return dev_def_prop[i]; + // if not found, return an empty DbDatum + return Tango::DbDatum(prop_name); +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAOClass::get_default_class_property() +// +// description : Return the default value for class property. +// +//----------------------------------------------------------------------------- +Tango::DbDatum RetrigAOClass::get_default_class_property(string &prop_name) +{ + for (unsigned int i=0 ; i<cl_def_prop.size() ; i++) + if (cl_def_prop[i].name == prop_name) + return cl_def_prop[i]; + // if not found, return an empty DbDatum + return Tango::DbDatum(prop_name); +} //+---------------------------------------------------------------------------- // // method : RetrigAOClass::device_factory @@ -396,190 +290,565 @@ void RetrigAOClass::command_factory() //----------------------------------------------------------------------------- void RetrigAOClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) { - - for (long i=0 ; i < devlist_ptr->length() ; i++) + + // Create all devices.(Automatic code generation) + //------------------------------------------------------------- + for (unsigned long i=0 ; i < devlist_ptr->length() ; i++) { cout4 << "Device name : " << (*devlist_ptr)[i].in() << endl; - // Create device and add it into the device list + // Create devices and add it into the device list //---------------------------------------------------- device_list.push_back(new RetrigAO(this, (*devlist_ptr)[i])); // Export device to the outside world - // Check before id database used. + // Check before if database used. //--------------------------------------------- - if (Tango::Util::_UseDb == true) + if ((Tango::Util::_UseDb == true) && (Tango::Util::_FileDb == false)) export_device(device_list.back()); else export_device(device_list.back(), (*devlist_ptr)[i]); } + // End of Automatic code generation + //------------------------------------------------------------- + } //+---------------------------------------------------------------------------- // Method: RetrigAOClass::attribute_factory(vector<Tango::Attr *> &att_list) //----------------------------------------------------------------------------- void RetrigAOClass::attribute_factory(vector<Tango::Attr *> &att_list) { + // Attribute : bufferDepth + bufferDepthAttrib *buffer_depth = new bufferDepthAttrib(); + Tango::UserDefaultAttrProp buffer_depth_prop; + buffer_depth_prop.set_label("buffer Depth"); + buffer_depth_prop.set_description("The buffer depth for <b>one channel</b>"); + buffer_depth->set_default_properties(buffer_depth_prop); + buffer_depth->set_memorized(); + buffer_depth->set_memorized_init(true); + att_list.push_back(buffer_depth); + + // Attribute : errorCounter + errorCounterAttrib *error_counter = new errorCounterAttrib(); + att_list.push_back(error_counter); + + // Attribute : useBoardFifo + useBoardFifoAttrib *use_board_fifo = new useBoardFifoAttrib(); + att_list.push_back(use_board_fifo); + + // Attribute : channel0Enable + channel0EnableAttrib *channel0_enable = new channel0EnableAttrib(); + att_list.push_back(channel0_enable); + + // Attribute : channel1Enable + channel1EnableAttrib *channel1_enable = new channel1EnableAttrib(); + att_list.push_back(channel1_enable); + + // Attribute : channel2Enable + channel2EnableAttrib *channel2_enable = new channel2EnableAttrib(); + att_list.push_back(channel2_enable); + + // Attribute : channel3Enable + channel3EnableAttrib *channel3_enable = new channel3EnableAttrib(); + att_list.push_back(channel3_enable); + + // Attribute : channel4Enable + channel4EnableAttrib *channel4_enable = new channel4EnableAttrib(); + att_list.push_back(channel4_enable); + + // Attribute : channel5Enable + channel5EnableAttrib *channel5_enable = new channel5EnableAttrib(); + att_list.push_back(channel5_enable); + + // Attribute : channel6Enable + channel6EnableAttrib *channel6_enable = new channel6EnableAttrib(); + att_list.push_back(channel6_enable); + + // Attribute : channel7Enable + channel7EnableAttrib *channel7_enable = new channel7EnableAttrib(); + att_list.push_back(channel7_enable); + // Attribute : channel0 - Tango::SpectrumAttr *channel0 = - new Tango::SpectrumAttr("channel0", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel0_prop; - channel0_prop.set_label("channel0"); - channel0_prop.set_unit("volts"); - channel0->set_default_properties(channel0_prop); + channel0Attrib *channel0 = new channel0Attrib(); att_list.push_back(channel0); // Attribute : channel1 - Tango::SpectrumAttr *channel1 = - new Tango::SpectrumAttr("channel1", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel1_prop; - channel1_prop.set_label("channel1"); - channel1_prop.set_unit("volts"); - channel1->set_default_properties(channel1_prop); + channel1Attrib *channel1 = new channel1Attrib(); att_list.push_back(channel1); // Attribute : channel2 - Tango::SpectrumAttr *channel2 = - new Tango::SpectrumAttr("channel2", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel2_prop; - channel2_prop.set_label("channel2"); - channel2_prop.set_unit("volts"); - channel2->set_default_properties(channel2_prop); + channel2Attrib *channel2 = new channel2Attrib(); att_list.push_back(channel2); // Attribute : channel3 - Tango::SpectrumAttr *channel3 = - new Tango::SpectrumAttr("channel3", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel3_prop; - channel3_prop.set_label("channel3"); - channel3->set_default_properties(channel3_prop); + channel3Attrib *channel3 = new channel3Attrib(); att_list.push_back(channel3); // Attribute : channel4 - Tango::SpectrumAttr *channel4 = - new Tango::SpectrumAttr("channel4", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel4_prop; - channel4_prop.set_label("channel4"); - channel4_prop.set_unit("volts"); - channel4->set_default_properties(channel4_prop); + channel4Attrib *channel4 = new channel4Attrib(); att_list.push_back(channel4); // Attribute : channel5 - Tango::SpectrumAttr *channel5 = - new Tango::SpectrumAttr("channel5", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel5_prop; - channel5_prop.set_label("channel"); - channel5_prop.set_unit("volts"); - channel5->set_default_properties(channel5_prop); + channel5Attrib *channel5 = new channel5Attrib(); att_list.push_back(channel5); // Attribute : channel6 - Tango::SpectrumAttr *channel6 = - new Tango::SpectrumAttr("channel6", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel6_prop; - channel6_prop.set_label("channel6"); - channel6_prop.set_unit("volts"); - channel6->set_default_properties(channel6_prop); + channel6Attrib *channel6 = new channel6Attrib(); att_list.push_back(channel6); // Attribute : channel7 - Tango::SpectrumAttr *channel7 = - new Tango::SpectrumAttr("channel7", Tango::DEV_DOUBLE, 1000000); - Tango::UserDefaultAttrProp channel7_prop; - channel7_prop.set_label("channel7"); - channel7_prop.set_unit("volts"); - channel7->set_default_properties(channel7_prop); + channel7Attrib *channel7 = new channel7Attrib(); att_list.push_back(channel7); - // Attribute : errorCounter - Tango::Attr *error_counter = - new Tango::Attr("errorCounter", Tango::DEV_DOUBLE, Tango::READ); - Tango::UserDefaultAttrProp error_counter_prop; - error_counter_prop.set_label("error counter"); - error_counter_prop.set_format("%i"); - error_counter_prop.set_description("Errors occuring during the waveform generation."); - error_counter->set_default_properties(error_counter_prop); - att_list.push_back(error_counter); + // End of Automatic code generation + //------------------------------------------------------------- +} - // Attribute : useBoardFifo - Tango::Attr *use_board_fifo = - new Tango::Attr("useBoardFifo", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp use_board_fifo_prop; - use_board_fifo_prop.set_label("use board FIFO"); - use_board_fifo_prop.set_description("Set to 1 if data have been loaded in FIFO.\nSet to 0 if data is continuously tranfered through DMA (possible underrun)"); - use_board_fifo->set_default_properties(use_board_fifo_prop); - att_list.push_back(use_board_fifo); - // Attribute : channel0Enable - Tango::Attr *channel0_enable = - new Tango::Attr("channel0Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel0_enable_prop; - channel0_enable_prop.set_label("channel0Enable"); - channel0_enable_prop.set_description("If equals to 1, data is output on channel 0, \notherwise the channel is disable."); - channel0_enable->set_default_properties(channel0_enable_prop); - att_list.push_back(channel0_enable); - // Attribute : channel1Enable - Tango::Attr *channel1_enable = - new Tango::Attr("channel1Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel1_enable_prop; - channel1_enable_prop.set_label("channel1Enable"); - channel1_enable_prop.set_description("If equals to 1, data is output on channel 1, \notherwise the channel is disable."); - channel1_enable->set_default_properties(channel1_enable_prop); - att_list.push_back(channel1_enable); - // Attribute : channel2Enable - Tango::Attr *channel2_enable = - new Tango::Attr("channel2Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel2_enable_prop; - channel2_enable_prop.set_label("channel2Enable"); - channel2_enable_prop.set_description("If equals to 1, data is output on channel 2, \notherwise the channel is disable."); - channel2_enable->set_default_properties(channel2_enable_prop); - att_list.push_back(channel2_enable); - // Attribute : channel3Enable - Tango::Attr *channel3_enable = - new Tango::Attr("channel3Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel3_enable_prop; - channel3_enable_prop.set_label("channel3Enable"); - channel3_enable_prop.set_description("If equals to 1, data is output on channel 3, \notherwise the channel is disable."); - channel3_enable->set_default_properties(channel3_enable_prop); - att_list.push_back(channel3_enable); - // Attribute : channel4Enable - Tango::Attr *channel4_enable = - new Tango::Attr("channel4Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel4_enable_prop; - channel4_enable_prop.set_label("channel4Enable"); - channel4_enable_prop.set_description("If equals to 1, data is output on channel 4, \notherwise the channel is disable."); - channel4_enable->set_default_properties(channel4_enable_prop); - att_list.push_back(channel4_enable); - // Attribute : channel5Enable - Tango::Attr *channel5_enable = - new Tango::Attr("channel5Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel5_enable_prop; - channel5_enable_prop.set_label("channel5Enable"); - channel5_enable_prop.set_description("If equals to 1, data is output on channel 5, \notherwise the channel is disable."); - channel5_enable->set_default_properties(channel5_enable_prop); - att_list.push_back(channel5_enable); - // Attribute : channel6Enable - Tango::Attr *channel6_enable = - new Tango::Attr("channel6Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel6_enable_prop; - channel6_enable_prop.set_label("channel6Enable"); - channel6_enable_prop.set_description("If equals to 1, data is output on channel 6, \notherwise the channel is disable."); - channel6_enable->set_default_properties(channel6_enable_prop); - att_list.push_back(channel6_enable); - // Attribute : channel7Enable - Tango::Attr *channel7_enable = - new Tango::Attr("channel7Enable", Tango::DEV_SHORT, Tango::READ); - Tango::UserDefaultAttrProp channel7_enable_prop; - channel7_enable_prop.set_label("channel7Enable"); - channel7_enable_prop.set_description("If equals to 1, data is output on channel 7, \notherwise the channel is disable."); - channel7_enable->set_default_properties(channel7_enable_prop); - att_list.push_back(channel7_enable); + +//+---------------------------------------------------------------------------- +// +// method : RetrigAOClass::get_class_property() +// +// description : Read the class properties from database. +// +//----------------------------------------------------------------------------- +void RetrigAOClass::get_class_property() +{ + // Initialize your default values here (if not done with POGO). + //------------------------------------------------------------------ + + // Read class properties from database.(Automatic code generation) + //------------------------------------------------------------------ + + // Call database and extract values + //-------------------------------------------- + if (Tango::Util::instance()->_UseDb==true) + get_db_class()->get_property(cl_prop); + Tango::DbDatum def_prop; + int i = -1; + + + // End of Automatic code generation + //------------------------------------------------------------------ + +} + +//+---------------------------------------------------------------------------- +// +// method : RetrigAOClass::set_default_property +// +// description: Set default property (class and device) for wizard. +// For each property, add to wizard property name and description +// If default value has been set, add it to wizard property and +// store it in a DbDatum. +// +//----------------------------------------------------------------------------- +void RetrigAOClass::set_default_property() +{ + string prop_name; + string prop_desc; + string prop_def; + + vector<string> vect_data; + // Set Default Class Properties + // Set Default Device Properties + prop_name = "BoardNum"; + prop_desc = "The number of the board in the chassis cPCI."; + prop_def = ""; + 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); + + prop_name = "Frequency"; + prop_desc = "The output frequency (the rate the samples are outputed)."; + prop_def = ""; + 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); + + prop_name = "TriggerMode"; + prop_desc = "Trigger mode: POST trigger or DELAY trigger."; + prop_def = ""; + 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); + + prop_name = "TriggerSource"; + prop_desc = "The trigger source.The possible values are internal trigger INTRIG, digital trigger\nDTRIG or analog trigger ATRIG."; + prop_def = ""; + 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); + + prop_name = "ATRIGSelection"; + prop_desc = "select the type of analog trigger. Can be BELOW (trigger occurs below ATRIGLevel)\nor can be ABOVE (trigger occurs above ATRIGLevel)."; + prop_def = ""; + 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); + + prop_name = "ATRIGLevel"; + prop_desc = "The analog trigger level in volts."; + prop_def = ""; + 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); + + prop_name = "DTRIGPolarity"; + prop_desc = "The edges on which the trigger are detected. Can be RISING or FALLING."; + prop_def = ""; + 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); + + prop_name = "AORefA"; + prop_desc = "The value of the reference voltage gave on pin AORefA."; + prop_def = ""; + 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); + + prop_name = "AORefB"; + prop_desc = "The value of the reference voltage gave on pin AORefB."; + prop_def = ""; + 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); + + prop_name = "Polarity"; + prop_desc = "BP for unipolar outputs or UP for bipolar outputs."; + prop_def = ""; + 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); + + prop_name = "AORefSource"; + prop_desc = "Select the internal reference (10.0 volts) with INTERN or the external references\nAORefA and AORefB with EXTERN."; + prop_def = ""; + 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); + + prop_name = "Channel0Enable"; + prop_desc = "1 if enable channel 0, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel1Enable"; + prop_desc = "1 if enable channel 1, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel2Enable"; + prop_desc = "1 if enable channel 2, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel3Enable"; + prop_desc = "1 if enable channel 3, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel4Enable"; + prop_desc = "1 if enable channel 4, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel5Enable"; + prop_desc = "1 if enable channel 5, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel6Enable"; + prop_desc = "1 if enable channel 6, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Channel7Enable"; + prop_desc = "1 if enable channel 7, 0 otherwise."; + prop_def = ""; + 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); + + prop_name = "Delay"; + prop_desc = "If trigger mode is delay, configure the delay in seconds."; + prop_def = ""; + 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); + + prop_name = "Channel0Waveform"; + prop_desc = "The waveform for channel 0 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel1Waveform"; + prop_desc = "The waveform for channel 1 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel2Waveform"; + prop_desc = "The waveform for channel 2 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel3Waveform"; + prop_desc = "The waveform for channel 3 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel4Waveform"; + prop_desc = "The waveform for channel 4 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel5Waveform"; + prop_desc = "The waveform for channel 5 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel6Waveform"; + prop_desc = "The waveform for channel 6 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "Channel7Waveform"; + prop_desc = "The waveform for channel 7 (attribute persistency)."; + prop_def = ""; + 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); + + prop_name = "FilePath"; + prop_desc = "The path to waveforms persistancy files"; + prop_def = ""; + 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); + + prop_name = "ConversionSource"; + prop_desc = "Set the AO conversion signal source (i.e. DAC sampling source).\nUse one of the following: INTERNAL, EXTSAMPLING."; + prop_def = ""; + 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); } //+---------------------------------------------------------------------------- @@ -596,68 +865,82 @@ void RetrigAOClass::write_class_property() if (Tango::Util::_UseDb == false) return; - // Prepeare DbDatum - //-------------------------------------------- + Tango::DbData data; + string classname = get_name(); + string header; + string::size_type start, end; + + // Put title Tango::DbDatum title("ProjectTitle"); string str_title("Retriggered Continuous Anolog Output"); title << str_title; + data.push_back(title); + // Put Description Tango::DbDatum description("Description"); - string str_desc("Perform continuous anolog ouput (waveform generation) on the selected outputs."); + vector<string> str_desc; + str_desc.push_back("Perform continuous anolog ouput (waveform generation) on the selected outputs."); description << str_desc; - - // Use the doc_url field to store all information - // on the server version and CVS - string::size_type pos, len; - - // 1) Manage module name - // get rid of the $RCSfile: prefix and of Class.cpp suffix - string classname = RCSfile; + data.push_back(description); - pos = classname.find("$RCSfile: "); - len = classname.length(); - - if (pos != string::npos) - classname= classname.substr(pos+10, len- pos-10); - - pos = classname.find ("Class.cpp",0); - if (pos != string::npos) - classname=classname.substr(0,pos); - - // 2) Manage version number with SOLEIL CVS rules - // tag name is in the form : release_1_0 ==> transform it to 1.0 - // - string version ; - string str_TagName=string(TagName); - - pos = str_TagName.find_first_of("_",0); - if (pos != string::npos) - version= str_TagName.substr(pos+1, 3); + // put cvs location + string rcsId(RcsId); + string filename(classname); + start = rcsId.find("/"); + if (start!=string::npos) + { + filename += "Class.cpp"; + end = rcsId.find(filename); + if (end>start) + { + string strloc = rcsId.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); + } + } - pos = version.find_first_of("_",0); - if (pos != string::npos) - version[pos] = '.'; + // Get CVS tag revision + 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); + } - - // Store all info in the str_url property - - string str_url= "Documentation URL = " + string(HttpServer) + classname +"-" + version + "/index.html" + "\n"; - str_url= str_url + " Version CVS Tag = " + string(TagName)+ "\n"; - str_url= str_url + " CVS location = " + string(FileName)+ "\n"; - - Tango::DbDatum doc_url("doc_url"); - - doc_url << str_url; + // 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); + } - // Push everything in DataBase + // Put inheritance + Tango::DbDatum inher_datum("InheritedFrom"); + vector<string> inheritance; + inheritance.push_back("Device_3Impl"); + inher_datum << inheritance; + data.push_back(inher_datum); - Tango::DbData data; - data.push_back(title); - data.push_back(description); - data.push_back(doc_url); - // Call database and and values - //-------------------------------------------- - get_db_class()->put_property(data); + // Call database and and values + //-------------------------------------------- + get_db_class()->put_property(data); } } // namespace diff --git a/src/RetrigAOClass.h b/src/RetrigAOClass.h index be5d575895e67fb29ecbc8ebeb7bc2f3ac48b5a5..c0f154c658f3277f0cd57955f6365f5d3f93a1cd 100644 --- a/src/RetrigAOClass.h +++ b/src/RetrigAOClass.h @@ -10,11 +10,14 @@ // // project : TANGO Device Server // -// $Author: syldup $ +// $Author: anoureddine $ // -// $Revision: 1.1.1.1 $ +// $Revision: 1.2 $ // // $Log: not supported by cvs2svn $ +// Revision 1.1.1.1 2004/12/06 10:23:38 syldup +// initial import +// // // copyleft : Synchrotron SOLEIL // L'Orme des Merisiers @@ -31,46 +34,314 @@ #define _RETRIGAOCLASS_H #include <tango.h> +#include <RetrigAO.h> +namespace RetrigAO_ns +{ +//===================================== +// Define classes for attributes +//===================================== +class channel7Attrib: public Tango::SpectrumAttr +{ +public: + channel7Attrib():SpectrumAttr("channel7", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel7Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel7(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel7_allowed(ty);} +}; -namespace RetrigAO +class channel6Attrib: public Tango::SpectrumAttr { -// -// Define classes for commands -// +public: + channel6Attrib():SpectrumAttr("channel6", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel6Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel6(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel6_allowed(ty);} +}; + +class channel5Attrib: public Tango::SpectrumAttr +{ +public: + channel5Attrib():SpectrumAttr("channel5", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel5Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel5(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel5_allowed(ty);} +}; + +class channel4Attrib: public Tango::SpectrumAttr +{ +public: + channel4Attrib():SpectrumAttr("channel4", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel4Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel4(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel4_allowed(ty);} +}; + +class channel3Attrib: public Tango::SpectrumAttr +{ +public: + channel3Attrib():SpectrumAttr("channel3", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel3Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel3(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel3_allowed(ty);} +}; + +class channel2Attrib: public Tango::SpectrumAttr +{ +public: + channel2Attrib():SpectrumAttr("channel2", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel2Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel2(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel2_allowed(ty);} +}; + +class channel1Attrib: public Tango::SpectrumAttr +{ +public: + channel1Attrib():SpectrumAttr("channel1", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel1Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel1_allowed(ty);} +}; + +class channel0Attrib: public Tango::SpectrumAttr +{ +public: + channel0Attrib():SpectrumAttr("channel0", Tango::DEV_DOUBLE, Tango::READ, 1000000) {}; + ~channel0Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel0(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel0_allowed(ty);} +}; + +class channel7EnableAttrib: public Tango::Attr +{ +public: + channel7EnableAttrib():Attr("channel7Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel7EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel7Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel7Enable_allowed(ty);} +}; + +class channel6EnableAttrib: public Tango::Attr +{ +public: + channel6EnableAttrib():Attr("channel6Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel6EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel6Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel6Enable_allowed(ty);} +}; + +class channel5EnableAttrib: public Tango::Attr +{ +public: + channel5EnableAttrib():Attr("channel5Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel5EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel5Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel5Enable_allowed(ty);} +}; + +class channel4EnableAttrib: public Tango::Attr +{ +public: + channel4EnableAttrib():Attr("channel4Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel4EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel4Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel4Enable_allowed(ty);} +}; + +class channel3EnableAttrib: public Tango::Attr +{ +public: + channel3EnableAttrib():Attr("channel3Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel3EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel3Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel3Enable_allowed(ty);} +}; + +class channel2EnableAttrib: public Tango::Attr +{ +public: + channel2EnableAttrib():Attr("channel2Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel2EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel2Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel2Enable_allowed(ty);} +}; + +class channel1EnableAttrib: public Tango::Attr +{ +public: + channel1EnableAttrib():Attr("channel1Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel1EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel1Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel1Enable_allowed(ty);} +}; + +class channel0EnableAttrib: public Tango::Attr +{ +public: + channel0EnableAttrib():Attr("channel0Enable", Tango::DEV_SHORT, Tango::READ) {}; + ~channel0EnableAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_channel0Enable(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_channel0Enable_allowed(ty);} +}; + +class useBoardFifoAttrib: public Tango::Attr +{ +public: + useBoardFifoAttrib():Attr("useBoardFifo", Tango::DEV_SHORT, Tango::READ) {}; + ~useBoardFifoAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_useBoardFifo(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_useBoardFifo_allowed(ty);} +}; + +class errorCounterAttrib: public Tango::Attr +{ +public: + errorCounterAttrib():Attr("errorCounter", Tango::DEV_DOUBLE, Tango::READ) {}; + ~errorCounterAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_errorCounter(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_errorCounter_allowed(ty);} +}; + +class bufferDepthAttrib: public Tango::Attr +{ +public: + bufferDepthAttrib():Attr("bufferDepth", Tango::DEV_USHORT, Tango::READ_WRITE) {}; + ~bufferDepthAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<RetrigAO *>(dev))->read_bufferDepth(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<RetrigAO *>(dev))->write_bufferDepth(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<RetrigAO *>(dev))->is_bufferDepth_allowed(ty);} +}; + +//========================================= +// Define classes for commands +//========================================= class SetAOScaledDataCmd : public Tango::Command { public: - SetAOScaledDataCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel); - SetAOScaledDataCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); + SetAOScaledDataCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + SetAOScaledDataCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; ~SetAOScaledDataCmd() {}; - virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); - virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); + virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); + virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) + {return (static_cast<RetrigAO *>(dev))->is_SetAOScaledData_allowed(any);} }; + class StopCmd : public Tango::Command { public: - StopCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel); - StopCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); + StopCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + StopCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; ~StopCmd() {}; - virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); - virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); + virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); + virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) + {return (static_cast<RetrigAO *>(dev))->is_Stop_allowed(any);} }; + class StartCmd : public Tango::Command { public: - StartCmd(const char *,Tango::CmdArgType, Tango::CmdArgType,const char *,const char *, Tango::DispLevel); - StartCmd(const char *,Tango::CmdArgType, Tango::CmdArgType); + StartCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out, + const char *in_desc, + const char *out_desc, + Tango::DispLevel level) + :Command(name,in,out,in_desc,out_desc, level) {}; + + StartCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; ~StartCmd() {}; - virtual bool is_allowed (Tango::DeviceImpl *, const CORBA::Any &); - virtual CORBA::Any *execute (Tango::DeviceImpl *, const CORBA::Any &); + virtual CORBA::Any *execute (Tango::DeviceImpl *dev, const CORBA::Any &any); + virtual bool is_allowed (Tango::DeviceImpl *dev, const CORBA::Any &any) + {return (static_cast<RetrigAO *>(dev))->is_Start_allowed(any);} }; @@ -82,29 +353,38 @@ public: class RetrigAOClass : public Tango::DeviceClass { public: +// properties member data // add your own data members here //------------------------------------ public: + Tango::DbData cl_prop; + Tango::DbData cl_def_prop; + Tango::DbData dev_def_prop; // Method prototypes static RetrigAOClass *init(const char *); static RetrigAOClass *instance(); ~RetrigAOClass(); + Tango::DbDatum get_class_property(string &); + Tango::DbDatum get_default_device_property(string &); + Tango::DbDatum get_default_class_property(string &); protected: RetrigAOClass(string &); static RetrigAOClass *_instance; void command_factory(); + void get_class_property(); void attribute_factory(vector<Tango::Attr *> &); void write_class_property(); + void set_default_property(); private: void device_factory(const Tango::DevVarStringArray *); }; -} // namespace RetrigAO +} // namespace RetrigAO_ns #endif // _RETRIGAOCLASS_H