Skip to content
Snippets Groups Projects
Commit c89166ee authored by Sonia Minolli's avatar Sonia Minolli
Browse files

Add IsAutoTuning command (TANGODEVIC-1881)

parent 4c4f1abe
No related branches found
No related merge requests found
No preview for this file type
...@@ -209,6 +209,20 @@ DATASET_ATTR:{name of the 'dataset enabled' TANGO attribute}<Br>&nbsp ...@@ -209,6 +209,20 @@ DATASET_ATTR:{name of the 'dataset enabled' TANGO attribute}<Br>&nbsp
<Br>&nbsp <Br>&nbsp
</ul><Br> </ul><Br>
<Br> <Br>
<A NAME="IsAutoTuning"><!-- --></A>
<A NAME="IsAutoTuning"><!-- --></A>
<h2>11 - IsAutoTuning (for expert only)</h2>
<ul>
<Li><Strong>Description: </Strong> Returns true if AUTO_TUNING property is enabled for current configuration, false otherwise.<Br>&nbsp
<Li><Strong>Argin:<Br>DEV_VOID</Strong>
: <Br>&nbsp
<Li><Strong>Argout:<Br>DEV_BOOLEAN</Strong>
: Auto tuning enabled<Br>&nbsp
<Li><Strong>Command allowed for: </Strong><Ul>
<Li>Tango::FAULT<Li>Tango::RUNNING<Li>Tango::STANDBY<Li>Tango::INIT<Li>Tango::ALARM<Li>Tango::MOVING</Ul>
<Br>&nbsp
</ul><Br>
<Br>
<!--- html Footer ---> <!--- html Footer --->
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<A Href="DevCommands.html#GetDataStreams" TARGET="DevCommands"> GetDataStreams</a><Br> <A Href="DevCommands.html#GetDataStreams" TARGET="DevCommands"> GetDataStreams</a><Br>
<A Href="DevCommands.html#SetDatasetName" TARGET="DevCommands"> SetDatasetName</a><Br> <A Href="DevCommands.html#SetDatasetName" TARGET="DevCommands"> SetDatasetName</a><Br>
<A Href="DevCommands.html#GetChannelInfo" TARGET="DevCommands"> GetChannelInfo</a><Br> <A Href="DevCommands.html#GetChannelInfo" TARGET="DevCommands"> GetChannelInfo</a><Br>
<A Href="DevCommands.html#IsAutoTuning" TARGET="DevCommands"> IsAutoTuning</a><Br>
</BODY> </BODY>
......
...@@ -107,6 +107,9 @@ Revision: - Author: sonia.minolli ...@@ -107,6 +107,9 @@ Revision: - Author: sonia.minolli
<Tr><Td><b>GetChannelInfo</b></Td> <Tr><Td><b>GetChannelInfo</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td> <Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEVVAR_LONGSTRINGARRAY</Font></Td> <Td><Font Size=-1>DEVVAR_LONGSTRINGARRAY</Font></Td>
<Tr><Td><b>IsAutoTuning</b></Td>
<Td><Font Size=-1>DEV_VOID</Font></Td>
<Td><Font Size=-1>DEV_BOOLEAN</Font></Td>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<groupId>fr.soleil.device</groupId> <groupId>fr.soleil.device</groupId>
<artifactId>AIControllerV2-${aol}-${mode}</artifactId> <artifactId>AIControllerV2-${aol}-${mode}</artifactId>
<version>2.7.2-SNAPSHOT</version> <version>2.8.0-SNAPSHOT</version>
<packaging>nar</packaging> <packaging>nar</packaging>
<name>AIControllerV2</name> <name>AIControllerV2</name>
......
...@@ -71,6 +71,7 @@ static const char *RcsId = "$Id: DevServ.cpp 13293 2009-04-07 10:53:56Z pascal_v ...@@ -71,6 +71,7 @@ static const char *RcsId = "$Id: DevServ.cpp 13293 2009-04-07 10:53:56Z pascal_v
// GetDataStreams | get_data_streams() // GetDataStreams | get_data_streams()
// SetDatasetName | set_dataset_name() // SetDatasetName | set_dataset_name()
// GetChannelInfo | get_channel_info() // GetChannelInfo | get_channel_info()
// IsAutoTuning | is_auto_tuning()
// //
//=================================================================== //===================================================================
...@@ -1669,4 +1670,39 @@ Tango::DevVarLongStringArray *AIController::get_channel_info() ...@@ -1669,4 +1670,39 @@ Tango::DevVarLongStringArray *AIController::get_channel_info()
return argout; return argout;
} }
//+------------------------------------------------------------------
/**
* method: AIController::is_auto_tuning
*
* description: method to execute "IsAutoTuning"
* Returns true if AUTO_TUNING property is enabled for current configuration, false otherwise.
*
* @return Auto tuning enabled
*
*/
//+------------------------------------------------------------------
Tango::DevBoolean AIController::is_auto_tuning()
{
Tango::DevBoolean argout ;
DEBUG_STREAM << "AIController::is_auto_tuning(): entering... !" << endl;
// Add your own code to control device here
CHECK_AI_MANAGER;
//- check Device state
Tango::DevState st = this->dev_state();
if ((Tango::MOVING == st) ||
(Tango::INIT == st))
{
THROW_DEVFAILED(_CPTC("BAD_STATE"),
_CPTC("request aborted - command not available in this state"),
_CPTC("AIController::is_auto_tuning"));
}
argout = this->m_aiManager->isAutoTuningEnabled();
return argout;
}
} // namespace } // namespace
...@@ -382,6 +382,10 @@ public : ...@@ -382,6 +382,10 @@ public :
* Execution allowed for GetChannelInfo command. * Execution allowed for GetChannelInfo command.
*/ */
virtual bool is_GetChannelInfo_allowed(const CORBA::Any &any); virtual bool is_GetChannelInfo_allowed(const CORBA::Any &any);
/**
* Execution allowed for IsAutoTuning command.
*/
virtual bool is_IsAutoTuning_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. * 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
...@@ -441,6 +445,12 @@ public : ...@@ -441,6 +445,12 @@ public :
* @exception DevFailed * @exception DevFailed
*/ */
Tango::DevVarLongStringArray *get_channel_info(); Tango::DevVarLongStringArray *get_channel_info();
/**
* Returns true if AUTO_TUNING property is enabled for current configuration, false otherwise.
* @return Auto tuning enabled
* @exception DevFailed
*/
Tango::DevBoolean is_auto_tuning();
/** /**
* Read the device properties from database * Read the device properties from database
......
...@@ -95,6 +95,27 @@ __declspec(dllexport) ...@@ -95,6 +95,27 @@ __declspec(dllexport)
namespace AIController_ns namespace AIController_ns
{ {
//+----------------------------------------------------------------------------
//
// method : IsAutoTuningClass::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 *IsAutoTuningClass::execute(Tango::DeviceImpl *device,const CORBA::Any &in_any)
{
cout2 << "IsAutoTuningClass::execute(): arrived" << endl;
return insert((static_cast<AIController *>(device))->is_auto_tuning());
}
//+---------------------------------------------------------------------------- //+----------------------------------------------------------------------------
// //
// method : GetChannelInfoClass::execute() // method : GetChannelInfoClass::execute()
...@@ -375,6 +396,11 @@ void AIControllerClass::command_factory() ...@@ -375,6 +396,11 @@ void AIControllerClass::command_factory()
"", "",
"Dataset info for all defined channels", "Dataset info for all defined channels",
Tango::EXPERT)); Tango::EXPERT));
command_list.push_back(new IsAutoTuningClass("IsAutoTuning",
Tango::DEV_VOID, Tango::DEV_BOOLEAN,
"",
"Auto tuning enabled",
Tango::EXPERT));
// add polling if any // add polling if any
for (unsigned int i=0 ; i<command_list.size(); i++) for (unsigned int i=0 ; i<command_list.size(); i++)
......
...@@ -181,6 +181,30 @@ public: ...@@ -181,6 +181,30 @@ public:
//========================================= //=========================================
// Define classes for commands // Define classes for commands
//========================================= //=========================================
class IsAutoTuningClass : public Tango::Command
{
public:
IsAutoTuningClass(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) {};
IsAutoTuningClass(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~IsAutoTuningClass() {};
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<AIController *>(dev))->is_IsAutoTuning_allowed(any);}
};
class GetChannelInfoClass : public Tango::Command class GetChannelInfoClass : public Tango::Command
{ {
public: public:
......
...@@ -281,5 +281,19 @@ bool AIController::is_GetChannelInfo_allowed(const CORBA::Any &any) ...@@ -281,5 +281,19 @@ bool AIController::is_GetChannelInfo_allowed(const CORBA::Any &any)
// Re-Start of Generated Code // Re-Start of Generated Code
return true; return true;
} }
//+----------------------------------------------------------------------------
//
// method : AIController::is_IsAutoTuning_allowed
//
// description : Execution allowed for IsAutoTuning command.
//
//-----------------------------------------------------------------------------
bool AIController::is_IsAutoTuning_allowed(const CORBA::Any &any)
{
// End of Generated Code
// Re-Start of Generated Code
return true;
}
} // namespace AIController_ns } // namespace AIController_ns
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment