diff --git a/doc/doc_html/Properties.html b/doc/doc_html/Properties.html index 192df9b96465ac8732f1cc40f53794be1a4649b6..92773b47f5d6d7bd3281bca9d18a8c42941993a9 100644 --- a/doc/doc_html/Properties.html +++ b/doc/doc_html/Properties.html @@ -66,15 +66,15 @@ Revision: - Author: xavela <Td><Font Size=-1>Tango::DEV_STRING</Font></Td> <Td><Font Size=-1>The name of the device which manage the communication.</Font></Td></Tr> -<Tr><Td><b><a href=#Dev_DefaultValues>ElectrometerTypeCh1 </a></b></Td> +<Tr><Td><b><a href=#Dev_DefaultValues>Electrometer1Address </a></b></Td> <Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> -<Td><Font Size=-1>The electrometer type number connected to the channel 1 --> for Type 1 Novelec model : 1</Font></Td></Tr> +<Td><Font Size=-1>The first electrometer address configured. <br /> +Note : if not connected, push 0 or let empty the property.</Font></Td></Tr> -<Tr><Td><b><a href=#Dev_DefaultValues>ElectrometerTypeCh2 </a></b></Td> +<Tr><Td><b><a href=#Dev_DefaultValues>Electrometer2Address </a></b></Td> <Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> -<Td><Font Size=-1>The electrometer type number connected to the channel 2 --> for Type 1 Novelec model : 1</Font></Td></Tr> +<Td><Font Size=-1>The second electrometer address configured. <br /> +Note : if not connected, push 0 or let empty the property.</Font></Td></Tr> </Table> @@ -94,11 +94,11 @@ Revision: - Author: xavela <td>No default value</td> </Tr> <Tr> - <Td>ElectrometerTypeCh1</Td> + <Td>Electrometer1Address</Td> <td>No default value</td> </Tr> <Tr> - <Td>ElectrometerTypeCh2</Td> + <Td>Electrometer2Address</Td> <td>No default value</td> </Tr> </Table> diff --git a/doc/doc_html/index.html b/doc/doc_html/index.html index 2b6d4747e68d5bd750de81cfaad30644f9e5adba..407d2468c134016a6e10b445b8a744c4d461c7c8 100644 --- a/doc/doc_html/index.html +++ b/doc/doc_html/index.html @@ -49,7 +49,7 @@ MCCE2Electrometers Class<Br> </h1> <b> Revision: - Author: xavela <Br> - Implemented in C++ - CVS repository: sourceforge(tango-ds) + Implemented in C++ </b> </center> <Br> diff --git a/doc/doc_html/user_guide.html b/doc/doc_html/user_guide.html index 94307fb126b362ce33bb53ddf48b7906f7f42b30..e4b311e43ccef7dd2282b07d059b2b2d9183e028 100644 --- a/doc/doc_html/user_guide.html +++ b/doc/doc_html/user_guide.html @@ -10,24 +10,28 @@ <TR> <TD ALIGN="left"> <A HREF="http://www.esrf.fr/" TARGET=new> - <IMG SRC="http://controle/icons/esrf_logo.gif" BORDER=0></A> + <IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0 Height="60"></A> </Td> <TD ALIGN="center"> <A HREF="http://www.elettra.trieste.it/" TARGET=new> - <IMG SRC="http://controle/icons/elettra_logo.gif" BORDER=0></A> + <IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0 Height="60"></A> </Td> <TD ALIGN="center"> <A HREF="http://www.synchrotron-soleil.fr/" TARGET=new> - <IMG SRC="http://controle/icons/soleil_logo.gif" BORDER=0></A> + <IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0 Height="60"></A> </Td> <TD ALIGN="right"> <A HREF="http://www.cells.es/" TARGET=new> - <IMG SRC="http://controle/icons/alba_logo.gif" BORDER=0></A> + <IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0 Height="54"></A> + </Td> + <TD ALIGN="right"> + <A HREF="http://www.desy.de/html/home/index_eng.html" TARGET=new> + <IMG SRC="http://www.esrf.fr/computing/cs/tango/desy.gif" BORDER=0 Height="60"></A> </Td> <Td> <H2><FONT COLOR="#7F00FF"> - <Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top"> + <Center><A HREF="http://www.tango-controls.org/" TARGET="_top"> TANGO </a> <Br> Device Server </Center></FONT> </Td> @@ -45,8 +49,8 @@ User's Guide<Br> <Br> <Br><Br> MCCE2Electrometers Class<Br> <Br></Td></Tr> </h1> <Tr><Td> -<b><Center>Revision: - Author: <Br> - Implemented in C++ - CVS repository: tango-ds +<b><Center>Revision: - Author: xavela <Br> + Implemented in C++ </Center></b> </Td></Tr> </center> @@ -66,10 +70,18 @@ through a Serial bus. </ul> <Br> <Br> -<Br> <Br><Br> +<Br><h2>Class Identification:</h2> +<ul> + <li><b>Contact :</b> at synchrotron-soleil.fr - xavier.elattaoui + <li><b>Class Family :</b> Acquisition + <li><b>Platform :</b> All Platforms + <li><b>Bus :</b> Serial Line + <li><b>Manufacturer :</b> SAPHYMO + <li><b>Reference :</b> MCCE-2 +</ul><Br> <Br><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> + <li> <a href="http://www.esrf.fr/computing/cs/tango/tango_doc/kernel_doc/cpp_doc/"> Tango::Device_4Impl</a></li> <ul> <li> MCCE2Electrometers</li> </ul> @@ -81,7 +93,6 @@ through a Serial bus. <Br> <Br><Br> <Br><h2>Properties:</h2> -<Br> <Br> <Br> <Center> <Br> <Br> <Br> <Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%"> @@ -95,10 +106,15 @@ through a Serial bus. <Td><Font Size=-1>Tango::DEV_STRING</Font></Td> <Td><Font Size=-1>The name of the device which manage the communication.</Font></Td></Tr> -<Tr><Td><b><a href=#Dev_DefaultValues>ElectrometerType </a></b></Td> +<Tr><Td><b><a href=#Dev_DefaultValues>Electrometer1Address </a></b></Td> +<Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> +<Td><Font Size=-1>The first electrometer address configured. <br /> +Note : if not connected, push 0 or let empty the property.</Font></Td></Tr> + +<Tr><Td><b><a href=#Dev_DefaultValues>Electrometer2Address </a></b></Td> <Td><Font Size=-1>Tango::DEV_USHORT</Font></Td> -<Td><Font Size=-1>The elctrometer type number. --> for Type 1 Novelec model : 1</Font></Td></Tr> +<Td><Font Size=-1>The second electrometer address configured. <br /> +Note : if not connected, push 0 or let empty the property.</Font></Td></Tr> </Table> @@ -118,7 +134,11 @@ through a Serial bus. <td>No default value</td> </Tr> <Tr> - <Td>ElectrometerType</Td> + <Td>Electrometer1Address</Td> + <td>No default value</td> + </Tr> + <Tr> + <Td>Electrometer2Address</Td> <td>No default value</td> </Tr> </Table> @@ -151,10 +171,6 @@ There is no Class properties.<Br><Br> <Tr><Td><b>FAULT</b></Td> <Td><Font Size=-1>Internal electrometer interface is not built or a Serial communication error occurred.</Font></Td></Tr> -<Tr><Td><b>RUNNING</b></Td> -<Td><Font Size=-1>The electrometer is in MEASURE mode, no parameter can be changed. -NOTE : switch it OFF before.</Font></Td></Tr> - @@ -175,10 +191,15 @@ NOTE : switch it OFF before.</Font></Td></Tr> <Td><Center><b>Data Type</b></td></Center> <Td><Center><b>R/W Type</b></td></Center> <Td><Center><b>Expert</b></td></Center> -<Font Size=-1> <Tr><Td><b>electrometerChannel</b>: <Font Size=-1>MCCE2 electrometer have two channels to support two amplifiers. WARN : default is 0 (please set this value first).</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>range1</b>: <Font Size=-1>The channel one MCCE2 range.</Font></Td> +<Td><Center><Font Size=-1>DEV_STRING</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>range2</b>: <Font Size=-1>The channel two MCCE range.</Font></Td> +<Td><Center><Font Size=-1>DEV_STRING</Font></Center></Td><Td><Center><Font Size=-1>READ</Font></Center></Td><Td><Center><Font Size=-1>No</Font></Center></Td></Tr> + </Table> </Center> <Br><Br><Br><Br><Br> @@ -214,6 +235,34 @@ NOTE : switch it OFF before.</Font></Td></Tr> <Tr><Td><b>RangeDOWN</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>Reset</b></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>ClearRegisters</b></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>GetRange</b></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Td><Font Size=-1>DEV_STRING</Font></Td> +<Tr><Td><b>SetRange</b></Td> +<Td><Font Size=-1>DEV_STRING</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> +<Tr><Td><b>SetPolarity</b></Td> +<Td><Font Size=-1>DEV_STRING</Font></Td> +<Td><Font Size=-1>DEV_VOID</Font></Td> + + + +</Table></Center> +<Br> <Br> <Br> +<Center> +<Table Border=2 Cellpadding=3 CELLSPACING=0 WIDTH="100%"> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<Td COLSPAN=3> <Font Size=+2><Center><b>Device Commands for Expert Level Only</b></td></Font></Center> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<Td><Center><b>Command name</b></td></Center> +<Td><Center><b>Argument In</b></td></Center> +<Td><Center><b>Argument Out</b></td></Center> <Tr><Td><b>SetZeroVFFunction</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> @@ -241,24 +290,12 @@ NOTE : switch it OFF before.</Font></Td></Tr> <Tr><Td><b>Remote</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> -<Tr><Td><b>Reset</b></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> -<Tr><Td><b>ClearRegisters</b></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> -<Tr><Td><b>GetRange</b></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> -<Td><Font Size=-1>CONST_DEV_STRING</Font></Td> -<Tr><Td><b>SetRange</b></Td> -<Td><Font Size=-1>DEV_STRING</Font></Td> -<Td><Font Size=-1>DEV_VOID</Font></Td> <Tr><Td><b>GetMode</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> -<Td><Font Size=-1>CONST_DEV_STRING</Font></Td> +<Td><Font Size=-1>DEV_STRING</Font></Td> <Tr><Td><b>GetPolarity</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> -<Td><Font Size=-1>CONST_DEV_STRING</Font></Td> +<Td><Font Size=-1>DEV_STRING</Font></Td> <Tr><Td><b>GetHzFilter</b></Td> <Td><Font Size=-1>DEV_VOID</Font></Td> <Td><Font Size=-1>DEV_SHORT</Font></Td> @@ -296,7 +333,7 @@ The language device desctructor automatically calls the <i> delete_device() </i> <Li><Strong>Argout:<Br>DEV_VOID</Strong> : none.<Br>  <Li><Strong>Command allowed for: </Strong><Ul> -<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT<Li>Tango::RUNNING</Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> @@ -310,7 +347,7 @@ The language device desctructor automatically calls the <i> delete_device() </i> <Li><Strong>Argout:<Br>DEV_STATE</Strong> : State Code<Br>  <Li><Strong>Command allowed for: </Strong><Ul> -<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT<Li>Tango::RUNNING</Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> @@ -324,7 +361,7 @@ The language device desctructor automatically calls the <i> delete_device() </i> <Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong> : Status description<Br>  <Li><Strong>Command allowed for: </Strong><Ul> -<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT<Li>Tango::RUNNING</Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> @@ -364,7 +401,7 @@ Throw : <Br> <A NAME="SetZeroVFFunction"><!-- --></A> <A NAME="SetZeroVFFunction"><!-- --></A> -<h2>6 - SetZeroVFFunction</h2> +<h2>6 - SetZeroVFFunction (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable the Zero V/F MCCE2 mode.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -372,13 +409,13 @@ Throw : <Li><Strong>Argout:<Br>DEV_VOID</Strong> : no argout<Br>  <Li><Strong>Command allowed for: </Strong><Ul> -<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT<Li>Tango::RUNNING</Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> <A NAME="SetOffsetZeroV1Function"><!-- --></A> <A NAME="SetOffsetZeroV1Function"><!-- --></A> -<h2>7 - SetOffsetZeroV1Function</h2> +<h2>7 - SetOffsetZeroV1Function (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable the Offset or Zero V1 MCCE2 mode.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -386,13 +423,13 @@ Throw : <Li><Strong>Argout:<Br>DEV_VOID</Strong> : no argout<Br>  <Li><Strong>Command allowed for: </Strong><Ul> -<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT<Li>Tango::RUNNING</Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> <A NAME="SetLeakageZeroV2Function"><!-- --></A> <A NAME="SetLeakageZeroV2Function"><!-- --></A> -<h2>8 - SetLeakageZeroV2Function</h2> +<h2>8 - SetLeakageZeroV2Function (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable the Leakage or Zero V2 MCCE2 mode.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -406,7 +443,7 @@ Throw : <Br> <A NAME="SetTestFunction"><!-- --></A> <A NAME="SetTestFunction"><!-- --></A> -<h2>9 - SetTestFunction</h2> +<h2>9 - SetTestFunction (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable theTest MCCE2 mode.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -420,7 +457,7 @@ Throw : <Br> <A NAME="SetMeasureFunction"><!-- --></A> <A NAME="SetMeasureFunction"><!-- --></A> -<h2>10 - SetMeasureFunction</h2> +<h2>10 - SetMeasureFunction (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable the Measure MCCE2 mode.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -434,9 +471,9 @@ Throw : <Br> <A NAME="MCCE2_ON"><!-- --></A> <A NAME="MCCE2_ON"><!-- --></A> -<h2>11 - MCCE2_ON</h2> +<h2>11 - MCCE2_ON (for expert only)</h2> <ul> -<Li><Strong>Description: </Strong> Enable the MEASURE function<Br>  +<Li><Strong>Description: </Strong> Enables the function set. Parameters cannot be set (read only mode).<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> : no argin<Br>  <Li><Strong>Argout:<Br>DEV_VOID</Strong> @@ -448,9 +485,9 @@ Throw : <Br> <A NAME="MCCE2_OFF"><!-- --></A> <A NAME="MCCE2_OFF"><!-- --></A> -<h2>12 - MCCE2_OFF</h2> +<h2>12 - MCCE2_OFF (for expert only)</h2> <ul> -<Li><Strong>Description: </Strong> Disable the MEASURE function<Br>  +<Li><Strong>Description: </Strong> Disables the function set. Parameters can be changed.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> : no argin<Br>  <Li><Strong>Argout:<Br>DEV_VOID</Strong> @@ -462,7 +499,7 @@ Throw : <Br> <A NAME="Local"><!-- --></A> <A NAME="Local"><!-- --></A> -<h2>13 - Local</h2> +<h2>13 - Local (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Enable local keyboard and Key<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -476,7 +513,7 @@ Throw : <Br> <A NAME="Remote"><!-- --></A> <A NAME="Remote"><!-- --></A> -<h2>14 - Remote</h2> +<h2>14 - Remote (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Disable \"MODIFY\" and the \"ON-OFF\" keys<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -523,7 +560,7 @@ Throw : <Li><Strong>Description: </Strong> Returns the electrometer range.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> : no argin<Br>  -<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong> +<Li><Strong>Argout:<Br>DEV_STRING</Strong> : The actual electrometer range<Br>  <Li><Strong>Command allowed for: </Strong><Ul> <Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> @@ -547,13 +584,13 @@ Else an exception is thrown.<Br>  <Br> <A NAME="GetMode"><!-- --></A> <A NAME="GetMode"><!-- --></A> -<h2>19 - GetMode</h2> +<h2>19 - GetMode (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Returns the electrometer mode which can be one of the following values : MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> : no argin<Br>  -<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong> +<Li><Strong>Argout:<Br>DEV_STRING</Strong> : The electrometer mode (MEASURE, LEAKAGE ...)<Br>  <Li><Strong>Command allowed for: </Strong><Ul> <Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> @@ -562,21 +599,37 @@ MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  <Br> <A NAME="GetPolarity"><!-- --></A> <A NAME="GetPolarity"><!-- --></A> -<h2>20 - GetPolarity</h2> +<h2>20 - GetPolarity (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Returns the electrometer polarity, which can be POSITIVE or NEGATIVE.<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> : no argin<Br>  -<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong> +<Li><Strong>Argout:<Br>DEV_STRING</Strong> : The electrometer polarity<Br>  <Li><Strong>Command allowed for: </Strong><Ul> <Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> <Br>  </ul><Br> <Br> +<A NAME="SetPolarity"><!-- --></A> +<A NAME="SetPolarity"><!-- --></A> +<h2>21 - SetPolarity</h2> +<ul> +<Li><Strong>Description: </Strong> Sets the new electrometer polarity. <Br> +NOTE : <Br> +Value must be set in UPPER case !!!<Br>  +<Li><Strong>Argin:<Br>DEV_STRING</Strong> + : POSITIVE or NEGATIVE<Br>  +<Li><Strong>Argout:<Br>DEV_VOID</Strong> + : no argout<Br>  +<Li><Strong>Command allowed for: </Strong><Ul> +<Li>Tango::ON<Li>Tango::ALARM<Li>Tango::FAULT</Ul> +<Br>  +</ul><Br> +<Br> <A NAME="GetHzFilter"><!-- --></A> <A NAME="GetHzFilter"><!-- --></A> -<h2>21 - GetHzFilter</h2> +<h2>22 - GetHzFilter (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Returns the Cut-off frequency in Hz<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -590,7 +643,7 @@ MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  <Br> <A NAME="SetHzFilter"><!-- --></A> <A NAME="SetHzFilter"><!-- --></A> -<h2>22 - SetHzFilter</h2> +<h2>23 - SetHzFilter (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> The Cut-off frequency in Hz<Br>  <Li><Strong>Argin:<Br>DEV_SHORT</Strong> @@ -604,7 +657,7 @@ MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  <Br> <A NAME="GetGain"><!-- --></A> <A NAME="GetGain"><!-- --></A> -<h2>23 - GetGain</h2> +<h2>24 - GetGain (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Returns the MCCE-2 gain<Br>  <Li><Strong>Argin:<Br>DEV_VOID</Strong> @@ -618,7 +671,7 @@ MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  <Br> <A NAME="SetGain"><!-- --></A> <A NAME="SetGain"><!-- --></A> -<h2>24 - SetGain</h2> +<h2>25 - SetGain (for expert only)</h2> <ul> <Li><Strong>Description: </Strong> Sets the new MCCE-2 gain value.<Br>  <Li><Strong>Argin:<Br>DEV_USHORT</Strong> @@ -634,10 +687,46 @@ MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST.<Br>  </center> <Br> <Br><Br> <Br> +<!--- html Footer ---> + <Center> -<Br> -<HR WIDTH="100%"></H5> -<H3> ESRF - Software Engineering Group </H3> +<Font size=-1> +<br> +<br> +<TABLE BORDER="1" WIDTH="100%"> + <Tr> + <!--- Hosted by Sourceforge ---> + <Td Align="Center"> + <Font size=-1> + <b>TANGO</b> is an open source project hosted by :<br> + <A href="http://sourceforge.net" Target="new"> + <IMG title="Sourceforge logo" + alt="Sourceforge logo small" + src="http://www.esrf.fr/computing/cs/tango/sourceforge.gif" + border=0> </a> + </Font> + </Td> + <!--- 2 Sourceforge Repositories ---> + <Td Align="Center"> + <Font size=-1> + Core and Tools : + <a href="http://tango-cs.cvs.sourceforge.net/tango-cs/" Target="new"> + CVS repository</a> on + <a href="https://sourceforge.net/projects/tango-cs" Target=new> + tango-cs project</a> + + <br> + + Device Servers : + <a href="http://tango-ds.cvs.sourceforge.net/tango-ds/" Target="new"> + CVS repository</a> on + <a href="https://sourceforge.net/projects/tango-ds" Target=new> + tango-ds project</a> + </Font> + </Td> + </Tr> +</Table> +</Font> </Center> </body> </html> diff --git a/pom.xml b/pom.xml index 21fabd153ae75a18565f98a96fa6a76bc9567b40..b95bca4168055778920a403ffc486563b90db2b6 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>fr.soleil.device</groupId> <artifactId>MCCE2Electrometers-${aol}-${mode}</artifactId> - <version>2.2.4-SNAPSHOT</version> + <version>2.2.4</version> <packaging>nar</packaging> <name>MCCE2Electrometers</name> <!-- use for the name of executable --> @@ -24,7 +24,8 @@ <dependencies> <dependency> <groupId>fr.soleil.lib</groupId> - <artifactId>Electrometers-${aol}-${library}-${mode}</artifactId> + <artifactId>Electrometers-${aol}-${library}-${mode}</artifactId> + <!-- <version>2.5.15</version> --> </dependency> </dependencies> <scm> @@ -45,4 +46,4 @@ <timezone>1</timezone> </developer> </developers> -</project> \ No newline at end of file +</project> diff --git a/src/MCCE2Electrometers.cpp b/src/MCCE2Electrometers.cpp index bc333fb09739e4f0fb30cd8bfe5c12dfd8b67c36..1d5eab50608f7adc8aafc8104d52927fff4fb463 100644 --- a/src/MCCE2Electrometers.cpp +++ b/src/MCCE2Electrometers.cpp @@ -29,8 +29,8 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio // //-============================================================================= // -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) // // (c) - Software Engineering Group - ESRF //============================================================================= @@ -39,11 +39,11 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio //=================================================================== // -// The following table gives the correspondence -// between commands and method name. +// The following table gives the correspondence +// between commands and method name. // // Command name | Method name -// ---------------------------------------- +// ---------------------------------------- // State | dev_state() // Status | dev_status() // RangeUP | range_up() @@ -81,1384 +81,1386 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio #include "N_PhotoConducteur.h" const size_t MAX_STRING_LENGTH = 64; +const unsigned short ELETRO_CHANNEL_ONE = 1; +const unsigned short ELETRO_CHANNEL_TWO = 2; namespace MCCE2Electrometers_ns { //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::MCCE2Electrometers(string &s) +// method : MCCE2Electrometers::MCCE2Electrometers(string &s) // -// description : constructor for simulated MCCE2Electrometers +// description : constructor for simulated MCCE2Electrometers // /home/experiences/diffabs/com-diffabs/DeviceServers/ds_MCCE2Electrometers // in : - cl : Pointer to the DeviceClass object // - s : Device name // //----------------------------------------------------------------------------- MCCE2Electrometers::MCCE2Electrometers(Tango::DeviceClass *cl,string &s) - :Tango::Device_4Impl(cl,s.c_str()) + :Tango::Device_4Impl(cl,s.c_str()) { - init_device(); + init_device(); } MCCE2Electrometers::MCCE2Electrometers(Tango::DeviceClass *cl,const char *s) - :Tango::Device_4Impl(cl,s) + :Tango::Device_4Impl(cl,s) { - init_device(); + init_device(); } MCCE2Electrometers::MCCE2Electrometers(Tango::DeviceClass *cl,const char *s,const char *d) - :Tango::Device_4Impl(cl,s,d) + :Tango::Device_4Impl(cl,s,d) { - init_device(); + init_device(); } + //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::delete_device() +// method : MCCE2Electrometers::delete_device() // -// description : will be called at device destruction or at init command. +// description : will be called at device destruction or at init command. // //----------------------------------------------------------------------------- void MCCE2Electrometers::delete_device() { - // Delete device's allocated object - if(this->_electrometerCH1) - { - delete this->_electrometerCH1; - this->_electrometerCH1 = 0; - } + // Delete device's allocated object + if(this->_electrometerCH1) + { + delete this->_electrometerCH1; + this->_electrometerCH1 = 0; + } - if(this->_electrometerCH2) - { - delete this->_electrometerCH2; - this->_electrometerCH2 = 0; - } + if(this->_electrometerCH2) + { + delete this->_electrometerCH2; + this->_electrometerCH2 = 0; + } - DELETE_DEVSTRING_ATTRIBUTE(attr_range1_read); - DELETE_DEVSTRING_ATTRIBUTE(attr_range2_read); - DELETE_SCALAR_ATTRIBUTE(attr_electrometerChannel_read); + DELETE_DEVSTRING_ATTRIBUTE(attr_range1_read); + DELETE_DEVSTRING_ATTRIBUTE(attr_range2_read); + DELETE_SCALAR_ATTRIBUTE(attr_electrometerChannel_read); } //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::init_device() +// method : MCCE2Electrometers::init_device() // -// description : will be called at device initialization. +// description : will be called at device initialization. // //----------------------------------------------------------------------------- void MCCE2Electrometers::init_device() { - INFO_STREAM << "MCCE2Electrometers::MCCE2Electrometers() create device " << device_name << endl; - - // Initialise variables to default values - //-------------------------------------------- - this->_electrometer = 0; - this->_electrometerCH1 = 0; - this->_electrometerCH2 = 0; - this->_missing_property = false; - attr_electrometerChannel_write = 1; - this->_updateRange1FromHW = true; //- force update after init. - this->_updateRange2FromHW = true; //- force update after init. - - get_device_property(); - - if ( this->communicationLinkName.empty() ) - this->_missing_property = true; - if ( !electrometerTypeCh1 && !electrometerTypeCh2 ) - this->_missing_property = true; - INFO_STREAM << "electrometerTypeChx -> _missing_property = " << _missing_property << std::endl; - - CREATE_SCALAR_ATTRIBUTE(attr_electrometerChannel_read); - CREATE_DEVSTRING_ATTRIBUTE(attr_range1_read, MAX_STRING_LENGTH, "Not updated yet."); - CREATE_DEVSTRING_ATTRIBUTE(attr_range2_read, MAX_STRING_LENGTH, "Not updated yet."); - - this->_init_done = false; - - INFO_STREAM << "Device up but not completly initialised!" << std::endl; - INFO_STREAM << "this->communicationLinkName = " << this->communicationLinkName << std::endl; - INFO_STREAM << "electrometerTypeCh1 = " << electrometerTypeCh1 << std::endl; - INFO_STREAM << "electrometerTypeCh2 = " << electrometerTypeCh2 << std::endl; + INFO_STREAM << "MCCE2Electrometers::MCCE2Electrometers() create device " << device_name << endl; + + // Initialise variables to default values + //-------------------------------------------- + this->_electrometer = 0; + this->_electrometerCH1 = 0; + this->_electrometerCH2 = 0; + this->_missing_property = false; + attr_electrometerChannel_write = ELETRO_CHANNEL_ONE; + this->_updateRange1FromHW = true; //- force update after init. + this->_updateRange2FromHW = true; //- force update after init. + + get_device_property(); + + if ( this->communicationLinkName.empty() ) + this->_missing_property = true; + if ( !electrometer1Address && !electrometer2Address ) + this->_missing_property = true; + INFO_STREAM << "electrometerTypeChx -> _missing_property = " << _missing_property << std::endl; + + CREATE_SCALAR_ATTRIBUTE(attr_electrometerChannel_read); + CREATE_DEVSTRING_ATTRIBUTE(attr_range1_read, MAX_STRING_LENGTH, "Not updated yet."); + CREATE_DEVSTRING_ATTRIBUTE(attr_range2_read, MAX_STRING_LENGTH, "Not updated yet."); + + this->_init_done = false; + + if( !this->_init_done && !this->_missing_property ) + { + INFO_STREAM << "init_device -> create_electrometers_obj : ... " << std::endl; + create_electrometers_obj(); + }//- end if + + INFO_STREAM << "Device up but not completly initialised!" << std::endl; + INFO_STREAM << "this->communicationLinkName = " << this->communicationLinkName << std::endl; + INFO_STREAM << "electrometer1Address = " << electrometer1Address << std::endl; + INFO_STREAM << "electrometer2Address = " << electrometer2Address << std::endl; } - //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::get_device_property() +// method : MCCE2Electrometers::get_device_property() // -// description : Read the device properties from database. +// description : Read the device properties from database. // //----------------------------------------------------------------------------- void MCCE2Electrometers::get_device_property() { - // Initialize your default values here (if not done with POGO). - //------------------------------------------------------------------ - communicationLinkName = ""; - electrometerTypeCh1 = 0; - electrometerTypeCh2 = 0; - // Read device properties from database.(Automatic code generation) - //------------------------------------------------------------------ - Tango::DbData dev_prop; - dev_prop.push_back(Tango::DbDatum("CommunicationLinkName")); - dev_prop.push_back(Tango::DbDatum("ElectrometerTypeCh1")); - dev_prop.push_back(Tango::DbDatum("ElectrometerTypeCh2")); - - // Call database and extract values - //-------------------------------------------- - if (Tango::Util::instance()->_UseDb==true) - get_db_device()->get_property(dev_prop); - Tango::DbDatum def_prop, cl_prop; - MCCE2ElectrometersClass *ds_class = - (static_cast<MCCE2ElectrometersClass *>(get_device_class())); - int i = -1; - - // Try to initialize CommunicationLinkName from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> communicationLinkName; - else { - // Try to initialize CommunicationLinkName from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> communicationLinkName; - } - // And try to extract CommunicationLinkName value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> communicationLinkName; - - // Try to initialize ElectrometerTypeCh1 from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> electrometerTypeCh1; - else { - // Try to initialize ElectrometerTypeCh1 from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> electrometerTypeCh1; - } - // And try to extract ElectrometerTypeCh1 value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> electrometerTypeCh1; - - // Try to initialize ElectrometerTypeCh2 from class property - cl_prop = ds_class->get_class_property(dev_prop[++i].name); - if (cl_prop.is_empty()==false) cl_prop >> electrometerTypeCh2; - else { - // Try to initialize ElectrometerTypeCh2 from default device value - def_prop = ds_class->get_default_device_property(dev_prop[i].name); - if (def_prop.is_empty()==false) def_prop >> electrometerTypeCh2; - } - // And try to extract ElectrometerTypeCh2 value from database - if (dev_prop[i].is_empty()==false) dev_prop[i] >> electrometerTypeCh2; - - - - // End of Automatic code generation - //------------------------------------------------------------------ - - //- Creates default property - Tango::DbData data_put; - if ( dev_prop[0].is_empty() ) - { - Tango::DbDatum prop("CommunicationLinkName"); - prop << communicationLinkName; - data_put.push_back(prop); - } - if ( dev_prop[1].is_empty() ) - { - Tango::DbDatum prop("ElectrometerTypeCh1"); - prop << electrometerTypeCh1; - data_put.push_back(prop); - } - if ( dev_prop[2].is_empty() ) - { - Tango::DbDatum prop("ElectrometerTypeCh2"); - prop << electrometerTypeCh2; - data_put.push_back(prop); - } - - //- write default property if created - if( !data_put.empty() ) - get_db_device()->put_property(data_put); + // Initialize your default values here (if not done with POGO). + //------------------------------------------------------------------ + communicationLinkName = ""; + electrometer1Address = 0; + electrometer2Address = 0; + // Read device properties from database.(Automatic code generation) + //------------------------------------------------------------------ + Tango::DbData dev_prop; + dev_prop.push_back(Tango::DbDatum("CommunicationLinkName")); + dev_prop.push_back(Tango::DbDatum("Electrometer1Address")); + dev_prop.push_back(Tango::DbDatum("Electrometer2Address")); + + // Call database and extract values + //-------------------------------------------- + if (Tango::Util::instance()->_UseDb==true) + get_db_device()->get_property(dev_prop); + Tango::DbDatum def_prop, cl_prop; + MCCE2ElectrometersClass *ds_class = + (static_cast<MCCE2ElectrometersClass *>(get_device_class())); + int i = -1; + + // Try to initialize CommunicationLinkName from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> communicationLinkName; + else { + // Try to initialize CommunicationLinkName from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> communicationLinkName; + } + // And try to extract CommunicationLinkName value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> communicationLinkName; + + // Try to initialize Electrometer1Address from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> electrometer1Address; + else { + // Try to initialize Electrometer1Address from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> electrometer1Address; + } + // And try to extract Electrometer1Address value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> electrometer1Address; + + // Try to initialize Electrometer2Address from class property + cl_prop = ds_class->get_class_property(dev_prop[++i].name); + if (cl_prop.is_empty()==false) cl_prop >> electrometer2Address; + else { + // Try to initialize Electrometer2Address from default device value + def_prop = ds_class->get_default_device_property(dev_prop[i].name); + if (def_prop.is_empty()==false) def_prop >> electrometer2Address; + } + // And try to extract Electrometer2Address value from database + if (dev_prop[i].is_empty()==false) dev_prop[i] >> electrometer2Address; + + + + // End of Automatic code generation + //------------------------------------------------------------------ + + //- Creates default property + Tango::DbData data_put; + if ( dev_prop[0].is_empty() ) + { + Tango::DbDatum prop("CommunicationLinkName"); + prop << communicationLinkName; + data_put.push_back(prop); + } + if ( dev_prop[1].is_empty() ) + { + Tango::DbDatum prop("Electrometer1Address"); + prop << electrometer1Address; + data_put.push_back(prop); + } + if ( dev_prop[2].is_empty() ) + { + Tango::DbDatum prop("Electrometer2Address"); + prop << electrometer2Address; + data_put.push_back(prop); + } + + //- write default property if created + if( !data_put.empty() ) + get_db_device()->put_property(data_put); } + //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::always_executed_hook() +// method : MCCE2Electrometers::always_executed_hook() // -// description : method always executed before any command is executed +// description : method always executed before any command is executed // //----------------------------------------------------------------------------- void MCCE2Electrometers::always_executed_hook() { - if( !this->_init_done && !this->_missing_property ) - { - INFO_STREAM << "always_executed_hook -> create_electrometers_obj : ... " << _missing_property << std::endl; - create_electrometers_obj(); - }//- end if + //- noop } + //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::read_attr_hardware +// method : MCCE2Electrometers::read_attr_hardware // -// description : Hardware acquisition for attributes. +// description : Hardware acquisition for attributes. // //----------------------------------------------------------------------------- void MCCE2Electrometers::read_attr_hardware(vector<long> &attr_list) { - DEBUG_STREAM << "MCCE2Electrometers::read_attr_hardware(vector<long> &attr_list) entering... "<< endl; - // Add your own code here + DEBUG_STREAM << "MCCE2Electrometers::read_attr_hardware(vector<long> &attr_list) entering... "<< endl; + // Add your own code here } + //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::read_range1 +// method : MCCE2Electrometers::read_range1 // -// description : Extract real attribute values for range1 acquisition result. +// description : Extract real attribute values for range1 acquisition result. // //----------------------------------------------------------------------------- void MCCE2Electrometers::read_range1(Tango::Attribute &attr) { - DEBUG_STREAM << "MCCE2Electrometers::read_range1(Tango::Attribute &attr) entering... "<< endl; + DEBUG_STREAM << "MCCE2Electrometers::read_range1(Tango::Attribute &attr) entering... "<< endl; - if ( this->_updateRange1FromHW ) - { - *attr_range1_read = this->get_range(); - this->_updateRange1FromHW = false; - } + if ( this->_updateRange1FromHW && *attr_electrometerChannel_read == ELETRO_CHANNEL_ONE ) + { + *attr_range1_read = this->get_range(); + this->_updateRange1FromHW = false; + } - attr.set_value(attr_range1_read); + attr.set_value(attr_range1_read); } //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::read_range2 +// method : MCCE2Electrometers::read_range2 // -// description : Extract real attribute values for range2 acquisition result. +// description : Extract real attribute values for range2 acquisition result. // //----------------------------------------------------------------------------- void MCCE2Electrometers::read_range2(Tango::Attribute &attr) { - DEBUG_STREAM << "MCCE2Electrometers::read_range2(Tango::Attribute &attr) entering... "<< endl; + DEBUG_STREAM << "MCCE2Electrometers::read_range2(Tango::Attribute &attr) entering... "<< endl; - if ( this->_updateRange2FromHW ) - { - *attr_range2_read = this->get_range(); - this->_updateRange2FromHW = false; - } + if ( this->_updateRange2FromHW && *attr_electrometerChannel_read == ELETRO_CHANNEL_TWO ) + { + *attr_range2_read = this->get_range(); + this->_updateRange2FromHW = false; + } - attr.set_value(attr_range2_read); + attr.set_value(attr_range2_read); } //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::read_electrometerChannel +// method : MCCE2Electrometers::read_electrometerChannel // -// description : Extract real attribute values for electrometerChannel acquisition result. +// description : Extract real attribute values for electrometerChannel acquisition result. // //----------------------------------------------------------------------------- void MCCE2Electrometers::read_electrometerChannel(Tango::Attribute &attr) { - DEBUG_STREAM << "MCCE2Electrometers::read_electrometerChannel(Tango::Attribute &attr) entering... "<< endl; - - Tango::DevUShort channelNumber = 0; - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::read_electrometerChannel()" - ); - } - - try - { - *attr_electrometerChannel_read = this->_electrometer->get_ElectroChannel(); - attr.set_value(attr_electrometerChannel_read); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to set the active channel value !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to get the active channel value : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to get the active channel value.", - (const char*) "MCCE2Electrometers::read_electrometerChannel()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to set the active channel value !"); - - ERROR_STREAM << "Failed to get the active channel value : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to get the new active channel value !", - (const char*) "MCCE2Electrometers::read_electrometerChannel()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to get the active channel value : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to set the active channel value !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::read_electrometerChannel(Tango::Attribute &attr) entering... "<< endl; + + Tango::DevUShort channelNumber = 0; + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::read_electrometerChannel()" + ); + } + + try + { + *attr_electrometerChannel_read = this->_electrometer->get_ElectroChannel(); + attr.set_value(attr_electrometerChannel_read); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to set the active channel value!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to get the active channel value : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to get the active channel value.", + "MCCE2Electrometers::read_electrometerChannel()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to set the active channel value!"); + + ERROR_STREAM << "Failed to get the active channel value : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to get the new active channel value!", + "MCCE2Electrometers::read_electrometerChannel()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to get the active channel value : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to set the active channel value!"); + + throw; + } } //+---------------------------------------------------------------------------- // -// method : MCCE2Electrometers::write_electrometerChannel +// method : MCCE2Electrometers::write_electrometerChannel // -// description : Write electrometerChannel attribute values to hardware. +// description : Write electrometerChannel attribute values to hardware. // //----------------------------------------------------------------------------- void MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr) { - DEBUG_STREAM << "MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr) entering... "<< endl; - - if (!this->_electrometer) - { - std::string err("There is no electrometer connected or the property\"electrometerTypeCh\" is not set"); - ERROR_STREAM << err << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - err.c_str(), - (const char*) "MCCE2Electrometers::write_electrometerChannel()" - ); - } - - attr.get_write_value(attr_electrometerChannel_write); - - if (attr_electrometerChannel_write != 1 && attr_electrometerChannel_write != 2) - { - Tango::Except::throw_exception( - (const char*) "INVALID_PARAMETER", - (const char*) "Expected channel values are 1 or 2 only !", - (const char*) "MCCE2Electrometers::write_electrometerChannel()"); - } - else - { - if ( attr_electrometerChannel_write == 1 ) - { - this->_electrometer = this->_electrometerCH1; - //- now force update from HW - this->_updateRange1FromHW = true; - - } - else - { - this->_electrometer = this->_electrometerCH2; - //- now force update from HW - this->_updateRange2FromHW = true; - } - } + DEBUG_STREAM << "MCCE2Electrometers::write_electrometerChannel(Tango::WAttribute &attr) entering... "<< endl; + + if ( !this->_electrometer ) + { + std::string err("There is no electrometer connected or the property\"electrometerTypeCh\" is not set"); + ERROR_STREAM << err << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + err.c_str(), + "MCCE2Electrometers::write_electrometerChannel()" + ); + } + + attr.get_write_value(attr_electrometerChannel_write); + + if ( attr_electrometerChannel_write == ELETRO_CHANNEL_ONE && this->_electrometerCH1 ) + { + this->_electrometer = this->_electrometerCH1; + //- now force update from HW + this->_updateRange1FromHW = true; + + } + else if ( attr_electrometerChannel_write == ELETRO_CHANNEL_TWO && this->_electrometerCH2 ) + { + this->_electrometer = this->_electrometerCH2; + //- now force update from HW + this->_updateRange2FromHW = true; + } + else + Tango::Except::throw_exception( + "INVALID_PARAMETER", + "Cannot control electrometer on this channel : seems taht nothing is connected on!", + "MCCE2Electrometers::write_electrometerChannel()"); } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::range_up + * method: MCCE2Electrometers::range_up * - * description: method to execute "RangeUP" - * Up the range of the electrometer. - * Throw : - * - electrometer::ElectrometerException if the range limit is reached - * - Tango::DevFailed if the command cannot be performed + * description: method to execute "RangeUP" + * Up the range of the electrometer. + * Throw : + * - electrometer::ElectrometerException if the range limit is reached + * - Tango::DevFailed if the command cannot be performed * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::range_up() { - DEBUG_STREAM << "MCCE2Electrometers::range_up(): entering... !" << endl; - - // Add your own code to control device here - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::range_up()" - ); - } - - try - { - this->_electrometer->range_up(); - //- update range attr from hardware - if ( *attr_electrometerChannel_read == 1) - this->_updateRange1FromHW = true; - else if ( *attr_electrometerChannel_read == 2) - this->_updateRange2FromHW = true; - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to up the range !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to up the range : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to up the range.", - (const char*) "MCCE2Electrometers::range_up()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to up the range !"); - - ERROR_STREAM << "Failed to up the range : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to up the range !", - (const char*) "MCCE2Electrometers::range_up()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to up the range : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to up the range !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::range_up(): entering... !" << endl; + + // Add your own code to control device here + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::range_up()" + ); + } + + try + { + this->_electrometer->range_up(); + //- update range attr from hardware + if ( *attr_electrometerChannel_read == ELETRO_CHANNEL_ONE) + this->_updateRange1FromHW = true; + else if ( *attr_electrometerChannel_read == ELETRO_CHANNEL_TWO) + this->_updateRange2FromHW = true; + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to up the range!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to up the range : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to up the range.", + "MCCE2Electrometers::range_up()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to up the range!"); + + ERROR_STREAM << "Failed to up the range : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to up the range!", + "MCCE2Electrometers::range_up()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to up the range : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to up the range!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::range_down + * method: MCCE2Electrometers::range_down * - * description: method to execute "RangeDOWN" - * Down the range of the electrometer. - * Throw : - * - electrometer::ElectrometerException if the range is negative - * - Tango::DevFailed if the command cannot be performed + * description: method to execute "RangeDOWN" + * Down the range of the electrometer. + * Throw : + * - electrometer::ElectrometerException if the range is negative + * - Tango::DevFailed if the command cannot be performed * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::range_down() { - DEBUG_STREAM << "MCCE2Electrometers::range_down(): entering... !" << endl; - - // Add your own code to control device here - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::range_down()" - ); - } - - try - { - this->_electrometer->range_down(); - //- update range attr from hardware - if ( *attr_electrometerChannel_read == 1) - this->_updateRange1FromHW = true; - else if ( *attr_electrometerChannel_read == 2) - this->_updateRange2FromHW = true; - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to down the range !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to down the range : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to down the range.", - (const char*) "MCCE2Electrometers::range_down()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to down the range !"); - - ERROR_STREAM << "Failed to down the range : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to down the range !", - (const char*) "MCCE2Electrometers::range_down()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to down the range : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to down the range !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::range_down(): entering... !" << endl; + + // Add your own code to control device here + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::range_down()" + ); + } + + try + { + this->_electrometer->range_down(); + //- update range attr from hardware + if ( *attr_electrometerChannel_read == ELETRO_CHANNEL_ONE ) + this->_updateRange1FromHW = true; + else if ( *attr_electrometerChannel_read == ELETRO_CHANNEL_TWO ) + this->_updateRange2FromHW = true; + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to down the range!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to down the range : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to down the range.", + "MCCE2Electrometers::range_down()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to down the range!"); + + ERROR_STREAM << "Failed to down the range : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to down the range!", + "MCCE2Electrometers::range_down()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to down the range : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to down the range!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_zero_vffunction + * method: MCCE2Electrometers::set_zero_vffunction * - * description: method to execute "SetZeroVFFunction" - * Enable the Zero V/F MCCE2 mode. + * description: method to execute "SetZeroVFFunction" + * Enable the Zero V/F MCCE2 mode. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_zero_vffunction() { - DEBUG_STREAM << "MCCE2Electrometers::set_zero_vffunction(): entering... !" << endl; - - // Add your own code to control device here - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_zero_vffunction()" - ); - } - - try - { - this->_electrometer->set_Zero_VonF_function(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable ZERO V/F function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable ZERO V/F function : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable ZERO V/F function.", - (const char*) "MCCE2Electrometers::set_zero_vffunction()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable ZERO V/F function !"); - - ERROR_STREAM << "Failed to enable ZERO V/F function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable ZERO V/F function !", - (const char*) "MCCE2Electrometers::set_zero_vffunction()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable ZERO V/F function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable ZERO V/F function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_zero_vffunction(): entering... !" << endl; + + // Add your own code to control device here + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_zero_vffunction()" + ); + } + + try + { + this->_electrometer->set_Zero_VonF_function(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable ZERO V/F function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable ZERO V/F function : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable ZERO V/F function.", + "MCCE2Electrometers::set_zero_vffunction()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable ZERO V/F function!"); + + ERROR_STREAM << "Failed to enable ZERO V/F function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable ZERO V/F function!", + "MCCE2Electrometers::set_zero_vffunction()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable ZERO V/F function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable ZERO V/F function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_offset_zero_v1_function + * method: MCCE2Electrometers::set_offset_zero_v1_function * - * description: method to execute "SetOffsetZeroV1Function" - * Enable the Offset or Zero V1 MCCE2 mode. + * description: method to execute "SetOffsetZeroV1Function" + * Enable the Offset or Zero V1 MCCE2 mode. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_offset_zero_v1_function() { - DEBUG_STREAM << "MCCE2Electrometers::set_offset_zero_v1_function(): entering... !" << endl; - - // Add your own code to control device here - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_offset_zero_v1_function()" - ); - } - - try - { - this->_electrometer->set_Offset_ZeroV1_function(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable OFFSET or ZERO V1 function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable OFFSET or ZERO V1 function.", - (const char*) "MCCE2Electrometers::set_offset_zero_v1_function()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable OFFSET or ZERO V1 function !"); - - ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable OFFSET or ZERO V1 function !", - (const char*) "MCCE2Electrometers::set_offset_zero_v1_function()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable OFFSET or ZERO V1 function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_offset_zero_v1_function(): entering... !" << endl; + + // Add your own code to control device here + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_offset_zero_v1_function()" + ); + } + + try + { + this->_electrometer->set_Offset_ZeroV1_function(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable OFFSET or ZERO V1 function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable OFFSET or ZERO V1 function.", + "MCCE2Electrometers::set_offset_zero_v1_function()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable OFFSET or ZERO V1 function!"); + + ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable OFFSET or ZERO V1 function!", + "MCCE2Electrometers::set_offset_zero_v1_function()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable OFFSET or ZERO V1 function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable OFFSET or ZERO V1 function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_leakage_zero_v2_function + * method: MCCE2Electrometers::set_leakage_zero_v2_function * - * description: method to execute "SetLeakageZeroV2Function" - * Enable the Leakage or Zero V2 MCCE2 mode. + * description: method to execute "SetLeakageZeroV2Function" + * Enable the Leakage or Zero V2 MCCE2 mode. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_leakage_zero_v2_function() { - DEBUG_STREAM << "MCCE2Electrometers::set_leakage_zero_v2_function(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_leakage_zero_v2_function()" - ); - } - - try - { - this->_electrometer->set_Leakage_ZeroV2_function(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable LEAKAGE or ZERO V2 function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable LEAKAGE or ZERO V2 function.", - (const char*) "MCCE2Electrometers::set_leakage_zero_v2_function()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable LEAKAGE or ZERO V2 function !"); - - ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable LEAKAGE or ZERO V2 function !", - (const char*) "MCCE2Electrometers::set_leakage_zero_v2_function()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable LEAKAGE or ZERO V2 function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_leakage_zero_v2_function(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_leakage_zero_v2_function()" + ); + } + + try + { + this->_electrometer->set_Leakage_ZeroV2_function(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable LEAKAGE or ZERO V2 function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable LEAKAGE or ZERO V2 function.", + "MCCE2Electrometers::set_leakage_zero_v2_function()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable LEAKAGE or ZERO V2 function!"); + + ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable LEAKAGE or ZERO V2 function!", + "MCCE2Electrometers::set_leakage_zero_v2_function()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable LEAKAGE or ZERO V2 function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable LEAKAGE or ZERO V2 function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_test_function + * method: MCCE2Electrometers::set_test_function * - * description: method to execute "SetTestFunction" - * Enable theTest MCCE2 mode. + * description: method to execute "SetTestFunction" + * Enable theTest MCCE2 mode. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_test_function() { - DEBUG_STREAM << "MCCE2Electrometers::set_test_function(): entering... !" << endl; - - // Add your own code to control device here - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_test_function()" - ); - } - - try - { - this->_electrometer->set_Test_function(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable TEST function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable TEST function : DevFailed EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable TEST function.", - (const char*) "MCCE2Electrometers::set_test_function()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable TEST function !"); - - ERROR_STREAM << "Failed to enable TEST function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable TEST function !", - (const char*) "MCCE2Electrometers::set_test_function()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable TEST function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable TEST function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_test_function(): entering... !" << endl; + + // Add your own code to control device here + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_test_function()" + ); + } + + try + { + this->_electrometer->set_Test_function(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable TEST function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable TEST function : DevFailed EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable TEST function.", + "MCCE2Electrometers::set_test_function()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable TEST function!"); + + ERROR_STREAM << "Failed to enable TEST function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable TEST function!", + "MCCE2Electrometers::set_test_function()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable TEST function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable TEST function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::mcce2__on + * method: MCCE2Electrometers::mcce2__on * - * description: method to execute "MCCE2_ON" - * Enables the function set. Parameters cannot be set (read only mode). + * description: method to execute "MCCE2_ON" + * Enables the function set. Parameters cannot be set (read only mode). * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::mcce2__on() { - DEBUG_STREAM << "MCCE2Electrometers::mcce2__on(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::mcce2__on()" - ); - } - - try - { - this->_electrometer->mcce_on(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable MCCE ON function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable MCCE ON function : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable MCCE ON function.", - (const char*) "MCCE2Electrometers::mcce2__on()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable MCCE ON function !"); - - ERROR_STREAM << "Failed to enable MCCE ON function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable MCCE ON function !", - (const char*) "MCCE2Electrometers::mcce2__on()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable MCCE2_ON function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable MCCE ON function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::mcce2__on(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::mcce2__on()" + ); + } + + try + { + this->_electrometer->mcce_on(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable MCCE ON function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable MCCE ON function : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable MCCE ON function.", + "MCCE2Electrometers::mcce2__on()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable MCCE ON function!"); + + ERROR_STREAM << "Failed to enable MCCE ON function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable MCCE ON function!", + "MCCE2Electrometers::mcce2__on()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable MCCE2_ON function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable MCCE ON function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::mcce2__off + * method: MCCE2Electrometers::mcce2__off * - * description: method to execute "MCCE2_OFF" - * Disables the function set. Parameters can be changed. + * description: method to execute "MCCE2_OFF" + * Disables the function set. Parameters can be changed. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::mcce2__off() { - DEBUG_STREAM << "MCCE2Electrometers::mcce2__off(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::mcce2__off()" - ); - } - - try - { - this->_electrometer->mcce_off(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable MCCE OFF function !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable MCCE OFF function : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable MCCE OFF function.", - (const char*) "MCCE2Electrometers::mcce2__off()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable MCCE OFF function !"); - - ERROR_STREAM << "Failed to enable MCCE OFF function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable MCCE OFF function !", - (const char*) "MCCE2Electrometers::mcce2__off()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable MCCE2_OFF function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable MCCE OFF function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::mcce2__off(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::mcce2__off()" + ); + } + + try + { + this->_electrometer->mcce_off(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable MCCE OFF function!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable MCCE OFF function : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable MCCE OFF function.", + "MCCE2Electrometers::mcce2__off()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable MCCE OFF function!"); + + ERROR_STREAM << "Failed to enable MCCE OFF function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable MCCE OFF function!", + "MCCE2Electrometers::mcce2__off()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable MCCE2_OFF function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable MCCE OFF function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::local + * method: MCCE2Electrometers::local * - * description: method to execute "Local" - * Enable local keyboard and Key + * description: method to execute "Local" + * Enable local keyboard and Key * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::local() { - DEBUG_STREAM << "MCCE2Electrometers::local(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::local()" - ); - } - - try - { - this->_electrometer->local(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable local mode !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable local mode : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable local mode.", - (const char*) "MCCE2Electrometers::local()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable local mode !"); - - ERROR_STREAM << "Failed to enable local function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable local mode !", - (const char*) "MCCE2Electrometers::local()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable local mode : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable local mode !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::local(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::local()" + ); + } + + try + { + this->_electrometer->local(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable local mode!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable local mode : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable local mode.", + "MCCE2Electrometers::local()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable local mode!"); + + ERROR_STREAM << "Failed to enable local function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable local mode!", + "MCCE2Electrometers::local()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable local mode : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable local mode!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::remote + * method: MCCE2Electrometers::remote * - * description: method to execute "Remote" - * Disable \"MODIFY\" and the \"ON-OFF\" keys + * description: method to execute "Remote" + * Disable \"MODIFY\" and the \"ON-OFF\" keys * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::remote() { - DEBUG_STREAM << "MCCE2Electrometers::remote(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::remote()" - ); - } - - try - { - this->_electrometer->remote(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable remote mode !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable remote mode : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable remote mode.", - (const char*) "MCCE2Electrometers::remote()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable remote mode !"); - - ERROR_STREAM << "Failed to enable remote mode : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable remote mode !", - (const char*) "MCCE2Electrometers::remote()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable remote mode : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable remote mode !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::remote(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::remote()" + ); + } + + try + { + this->_electrometer->remote(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable remote mode!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable remote mode : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable remote mode.", + "MCCE2Electrometers::remote()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable remote mode!"); + + ERROR_STREAM << "Failed to enable remote mode : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable remote mode!", + "MCCE2Electrometers::remote()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable remote mode : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable remote mode!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::reset + * method: MCCE2Electrometers::reset * - * description: method to execute "Reset" - * Restart the MCCE-2 + * description: method to execute "Reset" + * Restart the MCCE-2 * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::reset() { - DEBUG_STREAM << "MCCE2Electrometers::reset(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::reset()" - ); - } - - try - { - this->_electrometer->reset(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to enable reset mode !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to enable reset mode : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to enable reset mode.", - (const char*) "MCCE2Electrometers::reset()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable reset mode !"); - - ERROR_STREAM << "Failed to enable reset mode : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable reset mode !", - (const char*) "MCCE2Electrometers::reset()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable reset mode : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable reset mode !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::reset(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::reset()" + ); + } + + try + { + this->_electrometer->reset(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to enable reset mode!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to enable reset mode : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to enable reset mode.", + "MCCE2Electrometers::reset()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable reset mode!"); + + ERROR_STREAM << "Failed to enable reset mode : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable reset mode!", + "MCCE2Electrometers::reset()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable reset mode : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable reset mode!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::clear_registers + * method: MCCE2Electrometers::clear_registers * - * description: method to execute "ClearRegisters" - * Clear error(s) + * description: method to execute "ClearRegisters" + * Clear error(s) * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::clear_registers() { - DEBUG_STREAM << "MCCE2Electrometers::clear_registers(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::clear_registers()" - ); - } - - try - { - this->_electrometer->clear_registers(); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to clear all errors !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to clear all errors : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to clear all errors.", - (const char*) "MCCE2Electrometers::clear_registers()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to clear all errors !"); - - ERROR_STREAM << "Failed to clear all errors : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to clear all errors !", - (const char*) "MCCE2Electrometers::clear_registers()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to clear errors : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to clear all errors !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::clear_registers(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::clear_registers()" + ); + } + + try + { + this->_electrometer->clear_registers(); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to clear all errors!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to clear all errors : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to clear all errors.", + "MCCE2Electrometers::clear_registers()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to clear all errors!"); + + ERROR_STREAM << "Failed to clear all errors : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to clear all errors!", + "MCCE2Electrometers::clear_registers()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to clear errors : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to clear all errors!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::dev_state + * method: MCCE2Electrometers::dev_state * - * description: method to execute "State" - * This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller. + * description: method to execute "State" + * This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller. * - * @return State Code + * @return State Code * */ //+------------------------------------------------------------------ Tango::DevState MCCE2Electrometers::dev_state() { - Tango::DevState argout = Tango::UNKNOWN; - DEBUG_STREAM << "MCCE2Electrometers::dev_state(): entering... !" << endl; + Tango::DevState argout = Tango::UNKNOWN; + DEBUG_STREAM << "MCCE2Electrometers::dev_state(): entering... !" << endl; - // Add your own code to control device here - try + // Add your own code to control device here + try + { + if ( this->_missing_property ) { - if ( this->_missing_property ) - { - argout = Tango::FAULT; - } - else if (!this->_electrometer) - { - argout = Tango::FAULT; - } - else if( !this->_init_done ) - { - argout = Tango::ALARM; - } - else if ( attr_electrometerChannel_write != 1 && attr_electrometerChannel_write != 2 ) - { - argout = Tango::ALARM; - } - else - { - //- update state - this->_electrometer->electrometer_status(); - //- get electrometer state - short tmpState = _electrometer->electrometer_state(); - - switch(tmpState) - { - case Tango::ON : - argout = Tango::ON; - break; - case Tango::FAULT : - argout = Tango::FAULT; - break; - case Tango::ALARM : - argout = Tango::ALARM; - break; - /*case Tango::UNKNOWN: - default : - argout = Tango::UNKNOWN; - break;*/ - } - } + argout = Tango::FAULT; } - catch(const electrometer::ElectrometerException& ke) + else if ( !this->_electrometer ) { - set_state(Tango::ALARM); - set_status("Failed to get electrometer state !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Cannot perform get electrometer state : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to get electrometer state.", - (const char*) "MCCE2Electrometers::dev_state()", - Tango::ERR - ); + argout = Tango::FAULT; } - catch(Tango::DevFailed& df) + else if( !this->_init_done ) { - set_state(Tango::ALARM); - set_status("Failed to get electrometer state !"); - - ERROR_STREAM << "Failed to get electrometer state : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to get electrometer state !", - (const char*) "MCCE2Electrometers::dev_state()", - Tango::ERR - ); + argout = Tango::ALARM; } - catch(...) + else if ( attr_electrometerChannel_write != ELETRO_CHANNEL_ONE && attr_electrometerChannel_write != ELETRO_CHANNEL_TWO ) { - set_state(Tango::ALARM); - set_status("Failed to get electrometer state !"); - ERROR_STREAM << "Failed to get electrometer state : [...] EXCEPTION " << std::endl; - throw; + argout = Tango::ALARM; } - - set_state(argout); - return argout; + else + { + //- update state + this->_electrometer->electrometer_status(); + //- get electrometer state + short tmpState = _electrometer->electrometer_state(); + + switch(tmpState) + { + case Tango::ON : + argout = Tango::ON; + break; + case Tango::FAULT : + argout = Tango::FAULT; + break; + case Tango::ALARM : + argout = Tango::ALARM; + break; + /*case Tango::UNKNOWN: + default : + argout = Tango::UNKNOWN; + break;*/ + } + } + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to get electrometer state!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Cannot perform get electrometer state : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to get electrometer state.", + "MCCE2Electrometers::dev_state()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to get electrometer state!"); + + ERROR_STREAM << "Failed to get electrometer state : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to get electrometer state!", + "MCCE2Electrometers::dev_state()", + Tango::ERR + ); + } + catch(...) + { + set_state(Tango::ALARM); + set_status("Failed to get electrometer state!"); + ERROR_STREAM << "Failed to get electrometer state : [...] EXCEPTION " << std::endl; + throw; + } + + set_state(argout); + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::dev_status + * method: MCCE2Electrometers::dev_status * - * description: method to execute "Status" - * This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller. + * description: method to execute "Status" + * This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller. * - * @return Status descrition + * @return Status descrition * */ //+------------------------------------------------------------------ Tango::ConstDevString MCCE2Electrometers::dev_status() { - DEBUG_STREAM << "MCCE2Electrometers::dev_status(): entering... !" << endl; + DEBUG_STREAM << "MCCE2Electrometers::dev_status(): entering... !" << endl; - // Add your own code to control device here - try + // Add your own code to control device here + try + { + if ( this->_missing_property ) { - if ( this->_missing_property ) - { - _statusStr = "Device cannot be up while its properties are not set !"; - } - else if ( !this->_electrometer ) - { - _statusStr = "There is no link with the Electrometer Library."; - } - else if( !this->_init_done ) - { - _statusStr = "Device is not completely initialised !!!"; - } - else if ( attr_electrometerChannel_write != 1 && attr_electrometerChannel_write != 2 ) - { - _statusStr = "Invalid electrometer channel set !"; - } - else - { - _statusStr = this->_electrometer->electrometer_status(); - } + _statusStr = "Device cannot be up while its properties are not set!"; } - catch(const electrometer::ElectrometerException& ke) + else if ( !this->_electrometer ) { - set_state(Tango::ALARM); - set_status("Cannot perform electrometer_status() command."); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Cannot perform electrometer_status() command : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to get electrometer status.", - (const char*) "MCCE2Electrometers::dev_status()", - Tango::ERR - ); + _statusStr = "There is no link with the Electrometer Library."; } - catch(Tango::DevFailed& df) + else if( !this->_init_done ) { - set_state(Tango::ALARM); - set_status("Cannot perform electrometer_status() command !"); - - ERROR_STREAM << "Cannot perform electrometer_status() command : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Cannot perform electrometer_status() command !", - (const char*) "MCCE2Electrometers::dev_status()", - Tango::ERR - ); + _statusStr = "Device is not completely initialised!!!"; } - catch(...) + else if ( attr_electrometerChannel_write != ELETRO_CHANNEL_ONE && attr_electrometerChannel_write != ELETRO_CHANNEL_TWO ) { - ERROR_STREAM << "Failed to enable remote mode : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Cannot perform electrometer_status() command : caugth [...] exception."); - throw; + _statusStr = "Invalid electrometer channel set!"; } - set_status( _statusStr.c_str() ); - return _statusStr.c_str(); + else + { + _statusStr = this->_electrometer->electrometer_status(); + } + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Cannot perform electrometer_status() command."); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Cannot perform electrometer_status() command : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to get electrometer status.", + "MCCE2Electrometers::dev_status()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Cannot perform electrometer_status() command!"); + + ERROR_STREAM << "Cannot perform electrometer_status() command : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Cannot perform electrometer_status() command!", + "MCCE2Electrometers::dev_status()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable remote mode : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Cannot perform electrometer_status() command : caugth [...] exception."); + throw; + } + set_status( _statusStr.c_str() ); + return _statusStr.c_str(); } //+---------------------------------------------------------------------------- @@ -1466,927 +1468,957 @@ Tango::ConstDevString MCCE2Electrometers::dev_status() // method : MCCE2Electrometers::electrometer_to_tango_exception() // // description : Extract real attribute values from -// hardware acquisition result. +// hardware acquisition result. // //----------------------------------------------------------------------------- Tango::DevFailed MCCE2Electrometers::electrometer_to_tango_exception(const electrometer::ElectrometerException& de) { - Tango::DevErrorList error_list(de.errors.size()); - error_list.length(de.errors.size()); + Tango::DevErrorList error_list(de.errors.size()); + error_list.length(de.errors.size()); + + for(unsigned int i = 0; i < de.errors.size(); i++) + { + error_list[i].reason = CORBA::string_dup(de.errors[i].reason.c_str()); + error_list[i].desc = CORBA::string_dup(de.errors[i].desc.c_str()); + error_list[i].origin = CORBA::string_dup(de.errors[i].origin.c_str()); - for(unsigned int i = 0; i < de.errors.size(); i++) + switch(de.errors[i].severity) { - error_list[i].reason = CORBA::string_dup(de.errors[i].reason.c_str()); - error_list[i].desc = CORBA::string_dup(de.errors[i].desc.c_str()); - error_list[i].origin = CORBA::string_dup(de.errors[i].origin.c_str()); - - switch(de.errors[i].severity) - { - case electrometer::WARN: - error_list[i].severity = Tango::WARN; - break; - - case electrometer::PANIC: - error_list[i].severity = Tango::PANIC; - break; - - case electrometer::ERR: - - default: - error_list[i].severity = Tango::ERR; - break; - } + case electrometer::WARN: + error_list[i].severity = Tango::WARN; + break; + + case electrometer::PANIC: + error_list[i].severity = Tango::PANIC; + break; + + case electrometer::ERR: + + default: + error_list[i].severity = Tango::ERR; + break; } - return Tango::DevFailed(error_list); + } + return Tango::DevFailed(error_list); } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_measure_function + * method: MCCE2Electrometers::set_measure_function * - * description: method to execute "SetMeasureFunction" - * Enable the Measure MCCE2 mode. + * description: method to execute "SetMeasureFunction" + * Enable the Measure MCCE2 mode. * * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_measure_function() { - DEBUG_STREAM << "MCCE2Electrometers::set_measure_function(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_measure_function()" - ); - } - - try - { - this->_electrometer->set_Measure_function(); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - set_state(Tango::ALARM); - set_status("Failed to enable MEASURE function !"); - - ERROR_STREAM << "Failed to enable MEASURE function : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable MEASURE function.", - (const char*) "MCCE2Electrometers::set_measure_function()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to enable MEASURE function !"); - - ERROR_STREAM << "Failed to enable MEASURE function : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to enable MEASURE function !", - (const char*) "MCCE2Electrometers::set_measure_function()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to enable MEASURE function : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to enable MEASURE function !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_measure_function(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_measure_function()" + ); + } + + try + { + this->_electrometer->set_Measure_function(); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + set_state(Tango::ALARM); + set_status("Failed to enable MEASURE function!"); + + ERROR_STREAM << "Failed to enable MEASURE function : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable MEASURE function.", + "MCCE2Electrometers::set_measure_function()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to enable MEASURE function!"); + + ERROR_STREAM << "Failed to enable MEASURE function : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to enable MEASURE function!", + "MCCE2Electrometers::set_measure_function()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to enable MEASURE function : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to enable MEASURE function!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_range + * method: MCCE2Electrometers::set_range * - * description: method to execute "SetRange" - * Apply the specified argin range, on the electrometer, if well formatted. - * Else an exception is thrown. + * description: method to execute "SetRange" + * Apply the specified argin range, on the electrometer, if well formatted. + * Else an exception is thrown. * - * @param argin The range to apply on the electrometer + * @param argin The range to apply on the electrometer * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_range(Tango::DevString argin) { - DEBUG_STREAM << "MCCE2Electrometers::set_range(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_range()" - ); - } - - try - { - this->_electrometer->set_ElectroMeterRange(std::string(argin)); - } - catch(const electrometer::ElectrometerException& ke) - { - set_state(Tango::ALARM); - set_status("Failed to write the range !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to write the range : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to write the range.", - (const char*) "MCCE2Electrometers::set_range()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - set_state(Tango::ALARM); - set_status("Failed to write the range !"); - - ERROR_STREAM << "Failed to write the range : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to write the range !", - (const char*) "MCCE2Electrometers::set_range()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to set the new range value : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to write the range !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_range(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_range()" + ); + } + + try + { + this->_electrometer->set_ElectroMeterRange(std::string(argin)); + } + catch(const electrometer::ElectrometerException& ke) + { + set_state(Tango::ALARM); + set_status("Failed to write the range!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to write the range : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to write the range.", + "MCCE2Electrometers::set_range()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::ALARM); + set_status("Failed to write the range!"); + + ERROR_STREAM << "Failed to write the range : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to write the range!", + "MCCE2Electrometers::set_range()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to set the new range value : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to write the range!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_hz_filter + * method: MCCE2Electrometers::set_hz_filter * - * description: method to execute "SetHzFilter" - * The Cut-off frequency in Hz + * description: method to execute "SetHzFilter" + * The Cut-off frequency in Hz * - * @param argin The MCCE2 cut-off frequency in Hz + * @param argin The MCCE2 cut-off frequency in Hz * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_hz_filter(Tango::DevShort argin) { - DEBUG_STREAM << "MCCE2Electrometers::set_hz_filter(): entering... !" << endl; - std::string dataStr("") ; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_hz_filter()" - ); - } - - try - { - dataStr = XString<short>::convertToString(argin); - this->_electrometer->set_ElectroMeterFrequency(dataStr); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - set_state(Tango::ALARM); - set_status("Failed to set the Hz Filter !"); - ERROR_STREAM << "Failed to set the Hz Filter : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to set the Hz Filter.", - (const char*) "MCCE2Electrometers::set_hz_filter()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - ERROR_STREAM << "Failed to set the Hz Filter : DevFailed EXCEPTION -> " << df << std::endl; - - set_state(Tango::ALARM); - set_status("Failed to set the Hz Filter !"); - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to set the Hz Filter !", - (const char*) "MCCE2Electrometers::set_hz_filter()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to set the Hz Filter : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to set the Hz Filter !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_hz_filter(): entering... !" << endl; + std::string dataStr("") ; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_hz_filter()" + ); + } + + try + { + dataStr = XString<short>::convertToString(argin); + this->_electrometer->set_ElectroMeterFrequency(dataStr); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + set_state(Tango::ALARM); + set_status("Failed to set the Hz Filter!"); + ERROR_STREAM << "Failed to set the Hz Filter : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to set the Hz Filter.", + "MCCE2Electrometers::set_hz_filter()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + ERROR_STREAM << "Failed to set the Hz Filter : DevFailed EXCEPTION -> " << df << std::endl; + + set_state(Tango::ALARM); + set_status("Failed to set the Hz Filter!"); + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to set the Hz Filter!", + "MCCE2Electrometers::set_hz_filter()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to set the Hz Filter : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to set the Hz Filter!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::get_hz_filter + * method: MCCE2Electrometers::get_hz_filter * - * description: method to execute "GetHzFilter" - * Returns the Cut-off frequency in Hz + * description: method to execute "GetHzFilter" + * Returns the Cut-off frequency in Hz * - * @return The MCCE2 cut-off frequency in Hz + * @return The MCCE2 cut-off frequency in Hz * */ //+------------------------------------------------------------------ Tango::DevShort MCCE2Electrometers::get_hz_filter() { - Tango::DevShort argout = 0; - DEBUG_STREAM << "MCCE2Electrometers::get_hz_filter(): entering... !" << endl; - - // Add your own code to control device here - std::string dataStr(""); - - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::get_hz_filter()" - ); - } - - try - { - dataStr = this->_electrometer->get_ElectroMeterFrequency(); - argout = XString<short>::convertFromString(dataStr); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - set_state(Tango::ALARM); - set_status("Failed to set the Hz Filter !"); - ERROR_STREAM << "Failed to read the gain : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to read hzFilter .", - (const char*) "hzFilterAttrib::get_hz_filter()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - ERROR_STREAM << "Failed to read the Hz Filter : DevFailed EXCEPTION -> " << df << std::endl; - - set_state(Tango::ALARM); - set_status("Failed to set the Hz Filter !"); - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the Hz Filter !", - (const char*) "MCCE2Electrometers::get_hz_filter()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to read the Hz Filter : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to read the Hz Filter !"); - - throw; - } - - return argout; + Tango::DevShort argout = 0; + DEBUG_STREAM << "MCCE2Electrometers::get_hz_filter(): entering... !" << endl; + + // Add your own code to control device here + std::string dataStr(""); + + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::get_hz_filter()" + ); + } + + try + { + dataStr = this->_electrometer->get_ElectroMeterFrequency(); + argout = XString<short>::convertFromString(dataStr); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + set_state(Tango::ALARM); + set_status("Failed to set the Hz Filter!"); + ERROR_STREAM << "Failed to read the gain : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to read hzFilter.", + "hzFilterAttrib::get_hz_filter()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + ERROR_STREAM << "Failed to read the Hz Filter : DevFailed EXCEPTION -> " << df << std::endl; + + set_state(Tango::ALARM); + set_status("Failed to set the Hz Filter!"); + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the Hz Filter!", + "MCCE2Electrometers::get_hz_filter()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to read the Hz Filter : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to read the Hz Filter!"); + + throw; + } + + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::get_gain + * method: MCCE2Electrometers::get_gain * - * description: method to execute "GetGain" - * Returns the MCCE-2 gain + * description: method to execute "GetGain" + * Returns the MCCE-2 gain * - * @return The MCCE2 gain + * @return The MCCE2 gain * */ //+------------------------------------------------------------------ Tango::DevShort MCCE2Electrometers::get_gain() { - Tango::DevShort argout = 0; - DEBUG_STREAM << "MCCE2Electrometers::get_gain(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::get_gain()" - ); - } - - try - { - std::string dataStr(""); - dataStr = this->_electrometer->get_ElectroMeterGain(); - argout = XString<short>::convertFromString(dataStr); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - set_state(Tango::ALARM); - set_status("Failed to read the gain !"); - ERROR_STREAM << "Failed to read the gain : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to read the gain .", - (const char*) "hzFilterAttrib::get_gain()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - ERROR_STREAM << "Failed to read the gain : DevFailed EXCEPTION -> " << df << std::endl; - - set_state(Tango::ALARM); - set_status("Failed to read the gain !"); - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the gain !", - (const char*) "MCCE2Electrometers::get_gain()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to read the gain : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to read the gain !"); - - throw; - } - - return argout; + Tango::DevShort argout = 0; + DEBUG_STREAM << "MCCE2Electrometers::get_gain(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::get_gain()" + ); + } + + try + { + std::string dataStr(""); + dataStr = this->_electrometer->get_ElectroMeterGain(); + argout = XString<short>::convertFromString(dataStr); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + set_state(Tango::ALARM); + set_status("Failed to read the gain!"); + ERROR_STREAM << "Failed to read the gain : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to read the gain .", + "hzFilterAttrib::get_gain()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + ERROR_STREAM << "Failed to read the gain : DevFailed EXCEPTION -> " << df << std::endl; + + set_state(Tango::ALARM); + set_status("Failed to read the gain!"); + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the gain!", + "MCCE2Electrometers::get_gain()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to read the gain : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to read the gain!"); + + throw; + } + + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_gain + * method: MCCE2Electrometers::set_gain * - * description: method to execute "SetGain" - * Sets the new MCCE-2 gain value. + * description: method to execute "SetGain" + * Sets the new MCCE-2 gain value. * - * @param argin The new MCCE-2 gain + * @param argin The new MCCE-2 gain * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_gain(Tango::DevUShort argin) { - DEBUG_STREAM << "MCCE2Electrometers::set_gain(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_gain()" - ); - } - - try - { - std::string dataStr(""); - dataStr = XString<short>::convertToString(argin); - this->_electrometer->set_ElectroMeterGain(dataStr); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - set_state(Tango::ALARM); - set_status("Failed to set the gain !"); - ERROR_STREAM << "Failed to set the gain : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to set the gain .", - (const char*) "hzFilterAttrib::set_gain()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - ERROR_STREAM << "Failed to set the gain : DevFailed EXCEPTION -> " << df << std::endl; - - set_state(Tango::ALARM); - set_status("Failed to set the gain !"); - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to set the the gain !", - (const char*) "MCCE2Electrometers::set_gain()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to set the gain : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to set the gain !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_gain(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_gain()" + ); + } + + try + { + std::string dataStr(""); + dataStr = XString<short>::convertToString(argin); + this->_electrometer->set_ElectroMeterGain(dataStr); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + set_state(Tango::ALARM); + set_status("Failed to set the gain!"); + ERROR_STREAM << "Failed to set the gain : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to set the gain.", + "hzFilterAttrib::set_gain()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + ERROR_STREAM << "Failed to set the gain : DevFailed EXCEPTION -> " << df << std::endl; + + set_state(Tango::ALARM); + set_status("Failed to set the gain!"); + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to set the the gain!", + "MCCE2Electrometers::set_gain()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to set the gain : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to set the gain!"); + + throw; + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::get_range + * method: MCCE2Electrometers::get_range * - * description: method to execute "GetRange" - * Returns the electrometer range. + * description: method to execute "GetRange" + * Returns the electrometer range. * - * @return The actual electrometer range + * @return The actual electrometer range * */ //+------------------------------------------------------------------ Tango::DevString MCCE2Electrometers::get_range() { - // POGO has generated a method core with argout allocation. - // If you would like to use a static reference without copying, - // See "TANGO Device Server Programmer's Manual" - // (chapter : Writing a TANGO DS / Exchanging data) - //------------------------------------------------------------ - - // Add your own code to control device here - DEBUG_STREAM << "MCCE2Electrometers::get_range(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::get_range()" - ); - } - - Tango::DevString argout = 0; - try - { - std::string rangeStr(""); - rangeStr = this->_electrometer->get_ElectroMeterRange(); - argout = new char [rangeStr.size() + 1]; - strcpy(argout, rangeStr.c_str()); - } - catch(const electrometer::ElectrometerException& ke) - { - if ( argout ) - delete [] argout; - Tango::DevFailed df = electrometer_to_tango_exception(ke); - set_state(Tango::ALARM); - set_status("Failed to read the range !"); - - ERROR_STREAM << "Failed to set read the range : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to read the range.", - (const char*) "MCCE2Electrometers::get_range()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - if ( argout ) - delete [] argout; - set_state(Tango::ALARM); - set_status("Failed to read the range !"); - - ERROR_STREAM << "Failed to read the range : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the range !", - (const char*) "MCCE2Electrometers::get_range()", - Tango::ERR - ); - } - catch(...) - { - if ( argout ) - delete [] argout; - ERROR_STREAM << "Failed to read the range : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to read the range !"); - - throw; - } - - return argout; + // POGO has generated a method core with argout allocation. + // If you would like to use a static reference without copying, + // See "TANGO Device Server Programmer's Manual" + // (chapter : Writing a TANGO DS / Exchanging data) + //------------------------------------------------------------ + + // Add your own code to control device here + DEBUG_STREAM << "MCCE2Electrometers::get_range(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::get_range()" + ); + } + + Tango::DevString argout = 0; + try + { + std::string rangeStr(""); + rangeStr = this->_electrometer->get_ElectroMeterRange(); + argout = new char [rangeStr.size() + 1]; + strcpy(argout, rangeStr.c_str()); + } + catch(const electrometer::ElectrometerException& ke) + { + if ( argout ) + delete [] argout; + Tango::DevFailed df = electrometer_to_tango_exception(ke); + set_state(Tango::ALARM); + set_status("Failed to read the range!"); + + ERROR_STREAM << "Failed to set read the range : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to read the range.", + "MCCE2Electrometers::get_range()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + if ( argout ) + delete [] argout; + set_state(Tango::ALARM); + set_status("Failed to read the range!"); + + ERROR_STREAM << "Failed to read the range : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the range!", + "MCCE2Electrometers::get_range()", + Tango::ERR + ); + } + catch(...) + { + if ( argout ) + delete [] argout; + ERROR_STREAM << "Failed to read the range : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to read the range!"); + + throw; + } + + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::get_mode + * method: MCCE2Electrometers::get_mode * - * description: method to execute "GetMode" - * Returns the electrometer mode which can be one of the following values : - * MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST. + * description: method to execute "GetMode" + * Returns the electrometer mode which can be one of the following values : + * MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST. * - * @return The electrometer mode (MEASURE, LEAKAGE ...) + * @return The electrometer mode (MEASURE, LEAKAGE ...) * */ //+------------------------------------------------------------------ Tango::DevString MCCE2Electrometers::get_mode() { - // POGO has generated a method core with argout allocation. - // If you would like to use a static reference without copying, - // See "TANGO Device Server Programmer's Manual" - // (chapter : Writing a TANGO DS / Exchanging data) - //------------------------------------------------------------ - DEBUG_STREAM << "MCCE2Electrometers::get_mode(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::get_mode()" - ); - } - - Tango::DevString argout = 0; - try - { - std::string modeStr = this->_electrometer->get_ElectroMeterMode(); - argout = new char [modeStr.size() + 1]; - strcpy(argout, modeStr.c_str()); - } - catch(const electrometer::ElectrometerException& ke) - { - if ( argout ) - delete [] argout; - set_state(Tango::ALARM); - set_status("Failed to read the mode !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to set read the mode : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to read the mode", - (const char*) "MCCE2Electrometers::get_mode()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - if ( argout ) - delete [] argout; - set_state(Tango::ALARM); - set_status("Failed to read the mode !"); - - ERROR_STREAM << "Failed to read the mode : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the mode !", - (const char*) "MCCE2Electrometers::get_mode()", - Tango::ERR - ); - } - catch(...) - { - if ( argout ) - delete [] argout; - ERROR_STREAM << "Failed to read the mode : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to read the mode !"); - - throw; - } - return argout; + // POGO has generated a method core with argout allocation. + // If you would like to use a static reference without copying, + // See "TANGO Device Server Programmer's Manual" + // (chapter : Writing a TANGO DS / Exchanging data) + //------------------------------------------------------------ + DEBUG_STREAM << "MCCE2Electrometers::get_mode(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::get_mode()" + ); + } + + Tango::DevString argout = 0; + try + { + std::string modeStr = this->_electrometer->get_ElectroMeterMode(); + argout = new char [modeStr.size() + 1]; + strcpy(argout, modeStr.c_str()); + } + catch(const electrometer::ElectrometerException& ke) + { + if ( argout ) + delete [] argout; + set_state(Tango::ALARM); + set_status("Failed to read the mode!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to set read the mode : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to read the mode.", + "MCCE2Electrometers::get_mode()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + if ( argout ) + delete [] argout; + set_state(Tango::ALARM); + set_status("Failed to read the mode!"); + + ERROR_STREAM << "Failed to read the mode : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the mode!", + "MCCE2Electrometers::get_mode()", + Tango::ERR + ); + } + catch(...) + { + if ( argout ) + delete [] argout; + ERROR_STREAM << "Failed to read the mode : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to read the mode!"); + + throw; + } + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::get_polarity + * method: MCCE2Electrometers::get_polarity * - * description: method to execute "GetPolarity" - * Returns the electrometer polarity, which can be POSITIVE or NEGATIVE. + * description: method to execute "GetPolarity" + * Returns the electrometer polarity, which can be POSITIVE or NEGATIVE. * - * @return The electrometer polarity + * @return The electrometer polarity * */ //+------------------------------------------------------------------ Tango::DevString MCCE2Electrometers::get_polarity() { - // POGO has generated a method core with argout allocation. - // If you would like to use a static reference without copying, - // See "TANGO Device Server Programmer's Manual" - // (chapter : Writing a TANGO DS / Exchanging data) - //------------------------------------------------------------ - DEBUG_STREAM << "MCCE2Electrometers::get_polarity(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::get_polarity()" - ); - } - - - Tango::DevString argout = 0; - try - { - std::string polarStr = this->_electrometer->get_ElectroMeterPolarity(); - argout = new char [polarStr.size() + 1]; - strcpy(argout, polarStr.c_str()); - } - catch(const electrometer::ElectrometerException& ke) - { - if ( argout ) - delete [] argout; - set_state(Tango::ALARM); - set_status("Failed to read the polarity !"); - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - ERROR_STREAM << "Failed to set read the polarity : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the polarity.", - (const char*) "MCCE2Electrometers::get_polarity()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - if ( argout ) - delete [] argout; - set_state(Tango::ALARM); - set_status("Failed to read the polarity !"); - - ERROR_STREAM << "Failed to read the polarity : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to read the polarity !", - (const char*) "MCCE2Electrometers::get_polarity()", - Tango::ERR - ); - } - catch(...) - { - if ( argout ) - delete [] argout; - ERROR_STREAM << "Failed to read the polarity : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to read the polarity !"); - - throw; - } - - return argout; + // POGO has generated a method core with argout allocation. + // If you would like to use a static reference without copying, + // See "TANGO Device Server Programmer's Manual" + // (chapter : Writing a TANGO DS / Exchanging data) + //------------------------------------------------------------ + DEBUG_STREAM << "MCCE2Electrometers::get_polarity(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::get_polarity()" + ); + } + + + Tango::DevString argout = 0; + try + { + std::string polarStr = this->_electrometer->get_ElectroMeterPolarity(); + argout = new char [polarStr.size() + 1]; + strcpy(argout, polarStr.c_str()); + } + catch(const electrometer::ElectrometerException& ke) + { + if ( argout ) + delete [] argout; + set_state(Tango::ALARM); + set_status("Failed to read the polarity!"); + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to set read the polarity : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the polarity.", + "MCCE2Electrometers::get_polarity()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + if ( argout ) + delete [] argout; + set_state(Tango::ALARM); + set_status("Failed to read the polarity!"); + + ERROR_STREAM << "Failed to read the polarity : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to read the polarity!", + "MCCE2Electrometers::get_polarity()", + Tango::ERR + ); + } + catch(...) + { + if ( argout ) + delete [] argout; + ERROR_STREAM << "Failed to read the polarity : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to read the polarity!"); + + throw; + } + + return argout; } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::create_electrometers_obj + * method: MCCE2Electrometers::create_electrometers_obj * - * description: internal method to instanciate electrometer(s) obj + * description: internal method to instanciate electrometer(s) obj */ //+------------------------------------------------------------------ void MCCE2Electrometers::create_electrometers_obj() { - Tango::DevUShort channelNumber = 1; - //- instanciate channel 1 - if ( !_electrometerCH1 ) - { - switch(electrometerTypeCh1) - { - case 0 : - this->_electrometerCH1 = 0; - break; - case 1 : - case 2 : - case 3 : - this->_electrometerCH1 = new N_PhotoVoltaique (communicationLinkName, channelNumber, electrometerTypeCh1); - break; - case 4 : - case 5 : - this->_electrometerCH1 = new N_PhotoConducteur(communicationLinkName, channelNumber, electrometerTypeCh1); - break; - default : - FATAL_STREAM << "\nERROR : Electrometers::create_electrometers_obj() -> this " << electrometerTypeCh1 << " Novelec type is not supported now !" << endl; - return; - } - } - - //- instanciate channel 2 - channelNumber = 2; - if ( !this->_electrometerCH2 ) - { - switch(electrometerTypeCh2) - { - case 0 : - this->_electrometerCH2 = 0; - break; - case 1 : - case 2 : - case 3 : - this->_electrometerCH2 = new N_PhotoVoltaique (communicationLinkName, channelNumber, electrometerTypeCh2); - break; - case 4 : - case 5 : - this->_electrometerCH2 = new N_PhotoConducteur(communicationLinkName, channelNumber, electrometerTypeCh2); - break; - default : - FATAL_STREAM << "\nERROR : Electrometers::create_electrometers_obj() -> this " << electrometerTypeCh2 << " Novelec type is not supported now !" << endl; - return; - } - } - - //- check - if (!this->_electrometerCH1 && !this->_electrometerCH2) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Cannot build device comm obj !", - (const char*) "MCCE2Electrometers::create_electrometers_obj()"); + //- instanciate channel 1 + if ( !_electrometerCH1 && electrometer1Address ) + { + AbstractElectrometerClass* mcce1; + mcce1 = new Novelec_MCCE2(communicationLinkName, electrometer1Address); + mcce1->init_protocol(); + + Novelec_MCCE2* nMCCE1 = dynamic_cast<Novelec_MCCE2*>(mcce1); + short type1 = 0; + if(nMCCE1) + type1 = nMCCE1->get_electrometer_type(); + + switch(type1) + { + case 0 : + this->_electrometerCH1 = 0; + break; + case 1 : + case 2 : + case 3 : +// this->_electrometerCH1 = new N_PhotoVoltaique (communicationLinkName, channelNumber, electrometerTypeCh1); + this->_electrometerCH1 = new N_PhotoVoltaique (communicationLinkName, electrometer1Address); + break; + case 4 : + case 5 : + this->_electrometerCH1 = new N_PhotoConducteur(communicationLinkName, electrometer1Address); + break; + default : + FATAL_STREAM << "\nERROR : Electrometers::create_electrometers_obj() -> this " << electrometer1Address << " Novelec type is not supported now!" << endl; + return; + } + if ( mcce1 ) + { + delete mcce1; + mcce1 = 0; + } + } + + //- instanciate channel 2 + if ( !this->_electrometerCH2 && electrometer2Address ) + { + AbstractElectrometerClass* mcce2; + mcce2 = new Novelec_MCCE2(communicationLinkName, electrometer2Address); + mcce2->init_protocol(); + Novelec_MCCE2* nMCCE2 = dynamic_cast<Novelec_MCCE2*>(mcce2); + short type2 = 0; + if(nMCCE2) + type2 = nMCCE2->get_electrometer_type(); + + switch(type2) + { + case 0 : + this->_electrometerCH2 = 0; + break; + case 1 : + case 2 : + case 3 : + this->_electrometerCH2 = new N_PhotoVoltaique (communicationLinkName, electrometer2Address); + break; + case 4 : + case 5 : + this->_electrometerCH2 = new N_PhotoConducteur(communicationLinkName, electrometer2Address); + break; + default : + FATAL_STREAM << "\nERROR : Electrometers::create_electrometers_obj() -> this " << electrometer2Address << " Novelec type is not supported now!" << endl; + return; + } + if ( mcce2 ) + { + delete mcce2; + mcce2 = 0; + } + } + + //- check + if (!this->_electrometerCH1 && !this->_electrometerCH2) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Cannot build device comm obj!", + "MCCE2Electrometers::create_electrometers_obj()"); + } + + //- configure MCCE-2 : clear error(s), explicit response, mode MEASURE OFF + bool initCH1 = false; + bool initCH2 = false; + try + { + if ( this->_electrometerCH1 ) + { + initCH1 = this->_electrometerCH1->init_protocol(); + if ( initCH1 ) + this->_electrometerCH1->mcce_init(); + + INFO_STREAM << "this->_electrometer = this->_electrometerCH1!" << std::endl; } + else + WARN_STREAM << "WARN : !this->_electrometerCH1" << std::endl; - //- configure MCCE-2 : clear error(s), explicit response, mode MEASURE OFF - bool initCH1 = false; - bool initCH2 = false; - try + if ( this->_electrometerCH2 ) { - if ( this->_electrometerCH1 ) - { - initCH1 = this->_electrometerCH1->init_protocol(); - if ( initCH1 ) - this->_electrometerCH1->mcce_init(); - - INFO_STREAM << "this->_electrometer = this->_electrometerCH1 !" << std::endl; - } - else - WARN_STREAM << "WARN : !this->_electrometerCH1" << std::endl; - - if ( this->_electrometerCH2 ) - { - initCH2 = this->_electrometerCH2->init_protocol(); - if ( initCH2 ) - this->_electrometerCH2->mcce_init(); - INFO_STREAM << "this->_electrometer = this->_electrometerCH2 !" << std::endl; - } - - //- start with channel one - if ( this->_electrometerCH1 ) - { - this->_electrometer = this->_electrometerCH1; - this->_init_done = true; - } - else - this->_init_done = false; + initCH2 = this->_electrometerCH2->init_protocol(); + if ( initCH2 ) + this->_electrometerCH2->mcce_init(); + INFO_STREAM << "this->_electrometer = this->_electrometerCH2!" << std::endl; } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : ElectrometerException EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to set up the MCCE-2 module for a serial communication !", - (const char*) "MCCE2Electrometers::create_electrometers_obj()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) + //- start with channel one + if ( this->_electrometerCH1 ) { - set_state(Tango::FAULT); - set_status("Failed to set up the MCCE-2 module for a serial communication !"); - - ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : DevFailed EXCEPTION -> " << df << std::endl; - - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to set up the MCCE-2 module for a serial communication !", - (const char*) "MCCE2Electrometers::create_electrometers_obj()", - Tango::ERR - ); + this->_electrometer = this->_electrometerCH1; + this->_init_done = true; } - catch(...) + //- if nothing connected on channel one, try with the second one + else if ( this->_electrometerCH2 ) { - set_state(Tango::FAULT); - set_status("Failed to set up the MCCE-2 module for a serial communication caught[...]"); - - ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : [...] EXCEPTION " << std::endl; - - Tango::Except::throw_exception( - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to set up the MCCE-2 module for a serial communication ! [(...) exception]", - (const char*) "MCCE2Electrometers::create_electrometers_obj()", - Tango::ERR - ); + this->_electrometer = this->_electrometerCH2; + this->_init_done = true; } + else + this->_init_done = false; + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : ElectrometerException EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to set up the MCCE-2 module for a serial communication!", + "MCCE2Electrometers::create_electrometers_obj()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + set_state(Tango::FAULT); + set_status("Failed to set up the MCCE-2 module for a serial communication!"); + + ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : DevFailed EXCEPTION -> " << df << std::endl; + + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to set up the MCCE-2 module for a serial communication!", + "MCCE2Electrometers::create_electrometers_obj()", + Tango::ERR + ); + } + catch(...) + { + set_state(Tango::FAULT); + set_status("Failed to set up the MCCE-2 module for a serial communication caught[...]"); + + ERROR_STREAM << "Failed to set up the MCCE-2 module for a serial communication : [...] EXCEPTION " << std::endl; + + Tango::Except::throw_exception( + "UNKNOWN_ERROR", + "Failed to set up the MCCE-2 module for a serial communication! [(...) exception]", + "MCCE2Electrometers::create_electrometers_obj()", + Tango::ERR + ); + } } //+------------------------------------------------------------------ /** - * method: MCCE2Electrometers::set_polarity + * method: MCCE2Electrometers::set_polarity * - * description: method to execute "SetPolarity" - * Sets the new electrometer polarity. <Br> - * NOTE : <Br> - * Value must be set in UPPER case !!! + * description: method to execute "SetPolarity" + * Sets the new electrometer polarity. <Br> + * NOTE : <Br> + * Value must be set in UPPER case !!! * - * @param argin POSITIVE or NEGATIVE + * @param argin POSITIVE or NEGATIVE * */ //+------------------------------------------------------------------ void MCCE2Electrometers::set_polarity(Tango::DevString argin) { - DEBUG_STREAM << "MCCE2Electrometers::set_polarity(): entering... !" << endl; - - // Add your own code to control device here - if (!this->_electrometer) - { - ERROR_STREAM << "Not enough memory to create the electrometer obj !" << std::endl; - Tango::Except::throw_exception( - (const char*) "MEMORY_ERROR", - (const char*) "Failed to build the electrometer obj : not enough memory !?", - (const char*) "MCCE2Electrometers::set_polarity()" - ); - } - - try - { - this->_electrometer->set_ElectroMeterPolarity(argin); - } - catch(const electrometer::ElectrometerException& ke) - { - Tango::DevFailed df = electrometer_to_tango_exception(ke); - - set_state(Tango::ALARM); - set_status("Failed to change electrometer polarity !"); - ERROR_STREAM << "Failed to change electrometer polarity : ElectrometerException EXCEPTION -> " << df << std::endl; - Tango::Except::re_throw_exception(df, - (const char*) "UNKNOWN_ERROR", - (const char*) "Failed to change electrometer polarity .", - (const char*) "hzFilterAttrib::set_polarity()", - Tango::ERR - ); - } - catch(Tango::DevFailed& df) - { - ERROR_STREAM << "Failed to change electrometer polarity : DevFailed EXCEPTION -> " << df << std::endl; - - set_state(Tango::ALARM); - set_status("Failed to change electrometer polarity !"); - Tango::Except::re_throw_exception(df, - (const char*) "COMMUNICATION_ERROR", - (const char*) "Failed to change electrometer polarity !", - (const char*) "MCCE2Electrometers::set_polarity()", - Tango::ERR - ); - } - catch(...) - { - ERROR_STREAM << "Failed to change electrometer polarity : [...] EXCEPTION " << std::endl; - set_state(Tango::ALARM); - set_status("Failed to change electrometer polarity !"); - - throw; - } + DEBUG_STREAM << "MCCE2Electrometers::set_polarity(): entering... !" << endl; + + // Add your own code to control device here + if ( !this->_electrometer ) + { + ERROR_STREAM << "Not enough memory to create the electrometer obj!" << std::endl; + Tango::Except::throw_exception( + "MEMORY_ERROR", + "Failed to build the electrometer obj : not enough memory!?", + "MCCE2Electrometers::set_polarity()" + ); + } + + try + { + this->_electrometer->set_ElectroMeterPolarity(argin); + } + catch(const electrometer::ElectrometerException& ke) + { + Tango::DevFailed df = electrometer_to_tango_exception(ke); + + set_state(Tango::ALARM); + set_status("Failed to change electrometer polarity!"); + ERROR_STREAM << "Failed to change electrometer polarity : ElectrometerException EXCEPTION -> " << df << std::endl; + Tango::Except::re_throw_exception(df, + "UNKNOWN_ERROR", + "Failed to change electrometer polarity.", + "hzFilterAttrib::set_polarity()", + Tango::ERR + ); + } + catch(Tango::DevFailed& df) + { + ERROR_STREAM << "Failed to change electrometer polarity : DevFailed EXCEPTION -> " << df << std::endl; + + set_state(Tango::ALARM); + set_status("Failed to change electrometer polarity!"); + Tango::Except::re_throw_exception(df, + "COMMUNICATION_ERROR", + "Failed to change electrometer polarity!", + "MCCE2Electrometers::set_polarity()", + Tango::ERR + ); + } + catch(...) + { + ERROR_STREAM << "Failed to change electrometer polarity : [...] EXCEPTION " << std::endl; + set_state(Tango::ALARM); + set_status("Failed to change electrometer polarity!"); + + throw; + } } - - -} // namespace +} // namespace diff --git a/src/MCCE2Electrometers.h b/src/MCCE2Electrometers.h index 7205c41c1c4c38af03a36d21b4a5d680b69070a9..1e81393d5f7ace20a94becd5e2dc13174aa2e8bc 100644 --- a/src/MCCE2Electrometers.h +++ b/src/MCCE2Electrometers.h @@ -1,466 +1,466 @@ -//============================================================================= -// -// file : MCCE2Electrometers.h -// -// description : Include for the MCCE2Electrometers class. -// -// project : Novelec MCCE-2 Electrometers -// -// $Author: xavela $ -// -// $Revision: 1.16 $ -// -// $Log: not supported by cvs2svn $ -// Revision 1.14 2010/06/10 15:12:05 xavela -// TEST : control two channels with different MCCE2 -// -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= -#ifndef _MCCE2ELECTROMETERS_H -#define _MCCE2ELECTROMETERS_H - -#include <tango.h> -//using namespace Tango; -#include "AbstractElectrometerClass.h" -#include "ElectrometerException.h" - -/** - * @author $Author: xavela $ - * @version $Revision: 1.16 $ - */ - - // Add your own constants definitions here. - //----------------------------------------------- - - -namespace MCCE2Electrometers_ns -{ - -/** - * Class Description: - * This class allows you to control all MCCE-2 Novelec electrometers - * through a Serial bus. - * <br> Supported types : - * <br> Novelec Electrometers : MCCE2 - */ - -/* - * Device States Description: -* Tango::ON : Device up and ready -* Tango::ALARM : Device initialisation not complete or a bad channel number is set. -* Tango::FAULT : Internal electrometer interface is not built or a Serial communication error occurred. - */ - - -class MCCE2Electrometers: public Tango::Device_4Impl -{ -public : - // Add your own data members here - //----------------------------------------- - - - // Here is the Start of the automatic code generation part - //------------------------------------------------------------- -/** - * @name attributes - * Attributs member data. - */ -//@{ - Tango::DevUShort *attr_electrometerChannel_read; - Tango::DevUShort attr_electrometerChannel_write; - Tango::DevString *attr_range1_read; - Tango::DevString *attr_range2_read; -//@} - -/** - * @name Device properties - * Device properties member data. - */ -//@{ -/** - * The name of the device which manage the communication. - */ - string communicationLinkName; -/** - * The electrometer type number connected to the channel 1 - * -> for Type 1 Novelec model : 1 - */ - Tango::DevUShort electrometerTypeCh1; -/** - * The electrometer type number connected to the channel 2 - * -> for Type 1 Novelec model : 1 - */ - Tango::DevUShort electrometerTypeCh2; -//@} - -/**@name Constructors - * Miscellaneous constructors */ -//@{ -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device Name - */ - MCCE2Electrometers(Tango::DeviceClass *cl,string &s); -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device Name - */ - MCCE2Electrometers(Tango::DeviceClass *cl,const char *s); -/** - * Constructs a newly allocated Command object. - * - * @param cl Class. - * @param s Device name - * @param d Device description. - */ - MCCE2Electrometers(Tango::DeviceClass *cl,const char *s,const char *d); -//@} - -/**@name Destructor - * Only one desctructor is defined for this class */ -//@{ -/** - * The object desctructor. - */ - ~MCCE2Electrometers() {delete_device();}; -/** - * will be called at device destruction or at init command. - */ - void delete_device(); -//@} - - -/**@name Miscellaneous methods */ -//@{ -/** - * Initialize the device - */ - virtual void init_device(); -/** - * Always executed method befor execution command method. - */ - virtual void always_executed_hook(); - -//@} - -/** - * @name MCCE2Electrometers methods prototypes - */ - -//@{ -/** - * Hardware acquisition for attributes. - */ - virtual void read_attr_hardware(vector<long> &attr_list); -/** - * Extract real attribute values for electrometerChannel acquisition result. - */ - virtual void read_electrometerChannel(Tango::Attribute &attr); -/** - * Write electrometerChannel attribute values to hardware. - */ - virtual void write_electrometerChannel(Tango::WAttribute &attr); -/** - * Extract real attribute values for range1 acquisition result. - */ - virtual void read_range1(Tango::Attribute &attr); -/** - * Extract real attribute values for range2 acquisition result. - */ - virtual void read_range2(Tango::Attribute &attr); -/** - * Read/Write allowed for electrometerChannel attribute. - */ - virtual bool is_electrometerChannel_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for range1 attribute. - */ - virtual bool is_range1_allowed(Tango::AttReqType type); -/** - * Read/Write allowed for range2 attribute. - */ - virtual bool is_range2_allowed(Tango::AttReqType type); -/** - * Execution allowed for RangeUP command. - */ - virtual bool is_RangeUP_allowed(const CORBA::Any &any); -/** - * Execution allowed for RangeDOWN command. - */ - virtual bool is_RangeDOWN_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetZeroVFFunction command. - */ - virtual bool is_SetZeroVFFunction_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetOffsetZeroV1Function command. - */ - virtual bool is_SetOffsetZeroV1Function_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetLeakageZeroV2Function command. - */ - virtual bool is_SetLeakageZeroV2Function_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetTestFunction command. - */ - virtual bool is_SetTestFunction_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetMeasureFunction command. - */ - virtual bool is_SetMeasureFunction_allowed(const CORBA::Any &any); -/** - * Execution allowed for MCCE2_ON command. - */ - virtual bool is_MCCE2_ON_allowed(const CORBA::Any &any); -/** - * Execution allowed for MCCE2_OFF command. - */ - virtual bool is_MCCE2_OFF_allowed(const CORBA::Any &any); -/** - * Execution allowed for Local command. - */ - virtual bool is_Local_allowed(const CORBA::Any &any); -/** - * Execution allowed for Remote command. - */ - virtual bool is_Remote_allowed(const CORBA::Any &any); -/** - * Execution allowed for Reset command. - */ - virtual bool is_Reset_allowed(const CORBA::Any &any); -/** - * Execution allowed for ClearRegisters command. - */ - virtual bool is_ClearRegisters_allowed(const CORBA::Any &any); -/** - * Execution allowed for GetRange command. - */ - virtual bool is_GetRange_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetRange command. - */ - virtual bool is_SetRange_allowed(const CORBA::Any &any); -/** - * Execution allowed for GetMode command. - */ - virtual bool is_GetMode_allowed(const CORBA::Any &any); -/** - * Execution allowed for GetPolarity command. - */ - virtual bool is_GetPolarity_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetPolarity command. - */ - virtual bool is_SetPolarity_allowed(const CORBA::Any &any); -/** - * Execution allowed for GetHzFilter command. - */ - virtual bool is_GetHzFilter_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetHzFilter command. - */ - virtual bool is_SetHzFilter_allowed(const CORBA::Any &any); -/** - * Execution allowed for GetGain command. - */ - virtual bool is_GetGain_allowed(const CORBA::Any &any); -/** - * Execution allowed for SetGain command. - */ - virtual bool is_SetGain_allowed(const CORBA::Any &any); -/** - * This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller. - * @return State Code - * @exception DevFailed - */ - virtual Tango::DevState dev_state(); -/** - * This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller. - * @return Status description - * @exception DevFailed - */ - virtual Tango::ConstDevString dev_status(); -/** - * Up the range of the electrometer. - * Throw : - * - electrometer::ElectrometerException if the range limit is reached - * - Tango::DevFailed if the command cannot be performed - * @exception DevFailed - */ - void range_up(); -/** - * Down the range of the electrometer. - * Throw : - * - electrometer::ElectrometerException if the range is negative - * - Tango::DevFailed if the command cannot be performed - * @exception DevFailed - */ - void range_down(); -/** - * Enable the Zero V/F MCCE2 mode. - * @exception DevFailed - */ - void set_zero_vffunction(); -/** - * Enable the Offset or Zero V1 MCCE2 mode. - * @exception DevFailed - */ - void set_offset_zero_v1_function(); -/** - * Enable the Leakage or Zero V2 MCCE2 mode. - * @exception DevFailed - */ - void set_leakage_zero_v2_function(); -/** - * Enable theTest MCCE2 mode. - * @exception DevFailed - */ - void set_test_function(); -/** - * Enable the Measure MCCE2 mode. - * @exception DevFailed - */ - void set_measure_function(); -/** - * Enables the function set. Parameters cannot be set (read only mode). - * @exception DevFailed - */ - void mcce2__on(); -/** - * Disables the function set. Parameters can be changed. - * @exception DevFailed - */ - void mcce2__off(); -/** - * Enable local keyboard and Key - * @exception DevFailed - */ - void local(); -/** - * Disable \"MODIFY\" and the \"ON-OFF\" keys - * @exception DevFailed - */ - void remote(); -/** - * Restart the MCCE-2 - * @exception DevFailed - */ - void reset(); -/** - * Clear error(s) - * @exception DevFailed - */ - void clear_registers(); -/** - * Returns the electrometer range. - * @return The actual electrometer range - * @exception DevFailed - */ - Tango::DevString get_range(); -/** - * Apply the specified argin range, on the electrometer, if well formatted. - * Else an exception is thrown. - * @param argin The range to apply on the electrometer - * @exception DevFailed - */ - void set_range(Tango::DevString); -/** - * Returns the electrometer mode which can be one of the following values : - * MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST. - * @return The electrometer mode (MEASURE, LEAKAGE ...) - * @exception DevFailed - */ - Tango::DevString get_mode(); -/** - * Returns the electrometer polarity, which can be POSITIVE or NEGATIVE. - * @return The electrometer polarity - * @exception DevFailed - */ - Tango::DevString get_polarity(); -/** - * Sets the new electrometer polarity. <Br> - * NOTE : <Br> - * Value must be set in UPPER case !!! - * @param argin POSITIVE or NEGATIVE - * @exception DevFailed - */ - void set_polarity(Tango::DevString); -/** - * Returns the Cut-off frequency in Hz - * @return The MCCE2 cut-off frequency in Hz - * @exception DevFailed - */ - Tango::DevShort get_hz_filter(); -/** - * The Cut-off frequency in Hz - * @param argin The MCCE2 cut-off frequency in Hz - * @exception DevFailed - */ - void set_hz_filter(Tango::DevShort); -/** - * Returns the MCCE-2 gain - * @return The MCCE2 gain - * @exception DevFailed - */ - Tango::DevShort get_gain(); -/** - * Sets the new MCCE-2 gain value. - * @param argin The new MCCE-2 gain - * @exception DevFailed - */ - void set_gain(Tango::DevUShort); - -/** - * Read the device properties from database - */ - void get_device_property(); -//@} - - // Here is the end of the automatic code generation part - //------------------------------------------------------------- - - - -protected : - // Add your own data members here - //----------------------------------------- - AbstractElectrometerClass* _electrometer; - - std::string _statusStr; - - bool _init_done; //- used to allow device to start !! - bool _missing_property; - bool _updateRange1FromHW; - bool _updateRange2FromHW; - - std::string read_range_from_hw(); - - //- Method to convert all electrometer exceptions on Tango exception - Tango::DevFailed electrometer_to_tango_exception(const electrometer::ElectrometerException& de); - -private : - AbstractElectrometerClass* _electrometerCH1; //- electrometer on channel 1 - AbstractElectrometerClass* _electrometerCH2; //- electrometer on channel 2 - - //- instanciate electrometer(s) obj - void create_electrometers_obj(); - -}; - -} // namespace_ns - -#endif // _MCCE2ELECTROMETERS_H +//============================================================================= +// +// file : MCCE2Electrometers.h +// +// description : Include for the MCCE2Electrometers class. +// +// project : Novelec MCCE-2 Electrometers +// +// $Author: xavela $ +// +// $Revision: 1.16 $ +// +// $Log: not supported by cvs2svn $ +// Revision 1.14 2010/06/10 15:12:05 xavela +// TEST : control two channels with different MCCE2 +// +// +// copyleft : European Synchrotron Radiation Facility +// BP 220, Grenoble 38043 +// FRANCE +// +//============================================================================= +// +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +// +// (c) - Software Engineering Group - ESRF +//============================================================================= +#ifndef _MCCE2ELECTROMETERS_H +#define _MCCE2ELECTROMETERS_H + +#include <tango.h> +//using namespace Tango; +#include "AbstractElectrometerClass.h" +#include "ElectrometerException.h" + +/** + * @author $Author: xavela $ + * @version $Revision: 1.16 $ + */ + + // Add your own constants definitions here. + //----------------------------------------------- + + +namespace MCCE2Electrometers_ns +{ + +/** + * Class Description: + * This class allows you to control all MCCE-2 Novelec electrometers + * through a Serial bus. + * <br> Supported types : + * <br> Novelec Electrometers : MCCE2 + */ + +/* + * Device States Description: +* Tango::ON : Device up and ready +* Tango::ALARM : Device initialisation not complete or a bad channel number is set. +* Tango::FAULT : Internal electrometer interface is not built or a Serial communication error occurred. + */ + + +class MCCE2Electrometers: public Tango::Device_4Impl +{ +public : + // Add your own data members here + //----------------------------------------- + + + // Here is the Start of the automatic code generation part + //------------------------------------------------------------- +/** + * @name attributes + * Attributs member data. + */ +//@{ + Tango::DevUShort *attr_electrometerChannel_read; + Tango::DevUShort attr_electrometerChannel_write; + Tango::DevString *attr_range1_read; + Tango::DevString *attr_range2_read; +//@} + +/** + * @name Device properties + * Device properties member data. + */ +//@{ +/** + * The name of the device which manage the communication. + */ + string communicationLinkName; +/** + * The first electrometer address configured. <br /> + * Note : if not connected, push 0 or let empty the property. + */ + Tango::DevUShort electrometer1Address; +/** + * The second electrometer address configured. <br /> + * Note : if not connected, push 0 or let empty the property. + */ + Tango::DevUShort electrometer2Address; +//@} + +/**@name Constructors + * Miscellaneous constructors */ +//@{ +/** + * Constructs a newly allocated Command object. + * + * @param cl Class. + * @param s Device Name + */ + MCCE2Electrometers(Tango::DeviceClass *cl,string &s); +/** + * Constructs a newly allocated Command object. + * + * @param cl Class. + * @param s Device Name + */ + MCCE2Electrometers(Tango::DeviceClass *cl,const char *s); +/** + * Constructs a newly allocated Command object. + * + * @param cl Class. + * @param s Device name + * @param d Device description. + */ + MCCE2Electrometers(Tango::DeviceClass *cl,const char *s,const char *d); +//@} + +/**@name Destructor + * Only one desctructor is defined for this class */ +//@{ +/** + * The object desctructor. + */ + ~MCCE2Electrometers() {delete_device();}; +/** + * will be called at device destruction or at init command. + */ + void delete_device(); +//@} + + +/**@name Miscellaneous methods */ +//@{ +/** + * Initialize the device + */ + virtual void init_device(); +/** + * Always executed method befor execution command method. + */ + virtual void always_executed_hook(); + +//@} + +/** + * @name MCCE2Electrometers methods prototypes + */ + +//@{ +/** + * Hardware acquisition for attributes. + */ + virtual void read_attr_hardware(vector<long> &attr_list); +/** + * Extract real attribute values for electrometerChannel acquisition result. + */ + virtual void read_electrometerChannel(Tango::Attribute &attr); +/** + * Write electrometerChannel attribute values to hardware. + */ + virtual void write_electrometerChannel(Tango::WAttribute &attr); +/** + * Extract real attribute values for range1 acquisition result. + */ + virtual void read_range1(Tango::Attribute &attr); +/** + * Extract real attribute values for range2 acquisition result. + */ + virtual void read_range2(Tango::Attribute &attr); +/** + * Read/Write allowed for electrometerChannel attribute. + */ + virtual bool is_electrometerChannel_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for range1 attribute. + */ + virtual bool is_range1_allowed(Tango::AttReqType type); +/** + * Read/Write allowed for range2 attribute. + */ + virtual bool is_range2_allowed(Tango::AttReqType type); +/** + * Execution allowed for RangeUP command. + */ + virtual bool is_RangeUP_allowed(const CORBA::Any &any); +/** + * Execution allowed for RangeDOWN command. + */ + virtual bool is_RangeDOWN_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetZeroVFFunction command. + */ + virtual bool is_SetZeroVFFunction_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetOffsetZeroV1Function command. + */ + virtual bool is_SetOffsetZeroV1Function_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetLeakageZeroV2Function command. + */ + virtual bool is_SetLeakageZeroV2Function_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetTestFunction command. + */ + virtual bool is_SetTestFunction_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetMeasureFunction command. + */ + virtual bool is_SetMeasureFunction_allowed(const CORBA::Any &any); +/** + * Execution allowed for MCCE2_ON command. + */ + virtual bool is_MCCE2_ON_allowed(const CORBA::Any &any); +/** + * Execution allowed for MCCE2_OFF command. + */ + virtual bool is_MCCE2_OFF_allowed(const CORBA::Any &any); +/** + * Execution allowed for Local command. + */ + virtual bool is_Local_allowed(const CORBA::Any &any); +/** + * Execution allowed for Remote command. + */ + virtual bool is_Remote_allowed(const CORBA::Any &any); +/** + * Execution allowed for Reset command. + */ + virtual bool is_Reset_allowed(const CORBA::Any &any); +/** + * Execution allowed for ClearRegisters command. + */ + virtual bool is_ClearRegisters_allowed(const CORBA::Any &any); +/** + * Execution allowed for GetRange command. + */ + virtual bool is_GetRange_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetRange command. + */ + virtual bool is_SetRange_allowed(const CORBA::Any &any); +/** + * Execution allowed for GetMode command. + */ + virtual bool is_GetMode_allowed(const CORBA::Any &any); +/** + * Execution allowed for GetPolarity command. + */ + virtual bool is_GetPolarity_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetPolarity command. + */ + virtual bool is_SetPolarity_allowed(const CORBA::Any &any); +/** + * Execution allowed for GetHzFilter command. + */ + virtual bool is_GetHzFilter_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetHzFilter command. + */ + virtual bool is_SetHzFilter_allowed(const CORBA::Any &any); +/** + * Execution allowed for GetGain command. + */ + virtual bool is_GetGain_allowed(const CORBA::Any &any); +/** + * Execution allowed for SetGain command. + */ + virtual bool is_SetGain_allowed(const CORBA::Any &any); +/** + * This command gets the device state (stored in its <i>device_state</i> data member) and returns it to the caller. + * @return State Code + * @exception DevFailed + */ + virtual Tango::DevState dev_state(); +/** + * This command gets the device status (stored in its <i>device_status</i> data member) and returns it to the caller. + * @return Status description + * @exception DevFailed + */ + virtual Tango::ConstDevString dev_status(); +/** + * Up the range of the electrometer. + * Throw : + * - electrometer::ElectrometerException if the range limit is reached + * - Tango::DevFailed if the command cannot be performed + * @exception DevFailed + */ + void range_up(); +/** + * Down the range of the electrometer. + * Throw : + * - electrometer::ElectrometerException if the range is negative + * - Tango::DevFailed if the command cannot be performed + * @exception DevFailed + */ + void range_down(); +/** + * Enable the Zero V/F MCCE2 mode. + * @exception DevFailed + */ + void set_zero_vffunction(); +/** + * Enable the Offset or Zero V1 MCCE2 mode. + * @exception DevFailed + */ + void set_offset_zero_v1_function(); +/** + * Enable the Leakage or Zero V2 MCCE2 mode. + * @exception DevFailed + */ + void set_leakage_zero_v2_function(); +/** + * Enable theTest MCCE2 mode. + * @exception DevFailed + */ + void set_test_function(); +/** + * Enable the Measure MCCE2 mode. + * @exception DevFailed + */ + void set_measure_function(); +/** + * Enables the function set. Parameters cannot be set (read only mode). + * @exception DevFailed + */ + void mcce2__on(); +/** + * Disables the function set. Parameters can be changed. + * @exception DevFailed + */ + void mcce2__off(); +/** + * Enable local keyboard and Key + * @exception DevFailed + */ + void local(); +/** + * Disable \"MODIFY\" and the \"ON-OFF\" keys + * @exception DevFailed + */ + void remote(); +/** + * Restart the MCCE-2 + * @exception DevFailed + */ + void reset(); +/** + * Clear error(s) + * @exception DevFailed + */ + void clear_registers(); +/** + * Returns the electrometer range. + * @return The actual electrometer range + * @exception DevFailed + */ + Tango::DevString get_range(); +/** + * Apply the specified argin range, on the electrometer, if well formatted. + * Else an exception is thrown. + * @param argin The range to apply on the electrometer + * @exception DevFailed + */ + void set_range(Tango::DevString); +/** + * Returns the electrometer mode which can be one of the following values : + * MEASURE, V/F Zero, OFFSET, LEAKAGE or TEST. + * @return The electrometer mode (MEASURE, LEAKAGE ...) + * @exception DevFailed + */ + Tango::DevString get_mode(); +/** + * Returns the electrometer polarity, which can be POSITIVE or NEGATIVE. + * @return The electrometer polarity + * @exception DevFailed + */ + Tango::DevString get_polarity(); +/** + * Sets the new electrometer polarity. <Br> + * NOTE : <Br> + * Value must be set in UPPER case !!! + * @param argin POSITIVE or NEGATIVE + * @exception DevFailed + */ + void set_polarity(Tango::DevString); +/** + * Returns the Cut-off frequency in Hz + * @return The MCCE2 cut-off frequency in Hz + * @exception DevFailed + */ + Tango::DevShort get_hz_filter(); +/** + * The Cut-off frequency in Hz + * @param argin The MCCE2 cut-off frequency in Hz + * @exception DevFailed + */ + void set_hz_filter(Tango::DevShort); +/** + * Returns the MCCE-2 gain + * @return The MCCE2 gain + * @exception DevFailed + */ + Tango::DevShort get_gain(); +/** + * Sets the new MCCE-2 gain value. + * @param argin The new MCCE-2 gain + * @exception DevFailed + */ + void set_gain(Tango::DevUShort); + +/** + * Read the device properties from database + */ + void get_device_property(); +//@} + + // Here is the end of the automatic code generation part + //------------------------------------------------------------- + + + +protected : + // Add your own data members here + //----------------------------------------- + AbstractElectrometerClass* _electrometer; + + std::string _statusStr; + + bool _init_done; //- used to allow device to start !! + bool _missing_property; + bool _updateRange1FromHW; + bool _updateRange2FromHW; + + std::string read_range_from_hw(); + + //- Method to convert all electrometer exceptions on Tango exception + Tango::DevFailed electrometer_to_tango_exception(const electrometer::ElectrometerException& de); + +private : + AbstractElectrometerClass* _electrometerCH1; //- electrometer on channel 1 + AbstractElectrometerClass* _electrometerCH2; //- electrometer on channel 2 + + //- instanciate electrometer(s) obj + void create_electrometers_obj(); + +}; + +} // namespace_ns + +#endif // _MCCE2ELECTROMETERS_H diff --git a/src/MCCE2ElectrometersClass.cpp b/src/MCCE2ElectrometersClass.cpp index fc4512ecb62215c04fb5b9755716c71a7e8ade1e..9a409bb7690a34aa3e78663b973bba0b77e2c744 100644 --- a/src/MCCE2ElectrometersClass.cpp +++ b/src/MCCE2ElectrometersClass.cpp @@ -1,1139 +1,1139 @@ -static const char *ClassId = "$Id: MCCE2ElectrometersClass.cpp,v 1.16 2012-10-03 14:59:19 xavela Exp $"; -static const char *CvsPath = "$Source: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersClass.cpp,v $"; -static const char *SvnPath = "$HeadURL: $"; -static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersClass.cpp,v 1.16 2012-10-03 14:59:19 xavela Exp $"; -static const char *TagName = "$Name: not supported by cvs2svn $"; -static const char *HttpServer= "http://www.esrf.fr/computing/cs/tango/tango_doc/ds_doc/"; -//+============================================================================= -// -// file : MCCE2ElectrometersClass.cpp -// -// description : C++ source for the MCCE2ElectrometersClass. A singleton -// class derived from DeviceClass. It implements the -// command list and all properties and methods required -// by the MCCE2Electrometers once per process. -// -// project : TANGO Device Server -// -// $Author: xavela $ -// -// $Revision: 1.16 $ -// -// $Log: not supported by cvs2svn $ -// Revision 1.14 2010/06/10 15:12:05 xavela -// TEST : control two channels with different MCCE2 -// -// -// copyleft : Synchrotron SOLEIL -// L'Orme des Merisiers -// Saint-Aubin - BP 48 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - - -#include <tango.h> - -#include <MCCE2Electrometers.h> -#include <MCCE2ElectrometersClass.h> - - -//+---------------------------------------------------------------------------- -/** - * Create MCCE2ElectrometersClass singleton and return it in a C function for Python usage - */ -//+---------------------------------------------------------------------------- -extern "C" { -#ifdef WIN32 - -__declspec(dllexport) - -#endif - - Tango::DeviceClass *_create_MCCE2Electrometers_class(const char *name) { - return MCCE2Electrometers_ns::MCCE2ElectrometersClass::init(name); - } -} - - -namespace MCCE2Electrometers_ns -{ -//+---------------------------------------------------------------------------- -// -// method : SetPolarityClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetPolarityClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetPolarityClass::execute(): arrived" << endl; - - Tango::DevString argin; - extract(in_any, argin); - - ((static_cast<MCCE2Electrometers *>(device))->set_polarity(argin)); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2_OFFCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *MCCE2_OFFCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "MCCE2_OFFCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->mcce2__off()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2_ONCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *MCCE2_ONCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "MCCE2_ONCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->mcce2__on()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : SetGainCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetGainCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetGainCmd::execute(): arrived" << endl; - - Tango::DevUShort argin; - extract(in_any, argin); - - ((static_cast<MCCE2Electrometers *>(device))->set_gain(argin)); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : GetGainCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetGainCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetGainCmd::execute(): arrived" << endl; - - return insert((static_cast<MCCE2Electrometers *>(device))->get_gain()); -} - -//+---------------------------------------------------------------------------- -// -// method : GetModeCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetModeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetModeCmd::execute(): arrived" << endl; - - return insert((static_cast<MCCE2Electrometers *>(device))->get_mode()); -} - -//+---------------------------------------------------------------------------- -// -// method : SetRangeCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetRangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetRangeCmd::execute(): arrived" << endl; - - Tango::DevString argin; - extract(in_any, argin); - - ((static_cast<MCCE2Electrometers *>(device))->set_range(argin)); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : GetRangeCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetRangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetRangeCmd::execute(): arrived" << endl; - - return insert((static_cast<MCCE2Electrometers *>(device))->get_range()); -} - -//+---------------------------------------------------------------------------- -// -// method : RemoteCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RemoteCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RemoteCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->remote()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : LocalCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be executed -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *LocalCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "LocalCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->local()); - return new CORBA::Any(); -} - - - -//+---------------------------------------------------------------------------- -// -// method : GetHzFilterCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetHzFilterCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetHzFilterCmd::execute(): arrived" << endl; - - return insert((static_cast<MCCE2Electrometers *>(device))->get_hz_filter()); -} - -//+---------------------------------------------------------------------------- -// -// method : SetHzFilterCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetHzFilterCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetHzFilterCmd::execute(): arrived" << endl; - - Tango::DevShort argin; - extract(in_any, argin); - - ((static_cast<MCCE2Electrometers *>(device))->set_hz_filter(argin)); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : GetPolarityCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *GetPolarityCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "GetPolarityCmd::execute(): arrived" << endl; - - return insert((static_cast<MCCE2Electrometers *>(device))->get_polarity()); -} - - - - - -//+---------------------------------------------------------------------------- -// -// method : SetMeasureFunctionCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetMeasureFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetMeasureFunctionCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->set_measure_function()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : ClearRegistersClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *ClearRegistersClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "ClearRegistersClass::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->clear_registers()); - return new CORBA::Any(); -} - - -//+---------------------------------------------------------------------------- -// -// method : RangeUPCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RangeUPCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RangeUPCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->range_up()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : RangeDOWNClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *RangeDOWNClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "RangeDOWNClass::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->range_down()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : SetZeroVFFunctionCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetZeroVFFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetZeroVFFunctionCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->set_zero_vffunction()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : SetOffsetZeroV1FunctionCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetOffsetZeroV1FunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetOffsetZeroV1FunctionCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->set_offset_zero_v1_function()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : SetLeakageZeroV2FunctionCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetLeakageZeroV2FunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetLeakageZeroV2FunctionCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->set_leakage_zero_v2_function()); - return new CORBA::Any(); -} - -//+---------------------------------------------------------------------------- -// -// method : SetTestFunctionCmd::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *SetTestFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "SetTestFunctionCmd::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->set_test_function()); - return new CORBA::Any(); -} - - - - - -//+---------------------------------------------------------------------------- -// -// method : ResetClass::execute() -// -// description : method to trigger the execution of the command. -// PLEASE DO NOT MODIFY this method core without pogo -// -// in : - device : The device on which the command must be excuted -// - in_any : The command input data -// -// returns : The command output data (packed in the Any object) -// -//----------------------------------------------------------------------------- -CORBA::Any *ResetClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) -{ - - cout2 << "ResetClass::execute(): arrived" << endl; - - ((static_cast<MCCE2Electrometers *>(device))->reset()); - return new CORBA::Any(); -} - - -// -//---------------------------------------------------------------- -// Initialize pointer for singleton pattern -//---------------------------------------------------------------- -// -MCCE2ElectrometersClass *MCCE2ElectrometersClass::_instance = NULL; - -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::MCCE2ElectrometersClass(string &s) -// -// description : constructor for the MCCE2ElectrometersClass -// -// in : - s : The class name -// -//----------------------------------------------------------------------------- -MCCE2ElectrometersClass::MCCE2ElectrometersClass(string &s):DeviceClass(s) -{ - - cout2 << "Entering MCCE2ElectrometersClass constructor" << endl; - set_default_property(); - write_class_property(); - get_class_property(); - - cout2 << "Leaving MCCE2ElectrometersClass constructor" << endl; - -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::~MCCE2ElectrometersClass() -// -// description : destructor for the MCCE2ElectrometersClass -// -//----------------------------------------------------------------------------- -MCCE2ElectrometersClass::~MCCE2ElectrometersClass() -{ - _instance = NULL; -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::instance -// -// description : Create the object if not already done. Otherwise, just -// return a pointer to the object -// -// in : - name : The class name -// -//----------------------------------------------------------------------------- -MCCE2ElectrometersClass *MCCE2ElectrometersClass::init(const char *name) -{ - if (_instance == NULL) - { - try - { - string s(name); - _instance = new MCCE2ElectrometersClass(s); - } - catch (bad_alloc) - { - throw; - } - } - return _instance; -} - -MCCE2ElectrometersClass *MCCE2ElectrometersClass::instance() -{ - if (_instance == NULL) - { - cerr << "Class is not initialised !!" << endl; - exit(-1); - } - return _instance; -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::command_factory -// -// description : Create the command object(s) and store them in the -// command list -// -//----------------------------------------------------------------------------- -void MCCE2ElectrometersClass::command_factory() -{ - command_list.push_back(new RangeUPCmd("RangeUP", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new RangeDOWNClass("RangeDOWN", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new SetZeroVFFunctionCmd("SetZeroVFFunction", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new SetOffsetZeroV1FunctionCmd("SetOffsetZeroV1Function", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new SetLeakageZeroV2FunctionCmd("SetLeakageZeroV2Function", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new SetTestFunctionCmd("SetTestFunction", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new SetMeasureFunctionCmd("SetMeasureFunction", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new MCCE2_ONCmd("MCCE2_ON", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new MCCE2_OFFCmd("MCCE2_OFF", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new LocalCmd("Local", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new RemoteCmd("Remote", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::EXPERT)); - command_list.push_back(new ResetClass("Reset", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new ClearRegistersClass("ClearRegisters", - Tango::DEV_VOID, Tango::DEV_VOID, - "no argin", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new GetRangeCmd("GetRange", - Tango::DEV_VOID, Tango::DEV_STRING, - "no argin", - "The actual electrometer range", - Tango::OPERATOR)); - command_list.push_back(new SetRangeCmd("SetRange", - Tango::DEV_STRING, Tango::DEV_VOID, - "The range to apply on the electrometer", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new GetModeCmd("GetMode", - Tango::DEV_VOID, Tango::DEV_STRING, - "no argin", - "The electrometer mode (MEASURE, LEAKAGE ...)", - Tango::EXPERT)); - command_list.push_back(new GetPolarityCmd("GetPolarity", - Tango::DEV_VOID, Tango::DEV_STRING, - "no argin", - "The electrometer polarity", - Tango::EXPERT)); - command_list.push_back(new SetPolarityClass("SetPolarity", - Tango::DEV_STRING, Tango::DEV_VOID, - "POSITIVE or NEGATIVE", - "no argout", - Tango::OPERATOR)); - command_list.push_back(new GetHzFilterCmd("GetHzFilter", - Tango::DEV_VOID, Tango::DEV_SHORT, - "no argin", - "The MCCE2 cut-off frequency in Hz", - Tango::EXPERT)); - command_list.push_back(new SetHzFilterCmd("SetHzFilter", - Tango::DEV_SHORT, Tango::DEV_VOID, - "The MCCE2 cut-off frequency in Hz", - "no argout", - Tango::EXPERT)); - command_list.push_back(new GetGainCmd("GetGain", - Tango::DEV_VOID, Tango::DEV_SHORT, - "no argin", - "The MCCE2 gain", - Tango::EXPERT)); - command_list.push_back(new SetGainCmd("SetGain", - Tango::DEV_USHORT, Tango::DEV_VOID, - "The new MCCE-2 gain", - "no argout", - Tango::EXPERT)); - - // add polling if any - for (unsigned int i=0 ; i<command_list.size(); i++) - { - } -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::get_class_property -// -// description : Get the class property for specified name. -// -// in : string name : The property name -// -//+---------------------------------------------------------------------------- -Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::get_default_device_property() -// -// description : Return the default value for device property. -// -//----------------------------------------------------------------------------- -Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::get_default_class_property() -// -// description : Return the default value for class property. -// -//----------------------------------------------------------------------------- -Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::device_factory -// -// description : Create the device object(s) and store them in the -// device list -// -// in : Tango::DevVarStringArray *devlist_ptr : The device name list -// -//----------------------------------------------------------------------------- -void MCCE2ElectrometersClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) -{ - - // 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 devices and add it into the device list - //---------------------------------------------------- - device_list.push_back(new MCCE2Electrometers(this, (*devlist_ptr)[i])); - - // Export device to the outside world - // Check before if database used. - //--------------------------------------------- - 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: MCCE2ElectrometersClass::attribute_factory(vector<Tango::Attr *> &att_list) -//----------------------------------------------------------------------------- -void MCCE2ElectrometersClass::attribute_factory(vector<Tango::Attr *> &att_list) -{ - // Attribute : electrometerChannel - electrometerChannelAttrib *electrometer_channel = new electrometerChannelAttrib(); - Tango::UserDefaultAttrProp electrometer_channel_prop; - electrometer_channel_prop.set_label("electrometer channel"); - electrometer_channel_prop.set_unit(" "); - electrometer_channel_prop.set_standard_unit(" "); - electrometer_channel_prop.set_display_unit(" "); - electrometer_channel_prop.set_format("%1.0d"); - electrometer_channel_prop.set_description("MCCE2 electrometer have two channels to support two amplifiers.\nWARN : default is 0 (please set this value first)."); - electrometer_channel->set_default_properties(electrometer_channel_prop); - att_list.push_back(electrometer_channel); - - // Attribute : range1 - range1Attrib *range1 = new range1Attrib(); - Tango::UserDefaultAttrProp range1_prop; - range1_prop.set_label("range1"); - range1_prop.set_unit(" "); - range1_prop.set_standard_unit(" "); - range1_prop.set_display_unit(" "); - range1_prop.set_format("%s"); - range1_prop.set_description("The channel one MCCE2 range."); - range1->set_default_properties(range1_prop); - att_list.push_back(range1); - - // Attribute : range2 - range2Attrib *range2 = new range2Attrib(); - Tango::UserDefaultAttrProp range2_prop; - range2_prop.set_label("range2"); - range2_prop.set_unit(" "); - range2_prop.set_standard_unit(" "); - range2_prop.set_display_unit(" "); - range2_prop.set_format("%s"); - range2_prop.set_description("The channel two MCCE range."); - range2->set_default_properties(range2_prop); - att_list.push_back(range2); - - // End of Automatic code generation - //------------------------------------------------------------- -} - -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::get_class_property() -// -// description : Read the class properties from database. -// -//----------------------------------------------------------------------------- -void MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::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 MCCE2ElectrometersClass::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 = "CommunicationLinkName"; - prop_desc = "The name of the device which manage the communication."; - prop_def = ""; - vect_data.clear(); - 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 = "ElectrometerTypeCh1"; - prop_desc = "The electrometer type number connected to the channel 1\n-> for Type 1 Novelec model : 1"; - prop_def = ""; - vect_data.clear(); - 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 = "ElectrometerTypeCh2"; - prop_desc = "The electrometer type number connected to the channel 2\n-> for Type 1 Novelec model : 1"; - prop_def = ""; - vect_data.clear(); - if (prop_def.length()>0) - { - Tango::DbDatum data(prop_name); - data << vect_data ; - dev_def_prop.push_back(data); - add_wiz_dev_prop(prop_name, prop_desc, prop_def); - } - else - add_wiz_dev_prop(prop_name, prop_desc); - -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2ElectrometersClass::write_class_property -// -// description : Set class description as property in database -// -//----------------------------------------------------------------------------- -void MCCE2ElectrometersClass::write_class_property() -{ - // First time, check if database used - //-------------------------------------------- - if (Tango::Util::_UseDb == false) - return; - - Tango::DbData data; - string classname = get_name(); - string header; - string::size_type start, end; - - // Put title - Tango::DbDatum title("ProjectTitle"); - string str_title("Novelec MCCE-2 Electrometers"); - title << str_title; - data.push_back(title); - - // Put Description - Tango::DbDatum description("Description"); - vector<string> str_desc; - str_desc.push_back("This class allows you to control all MCCE-2 Novelec electrometers"); - str_desc.push_back("through a Serial bus."); - str_desc.push_back("<br> Supported types :"); - str_desc.push_back("<br> Novelec Electrometers : MCCE2"); - description << str_desc; - data.push_back(description); - - // put cvs or svn location - string filename(classname); - filename += "Class.cpp"; - - // Create a string with the class ID to - // get the string into the binary - string class_id(ClassId); - - // check for cvs information - string src_path(CvsPath); - start = src_path.find("/"); - if (start!=string::npos) - { - end = src_path.find(filename); - if (end>start) - { - string strloc = src_path.substr(start, end-start); - // Check if specific repository - start = strloc.find("/cvsroot/"); - if (start!=string::npos && start>0) - { - string repository = strloc.substr(0, start); - if (repository.find("/segfs/")!=string::npos) - strloc = "ESRF:" + strloc.substr(start, strloc.length()-start); - } - Tango::DbDatum cvs_loc("cvs_location"); - cvs_loc << strloc; - data.push_back(cvs_loc); - } - } - // check for svn information - else - { - string src_path(SvnPath); - start = src_path.find("://"); - if (start!=string::npos) - { - end = src_path.find(filename); - if (end>start) - { - header = "$HeadURL: "; - start = header.length(); - string strloc = src_path.substr(start, (end-start)); - - Tango::DbDatum svn_loc("svn_location"); - svn_loc << strloc; - data.push_back(svn_loc); - } - } - } - - // Get CVS or SVN revision tag - - // CVS tag - string tagname(TagName); - header = "$Name: "; - start = header.length(); - string endstr(" $"); - - end = tagname.find(endstr); - if (end!=string::npos && end>start) - { - string strtag = tagname.substr(start, end-start); - Tango::DbDatum cvs_tag("cvs_tag"); - cvs_tag << strtag; - data.push_back(cvs_tag); - } - - // SVN tag - string svnpath(SvnPath); - header = "$HeadURL: "; - start = header.length(); - - end = svnpath.find(endstr); - if (end!=string::npos && end>start) - { - string strloc = svnpath.substr(start, end-start); - - string tagstr ("/tags/"); - start = strloc.find(tagstr); - if ( start!=string::npos ) - { - start = start + tagstr.length(); - end = strloc.find(filename); - string strtag = strloc.substr(start, end-start-1); - - Tango::DbDatum svn_tag("svn_tag"); - svn_tag << strtag; - data.push_back(svn_tag); - } - } - - // Get URL location - string httpServ(HttpServer); - if (httpServ.length()>0) - { - Tango::DbDatum db_doc_url("doc_url"); - db_doc_url << httpServ; - data.push_back(db_doc_url); - } - - // Put inheritance - Tango::DbDatum inher_datum("InheritedFrom"); - vector<string> inheritance; - inheritance.push_back("Device_4Impl"); - inher_datum << inheritance; - data.push_back(inher_datum); - - // Call database and and values - //-------------------------------------------- - get_db_class()->put_property(data); -} - -} // namespace +static const char *ClassId = "$Id: MCCE2ElectrometersClass.cpp,v 1.16 2012-10-03 14:59:19 xavela Exp $"; +static const char *CvsPath = "$Source: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersClass.cpp,v $"; +static const char *SvnPath = "$HeadURL: $"; +static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersClass.cpp,v 1.16 2012-10-03 14:59:19 xavela Exp $"; +static const char *TagName = "$Name: not supported by cvs2svn $"; +static const char *HttpServer= "http://www.esrf.fr/computing/cs/tango/tango_doc/ds_doc/"; +//+============================================================================= +// +// file : MCCE2ElectrometersClass.cpp +// +// description : C++ source for the MCCE2ElectrometersClass. A singleton +// class derived from DeviceClass. It implements the +// command list and all properties and methods required +// by the MCCE2Electrometers once per process. +// +// project : TANGO Device Server +// +// $Author: xavela $ +// +// $Revision: 1.16 $ +// +// $Log: not supported by cvs2svn $ +// Revision 1.14 2010/06/10 15:12:05 xavela +// TEST : control two channels with different MCCE2 +// +// +// copyleft : Synchrotron SOLEIL +// L'Orme des Merisiers +// Saint-Aubin - BP 48 +// FRANCE +// +//-============================================================================= +// +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +// +// (c) - Software Engineering Group - ESRF +//============================================================================= + + +#include <tango.h> + +#include <MCCE2Electrometers.h> +#include <MCCE2ElectrometersClass.h> + + +//+---------------------------------------------------------------------------- +/** + * Create MCCE2ElectrometersClass singleton and return it in a C function for Python usage + */ +//+---------------------------------------------------------------------------- +extern "C" { +#ifdef WIN32 + +__declspec(dllexport) + +#endif + + Tango::DeviceClass *_create_MCCE2Electrometers_class(const char *name) { + return MCCE2Electrometers_ns::MCCE2ElectrometersClass::init(name); + } +} + + +namespace MCCE2Electrometers_ns +{ +//+---------------------------------------------------------------------------- +// +// method : SetPolarityClass::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetPolarityClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetPolarityClass::execute(): arrived" << endl; + + Tango::DevString argin; + extract(in_any, argin); + + ((static_cast<MCCE2Electrometers *>(device))->set_polarity(argin)); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2_OFFCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *MCCE2_OFFCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "MCCE2_OFFCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->mcce2__off()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2_ONCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *MCCE2_ONCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "MCCE2_ONCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->mcce2__on()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : SetGainCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetGainCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetGainCmd::execute(): arrived" << endl; + + Tango::DevUShort argin; + extract(in_any, argin); + + ((static_cast<MCCE2Electrometers *>(device))->set_gain(argin)); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : GetGainCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *GetGainCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "GetGainCmd::execute(): arrived" << endl; + + return insert((static_cast<MCCE2Electrometers *>(device))->get_gain()); +} + +//+---------------------------------------------------------------------------- +// +// method : GetModeCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *GetModeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "GetModeCmd::execute(): arrived" << endl; + + return insert((static_cast<MCCE2Electrometers *>(device))->get_mode()); +} + +//+---------------------------------------------------------------------------- +// +// method : SetRangeCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetRangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetRangeCmd::execute(): arrived" << endl; + + Tango::DevString argin; + extract(in_any, argin); + + ((static_cast<MCCE2Electrometers *>(device))->set_range(argin)); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : GetRangeCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *GetRangeCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "GetRangeCmd::execute(): arrived" << endl; + + return insert((static_cast<MCCE2Electrometers *>(device))->get_range()); +} + +//+---------------------------------------------------------------------------- +// +// method : RemoteCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *RemoteCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "RemoteCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->remote()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : LocalCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be executed +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *LocalCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "LocalCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->local()); + return new CORBA::Any(); +} + + + +//+---------------------------------------------------------------------------- +// +// method : GetHzFilterCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *GetHzFilterCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "GetHzFilterCmd::execute(): arrived" << endl; + + return insert((static_cast<MCCE2Electrometers *>(device))->get_hz_filter()); +} + +//+---------------------------------------------------------------------------- +// +// method : SetHzFilterCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetHzFilterCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetHzFilterCmd::execute(): arrived" << endl; + + Tango::DevShort argin; + extract(in_any, argin); + + ((static_cast<MCCE2Electrometers *>(device))->set_hz_filter(argin)); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : GetPolarityCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *GetPolarityCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "GetPolarityCmd::execute(): arrived" << endl; + + return insert((static_cast<MCCE2Electrometers *>(device))->get_polarity()); +} + + + + + +//+---------------------------------------------------------------------------- +// +// method : SetMeasureFunctionCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetMeasureFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetMeasureFunctionCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->set_measure_function()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : ClearRegistersClass::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *ClearRegistersClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "ClearRegistersClass::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->clear_registers()); + return new CORBA::Any(); +} + + +//+---------------------------------------------------------------------------- +// +// method : RangeUPCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *RangeUPCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "RangeUPCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->range_up()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : RangeDOWNClass::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *RangeDOWNClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "RangeDOWNClass::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->range_down()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : SetZeroVFFunctionCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetZeroVFFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetZeroVFFunctionCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->set_zero_vffunction()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : SetOffsetZeroV1FunctionCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetOffsetZeroV1FunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetOffsetZeroV1FunctionCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->set_offset_zero_v1_function()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : SetLeakageZeroV2FunctionCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetLeakageZeroV2FunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetLeakageZeroV2FunctionCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->set_leakage_zero_v2_function()); + return new CORBA::Any(); +} + +//+---------------------------------------------------------------------------- +// +// method : SetTestFunctionCmd::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *SetTestFunctionCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "SetTestFunctionCmd::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->set_test_function()); + return new CORBA::Any(); +} + + + + + +//+---------------------------------------------------------------------------- +// +// method : ResetClass::execute() +// +// description : method to trigger the execution of the command. +// PLEASE DO NOT MODIFY this method core without pogo +// +// in : - device : The device on which the command must be excuted +// - in_any : The command input data +// +// returns : The command output data (packed in the Any object) +// +//----------------------------------------------------------------------------- +CORBA::Any *ResetClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any) +{ + + cout2 << "ResetClass::execute(): arrived" << endl; + + ((static_cast<MCCE2Electrometers *>(device))->reset()); + return new CORBA::Any(); +} + + +// +//---------------------------------------------------------------- +// Initialize pointer for singleton pattern +//---------------------------------------------------------------- +// +MCCE2ElectrometersClass *MCCE2ElectrometersClass::_instance = NULL; + +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::MCCE2ElectrometersClass(string &s) +// +// description : constructor for the MCCE2ElectrometersClass +// +// in : - s : The class name +// +//----------------------------------------------------------------------------- +MCCE2ElectrometersClass::MCCE2ElectrometersClass(string &s):DeviceClass(s) +{ + + cout2 << "Entering MCCE2ElectrometersClass constructor" << endl; + set_default_property(); + write_class_property(); + get_class_property(); + + cout2 << "Leaving MCCE2ElectrometersClass constructor" << endl; + +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::~MCCE2ElectrometersClass() +// +// description : destructor for the MCCE2ElectrometersClass +// +//----------------------------------------------------------------------------- +MCCE2ElectrometersClass::~MCCE2ElectrometersClass() +{ + _instance = NULL; +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::instance +// +// description : Create the object if not already done. Otherwise, just +// return a pointer to the object +// +// in : - name : The class name +// +//----------------------------------------------------------------------------- +MCCE2ElectrometersClass *MCCE2ElectrometersClass::init(const char *name) +{ + if (_instance == NULL) + { + try + { + string s(name); + _instance = new MCCE2ElectrometersClass(s); + } + catch (bad_alloc) + { + throw; + } + } + return _instance; +} + +MCCE2ElectrometersClass *MCCE2ElectrometersClass::instance() +{ + if (_instance == NULL) + { + cerr << "Class is not initialised !!" << endl; + exit(-1); + } + return _instance; +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::command_factory +// +// description : Create the command object(s) and store them in the +// command list +// +//----------------------------------------------------------------------------- +void MCCE2ElectrometersClass::command_factory() +{ + command_list.push_back(new RangeUPCmd("RangeUP", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new RangeDOWNClass("RangeDOWN", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new SetZeroVFFunctionCmd("SetZeroVFFunction", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new SetOffsetZeroV1FunctionCmd("SetOffsetZeroV1Function", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new SetLeakageZeroV2FunctionCmd("SetLeakageZeroV2Function", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new SetTestFunctionCmd("SetTestFunction", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new SetMeasureFunctionCmd("SetMeasureFunction", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new MCCE2_ONCmd("MCCE2_ON", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new MCCE2_OFFCmd("MCCE2_OFF", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new LocalCmd("Local", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new RemoteCmd("Remote", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::EXPERT)); + command_list.push_back(new ResetClass("Reset", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new ClearRegistersClass("ClearRegisters", + Tango::DEV_VOID, Tango::DEV_VOID, + "no argin", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new GetRangeCmd("GetRange", + Tango::DEV_VOID, Tango::DEV_STRING, + "no argin", + "The actual electrometer range", + Tango::OPERATOR)); + command_list.push_back(new SetRangeCmd("SetRange", + Tango::DEV_STRING, Tango::DEV_VOID, + "The range to apply on the electrometer", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new GetModeCmd("GetMode", + Tango::DEV_VOID, Tango::DEV_STRING, + "no argin", + "The electrometer mode (MEASURE, LEAKAGE ...)", + Tango::EXPERT)); + command_list.push_back(new GetPolarityCmd("GetPolarity", + Tango::DEV_VOID, Tango::DEV_STRING, + "no argin", + "The electrometer polarity", + Tango::EXPERT)); + command_list.push_back(new SetPolarityClass("SetPolarity", + Tango::DEV_STRING, Tango::DEV_VOID, + "POSITIVE or NEGATIVE", + "no argout", + Tango::OPERATOR)); + command_list.push_back(new GetHzFilterCmd("GetHzFilter", + Tango::DEV_VOID, Tango::DEV_SHORT, + "no argin", + "The MCCE2 cut-off frequency in Hz", + Tango::EXPERT)); + command_list.push_back(new SetHzFilterCmd("SetHzFilter", + Tango::DEV_SHORT, Tango::DEV_VOID, + "The MCCE2 cut-off frequency in Hz", + "no argout", + Tango::EXPERT)); + command_list.push_back(new GetGainCmd("GetGain", + Tango::DEV_VOID, Tango::DEV_SHORT, + "no argin", + "The MCCE2 gain", + Tango::EXPERT)); + command_list.push_back(new SetGainCmd("SetGain", + Tango::DEV_USHORT, Tango::DEV_VOID, + "The new MCCE-2 gain", + "no argout", + Tango::EXPERT)); + + // add polling if any + for (unsigned int i=0 ; i<command_list.size(); i++) + { + } +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::get_class_property +// +// description : Get the class property for specified name. +// +// in : string name : The property name +// +//+---------------------------------------------------------------------------- +Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::get_default_device_property() +// +// description : Return the default value for device property. +// +//----------------------------------------------------------------------------- +Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::get_default_class_property() +// +// description : Return the default value for class property. +// +//----------------------------------------------------------------------------- +Tango::DbDatum MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::device_factory +// +// description : Create the device object(s) and store them in the +// device list +// +// in : Tango::DevVarStringArray *devlist_ptr : The device name list +// +//----------------------------------------------------------------------------- +void MCCE2ElectrometersClass::device_factory(const Tango::DevVarStringArray *devlist_ptr) +{ + + // 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 devices and add it into the device list + //---------------------------------------------------- + device_list.push_back(new MCCE2Electrometers(this, (*devlist_ptr)[i])); + + // Export device to the outside world + // Check before if database used. + //--------------------------------------------- + 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: MCCE2ElectrometersClass::attribute_factory(vector<Tango::Attr *> &att_list) +//----------------------------------------------------------------------------- +void MCCE2ElectrometersClass::attribute_factory(vector<Tango::Attr *> &att_list) +{ + // Attribute : electrometerChannel + electrometerChannelAttrib *electrometer_channel = new electrometerChannelAttrib(); + Tango::UserDefaultAttrProp electrometer_channel_prop; + electrometer_channel_prop.set_label("electrometer channel"); + electrometer_channel_prop.set_unit(" "); + electrometer_channel_prop.set_standard_unit(" "); + electrometer_channel_prop.set_display_unit(" "); + electrometer_channel_prop.set_format("%1.0d"); + electrometer_channel_prop.set_description("MCCE2 electrometer have two channels to support two amplifiers.\nWARN : default is 0 (please set this value first)."); + electrometer_channel->set_default_properties(electrometer_channel_prop); + att_list.push_back(electrometer_channel); + + // Attribute : range1 + range1Attrib *range1 = new range1Attrib(); + Tango::UserDefaultAttrProp range1_prop; + range1_prop.set_label("range1"); + range1_prop.set_unit(" "); + range1_prop.set_standard_unit(" "); + range1_prop.set_display_unit(" "); + range1_prop.set_format("%s"); + range1_prop.set_description("The channel one MCCE2 range."); + range1->set_default_properties(range1_prop); + att_list.push_back(range1); + + // Attribute : range2 + range2Attrib *range2 = new range2Attrib(); + Tango::UserDefaultAttrProp range2_prop; + range2_prop.set_label("range2"); + range2_prop.set_unit(" "); + range2_prop.set_standard_unit(" "); + range2_prop.set_display_unit(" "); + range2_prop.set_format("%s"); + range2_prop.set_description("The channel two MCCE range."); + range2->set_default_properties(range2_prop); + att_list.push_back(range2); + + // End of Automatic code generation + //------------------------------------------------------------- +} + +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::get_class_property() +// +// description : Read the class properties from database. +// +//----------------------------------------------------------------------------- +void MCCE2ElectrometersClass::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 : MCCE2ElectrometersClass::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 MCCE2ElectrometersClass::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 = "CommunicationLinkName"; + prop_desc = "The name of the device which manage the communication."; + prop_def = ""; + vect_data.clear(); + 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 = "Electrometer1Address"; + prop_desc = "The first electrometer address configured. <br />\nNote : if not connected, push 0 or let empty the property."; + prop_def = ""; + vect_data.clear(); + 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 = "Electrometer2Address"; + prop_desc = "The second electrometer address configured. <br />\nNote : if not connected, push 0 or let empty the property."; + prop_def = ""; + vect_data.clear(); + if (prop_def.length()>0) + { + Tango::DbDatum data(prop_name); + data << vect_data ; + dev_def_prop.push_back(data); + add_wiz_dev_prop(prop_name, prop_desc, prop_def); + } + else + add_wiz_dev_prop(prop_name, prop_desc); + +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2ElectrometersClass::write_class_property +// +// description : Set class description as property in database +// +//----------------------------------------------------------------------------- +void MCCE2ElectrometersClass::write_class_property() +{ + // First time, check if database used + //-------------------------------------------- + if (Tango::Util::_UseDb == false) + return; + + Tango::DbData data; + string classname = get_name(); + string header; + string::size_type start, end; + + // Put title + Tango::DbDatum title("ProjectTitle"); + string str_title("Novelec MCCE-2 Electrometers"); + title << str_title; + data.push_back(title); + + // Put Description + Tango::DbDatum description("Description"); + vector<string> str_desc; + str_desc.push_back("This class allows you to control all MCCE-2 Novelec electrometers"); + str_desc.push_back("through a Serial bus."); + str_desc.push_back("<br> Supported types :"); + str_desc.push_back("<br> Novelec Electrometers : MCCE2"); + description << str_desc; + data.push_back(description); + + // put cvs or svn location + string filename(classname); + filename += "Class.cpp"; + + // Create a string with the class ID to + // get the string into the binary + string class_id(ClassId); + + // check for cvs information + string src_path(CvsPath); + start = src_path.find("/"); + if (start!=string::npos) + { + end = src_path.find(filename); + if (end>start) + { + string strloc = src_path.substr(start, end-start); + // Check if specific repository + start = strloc.find("/cvsroot/"); + if (start!=string::npos && start>0) + { + string repository = strloc.substr(0, start); + if (repository.find("/segfs/")!=string::npos) + strloc = "ESRF:" + strloc.substr(start, strloc.length()-start); + } + Tango::DbDatum cvs_loc("cvs_location"); + cvs_loc << strloc; + data.push_back(cvs_loc); + } + } + // check for svn information + else + { + string src_path(SvnPath); + start = src_path.find("://"); + if (start!=string::npos) + { + end = src_path.find(filename); + if (end>start) + { + header = "$HeadURL: "; + start = header.length(); + string strloc = src_path.substr(start, (end-start)); + + Tango::DbDatum svn_loc("svn_location"); + svn_loc << strloc; + data.push_back(svn_loc); + } + } + } + + // Get CVS or SVN revision tag + + // CVS tag + string tagname(TagName); + header = "$Name: "; + start = header.length(); + string endstr(" $"); + + end = tagname.find(endstr); + if (end!=string::npos && end>start) + { + string strtag = tagname.substr(start, end-start); + Tango::DbDatum cvs_tag("cvs_tag"); + cvs_tag << strtag; + data.push_back(cvs_tag); + } + + // SVN tag + string svnpath(SvnPath); + header = "$HeadURL: "; + start = header.length(); + + end = svnpath.find(endstr); + if (end!=string::npos && end>start) + { + string strloc = svnpath.substr(start, end-start); + + string tagstr ("/tags/"); + start = strloc.find(tagstr); + if ( start!=string::npos ) + { + start = start + tagstr.length(); + end = strloc.find(filename); + string strtag = strloc.substr(start, end-start-1); + + Tango::DbDatum svn_tag("svn_tag"); + svn_tag << strtag; + data.push_back(svn_tag); + } + } + + // Get URL location + string httpServ(HttpServer); + if (httpServ.length()>0) + { + Tango::DbDatum db_doc_url("doc_url"); + db_doc_url << httpServ; + data.push_back(db_doc_url); + } + + // Put inheritance + Tango::DbDatum inher_datum("InheritedFrom"); + vector<string> inheritance; + inheritance.push_back("Device_4Impl"); + inher_datum << inheritance; + data.push_back(inher_datum); + + // Call database and and values + //-------------------------------------------- + get_db_class()->put_property(data); +} + +} // namespace diff --git a/src/MCCE2ElectrometersClass.h b/src/MCCE2ElectrometersClass.h index 5e9ca82aa829b33c374d2ecc79b5bfc017bf4b98..bd4ac0b5c866045cacb1661577247d450bc08f22 100644 --- a/src/MCCE2ElectrometersClass.h +++ b/src/MCCE2ElectrometersClass.h @@ -1,662 +1,662 @@ -//============================================================================= -// -// file : MCCE2ElectrometersClass.h -// -// description : Include for the MCCE2ElectrometersClass root class. -// This class is represents the singleton class for -// the MCCE2Electrometers device class. -// It contains all properties and methods which the -// MCCE2Electrometers requires only once e.g. the commands. -// -// project : TANGO Device Server -// -// $Author: xavela $ -// -// $Revision: 1.14 $ -// -// $Log: not supported by cvs2svn $ -// Revision 1.12 2010/06/10 15:12:05 xavela -// TEST : control two channels with different MCCE2 -// -// -// copyleft : Synchrotron SOLEIL -// L'Orme des Merisiers -// Saint-Aubin - BP 48 -// -//============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - -#ifndef _MCCE2ELECTROMETERSCLASS_H -#define _MCCE2ELECTROMETERSCLASS_H - -#include <tango.h> -#include <MCCE2Electrometers.h> - - -namespace MCCE2Electrometers_ns -{ -//===================================== -// Define classes for attributes -//===================================== -class range2Attrib: public Tango::Attr -{ -public: - range2Attrib():Attr("range2", Tango::DEV_STRING, Tango::READ) {}; - ~range2Attrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<MCCE2Electrometers *>(dev))->read_range2(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<MCCE2Electrometers *>(dev))->is_range2_allowed(ty);} -}; - -class range1Attrib: public Tango::Attr -{ -public: - range1Attrib():Attr("range1", Tango::DEV_STRING, Tango::READ) {}; - ~range1Attrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<MCCE2Electrometers *>(dev))->read_range1(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<MCCE2Electrometers *>(dev))->is_range1_allowed(ty);} -}; - -class electrometerChannelAttrib: public Tango::Attr -{ -public: - electrometerChannelAttrib():Attr("electrometerChannel", Tango::DEV_USHORT, Tango::READ_WRITE) {}; - ~electrometerChannelAttrib() {}; - - virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) - {(static_cast<MCCE2Electrometers *>(dev))->read_electrometerChannel(att);} - virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) - {(static_cast<MCCE2Electrometers *>(dev))->write_electrometerChannel(att);} - virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) - {return (static_cast<MCCE2Electrometers *>(dev))->is_electrometerChannel_allowed(ty);} -}; - -//========================================= -// Define classes for commands -//========================================= -class SetGainCmd : public Tango::Command -{ -public: - SetGainCmd(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) {}; - - SetGainCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetGainCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetGain_allowed(any);} -}; - - - -class GetGainCmd : public Tango::Command -{ -public: - GetGainCmd(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) {}; - - GetGainCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetGainCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_GetGain_allowed(any);} -}; - - - -class SetHzFilterCmd : public Tango::Command -{ -public: - SetHzFilterCmd(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) {}; - - SetHzFilterCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetHzFilterCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetHzFilter_allowed(any);} -}; - - - -class GetHzFilterCmd : public Tango::Command -{ -public: - GetHzFilterCmd(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) {}; - - GetHzFilterCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetHzFilterCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_GetHzFilter_allowed(any);} -}; - - - -class SetPolarityClass : public Tango::Command -{ -public: - SetPolarityClass(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) {}; - - SetPolarityClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetPolarityClass() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetPolarity_allowed(any);} -}; - - - -class GetPolarityCmd : public Tango::Command -{ -public: - GetPolarityCmd(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) {}; - - GetPolarityCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetPolarityCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_GetPolarity_allowed(any);} -}; - - - -class GetModeCmd : public Tango::Command -{ -public: - GetModeCmd(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) {}; - - GetModeCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetModeCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_GetMode_allowed(any);} -}; - - - -class SetRangeCmd : public Tango::Command -{ -public: - SetRangeCmd(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) {}; - - SetRangeCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetRangeCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetRange_allowed(any);} -}; - - - -class GetRangeCmd : public Tango::Command -{ -public: - GetRangeCmd(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) {}; - - GetRangeCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~GetRangeCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_GetRange_allowed(any);} -}; - - - -class ClearRegistersClass : public Tango::Command -{ -public: - ClearRegistersClass(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) {}; - - ClearRegistersClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~ClearRegistersClass() {}; - - 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<MCCE2Electrometers *>(dev))->is_ClearRegisters_allowed(any);} -}; - - - -class ResetClass : public Tango::Command -{ -public: - ResetClass(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) {}; - - ResetClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~ResetClass() {}; - - 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<MCCE2Electrometers *>(dev))->is_Reset_allowed(any);} -}; - - - -class RemoteCmd : public Tango::Command -{ -public: - RemoteCmd(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) {}; - - RemoteCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RemoteCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_Remote_allowed(any);} -}; - - - -class LocalCmd : public Tango::Command -{ -public: - LocalCmd(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) {}; - - LocalCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~LocalCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_Local_allowed(any);} -}; - - - -class MCCE2_OFFCmd : public Tango::Command -{ -public: - MCCE2_OFFCmd(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) {}; - - MCCE2_OFFCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~MCCE2_OFFCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_MCCE2_OFF_allowed(any);} -}; - - - -class MCCE2_ONCmd : public Tango::Command -{ -public: - MCCE2_ONCmd(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) {}; - - MCCE2_ONCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~MCCE2_ONCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_MCCE2_ON_allowed(any);} -}; - - - -class SetMeasureFunctionCmd : public Tango::Command -{ -public: - SetMeasureFunctionCmd(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) {}; - - SetMeasureFunctionCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetMeasureFunctionCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetMeasureFunction_allowed(any);} -}; - - - -class SetTestFunctionCmd : public Tango::Command -{ -public: - SetTestFunctionCmd(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) {}; - - SetTestFunctionCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetTestFunctionCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetTestFunction_allowed(any);} -}; - - - -class SetLeakageZeroV2FunctionCmd : public Tango::Command -{ -public: - SetLeakageZeroV2FunctionCmd(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) {}; - - SetLeakageZeroV2FunctionCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetLeakageZeroV2FunctionCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetLeakageZeroV2Function_allowed(any);} -}; - - - -class SetOffsetZeroV1FunctionCmd : public Tango::Command -{ -public: - SetOffsetZeroV1FunctionCmd(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) {}; - - SetOffsetZeroV1FunctionCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetOffsetZeroV1FunctionCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetOffsetZeroV1Function_allowed(any);} -}; - - - -class SetZeroVFFunctionCmd : public Tango::Command -{ -public: - SetZeroVFFunctionCmd(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) {}; - - SetZeroVFFunctionCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~SetZeroVFFunctionCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_SetZeroVFFunction_allowed(any);} -}; - - - -class RangeDOWNClass : public Tango::Command -{ -public: - RangeDOWNClass(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) {}; - - RangeDOWNClass(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RangeDOWNClass() {}; - - 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<MCCE2Electrometers *>(dev))->is_RangeDOWN_allowed(any);} -}; - - - -class RangeUPCmd : public Tango::Command -{ -public: - RangeUPCmd(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) {}; - - RangeUPCmd(const char *name, - Tango::CmdArgType in, - Tango::CmdArgType out) - :Command(name,in,out) {}; - ~RangeUPCmd() {}; - - 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<MCCE2Electrometers *>(dev))->is_RangeUP_allowed(any);} -}; - - - -// -// The MCCE2ElectrometersClass singleton definition -// - -class -#ifdef WIN32 - __declspec(dllexport) -#endif - MCCE2ElectrometersClass : 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 MCCE2ElectrometersClass *init(const char *); - static MCCE2ElectrometersClass *instance(); - ~MCCE2ElectrometersClass(); - Tango::DbDatum get_class_property(string &); - Tango::DbDatum get_default_device_property(string &); - Tango::DbDatum get_default_class_property(string &); - -protected: - MCCE2ElectrometersClass(string &); - static MCCE2ElectrometersClass *_instance; - void command_factory(); - void get_class_property(); - void attribute_factory(vector<Tango::Attr *> &); - void write_class_property(); - void set_default_property(); - string get_cvstag(); - string get_cvsroot(); - -private: - void device_factory(const Tango::DevVarStringArray *); -}; - - -} // namespace MCCE2Electrometers_ns - -#endif // _MCCE2ELECTROMETERSCLASS_H +//============================================================================= +// +// file : MCCE2ElectrometersClass.h +// +// description : Include for the MCCE2ElectrometersClass root class. +// This class is represents the singleton class for +// the MCCE2Electrometers device class. +// It contains all properties and methods which the +// MCCE2Electrometers requires only once e.g. the commands. +// +// project : TANGO Device Server +// +// $Author: xavela $ +// +// $Revision: 1.14 $ +// +// $Log: not supported by cvs2svn $ +// Revision 1.12 2010/06/10 15:12:05 xavela +// TEST : control two channels with different MCCE2 +// +// +// copyleft : Synchrotron SOLEIL +// L'Orme des Merisiers +// Saint-Aubin - BP 48 +// +//============================================================================= +// +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +// +// (c) - Software Engineering Group - ESRF +//============================================================================= + +#ifndef _MCCE2ELECTROMETERSCLASS_H +#define _MCCE2ELECTROMETERSCLASS_H + +#include <tango.h> +#include <MCCE2Electrometers.h> + + +namespace MCCE2Electrometers_ns +{ +//===================================== +// Define classes for attributes +//===================================== +class range2Attrib: public Tango::Attr +{ +public: + range2Attrib():Attr("range2", Tango::DEV_STRING, Tango::READ) {}; + ~range2Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<MCCE2Electrometers *>(dev))->read_range2(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<MCCE2Electrometers *>(dev))->is_range2_allowed(ty);} +}; + +class range1Attrib: public Tango::Attr +{ +public: + range1Attrib():Attr("range1", Tango::DEV_STRING, Tango::READ) {}; + ~range1Attrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<MCCE2Electrometers *>(dev))->read_range1(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<MCCE2Electrometers *>(dev))->is_range1_allowed(ty);} +}; + +class electrometerChannelAttrib: public Tango::Attr +{ +public: + electrometerChannelAttrib():Attr("electrometerChannel", Tango::DEV_USHORT, Tango::READ_WRITE) {}; + ~electrometerChannelAttrib() {}; + + virtual void read(Tango::DeviceImpl *dev,Tango::Attribute &att) + {(static_cast<MCCE2Electrometers *>(dev))->read_electrometerChannel(att);} + virtual void write(Tango::DeviceImpl *dev,Tango::WAttribute &att) + {(static_cast<MCCE2Electrometers *>(dev))->write_electrometerChannel(att);} + virtual bool is_allowed(Tango::DeviceImpl *dev,Tango::AttReqType ty) + {return (static_cast<MCCE2Electrometers *>(dev))->is_electrometerChannel_allowed(ty);} +}; + +//========================================= +// Define classes for commands +//========================================= +class SetGainCmd : public Tango::Command +{ +public: + SetGainCmd(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) {}; + + SetGainCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetGainCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetGain_allowed(any);} +}; + + + +class GetGainCmd : public Tango::Command +{ +public: + GetGainCmd(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) {}; + + GetGainCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~GetGainCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_GetGain_allowed(any);} +}; + + + +class SetHzFilterCmd : public Tango::Command +{ +public: + SetHzFilterCmd(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) {}; + + SetHzFilterCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetHzFilterCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetHzFilter_allowed(any);} +}; + + + +class GetHzFilterCmd : public Tango::Command +{ +public: + GetHzFilterCmd(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) {}; + + GetHzFilterCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~GetHzFilterCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_GetHzFilter_allowed(any);} +}; + + + +class SetPolarityClass : public Tango::Command +{ +public: + SetPolarityClass(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) {}; + + SetPolarityClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetPolarityClass() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetPolarity_allowed(any);} +}; + + + +class GetPolarityCmd : public Tango::Command +{ +public: + GetPolarityCmd(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) {}; + + GetPolarityCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~GetPolarityCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_GetPolarity_allowed(any);} +}; + + + +class GetModeCmd : public Tango::Command +{ +public: + GetModeCmd(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) {}; + + GetModeCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~GetModeCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_GetMode_allowed(any);} +}; + + + +class SetRangeCmd : public Tango::Command +{ +public: + SetRangeCmd(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) {}; + + SetRangeCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetRangeCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetRange_allowed(any);} +}; + + + +class GetRangeCmd : public Tango::Command +{ +public: + GetRangeCmd(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) {}; + + GetRangeCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~GetRangeCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_GetRange_allowed(any);} +}; + + + +class ClearRegistersClass : public Tango::Command +{ +public: + ClearRegistersClass(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) {}; + + ClearRegistersClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~ClearRegistersClass() {}; + + 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<MCCE2Electrometers *>(dev))->is_ClearRegisters_allowed(any);} +}; + + + +class ResetClass : public Tango::Command +{ +public: + ResetClass(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) {}; + + ResetClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~ResetClass() {}; + + 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<MCCE2Electrometers *>(dev))->is_Reset_allowed(any);} +}; + + + +class RemoteCmd : public Tango::Command +{ +public: + RemoteCmd(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) {}; + + RemoteCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~RemoteCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_Remote_allowed(any);} +}; + + + +class LocalCmd : public Tango::Command +{ +public: + LocalCmd(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) {}; + + LocalCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~LocalCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_Local_allowed(any);} +}; + + + +class MCCE2_OFFCmd : public Tango::Command +{ +public: + MCCE2_OFFCmd(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) {}; + + MCCE2_OFFCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~MCCE2_OFFCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_MCCE2_OFF_allowed(any);} +}; + + + +class MCCE2_ONCmd : public Tango::Command +{ +public: + MCCE2_ONCmd(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) {}; + + MCCE2_ONCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~MCCE2_ONCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_MCCE2_ON_allowed(any);} +}; + + + +class SetMeasureFunctionCmd : public Tango::Command +{ +public: + SetMeasureFunctionCmd(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) {}; + + SetMeasureFunctionCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetMeasureFunctionCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetMeasureFunction_allowed(any);} +}; + + + +class SetTestFunctionCmd : public Tango::Command +{ +public: + SetTestFunctionCmd(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) {}; + + SetTestFunctionCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetTestFunctionCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetTestFunction_allowed(any);} +}; + + + +class SetLeakageZeroV2FunctionCmd : public Tango::Command +{ +public: + SetLeakageZeroV2FunctionCmd(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) {}; + + SetLeakageZeroV2FunctionCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetLeakageZeroV2FunctionCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetLeakageZeroV2Function_allowed(any);} +}; + + + +class SetOffsetZeroV1FunctionCmd : public Tango::Command +{ +public: + SetOffsetZeroV1FunctionCmd(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) {}; + + SetOffsetZeroV1FunctionCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetOffsetZeroV1FunctionCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetOffsetZeroV1Function_allowed(any);} +}; + + + +class SetZeroVFFunctionCmd : public Tango::Command +{ +public: + SetZeroVFFunctionCmd(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) {}; + + SetZeroVFFunctionCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~SetZeroVFFunctionCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_SetZeroVFFunction_allowed(any);} +}; + + + +class RangeDOWNClass : public Tango::Command +{ +public: + RangeDOWNClass(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) {}; + + RangeDOWNClass(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~RangeDOWNClass() {}; + + 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<MCCE2Electrometers *>(dev))->is_RangeDOWN_allowed(any);} +}; + + + +class RangeUPCmd : public Tango::Command +{ +public: + RangeUPCmd(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) {}; + + RangeUPCmd(const char *name, + Tango::CmdArgType in, + Tango::CmdArgType out) + :Command(name,in,out) {}; + ~RangeUPCmd() {}; + + 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<MCCE2Electrometers *>(dev))->is_RangeUP_allowed(any);} +}; + + + +// +// The MCCE2ElectrometersClass singleton definition +// + +class +#ifdef WIN32 + __declspec(dllexport) +#endif + MCCE2ElectrometersClass : 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 MCCE2ElectrometersClass *init(const char *); + static MCCE2ElectrometersClass *instance(); + ~MCCE2ElectrometersClass(); + Tango::DbDatum get_class_property(string &); + Tango::DbDatum get_default_device_property(string &); + Tango::DbDatum get_default_class_property(string &); + +protected: + MCCE2ElectrometersClass(string &); + static MCCE2ElectrometersClass *_instance; + void command_factory(); + void get_class_property(); + void attribute_factory(vector<Tango::Attr *> &); + void write_class_property(); + void set_default_property(); + string get_cvstag(); + string get_cvsroot(); + +private: + void device_factory(const Tango::DevVarStringArray *); +}; + + +} // namespace MCCE2Electrometers_ns + +#endif // _MCCE2ELECTROMETERSCLASS_H diff --git a/src/MCCE2ElectrometersStateMachine.cpp b/src/MCCE2ElectrometersStateMachine.cpp index 6684d3ffbbce4582ec708797601cd551dc3a7470..68e257410a74b9454406951f0bef36c70b92d5dc 100644 --- a/src/MCCE2ElectrometersStateMachine.cpp +++ b/src/MCCE2ElectrometersStateMachine.cpp @@ -1,414 +1,414 @@ -static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersStateMachine.cpp,v 1.14 2012-10-03 14:59:19 xavela Exp $"; -//+============================================================================= -// -// file : MCCE2ElectrometersStateMachine.cpp -// -// description : C++ source for the MCCE2Electrometers and its alowed. -// method for commands and attributes -// -// project : TANGO Device Server -// -// $Author: xavela $ -// -// $Revision: 1.14 $ -// -// $Log: not supported by cvs2svn $ -// Revision 1.12 2010/06/10 15:12:05 xavela -// TEST : control two channels with different MCCE2 -// -// -// copyleft : European Synchrotron Radiation Facility -// BP 220, Grenoble 38043 -// FRANCE -// -//-============================================================================= -// -// This file is generated by POGO -// (Program Obviously used to Generate tango Object) -// -// (c) - Software Engineering Group - ESRF -//============================================================================= - -#include <tango.h> -#include <MCCE2Electrometers.h> -#include <MCCE2ElectrometersClass.h> - -/*==================================================================== - * This file contains the methods to allow commands and attributes - * read or write execution. - * - * If you wand to add your own code, add it between - * the "End/Re-Start of Generated Code" comments. - * - * If you want, you can also add your own methods. - *==================================================================== - */ - -namespace MCCE2Electrometers_ns -{ - -//================================================= -// Attributes Allowed Methods -//================================================= - -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_electrometerChannel_allowed -// -// description : Read/Write allowed for electrometerChannel attribute. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_electrometerChannel_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_range1_allowed -// -// description : Read/Write allowed for range1 attribute. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_range1_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_range2_allowed -// -// description : Read/Write allowed for range2 attribute. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_range2_allowed(Tango::AttReqType type) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} - -//================================================= -// Commands Allowed Methods -//================================================= - -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_RangeUP_allowed -// -// description : Execution allowed for RangeUP command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_RangeUP_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_RangeDOWN_allowed -// -// description : Execution allowed for RangeDOWN command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_RangeDOWN_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetZeroVFFunction_allowed -// -// description : Execution allowed for SetZeroVFFunction command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetZeroVFFunction_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetOffsetZeroV1Function_allowed -// -// description : Execution allowed for SetOffsetZeroV1Function command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetOffsetZeroV1Function_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetLeakageZeroV2Function_allowed -// -// description : Execution allowed for SetLeakageZeroV2Function command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetLeakageZeroV2Function_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetTestFunction_allowed -// -// description : Execution allowed for SetTestFunction command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetTestFunction_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_MCCE2_ON_allowed -// -// description : Execution allowed for MCCE2_ON command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_MCCE2_ON_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_MCCE2_OFF_allowed -// -// description : Execution allowed for MCCE2_OFF command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_MCCE2_OFF_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_Local_allowed -// -// description : Execution allowed for Local command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_Local_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_Remote_allowed -// -// description : Execution allowed for Remote command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_Remote_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_Reset_allowed -// -// description : Execution allowed for Reset command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_Reset_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_ClearRegisters_allowed -// -// description : Execution allowed for ClearRegisters command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_ClearRegisters_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetMeasureFunction_allowed -// -// description : Execution allowed for SetMeasureFunction command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetMeasureFunction_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_GetRange_allowed -// -// description : Execution allowed for GetRange command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_GetRange_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetRange_allowed -// -// description : Execution allowed for SetRange command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetRange_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_GetMode_allowed -// -// description : Execution allowed for GetMode command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_GetMode_allowed(const CORBA::Any &any) -{ - if (get_state() == Tango::RUNNING) - { - // End of Generated Code - - // Re-Start of Generated Code - return false; - } - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_GetPolarity_allowed -// -// description : Execution allowed for GetPolarity command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_GetPolarity_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetHzFilter_allowed -// -// description : Execution allowed for SetHzFilter command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetHzFilter_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_GetHzFilter_allowed -// -// description : Execution allowed for GetHzFilter command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_GetHzFilter_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_GetGain_allowed -// -// description : Execution allowed for GetGain command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_GetGain_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetGain_allowed -// -// description : Execution allowed for SetGain command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetGain_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} -//+---------------------------------------------------------------------------- -// -// method : MCCE2Electrometers::is_SetPolarity_allowed -// -// description : Execution allowed for SetPolarity command. -// -//----------------------------------------------------------------------------- -bool MCCE2Electrometers::is_SetPolarity_allowed(const CORBA::Any &any) -{ - // End of Generated Code - - // Re-Start of Generated Code - return true; -} - -} // namespace MCCE2Electrometers_ns +static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/NovelecElectro/src/MCCE2ElectrometersStateMachine.cpp,v 1.14 2012-10-03 14:59:19 xavela Exp $"; +//+============================================================================= +// +// file : MCCE2ElectrometersStateMachine.cpp +// +// description : C++ source for the MCCE2Electrometers and its alowed. +// method for commands and attributes +// +// project : TANGO Device Server +// +// $Author: xavela $ +// +// $Revision: 1.14 $ +// +// $Log: not supported by cvs2svn $ +// Revision 1.12 2010/06/10 15:12:05 xavela +// TEST : control two channels with different MCCE2 +// +// +// copyleft : European Synchrotron Radiation Facility +// BP 220, Grenoble 38043 +// FRANCE +// +//-============================================================================= +// +// This file is generated by POGO +// (Program Obviously used to Generate tango Object) +// +// (c) - Software Engineering Group - ESRF +//============================================================================= + +#include <tango.h> +#include <MCCE2Electrometers.h> +#include <MCCE2ElectrometersClass.h> + +/*==================================================================== + * This file contains the methods to allow commands and attributes + * read or write execution. + * + * If you wand to add your own code, add it between + * the "End/Re-Start of Generated Code" comments. + * + * If you want, you can also add your own methods. + *==================================================================== + */ + +namespace MCCE2Electrometers_ns +{ + +//================================================= +// Attributes Allowed Methods +//================================================= + +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_electrometerChannel_allowed +// +// description : Read/Write allowed for electrometerChannel attribute. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_electrometerChannel_allowed(Tango::AttReqType type) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_range1_allowed +// +// description : Read/Write allowed for range1 attribute. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_range1_allowed(Tango::AttReqType type) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_range2_allowed +// +// description : Read/Write allowed for range2 attribute. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_range2_allowed(Tango::AttReqType type) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} + +//================================================= +// Commands Allowed Methods +//================================================= + +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_RangeUP_allowed +// +// description : Execution allowed for RangeUP command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_RangeUP_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_RangeDOWN_allowed +// +// description : Execution allowed for RangeDOWN command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_RangeDOWN_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetZeroVFFunction_allowed +// +// description : Execution allowed for SetZeroVFFunction command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetZeroVFFunction_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetOffsetZeroV1Function_allowed +// +// description : Execution allowed for SetOffsetZeroV1Function command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetOffsetZeroV1Function_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetLeakageZeroV2Function_allowed +// +// description : Execution allowed for SetLeakageZeroV2Function command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetLeakageZeroV2Function_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetTestFunction_allowed +// +// description : Execution allowed for SetTestFunction command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetTestFunction_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_MCCE2_ON_allowed +// +// description : Execution allowed for MCCE2_ON command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_MCCE2_ON_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_MCCE2_OFF_allowed +// +// description : Execution allowed for MCCE2_OFF command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_MCCE2_OFF_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_Local_allowed +// +// description : Execution allowed for Local command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_Local_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_Remote_allowed +// +// description : Execution allowed for Remote command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_Remote_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_Reset_allowed +// +// description : Execution allowed for Reset command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_Reset_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_ClearRegisters_allowed +// +// description : Execution allowed for ClearRegisters command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_ClearRegisters_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetMeasureFunction_allowed +// +// description : Execution allowed for SetMeasureFunction command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetMeasureFunction_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_GetRange_allowed +// +// description : Execution allowed for GetRange command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_GetRange_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetRange_allowed +// +// description : Execution allowed for SetRange command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetRange_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_GetMode_allowed +// +// description : Execution allowed for GetMode command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_GetMode_allowed(const CORBA::Any &any) +{ + if (get_state() == Tango::RUNNING) + { + // End of Generated Code + + // Re-Start of Generated Code + return false; + } + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_GetPolarity_allowed +// +// description : Execution allowed for GetPolarity command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_GetPolarity_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetHzFilter_allowed +// +// description : Execution allowed for SetHzFilter command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetHzFilter_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_GetHzFilter_allowed +// +// description : Execution allowed for GetHzFilter command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_GetHzFilter_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_GetGain_allowed +// +// description : Execution allowed for GetGain command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_GetGain_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetGain_allowed +// +// description : Execution allowed for SetGain command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetGain_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} +//+---------------------------------------------------------------------------- +// +// method : MCCE2Electrometers::is_SetPolarity_allowed +// +// description : Execution allowed for SetPolarity command. +// +//----------------------------------------------------------------------------- +bool MCCE2Electrometers::is_SetPolarity_allowed(const CORBA::Any &any) +{ + // End of Generated Code + + // Re-Start of Generated Code + return true; +} + +} // namespace MCCE2Electrometers_ns diff --git a/src/cbproj/Novelec.cbp b/src/cbproj/Novelec.cbp index c0c85d05b25a000cf8d0fa75783b27ab102a5c17..37512076d0eabc8ce8881e525b685b3b5aa55b62 100644 --- a/src/cbproj/Novelec.cbp +++ b/src/cbproj/Novelec.cbp @@ -42,6 +42,7 @@ <Add option="/W3" /> <Add option="/EHsc" /> </Compiler> + <Unit filename="../../pom.xml" /> <Unit filename="../ClassFactory.cpp" /> <Unit filename="../MCCE2Electrometers.cpp" /> <Unit filename="../MCCE2Electrometers.h" /> diff --git a/src/cbproj/Novelec.layout b/src/cbproj/Novelec.layout index 9148350e4982afc1db750e9d714f085d45c8814e..fbeda0bb31291be48d8f684a523c5698fe49ad5d 100644 --- a/src/cbproj/Novelec.layout +++ b/src/cbproj/Novelec.layout @@ -1,14 +1,34 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <CodeBlocks_layout_file> <ActiveTarget name="Debug" /> + <File name="..\main.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <Cursor> + <Cursor1 position="628" topLine="24" /> + </Cursor> + </File> + <File name="..\MCCE2Electrometers.h" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <Cursor> + <Cursor1 position="0" topLine="0" /> + </Cursor> + </File> + <File name="..\MCCE2ElectrometersClass.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <Cursor> + <Cursor1 position="0" topLine="59" /> + </Cursor> + </File> <File name="..\MCCE2Electrometers.cpp" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="53307" topLine="1315" /> + <Cursor1 position="924" topLine="0" /> + </Cursor> + </File> + <File name="..\MCCE2ElectrometersStateMachine.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <Cursor> + <Cursor1 position="0" topLine="51" /> </Cursor> </File> - <File name="..\MCCE2Electrometers.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> + <File name="..\..\pom.xml" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <Cursor> - <Cursor1 position="12020" topLine="151" /> + <Cursor1 position="1081" topLine="0" /> </Cursor> </File> </CodeBlocks_layout_file>