Commit 210c3b2f authored by Yuelong Yu's avatar Yuelong Yu
Browse files

added powercycle commands

parent 02519e9c
......@@ -62,6 +62,11 @@ static const char *RcsId = "$Id: $";
//================================================================
// State | Inherited (no method)
// Status | Inherited (no method)
// PowerCycle1 | power_cycle1
// PowerCycle2 | power_cycle2
// PowerCycle3 | power_cycle3
// PowerCycle4 | power_cycle4
// PowerCycle5 | power_cycle5
//================================================================
//================================================================
......@@ -1014,6 +1019,86 @@ void AGIPDMC::add_dynamic_attributes()
/*----- PROTECTED REGION END -----*/ // AGIPDMC::add_dynamic_attributes
}
//--------------------------------------------------------
/**
* Command PowerCycle1 related method
* Description:
*
*/
//--------------------------------------------------------
void AGIPDMC::power_cycle1()
{
DEBUG_STREAM << "AGIPDMC::PowerCycle1() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::power_cycle1) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::power_cycle1
}
//--------------------------------------------------------
/**
* Command PowerCycle2 related method
* Description:
*
*/
//--------------------------------------------------------
void AGIPDMC::power_cycle2()
{
DEBUG_STREAM << "AGIPDMC::PowerCycle2() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::power_cycle2) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::power_cycle2
}
//--------------------------------------------------------
/**
* Command PowerCycle3 related method
* Description:
*
*/
//--------------------------------------------------------
void AGIPDMC::power_cycle3()
{
DEBUG_STREAM << "AGIPDMC::PowerCycle3() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::power_cycle3) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::power_cycle3
}
//--------------------------------------------------------
/**
* Command PowerCycle4 related method
* Description:
*
*/
//--------------------------------------------------------
void AGIPDMC::power_cycle4()
{
DEBUG_STREAM << "AGIPDMC::PowerCycle4() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::power_cycle4) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::power_cycle4
}
//--------------------------------------------------------
/**
* Command PowerCycle5 related method
* Description:
*
*/
//--------------------------------------------------------
void AGIPDMC::power_cycle5()
{
DEBUG_STREAM << "AGIPDMC::PowerCycle5() - " << device_name << endl;
/*----- PROTECTED REGION ID(AGIPDMC::power_cycle5) ENABLED START -----*/
// Add your own code
/*----- PROTECTED REGION END -----*/ // AGIPDMC::power_cycle5
}
/*----- PROTECTED REGION ID(AGIPDMC::namespace_ending) ENABLED START -----*/
......
......@@ -492,6 +492,41 @@ public:
// Command related methods
public:
/**
* Command PowerCycle1 related method
* Description:
*
*/
virtual void power_cycle1();
virtual bool is_PowerCycle1_allowed(const CORBA::Any &any);
/**
* Command PowerCycle2 related method
* Description:
*
*/
virtual void power_cycle2();
virtual bool is_PowerCycle2_allowed(const CORBA::Any &any);
/**
* Command PowerCycle3 related method
* Description:
*
*/
virtual void power_cycle3();
virtual bool is_PowerCycle3_allowed(const CORBA::Any &any);
/**
* Command PowerCycle4 related method
* Description:
*
*/
virtual void power_cycle4();
virtual bool is_PowerCycle4_allowed(const CORBA::Any &any);
/**
* Command PowerCycle5 related method
* Description:
*
*/
virtual void power_cycle5();
virtual bool is_PowerCycle5_allowed(const CORBA::Any &any);
/*----- PROTECTED REGION ID(AGIPDMC::Additional Method prototypes) ENABLED START -----*/
......
......@@ -31,6 +31,51 @@
</argout>
<status abstract="true" inherited="true" concrete="true" concreteHere="false"/>
</commands>
<commands name="PowerCycle1" description="" execMethod="power_cycle1" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="PowerCycle2" description="" execMethod="power_cycle2" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="PowerCycle3" description="" execMethod="power_cycle3" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="PowerCycle4" description="" execMethod="power_cycle4" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="PowerCycle5" description="" execMethod="power_cycle5" displayLevel="OPERATOR" polledPeriod="0">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<attributes name="Temperature1" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
......
......@@ -158,6 +158,96 @@ AGIPDMCClass *AGIPDMCClass::instance()
//===================================================================
// Command execution method calls
//===================================================================
//--------------------------------------------------------
/**
* method : PowerCycle1Class::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *PowerCycle1Class::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "PowerCycle1Class::execute(): arrived" << endl;
((static_cast<AGIPDMC *>(device))->power_cycle1());
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : PowerCycle2Class::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *PowerCycle2Class::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "PowerCycle2Class::execute(): arrived" << endl;
((static_cast<AGIPDMC *>(device))->power_cycle2());
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : PowerCycle3Class::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *PowerCycle3Class::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "PowerCycle3Class::execute(): arrived" << endl;
((static_cast<AGIPDMC *>(device))->power_cycle3());
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : PowerCycle4Class::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *PowerCycle4Class::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "PowerCycle4Class::execute(): arrived" << endl;
((static_cast<AGIPDMC *>(device))->power_cycle4());
return new CORBA::Any();
}
//--------------------------------------------------------
/**
* method : PowerCycle5Class::execute()
* description : method to trigger the execution of the command.
*
* @param device The device on which the command must be executed
* @param in_any The command input data
*
* returns The command output data (packed in the Any object)
*/
//--------------------------------------------------------
CORBA::Any *PowerCycle5Class::execute(Tango::DeviceImpl *device, TANGO_UNUSED(const CORBA::Any &in_any))
{
cout2 << "PowerCycle5Class::execute(): arrived" << endl;
((static_cast<AGIPDMC *>(device))->power_cycle5());
return new CORBA::Any();
}
//===================================================================
// Properties management
......@@ -1276,6 +1366,51 @@ void AGIPDMCClass::command_factory()
/*----- PROTECTED REGION END -----*/ // AGIPDMCClass::command_factory_before
// Command PowerCycle1
PowerCycle1Class *pPowerCycle1Cmd =
new PowerCycle1Class("PowerCycle1",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pPowerCycle1Cmd);
// Command PowerCycle2
PowerCycle2Class *pPowerCycle2Cmd =
new PowerCycle2Class("PowerCycle2",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pPowerCycle2Cmd);
// Command PowerCycle3
PowerCycle3Class *pPowerCycle3Cmd =
new PowerCycle3Class("PowerCycle3",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pPowerCycle3Cmd);
// Command PowerCycle4
PowerCycle4Class *pPowerCycle4Cmd =
new PowerCycle4Class("PowerCycle4",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pPowerCycle4Cmd);
// Command PowerCycle5
PowerCycle5Class *pPowerCycle5Cmd =
new PowerCycle5Class("PowerCycle5",
Tango::DEV_VOID, Tango::DEV_VOID,
"",
"",
Tango::OPERATOR);
command_list.push_back(pPowerCycle5Cmd);
/*----- PROTECTED REGION ID(AGIPDMCClass::command_factory_after) ENABLED START -----*/
// Add your own code
......
......@@ -489,6 +489,125 @@ public:
};
//=========================================
// Define classes for commands
//=========================================
// Command PowerCycle1 class definition
class PowerCycle1Class : public Tango::Command
{
public:
PowerCycle1Class(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) {};
PowerCycle1Class(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~PowerCycle1Class() {};
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<AGIPDMC *>(dev))->is_PowerCycle1_allowed(any);}
};
// Command PowerCycle2 class definition
class PowerCycle2Class : public Tango::Command
{
public:
PowerCycle2Class(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) {};
PowerCycle2Class(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~PowerCycle2Class() {};
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<AGIPDMC *>(dev))->is_PowerCycle2_allowed(any);}
};
// Command PowerCycle3 class definition
class PowerCycle3Class : public Tango::Command
{
public:
PowerCycle3Class(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) {};
PowerCycle3Class(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~PowerCycle3Class() {};
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<AGIPDMC *>(dev))->is_PowerCycle3_allowed(any);}
};
// Command PowerCycle4 class definition
class PowerCycle4Class : public Tango::Command
{
public:
PowerCycle4Class(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) {};
PowerCycle4Class(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~PowerCycle4Class() {};
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<AGIPDMC *>(dev))->is_PowerCycle4_allowed(any);}
};
// Command PowerCycle5 class definition
class PowerCycle5Class : public Tango::Command
{
public:
PowerCycle5Class(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) {};
PowerCycle5Class(const char *name,
Tango::CmdArgType in,
Tango::CmdArgType out)
:Command(name,in,out) {};
~PowerCycle5Class() {};
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<AGIPDMC *>(dev))->is_PowerCycle5_allowed(any);}
};
/**
* The AGIPDMCClass singleton definition
*/
......
......@@ -584,4 +584,79 @@ bool AGIPDMC::is_LTCC16_allowed(TANGO_UNUSED(Tango::AttReqType type))
// Commands Allowed Methods
//=================================================
//--------------------------------------------------------
/**
* Method : AGIPDMC::is_PowerCycle1_allowed()
* Description : Execution allowed for PowerCycle1 attribute
*/
//--------------------------------------------------------
bool AGIPDMC::is_PowerCycle1_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for PowerCycle1 command.
/*----- PROTECTED REGION ID(AGIPDMC::PowerCycle1StateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDMC::PowerCycle1StateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::is_PowerCycle2_allowed()
* Description : Execution allowed for PowerCycle2 attribute
*/
//--------------------------------------------------------
bool AGIPDMC::is_PowerCycle2_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for PowerCycle2 command.
/*----- PROTECTED REGION ID(AGIPDMC::PowerCycle2StateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDMC::PowerCycle2StateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::is_PowerCycle3_allowed()
* Description : Execution allowed for PowerCycle3 attribute
*/
//--------------------------------------------------------
bool AGIPDMC::is_PowerCycle3_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for PowerCycle3 command.
/*----- PROTECTED REGION ID(AGIPDMC::PowerCycle3StateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDMC::PowerCycle3StateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::is_PowerCycle4_allowed()
* Description : Execution allowed for PowerCycle4 attribute
*/
//--------------------------------------------------------
bool AGIPDMC::is_PowerCycle4_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for PowerCycle4 command.
/*----- PROTECTED REGION ID(AGIPDMC::PowerCycle4StateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDMC::PowerCycle4StateAllowed
return true;
}
//--------------------------------------------------------
/**
* Method : AGIPDMC::is_PowerCycle5_allowed()
* Description : Execution allowed for PowerCycle5 attribute
*/
//--------------------------------------------------------
bool AGIPDMC::is_PowerCycle5_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Not any excluded states for PowerCycle5 command.
/*----- PROTECTED REGION ID(AGIPDMC::PowerCycle5StateAllowed) ENABLED START -----*/
/*----- PROTECTED REGION END -----*/ // AGIPDMC::PowerCycle5StateAllowed
return true;
}
} // End of namespace
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title> AGIPDMC Tango Class Command PowerCycle1 </title>
</head>
<body text="Black" bgcolor="White" link="Blue" vlink="Purple" alink="Red">
<br><br><br>
<font size="+1"><u><b> Command PowerCycle1 : </b></u></font>
<ul>
</ul>
<br><br><br>
<Table Border=2 Cellpadding=3 CELLSPACING=0>
<tr bgcolor="#CCCCFF" class="TableHeadingColor">
<td colspan=0> <font size=+1> <center><b> PowerCycle1 Definition </b></font></center></td>
</tr>
<tr>
<td> Input Argument </td>
<td> Tango::DEV_VOID </td>
<td> </td>
</tr>
<tr>
<td> Output Argument </td>
<td> Tango::DEV_VOID </td>
<td> </td>
</tr>
<tr>
<td> DisplayLevel </td>
<td> OPERATOR </td>
<td> .. </td>
</tr>
<tr>
<td> Inherited </td>
<td> false </td>
<td> .. </td>
</tr>
<tr>
<td> Abstract </td>
<td> false </td>
<td> .. </td>
</tr>
<tr>
<td> Polling Period </td>
<td> Not polled </td>
<td> .. </td>
</tr>
<Tr BGCOLOR="#CCCCFF"><Td><Hr></Td><Td><Hr></Td><Td><Hr></Td></Tr>
<tr>
<td> Command allowed for </td>
<td> All states </td>
<td> .. </td>
</tr>
</table>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title> AGIPDMC Tango Class Command PowerCycle2 </title>
</head>
<body text="Black" bgcolor="White" link="Blue" vlink="Purple" alink="Red">
<br><br><br>
<font size="+1"><u><b> Command PowerCycle2 : </b></u></font>