From e614d157b98fd5e809699db4fa8e234a2a8d29b8 Mon Sep 17 00:00:00 2001
From: Gwenaelle Abeille <gwenaelle.abeille@synchrotron-soleil.fr>
Date: Thu, 20 Jan 2005 13:21:51 +0000
Subject: [PATCH] following ASL modifications (states management).

---
 doc/doc_html/Attributes.html       |  2 +-
 doc/doc_html/DevCommands.html      | 16 ++++-----
 doc/doc_html/DevCommandsTable.html |  2 +-
 doc/doc_html/Properties.html       |  2 +-
 doc/doc_html/TangoDevStates.html   |  5 ++-
 doc/doc_html/index.html            | 12 +++----
 src/ContinuousAO.cpp               | 57 ++++++++++++++++++++++++------
 src/ContinuousAO.h                 | 36 ++++++++++---------
 src/ContinuousAOClass.cpp          |  9 +++--
 9 files changed, 93 insertions(+), 48 deletions(-)

diff --git a/doc/doc_html/Attributes.html b/doc/doc_html/Attributes.html
index 383d445..6a55345 100644
--- a/doc/doc_html/Attributes.html
+++ b/doc/doc_html/Attributes.html
@@ -28,7 +28,7 @@ Device Attributes Description
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 
diff --git a/doc/doc_html/DevCommands.html b/doc/doc_html/DevCommands.html
index 82dbba2..5a04c92 100644
--- a/doc/doc_html/DevCommands.html
+++ b/doc/doc_html/DevCommands.html
@@ -28,7 +28,7 @@ Device Commands Description
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 
@@ -50,7 +50,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <Li><Strong>Argout:<Br>DEV_VOID</Strong>
  : none.<Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
@@ -64,7 +64,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <Li><Strong>Argout:<Br>DEV_STATE</Strong>
  : State Code<Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
@@ -78,7 +78,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong>
  : Status descrition<Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
@@ -92,7 +92,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <Li><Strong>Argout:<Br>DEV_VOID</Strong>
  : <Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
@@ -106,7 +106,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <Li><Strong>Argout:<Br>DEV_VOID</Strong>
  : <Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
@@ -116,11 +116,11 @@ The language device desctructor automatically calls the <i> delete_device() </i>
 <ul>
 <Li><Strong>Description: </Strong> Give one period of the signal to generated of a specified channel in volts.<Br>&nbsp
 <Li><Strong>Argin:<Br>DEVVAR_DOUBLESTRINGARRAY</Strong>
- : The channel number (string).  The output data in volts (double)<Br>&nbsp
+ : The channel number ,in string).  The output data in volts ,in double)<Br>&nbsp
 <Li><Strong>Argout:<Br>DEV_VOID</Strong>
  : <Br>&nbsp
 <Li><Strong>Command allowed for: </Strong><Ul>
-<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
+<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING<Li>Tango::FAULT</Ul>
 <Br>&nbsp
 </ul><Br>
 <Br>
diff --git a/doc/doc_html/DevCommandsTable.html b/doc/doc_html/DevCommandsTable.html
index 01abe5c..ed4864c 100644
--- a/doc/doc_html/DevCommandsTable.html
+++ b/doc/doc_html/DevCommandsTable.html
@@ -28,7 +28,7 @@ Device Commands Description
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 
diff --git a/doc/doc_html/Properties.html b/doc/doc_html/Properties.html
index a41dd83..12276a2 100644
--- a/doc/doc_html/Properties.html
+++ b/doc/doc_html/Properties.html
@@ -28,7 +28,7 @@ Properties Description
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 
diff --git a/doc/doc_html/TangoDevStates.html b/doc/doc_html/TangoDevStates.html
index 02660af..40e2a28 100644
--- a/doc/doc_html/TangoDevStates.html
+++ b/doc/doc_html/TangoDevStates.html
@@ -28,7 +28,7 @@ Device States Description
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 
@@ -50,6 +50,9 @@ Revision:  - Author:
 <Tr><Td>RUNNING</Td>
 <Td></Td></Tr>
 
+<Tr><Td>FAULT</Td>
+<Td></Td></Tr>
+
 
 
 
diff --git a/doc/doc_html/index.html b/doc/doc_html/index.html
index 29c83c5..79e9862 100644
--- a/doc/doc_html/index.html
+++ b/doc/doc_html/index.html
@@ -28,7 +28,7 @@ Device Server User's Guide
 </h1>
 <Br>
 <b>
-Revision:  - Author: 
+Revision: 1.1.1.1 - Author: syldup
 </b>
 </center>
 <Br>
@@ -52,12 +52,12 @@ Perform continuous anolog ouput (waveform generation) on the selected outputs.<B
 <Br>
 <Br>
 <Br>
-<h2>Extented User's guide (available only for complex DeviceServers):</h2>
+<h2>Extented User's guide (available only for complex DeviceServers): Available in French OR English versions</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="..\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>
 </ul>
 <Br>
 <Br>
diff --git a/src/ContinuousAO.cpp b/src/ContinuousAO.cpp
index 4181dcf..ea8e73e 100644
--- a/src/ContinuousAO.cpp
+++ b/src/ContinuousAO.cpp
@@ -1,4 +1,4 @@
-static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAO.cpp,v 1.4 2004-12-21 13:06:59 abeilleg Exp $";
+static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAO.cpp,v 1.5 2005-01-20 13:21:51 abeilleg Exp $";
 //+=============================================================================
 //
 // file :	  ContinuousAO.cpp
@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD
 //
 // $Author: abeilleg $
 //
-// $Revision: 1.4 $
+// $Revision: 1.5 $
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.4  2004/12/21 13:06:59  abeilleg
+// minor bugs fixed
+//
 //
 // copyleft :	  Synchrotron SOLEIL
 //		  L'Orme des Merisiers
@@ -42,7 +45,7 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/AD
 //	Status	|	dev_status()
 //	Start	|	start()
 //	Stop	|	stop()
-//	SetAOScaledData |	set_aoscaled_data()
+//	SetAOScaledData	|	set_aoscaled_data()
 //
 //===================================================================
 #include <ContinuousAO.h>
@@ -637,7 +640,37 @@ void ContinuousAO::get_device_property()
 	//	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]  >>  startTrigger;
+	if (data[3].is_empty()==false)	data[3]  >>  stopTrigger;
+	if (data[4].is_empty()==false)	data[4]  >>  startTriggerSource;
+	if (data[5].is_empty()==false)	data[5]  >>  stopTriggerSource;
+	if (data[6].is_empty()==false)	data[6]  >>  aTRIGSelection;
+	if (data[7].is_empty()==false)	data[7]  >>  aTRIGLevel;
+	if (data[8].is_empty()==false)	data[8]  >>  dTRIGPolarity;
+	if (data[9].is_empty()==false)	data[9]  >>  aORefA;
+	if (data[10].is_empty()==false)	data[10]  >>  aORefB;
+	if (data[11].is_empty()==false)	data[11]  >>  polarity;
+	if (data[12].is_empty()==false)	data[12]  >>  aORefSource;
+	if (data[13].is_empty()==false)	data[13]  >>  channel0Enable;
+	if (data[14].is_empty()==false)	data[14]  >>  channel1Enable;
+	if (data[15].is_empty()==false)	data[15]  >>  channel2Enable;
+	if (data[16].is_empty()==false)	data[16]  >>  channel3Enable;
+	if (data[17].is_empty()==false)	data[17]  >>  channel4Enable;
+	if (data[18].is_empty()==false)	data[18]  >>  channel5Enable;
+	if (data[19].is_empty()==false)	data[19]  >>  channel6Enable;
+	if (data[20].is_empty()==false)	data[20]  >>  channel7Enable;
+	if (data[21].is_empty()==false)	data[21]  >>  bufferDepth;
+	if (data[22].is_empty()==false)	data[22]  >>  channel0Waveform;
+	if (data[23].is_empty()==false)	data[23]  >>  channel1Waveform;
+	if (data[24].is_empty()==false)	data[24]  >>  channel2Waveform;
+	if (data[25].is_empty()==false)	data[25]  >>  channel3Waveform;
+	if (data[26].is_empty()==false)	data[26]  >>  channel4Waveform;
+	if (data[27].is_empty()==false)	data[27]  >>  channel5Waveform;
+	if (data[28].is_empty()==false)	data[28]  >>  channel6Waveform;
+	if (data[29].is_empty()==false)	data[29]  >>  channel7Waveform;
+
 
   //	End of Automatic code generation
   //-------------------------------------------------------------
@@ -1127,7 +1160,7 @@ void ContinuousAO::read_attr(Tango::Attribute &attr)
 
 //+------------------------------------------------------------------
 /**
- *	method: ContinuousAO::start
+ *	method:	ContinuousAO::start
  *
  *	description:	method to execute "Start"
  *	start the generation.
@@ -1155,7 +1188,7 @@ void ContinuousAO::start()
 
 //+------------------------------------------------------------------
 /**
- *	method: ContinuousAO::stop
+ *	method:	ContinuousAO::stop
  *
  *	description:	method to execute "Stop"
  *	stop the generation.
@@ -1179,12 +1212,12 @@ void ContinuousAO::stop()
 
 //+------------------------------------------------------------------
 /**
- *	method: ContinuousAO::set_aoscaled_data
+ *	method:	ContinuousAO::set_aoscaled_data
  *
  *	description:	method to execute "SetAOScaledData"
  *	Give one period of the signal to generated of a specified channel in volts.
  *
- * @param	argin	The channel number (string).  The output data in volts (double)
+ * @param	argin	The channel number ,in string).  The output data in volts ,in double)
  *
  */
 //+------------------------------------------------------------------
@@ -1322,13 +1355,15 @@ void  ContinuousAO::set_internal_state(void)
       this->set_status("The acquisition is stopped");
       break;
     case asl::ContinuousAO::RUNNING:
-   // case asl::ContinuousAO::RESTARTING:
     case asl::ContinuousAO::ABORTING:
       this->set_state(Tango::RUNNING);
       this->set_status("The acquisition is running");
       break;
-    case asl::ContinuousAO::UNKNOWN:
-      case asl::ContinuousAO::FAULT:
+    case asl::ContinuousAO::FAULT:
+      this->set_state(Tango::FAULT);
+      this->set_status("An error has occured");
+      break;
+    case asl::ContinuousAO::UNKNOWN:    
     default:
       this->set_state(Tango::UNKNOWN);
       this->set_status("The acquisition is in an unknown state");
diff --git a/src/ContinuousAO.h b/src/ContinuousAO.h
index 4678e05..38f19cd 100644
--- a/src/ContinuousAO.h
+++ b/src/ContinuousAO.h
@@ -6,11 +6,14 @@
 //
 // project :	Continuous Anolog Output
 //
-// $Author: syldup $
+// $Author: abeilleg $
 //
-// $Revision: 1.1.1.1 $
+// $Revision: 1.2 $
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.1.1.1  2004/12/06 10:20:44  syldup
+// initial import
+//
 //
 // copyleft :	  Synchrotron SOLEIL
 //		  L'Orme des Merisiers
@@ -34,8 +37,8 @@
 //using namespace Tango;
 
 /**
- * @author	$Author: syldup $
- * @version	$Revision: 1.1.1.1 $ $
+ * @author	$Author: abeilleg $
+ * @version	$Revision: 1.2 $ $
  */
 
  //	Add your own constants definitions here.
@@ -55,6 +58,7 @@ namespace ContinuousAO
  *	Tango::UNKNOWN :	
  *	Tango::STANDBY :	
  *	Tango::RUNNING :	
+ *	Tango::FAULT :	
  */
 
 
@@ -81,7 +85,7 @@ public :
 		Tango::DevDouble	*attr_channel6_read;
 		Tango::DevDouble	*attr_channel7_read;
 		Tango::DevDouble	*attr_errorCounter_read;
-		Tango::DevShort *attr_useBoardFifo_read;
+		Tango::DevShort	*attr_useBoardFifo_read;
 //@}
 
 /**
@@ -100,11 +104,11 @@ public :
 /**
  *	1 if using a start trigger, 0 otherwise.
  */
-	Tango::DevShort startTrigger;
+	Tango::DevShort	startTrigger;
 /**
  *	1 if using a stop trigger, 0 otherwise.
  */
-	Tango::DevShort stopTrigger;
+	Tango::DevShort	stopTrigger;
 /**
  *	The start trigger source. Analog trigger DTRIG or ATRIG.
  */
@@ -146,35 +150,35 @@ public :
 /**
  *	1 if enable channel 0, 0 otherwise.
  */
-	Tango::DevShort channel0Enable;
+	Tango::DevShort	channel0Enable;
 /**
  *	1 if enable channel 1, 0 otherwise.
  */
-	Tango::DevShort channel1Enable;
+	Tango::DevShort	channel1Enable;
 /**
  *	1 if enable channel 2, 0 otherwise.
  */
-	Tango::DevShort channel2Enable;
+	Tango::DevShort	channel2Enable;
 /**
  *	1 if enable channel 3, 0 otherwise.
  */
-	Tango::DevShort channel3Enable;
+	Tango::DevShort	channel3Enable;
 /**
  *	1 if enable channel 4, 0 otherwise.
  */
-	Tango::DevShort channel4Enable;
+	Tango::DevShort	channel4Enable;
 /**
  *	1 if enable channel 5, 0 otherwise.
  */
-	Tango::DevShort channel5Enable;
+	Tango::DevShort	channel5Enable;
 /**
  *	1 if enable channel 6, 0 otherwise.
  */
-	Tango::DevShort channel6Enable;
+	Tango::DevShort	channel6Enable;
 /**
  *	1 if enable channel 7, 0 otherwise.
  */
-	Tango::DevShort channel7Enable;
+	Tango::DevShort	channel7Enable;
 /**
  *	The buffer depth for <b>one channel</b>.
  */
@@ -292,7 +296,7 @@ public :
 	void	stop();
 /**
  * Give one period of the signal to generated of a specified channel in volts.
- *	@param	argin	The channel number (string).  The output data in volts (double)
+ *	@param	argin	The channel number ,in string).  The output data in volts ,in double)
  *	@exception DevFailed
  */
 	void	set_aoscaled_data(const Tango::DevVarDoubleStringArray *);
diff --git a/src/ContinuousAOClass.cpp b/src/ContinuousAOClass.cpp
index 82fc9cc..d2b6371 100644
--- a/src/ContinuousAOClass.cpp
+++ b/src/ContinuousAOClass.cpp
@@ -1,4 +1,4 @@
-static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAOClass.cpp,v 1.1.1.1 2004-12-06 10:20:44 syldup Exp $";
+static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/InputOutput/ADLINK/ContinuousAO/src/ContinuousAOClass.cpp,v 1.2 2005-01-20 13:21:51 abeilleg Exp $";
 
 static const char *TagName = "$Name: not supported by cvs2svn $";
 
@@ -18,11 +18,14 @@ static const char *RCSfile = "$RCSfile: ContinuousAOClass.cpp,v $";
 //
 // project :     TANGO Device Server
 //
-// $Author: syldup $
+// $Author: abeilleg $
 //
-// $Revision: 1.1.1.1 $
+// $Revision: 1.2 $
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.1.1.1  2004/12/06 10:20:44  syldup
+// initial import
+//
 //
 // copyleft :     Synchrotron SOLEIL
 //                L'Orme des Merisiers
-- 
GitLab