Skip to content
Snippets Groups Projects
Commit d610c8dc authored by Arafat NOUREDDINE's avatar Arafat NOUREDDINE
Browse files

Merge branch 'on_to_standy'

parents 44ffa794 9520edd9
Branches
No related merge requests found
......@@ -9,7 +9,7 @@
<properties>
<PROJECT.name>PIController</PROJECT.name>
<PROJECT.version>1.0.0</PROJECT.version>
<PROJECT.version>1.1.0</PROJECT.version>
<PROJECT.description>PIController motion PI controllers device controller</PROJECT.description>
</properties>
......
......@@ -65,7 +65,7 @@ void AxisController::compute_state_status()
Serializer::pull_from_server(&m_on, m_axis_id);
if (m_on.get_value() == 1)
{
set_state(Tango::ON);
set_state(Tango::STANDBY);
set_status("Motor on");
Serializer::pull_from_server(&m_is_moving, m_axis_id);
if (m_is_moving.get_value() == 1)
......@@ -410,7 +410,7 @@ void AxisController::process_message(yat::Message& msg)
case CTRL_ON_MSG:
{
//DEBUG_STREAM << "-> AxisController::TASK_CTRL_ON_MSG" << std::endl;
set_state(Tango::ON);
set_state(Tango::STANDBY);
Serializer::push_to_server(&m_on, m_axis_id);
}
break;
......@@ -451,7 +451,7 @@ void AxisController::process_message(yat::Message& msg)
case CTRL_SETVELOCITY_MSG:
{
DEBUG_STREAM << "-> AxisController::TASK_CTRL_SETVELOCITY_MSG" << std::endl;
set_state(Tango::ON);
set_state(Tango::STANDBY);
Serializer::push_to_server(&m_velocity, m_axis_id);
}
break;
......@@ -467,7 +467,7 @@ void AxisController::process_message(yat::Message& msg)
case CTRL_SETACCELERATION_MSG:
{
DEBUG_STREAM << "-> AxisController::TASK_CTRL_SETACCELERATION_MSG" << std::endl;
set_state(Tango::ON);
set_state(Tango::STANDBY);
Serializer::push_to_server(&m_acceleration, m_axis_id);
}
break;
......@@ -483,7 +483,7 @@ void AxisController::process_message(yat::Message& msg)
case CTRL_SETDECELERATION_MSG:
{
DEBUG_STREAM << "-> AxisController::TASK_CTRL_SETDECELERATION_MSG" << std::endl;
set_state(Tango::ON);
set_state(Tango::STANDBY);
Serializer::push_to_server(&m_deceleration, m_axis_id);
}
break;
......@@ -513,7 +513,7 @@ void AxisController::process_message(yat::Message& msg)
case CTRL_STOP_MSG:
{
DEBUG_STREAM << "-> AxisController::TASK_CTRL_STOP_MSG" << std::endl;
set_state(Tango::ON);
set_state(Tango::STANDBY);
Serializer::push_to_server(&m_stop, m_axis_id);
}
break;
......
......@@ -122,7 +122,6 @@ PIAxis::PIAxis(Tango::DeviceClass *cl, const char *s, const char *d)
//--------------------------------------------------------
void PIAxis::delete_device()
{
DEBUG_STREAM << "PIAxis::delete_device() " << device_name << endl;
/*----- PROTECTED REGION ID(PIAxis::delete_device) ENABLED START -----*/
INFO_STREAM << "PIAxis::delete_device() " << device_name << std::endl;
......@@ -147,7 +146,6 @@ void PIAxis::delete_device()
//--------------------------------------------------------
void PIAxis::init_device()
{
DEBUG_STREAM << "PIAxis::init_device() create device " << device_name << endl;
/*----- PROTECTED REGION ID(PIAxis::init_device_before) ENABLED START -----*/
INFO_STREAM << "PIAxis::init_device() create device " << device_name << std::endl;
......@@ -329,7 +327,6 @@ void PIAxis::get_device_property()
//--------------------------------------------------------
void PIAxis::always_executed_hook()
{
DEBUG_STREAM << "PIAxis::always_executed_hook() " << device_name << endl;
/*----- PROTECTED REGION ID(PIAxis::always_executed_hook) ENABLED START -----*/
// code always executed before all requests
......@@ -361,7 +358,6 @@ void PIAxis::always_executed_hook()
//--------------------------------------------------------
void PIAxis::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
DEBUG_STREAM << "PIAxis::read_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(PIAxis::read_attr_hardware) ENABLED START -----*/
// Add your own code
......@@ -376,7 +372,6 @@ void PIAxis::read_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
//--------------------------------------------------------
void PIAxis::write_attr_hardware(TANGO_UNUSED(vector<long> &attr_list))
{
DEBUG_STREAM << "PIAxis::write_attr_hardware(vector<long> &attr_list) entering... " << endl;
/*----- PROTECTED REGION ID(PIAxis::write_attr_hardware) ENABLED START -----*/
// Add your own code
......
<?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
<classes name="PIAxis" pogoRevision="9.6">
<description description="" title="" sourcePath="/home/informatique/ica/desgrangesm/workspace/picontroller/src/piaxis" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<description description="" title="" sourcePath="/home/informatique/ica/noureddine/DeviceSources/PIController/src/piaxis" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<identification contact="at synchrotron-soleil.fr - marc.desgranges" author="marc.desgranges" emailDomain="synchrotron-soleil.fr" classFamily="Motion" siteSpecific="" platform="All Platforms" bus="TCP/UDP" manufacturer="none" reference=""/>
</description>
......@@ -55,6 +55,7 @@
<excludedStates>MOVING</excludedStates>
<excludedStates>FAULT</excludedStates>
<excludedStates>INIT</excludedStates>
<excludedStates>STANDBY</excludedStates>
</commands>
<commands name="Off" description="Turn motor off" execMethod="off" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
......@@ -81,6 +82,7 @@
<excludedStates>OFF</excludedStates>
<excludedStates>FAULT</excludedStates>
<excludedStates>INIT</excludedStates>
<excludedStates>STANDBY</excludedStates>
</commands>
<commands name="Backward" description="Move To Negative Limit" execMethod="backward" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
......@@ -188,9 +190,6 @@
<properties description="Is positive limit switch reached" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<readExcludedStates>FAULT</readExcludedStates>
</attributes>
<states name="ON" description="Motor on">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="OFF" description="Motor Off">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
......@@ -203,6 +202,9 @@
<states name="INIT" description="Waiting for InitialiseReferencePosition to be done">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<states name="STANDBY" description="">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
<preferences docHome="../doc/doc_html" makefileHome="$(TANGO_HOME)"/>
</classes>
</pogoDsl:PogoSystem>
......@@ -36,11 +36,11 @@
//================================================================
// States | Description
//================================================================
// ON | Motor on
// OFF | Motor Off
// MOVING | Motor is moving
// FAULT | Motor is in fault
// INIT | Waiting for InitialiseReferencePosition to be done
// STANDBY |
namespace PIAxis_ns
......@@ -311,10 +311,10 @@ bool PIAxis::is_forwardLimitSwitch_allowed(TANGO_UNUSED(Tango::AttReqType type))
bool PIAxis::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::ON ||
get_state()==Tango::MOVING ||
if (get_state()==Tango::MOVING ||
get_state()==Tango::FAULT ||
get_state()==Tango::INIT)
get_state()==Tango::INIT ||
get_state()==Tango::STANDBY)
{
/*----- PROTECTED REGION ID(PIAxis::OnStateAllowed) ENABLED START -----*/
if (get_state()==Tango::FAULT && is_device_initialized())
......@@ -361,10 +361,10 @@ bool PIAxis::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any))
bool PIAxis::is_Stop_allowed(TANGO_UNUSED(const CORBA::Any &any))
{
// Compare device state with not allowed states.
if (get_state()==Tango::ON ||
get_state()==Tango::OFF ||
if (get_state()==Tango::OFF ||
get_state()==Tango::FAULT ||
get_state()==Tango::INIT)
get_state()==Tango::INIT ||
get_state()==Tango::STANDBY)
{
/*----- PROTECTED REGION ID(PIAxis::StopStateAllowed) ENABLED START -----*/
if (get_state()==Tango::FAULT && is_device_initialized())
......
......@@ -23,14 +23,14 @@
#this i a special section to declare user variables, the syntaxe is xxx=yyy
model=(c)MOCK, SIMULATOR, 111111111, 1.0.0.0
servo=1
pos=7.000000
vel=3.000000
accel=5.000000
decel=2.000000
pos=10.000000
vel=5.000000
accel=2.000000
decel=1.000000
moving=0
ron=1
err=0
limit_switch=0x9000
limit_switch=0x9004
is_initialized=1
[END]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment