Skip to content
Snippets Groups Projects
Commit e7b133b6 authored by Sebastien Leport's avatar Sebastien Leport
Browse files

- status modification

- add GetLastError command
parent cc4d63fc
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -10,21 +10,23 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -39,7 +41,7 @@ Device Attributes Description <Br> <Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
......
......@@ -9,21 +9,26 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.cells.es/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/alba.jpg" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Servers
</Center></FONT>
</Td>
</TR>
......
......@@ -10,21 +10,23 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -39,7 +41,7 @@ Device Commands Description <Br> <Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
......@@ -61,7 +63,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: none.<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::OFF<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......@@ -75,7 +77,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
<Li><Strong>Argout:<Br>DEV_STATE</Strong>
: State Code<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::OFF<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......@@ -89,7 +91,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
<Li><Strong>Argout:<Br>CONST_DEV_STRING</Strong>
: Status descrition<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::OFF<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......@@ -103,7 +105,7 @@ The language device desctructor automatically calls the <i> delete_device() </i>
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::OFF<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......@@ -118,7 +120,7 @@ switching ON, Output voltages stay at 0 V.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......@@ -132,13 +134,13 @@ switching ON, Output voltages stay at 0 V.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="Set_Channels_Target_Voltages"><!-- --></A>
<A NAME="Set_Channels_Target_Voltages"><!-- --></A>
<h2>7 - Set_Channels_Target_Voltages</h2>
<A NAME="SetChannelsTargetVoltage"><!-- --></A>
<A NAME="SetChannelsTargetVoltage"><!-- --></A>
<h2>7 - SetChannelsTargetVoltage</h2>
<ul>
<Li><Strong>Description: </Strong> This command sets all channels to the voltage defined by each target voltage attributes in the
SY900S_channel device.<Br>&nbsp
......@@ -147,7 +149,21 @@ SY900S_channel device.<Br>&nbsp
<Li><Strong>Argout:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::ON<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<A NAME="GetLastError"><!-- --></A>
<A NAME="GetLastError"><!-- --></A>
<h2>8 - GetLastError</h2>
<ul>
<Li><Strong>Description: </Strong> this function get the las error message which has occured<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Argout:<Br>DEV_STRING</Strong>
: error message<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::ALARM<Li>Tango::UNKNOWN<Li>Tango::STANDBY<Li>Tango::RUNNING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
......
......@@ -14,7 +14,8 @@
<A Href="DevCommands.html#On" TARGET="DevCommands"> On</a><Br>
<A Href="DevCommands.html#Off" TARGET="DevCommands"> Off</a><Br>
<A Href="DevCommands.html#ResetError" TARGET="DevCommands"> ResetError</a><Br>
<A Href="DevCommands.html#Set_Channels_Target_Voltages" TARGET="DevCommands"> Set_Channels_Target_Voltages</a><Br>
<A Href="DevCommands.html#SetChannelsTargetVoltage" TARGET="DevCommands"> SetChannelsTargetVoltage</a><Br>
<A Href="DevCommands.html#GetLastError" TARGET="DevCommands"> GetLastError</a><Br>
</BODY>
......
......@@ -10,21 +10,23 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -39,7 +41,7 @@ Device Commands Description <Br> <Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
......@@ -73,9 +75,12 @@ Revision: - Author:
<Tr><Td>ResetError</Td>
<Td>DEV_VOID</Td>
<Td>DEV_VOID</Td>
<Tr><Td>Set_Channels_Target_Voltages</Td>
<Tr><Td>SetChannelsTargetVoltage</Td>
<Td>DEV_VOID</Td>
<Td>DEV_VOID</Td>
<Tr><Td>GetLastError</Td>
<Td>DEV_VOID</Td>
<Td>DEV_STRING</Td>
......
......@@ -10,21 +10,23 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -39,7 +41,7 @@ Properties Description <Br> <Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
......
......@@ -10,21 +10,23 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<Td>
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -39,7 +41,7 @@ Device States Description <Br> <Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
......@@ -52,12 +54,6 @@ Revision: - Author:
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<Td><Center><b>Names</b></td></Center>
<Td><Center><b>Descriptions</b></td></Center>
<Tr><Td>ON</Td>
<Td></Td></Tr>
<Tr><Td>OFF</Td>
<Td></Td></Tr>
<Tr><Td>FAULT</Td>
<Td>memory allocation problem</Td></Tr>
......@@ -71,7 +67,8 @@ Revision: - Author:
<Td>wait for a command</Td></Tr>
<Tr><Td>RUNNING</Td>
<Td>SY900S busy</Td></Tr>
<Td>SY900S busy
</Td></Tr>
......
......@@ -9,21 +9,22 @@
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<A HREF=http://www.esrf.fr>
<A HREF="http://www.esrf.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/gifs/logo/80.gif" BORDER=0></A>
</Td>
<TD ALIGN="center">
<A HREF=http://www.elettra.trieste.it/>
<IMG SRC="http://www.esrf.fr/tango/elettra_logo.gif" BORDER=0></A>
<A HREF="http://www.elettra.trieste.it/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/elettra_logo.gif" BORDER=0></A>
</Td>
<TD ALIGN="right">
<A HREF=http://www.synchrotron-soleil.fr/>
<IMG SRC="http://www.esrf.fr/tango/soleil_logo.gif" BORDER=0></A>
<A HREF="http://www.synchrotron-soleil.fr/" TARGET=new>
<IMG SRC="http://www.esrf.fr/computing/cs/tango/soleil_logo.gif" BORDER=0></A>
</Td>
<Td>
<H1><FONT COLOR="#0000FF">
<Center>TANGO <Br> Device Server
<H2><FONT COLOR="#7F00FF">
<Center><A HREF="http://www.esrf.fr/Infrastructure/Computing/tango/" TARGET="_top">
TANGO </a> <Br> Device Server
</Center></FONT>
</Td>
</TR>
......@@ -31,15 +32,15 @@
<HR WIDTH="100%"></H5>
<center>
<!---------- center>
<h1>
SY900S_Group <Br>
Device Server User's Guide <Br><Br>
SY900S_Group Class <Br>
</h1>
<b>
Revision: - Author:
<b ---------->
Revision: - Author: stephle - CVS repository: sourceforge(tango-ds)
</b>
</center>
<Br>
......@@ -63,20 +64,11 @@ this device controls one group of channels. Every channels of one group reply by
<Br>
<Br>
<Br>
<h2>Extented User's guide (available only for complex DeviceServers): Available in French OR English versions</h2>
<ul>
<li> <a href="..\DeviceServerUsersGuide.doc"> In English word format.</a>
<li> <a href="..\DeviceServerUsersGuide.pdf"> In English PDF format.</a>
<li> <a href="..\DeviceServerUsersGuide_fr.doc"> In French word format.</a>
<li> <a href="..\DeviceServerUsersGuide_fr.pdf"> In French PDF format.</a>
</ul>
<Br>
<Br>
<h2>Programmer's guide:</h2>
<!--------------h2>Programmer's guide:</h2>
<ul>
<li> <a href="html/index.html"> Software description.</a>
</ul>
<Br>
<Br------>
<Br>
<Br>
<h2>Conclusion:</h2>
......
......@@ -6,11 +6,14 @@
#
# project : Makefile to generate a Tango server
#
# $Author: stephle $
# $Author: sebleport $
#
# $Revision: 1.1.1.1 $
# $Revision: 1.2 $
#
# $Log: not supported by cvs2svn $
# Revision 1.1.1.1 2006/08/02 07:49:52 stephle
# initial import
#
#
# copyleft : European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
......@@ -24,6 +27,9 @@
#=============================================================================
#
CLASS = SY900S_Group
RELEASE = Release_1_0
#-----------------------------------------
# Set default home directories
#-----------------------------------------
......@@ -89,7 +95,7 @@ endif
#-----------------------------------------
# Set dependences
#-----------------------------------------
CLASS = SY900S_Group
SVC_OBJS = main.o \
ClassFactory.o \
......@@ -135,3 +141,14 @@ lib: clean
ar ruv $(TARGET_LIB) $(CLASS)Class.o
ar ruv $(TARGET_LIB) $(CLASS)StateMachine.o
ident $(TARGET_LIB)
#----------------------------------------------------
# Tag the CVS module corresponding to this class
#----------------------------------------------------
tag:
@cvstag "$(CLASS)-$(RELEASE)"
@make $(CLASS)
@make show_tag
show_tag:
@cvstag -d
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_Group.cpp,v 1.2 2006-08-03 07:49:11 sebleport Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_Group.cpp,v 1.3 2006-08-03 14:58:27 sebleport Exp $";
//+=============================================================================
//
// file : SY900S_Group.cpp
......@@ -13,9 +13,12 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// $Author: sebleport $
//
// $Revision: 1.2 $
// $Revision: 1.3 $
//
// $Log: not supported by cvs2svn $
// Revision 1.2 2006/08/03 07:49:11 sebleport
// status modification
//
// Revision 1.1.1.1 2006/08/02 07:49:52 stephle
// initial import
//
......@@ -46,7 +49,8 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
// On | on()
// Off | off()
// ResetError | reset_error()
// Set_Channels_Target_Voltages | set__channels__target__voltages()
// SetChannelsTargetVoltage | set_channels_target_voltage()
// GetLastError | get_last_error()
//
//===================================================================
......@@ -127,7 +131,7 @@ void SY900S_Group::init_device()
CREATE_SCALAR_ATTRIBUTE(attr_group_read);
set_state(Tango::STANDBY);
// set_status("ready");
set_status("ready");
}
......@@ -155,26 +159,28 @@ void SY900S_Group::get_device_property()
// Call database and extract values
//--------------------------------------------
get_db_device()->get_property(dev_prop);
Tango::DbDatum def_prop, cl_prop;
SY900S_GroupClass *ds_class =
(static_cast<SY900S_GroupClass *>(get_device_class()));
int i = -1;
// Extract Group_Number value
if (dev_prop[++i].is_empty()==false) dev_prop[i] >> group_Number;
else
{
// Try to get value from class property
Tango::DbDatum cl_prop = ds_class->get_class_property(dev_prop[i].name);
if (cl_prop.is_empty()==false) cl_prop >> group_Number;
}
// Extract SY900S_generic_Proxy_Server value
if (dev_prop[++i].is_empty()==false) dev_prop[i] >> sY900S_generic_Proxy_Server;
else
{
// Try to get value from class property
Tango::DbDatum cl_prop = ds_class->get_class_property(dev_prop[i].name);
// Try to initialize Group_Number from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> group_Number;
// Try to initialize Group_Number from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> group_Number;
// And try to extract Group_Number value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> group_Number;
// Try to initialize SY900S_generic_Proxy_Server from class property
cl_prop = ds_class->get_class_property(dev_prop[++i].name);
if (cl_prop.is_empty()==false) cl_prop >> sY900S_generic_Proxy_Server;
}
// Try to initialize SY900S_generic_Proxy_Server from default device value
def_prop = ds_class->get_default_device_property(dev_prop[i].name);
if (def_prop.is_empty()==false) def_prop >> sY900S_generic_Proxy_Server;
// And try to extract SY900S_generic_Proxy_Server value from database
if (dev_prop[i].is_empty()==false) dev_prop[i] >> sY900S_generic_Proxy_Server;
......@@ -191,7 +197,7 @@ void SY900S_Group::get_device_property()
//-----------------------------------------------------------------------------
void SY900S_Group::always_executed_hook()
{
dev_status();
dev_state();
}
//+----------------------------------------------------------------------------
//
......@@ -363,25 +369,62 @@ void SY900S_Group::reset_error()
//+------------------------------------------------------------------
/**
* method: SY900S_Group::set__channels__target__voltages
* method: SY900S_Group::set_channels_target_voltage
*
* description: method to execute "Set_Channels_Target_Voltages"
* description: method to execute "SetChannelsTargetVoltage"
* This command sets all channels to the voltage defined by each target voltage attributes in the
* SY900S_channel device.
*
*
*/
//+------------------------------------------------------------------
void SY900S_Group::set__channels__target__voltages()
void SY900S_Group::set_channels_target_voltage()
{
DEBUG_STREAM << "SY900S_Group::set__channels__target__voltages(): entering... !" << endl;
DEBUG_STREAM << "SY900S_Group::set_channels_target_voltage(): entering... !" << endl;
// Add your own code to control device here
// command_generation
std::string command = command_generation(group_Number,"_allTRGT",0,true,false);
// send command
std::string response = write_read(command);
}
//+------------------------------------------------------------------
/**
* method: SY900S_Group::get_last_error
*
* description: method to execute "GetLastError"
* this function get the las error message which has occured
*
* @return error message
*
*/
//+------------------------------------------------------------------
Tango::DevString SY900S_Group::get_last_error()
{
// 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 << "SY900S_Group::get_last_error(): entering... !" << endl;
// Add your own code to control device here
// command_generation
std::string command = command_generation(group_Number,"_lasterr",0,false,false);
// send command
std::string response = write_read(command);
int length = response.length();
Tango::DevString argout = new char[length + 1];
strcpy(argout,response.c_str());
return argout;
}
//+------------------------------------------------------------------
......@@ -400,6 +443,27 @@ Tango::ConstDevString SY900S_Group::dev_status()
Tango::ConstDevString argout = DeviceImpl::dev_status();
DEBUG_STREAM << "SY900S_Channel::dev_status(): entering... !" << endl;
return argout;
}
//+------------------------------------------------------------------
/**
* method: SY900S_Group::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.
*
* @return State Code
*
*/
//+------------------------------------------------------------------
Tango::DevState SY900S_Group::dev_state()
{
Tango::DevState argout = DeviceImpl::dev_state();
DEBUG_STREAM << "SY900S_Group::dev_state(): entering... !" << endl;
// Add your own code to control device here
// command_generation
std::string command = command_generation(group_Number,"_status",0,false,false);
......@@ -411,19 +475,18 @@ Tango::ConstDevString SY900S_Group::dev_status()
if(state)
{
set_state(Tango::RUNNING);
// set_status("hardware busy");
set_status("all channels of the same group are reaching the preset voltage");
}
else
{
set_state(Tango::STANDBY);
// set_status("hadrware is waiting for an action");
set_status("all channels of the same group are waiting a new preset voltage");
}
return argout;
}
/***************************************************************************************
//
//
......@@ -565,15 +628,13 @@ Tango::ConstDevString SY900S_Group::dev_status()
// faire cas o set sans preset
cout<<"command to send: "<<command<<endl;
return command;
}
//+----------------------------------------------------------------------------
/**
* method: get_value
* method: get_value()
*
* description: gets the value part from the string (response to a GET command)
* string: original string
......@@ -585,24 +646,17 @@ Tango::ConstDevString SY900S_Group::dev_status()
int length = string.length();
// cout<<"string before is: "<<string<<endl;
string = string.substr(16,length - 17);
int index = string.find(',',0);
string = string.substr(0,index);
cout<<"string after is: "<<string<<endl;
// preset : string to int
value = XString<int>::convertFromString(string);
// cout<<"preset is: "<<value<<endl;
return value;
}//end function
}
} // namespace
......@@ -6,11 +6,14 @@
//
// project : SY900S_Group
//
// $Author: stephle $
// $Author: sebleport $
//
// $Revision: 1.1.1.1 $
// $Revision: 1.2 $
//
// $Log: not supported by cvs2svn $
// Revision 1.1.1.1 2006/08/02 07:49:52 stephle
// initial import
//
//
// copyleft : European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
......@@ -32,8 +35,8 @@
#include "DeviceProxyHelper.h"
/**
* @author $Author: stephle $
* @version $Revision: 1.1.1.1 $
* @author $Author: sebleport $
* @version $Revision: 1.2 $
*/
// Add your own constants definitions here.
......@@ -51,9 +54,11 @@ namespace SY900S_Group_ns
/*
* Device States Description:
* Tango::FAULT : memory allocation problem
* Tango::ALARM :
* Tango::UNKNOWN :
*
* Tango::ALARM : *
* Tango::UNKNOWN : *
* Tango::STANDBY : wait for a command
*
* Tango::RUNNING : SY900S busy
*/
......@@ -201,9 +206,19 @@ public :
*/
virtual bool is_ResetError_allowed(const CORBA::Any &any);
/**
* Execution allowed for Set_Channels_Target_Voltages command.
* Execution allowed for SetChannelsTargetVoltage command.
*/
virtual bool is_Set_Channels_Target_Voltages_allowed(const CORBA::Any &any);
virtual bool is_SetChannelsTargetVoltage_allowed(const CORBA::Any &any);
/**
* Execution allowed for GetLastError command.
*/
virtual bool is_GetLastError_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 descrition
......@@ -231,7 +246,13 @@ public :
* SY900S_channel device.
* @exception DevFailed
*/
void set__channels__target__voltages();
void set_channels_target_voltage();
/**
* this function get the las error message which has occured
* @return error message
* @exception DevFailed
*/
Tango::DevString get_last_error();
/**
* Read the device properties from database
......
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_GroupClass.cpp,v 1.1.1.1 2006-08-02 07:49:52 stephle Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_GroupClass.cpp,v 1.2 2006-08-03 14:58:27 sebleport Exp $";
static const char *TagName = "$Name: not supported by cvs2svn $";
......@@ -20,11 +20,14 @@ static const char *RCSfile = "$RCSfile: SY900S_GroupClass.cpp,v $";
//
// project : TANGO Device Server
//
// $Author: stephle $
// $Author: sebleport $
//
// $Revision: 1.1.1.1 $
// $Revision: 1.2 $
//
// $Log: not supported by cvs2svn $
// Revision 1.1.1.1 2006/08/02 07:49:52 stephle
// initial import
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
......@@ -49,7 +52,7 @@ namespace SY900S_Group_ns
{
//+----------------------------------------------------------------------------
//
// method : Set_Channels_Target_VoltagesClass::execute()
// method : SetChannelsTargetVoltageCmd::execute()
//
// description : method to trigger the execution of the command.
// PLEASE DO NOT MODIFY this method core without pogo
......@@ -60,15 +63,38 @@ namespace SY900S_Group_ns
// returns : The command output data (packed in the Any object)
//
//-----------------------------------------------------------------------------
CORBA::Any *Set_Channels_Target_VoltagesClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
CORBA::Any *SetChannelsTargetVoltageCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "Set_Channels_Target_VoltagesClass::execute(): arrived" << endl;
cout2 << "SetChannelsTargetVoltageCmd::execute(): arrived" << endl;
((static_cast<SY900S_Group *>(device))->set__channels__target__voltages());
((static_cast<SY900S_Group *>(device))->set_channels_target_voltage());
return new CORBA::Any();
}
//+----------------------------------------------------------------------------
//
// method : GetLastErrorCmd::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 *GetLastErrorCmd::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "GetLastErrorCmd::execute(): arrived" << endl;
return insert((static_cast<SY900S_Group *>(device))->get_last_error());
}
//+----------------------------------------------------------------------------
//
......@@ -156,6 +182,8 @@ SY900S_GroupClass::SY900S_GroupClass(string &s):DeviceClass(s)
{
cout2 << "Entering SY900S_GroupClass constructor" << endl;
set_default_property();
get_class_property();
write_class_property();
cout2 << "Leaving SY900S_GroupClass constructor" << endl;
......@@ -235,11 +263,16 @@ void SY900S_GroupClass::command_factory()
"",
"",
Tango::OPERATOR));
command_list.push_back(new Set_Channels_Target_VoltagesClass("Set_Channels_Target_Voltages",
command_list.push_back(new SetChannelsTargetVoltageCmd("SetChannelsTargetVoltage",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR));
command_list.push_back(new GetLastErrorCmd("GetLastError",
Tango::DEV_VOID, Tango::DEV_STRING,
"",
"error message",
Tango::OPERATOR));
// add polling if any
for (unsigned int i=0 ; i<command_list.size(); i++)
......@@ -256,13 +289,44 @@ void SY900S_GroupClass::command_factory()
// in : string name : The property name
//
//+----------------------------------------------------------------------------
Tango::DbDatum SY900S_GroupClass::get_class_property(string &name)
Tango::DbDatum SY900S_GroupClass::get_class_property(string &prop_name)
{
for (int i=0 ; i<cl_prop.size() ; i++)
if (cl_prop[i].name == name)
if (cl_prop[i].name == prop_name)
return cl_prop[i];
// if not found, return an empty DbDatum
return Tango::DbDatum(name);
return Tango::DbDatum(prop_name);
}
//+----------------------------------------------------------------------------
//
// method : SY900S_GroupClass::get_default_device_property()
//
// description : Return the default value for device property.
//
//-----------------------------------------------------------------------------
Tango::DbDatum SY900S_GroupClass::get_default_device_property(string &prop_name)
{
for (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 : SY900S_GroupClass::get_default_class_property()
//
// description : Return the default value for class property.
//
//-----------------------------------------------------------------------------
Tango::DbDatum SY900S_GroupClass::get_default_class_property(string &prop_name)
{
for (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);
}
//+----------------------------------------------------------------------------
//
......@@ -337,6 +401,82 @@ void SY900S_GroupClass::attribute_factory(vector<Tango::Attr *> &att_list)
group->set_default_properties(group_prop);
att_list.push_back(group);
}
//+----------------------------------------------------------------------------
//
// method : SY900S_GroupClass::get_class_property()
//
// description : Read the class properties from database.
//
//-----------------------------------------------------------------------------
void SY900S_GroupClass::get_class_property()
{
// Initialize your default values here (if not done with POGO).
//------------------------------------------------------------------
// Read class properties from database.(Automatic code generation)
//------------------------------------------------------------------
if (Tango::Util::instance()->_UseDb==false)
return;
// Call database and extract values
//--------------------------------------------
get_db_class()->get_property(cl_prop);
Tango::DbDatum def_prop;
int i = -1;
// End of Automatic code generation
//------------------------------------------------------------------
}
//+----------------------------------------------------------------------------
//
// method : SY900S_GroupClass::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 SY900S_GroupClass::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 = "Group_Number";
prop_desc = "one group is consisted of severals channels. this property assigns\nthe group number.";
prop_def = "";
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
data << vect_data ;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
prop_name = "SY900S_generic_Proxy_Server";
prop_desc = "name of the device proxy server used";
prop_def = "";
if (prop_def.length()>0)
{
Tango::DbDatum data(prop_name);
data << vect_data ;
dev_def_prop.push_back(data);
add_wiz_dev_prop(prop_name, prop_desc, prop_def);
}
else
add_wiz_dev_prop(prop_name, prop_desc);
}
//+----------------------------------------------------------------------------
//
......@@ -352,66 +492,72 @@ void SY900S_GroupClass::write_class_property()
if (Tango::Util::_UseDb == false)
return;
// Prepeare DbDatum
//--------------------------------------------
Tango::DbData data;
string classname = get_name();
string header;
string::size_type start, end;
// Put title
Tango::DbDatum title("ProjectTitle");
string str_title("SY900S_Group");
title << str_title;
data.push_back(title);
// Put Description
Tango::DbDatum description("Description");
vector<string> str_desc;
str_desc.push_back("this device controls one group of channels. Every channels of one group reply by the same way");
description << str_desc;
data.push_back(description);
// Use the doc_url field to store all information
// on the server version and CVS
string::size_type pos, len;
// 1) Manage module name
// get rid of the $RCSfile: prefix and of Class.cpp suffix
string classname = RCSfile;
pos = classname.find("$RCSfile: ");
len = classname.length();
if (pos != string::npos)
classname= classname.substr(pos+10, len- pos-10);
pos = classname.find ("Class.cpp",0);
if (pos != string::npos)
classname=classname.substr(0,pos);
// 2) Manage version number with SOLEIL CVS rules
// tag name is in the form : release_1_0 ==> transform it to 1.0
//
string version ;
string str_TagName=string(TagName);
pos = str_TagName.find_first_of("_",0);
if (pos != string::npos)
version= str_TagName.substr(pos+1, 3);
pos = version.find_first_of("_",0);
if (pos != string::npos)
version[pos] = '.';
// Store all info in the str_url property
string str_url= "Documentation URL = " + string(HttpServer) + classname +"-" + version + "/index.html" + "\n";
str_url= str_url + " Version CVS Tag = " + string(TagName)+ "\n";
str_url= str_url + " CVS location = " + string(FileName)+ "\n";
Tango::DbDatum doc_url("doc_url");
// put cvs location
string rcsId(RcsId);
string filename(classname);
start = rcsId.find("/");
if (start!=string::npos)
{
filename += "Class.cpp";
end = rcsId.find(filename);
if (end>start)
{
string strloc = rcsId.substr(start, end-start);
// Check if specific repository
start = strloc.find("/cvsroot/");
if (start!=string::npos && start>0)
{
string repository = strloc.substr(0, start);
if (repository.find("/segfs/")!=string::npos)
strloc = "ESRF:" + strloc.substr(start, strloc.length()-start);
}
Tango::DbDatum cvs_loc("cvs_location");
cvs_loc << strloc;
data.push_back(cvs_loc);
}
}
doc_url << str_url;
// Get CVS tag revision
string tagname(TagName);
header = "$Name: ";
start = header.length();
string endstr(" $");
end = tagname.find(endstr);
if (end>start)
{
string strtag = tagname.substr(start, end-start);
Tango::DbDatum cvs_tag("cvs_tag");
cvs_tag << strtag;
data.push_back(cvs_tag);
}
// Push everything in DataBase
// 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);
}
Tango::DbData data;
data.push_back(title);
data.push_back(description);
data.push_back(doc_url);
// Call database and and values
//--------------------------------------------
get_db_class()->put_property(data);
......
......@@ -10,11 +10,14 @@
//
// project : TANGO Device Server
//
// $Author: stephle $
// $Author: sebleport $
//
// $Revision: 1.1.1.1 $
// $Revision: 1.2 $
//
// $Log: not supported by cvs2svn $
// Revision 1.1.1.1 2006/08/02 07:49:52 stephle
// initial import
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
......@@ -83,10 +86,34 @@ public:
//=========================================
// Define classes for commands
//=========================================
class Set_Channels_Target_VoltagesClass : public Tango::Command
class GetLastErrorCmd : public Tango::Command
{
public:
GetLastErrorCmd(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) {};
GetLastErrorCmd(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~GetLastErrorCmd() {};
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<SY900S_Group *>(dev))->is_GetLastError_allowed(any);}
};
class SetChannelsTargetVoltageCmd : public Tango::Command
{
public:
Set_Channels_Target_VoltagesClass(const char *name,
SetChannelsTargetVoltageCmd(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out,
const char *in_desc,
......@@ -94,15 +121,15 @@ public:
Tango::DispLevel level)
:Command(name,in,out,in_desc,out_desc, level) {};
Set_Channels_Target_VoltagesClass(const char *name,
SetChannelsTargetVoltageCmd(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~Set_Channels_Target_VoltagesClass() {};
~SetChannelsTargetVoltageCmd() {};
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<SY900S_Group *>(dev))->is_Set_Channels_Target_Voltages_allowed(any);}
{return (static_cast<SY900S_Group *>(dev))->is_SetChannelsTargetVoltage_allowed(any);}
};
......@@ -186,31 +213,38 @@ public:
class SY900S_GroupClass : 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 SY900S_GroupClass *init(const char *);
static SY900S_GroupClass *instance();
~SY900S_GroupClass();
Tango::DbDatum get_class_property(string &);
Tango::DbDatum get_default_device_property(string &);
Tango::DbDatum get_default_class_property(string &);
protected:
SY900S_GroupClass(string &);
static SY900S_GroupClass *_instance;
void command_factory();
void get_class_property();
void attribute_factory(vector<Tango::Attr *> &);
void write_class_property();
void set_default_property();
private:
void device_factory(const Tango::DevVarStringArray *);
};
} // namespace SY900S_Group
} // namespace SY900S_Group_ns
#endif // _SY900S_GROUPCLASS_H
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_GroupStateMachine.cpp,v 1.1.1.1 2006-08-02 07:49:52 stephle Exp $";
static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentation/SY900S_group/src/SY900S_GroupStateMachine.cpp,v 1.2 2006-08-03 14:58:27 sebleport Exp $";
//+=============================================================================
//
// file : SY900S_GroupStateMachine.cpp
......@@ -8,11 +8,14 @@ static const char *RcsId = "$Header: /users/chaize/newsvn/cvsroot/Instrumentatio
//
// project : TANGO Device Server
//
// $Author: stephle $
// $Author: sebleport $
//
// $Revision: 1.1.1.1 $
// $Revision: 1.2 $
//
// $Log: not supported by cvs2svn $
// Revision 1.1.1.1 2006/08/02 07:49:52 stephle
// initial import
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
......@@ -160,12 +163,26 @@ bool SY900S_Group::is_ResetError_allowed(const CORBA::Any &any)
}
//+----------------------------------------------------------------------------
//
// method : SY900S_Group::is_Set_Channels_Target_Voltages_allowed
// method : SY900S_Group::is_GetLastError_allowed
//
// description : Execution allowed for GetLastError command.
//
//-----------------------------------------------------------------------------
bool SY900S_Group::is_GetLastError_allowed(const CORBA::Any &any)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
//+----------------------------------------------------------------------------
//
// method : SY900S_Group::is_SetChannelsTargetVoltage_allowed
//
// description : Execution allowed for Set_Channels_Target_Voltages command.
// description : Execution allowed for SetChannelsTargetVoltage command.
//
//-----------------------------------------------------------------------------
bool SY900S_Group::is_Set_Channels_Target_Voltages_allowed(const CORBA::Any &any)
bool SY900S_Group::is_SetChannelsTargetVoltage_allowed(const CORBA::Any &any)
{
if (get_state() == Tango::OFF)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment