diff --git a/src/DataExporter.cpp b/src/DataExporter.cpp index 1242d1217556a12ae73c6f60fba843786dc7e720..76287bb30bb643272dbab393d20fa77d548e6da7 100644 --- a/src/DataExporter.cpp +++ b/src/DataExporter.cpp @@ -50,7 +50,7 @@ /** * DataExporter class description: - * + * */ //================================================================ @@ -143,11 +143,11 @@ void DataExporter::init_device() set_status("Initializing device"); /*----- PROTECTED REGION END -----*/ // DataExporter::init_device_before - + // Get the device properties from database get_device_property(); - + /*----- PROTECTED REGION ID(DataExporter::init_device) ENABLED START -----*/ @@ -220,7 +220,7 @@ void DataExporter::get_device_property() // Call database and extract values if (Tango::Util::instance()->_UseDb==true) get_db_device()->get_property(dev_prop); - + // get instance on DataExporterClass to get class property Tango::DbDatum def_prop, cl_prop; DataExporterClass *ds_class = @@ -480,7 +480,7 @@ void DataExporter::get_device_property() //-------------------------------------------------------- void DataExporter::always_executed_hook() { - DEBUG_STREAM << "DataExporter::always_executed_hook() " << device_name << endl; + INFO_STREAM << "DataExporter::always_executed_hook() " << device_name << endl; /*----- PROTECTED REGION ID(DataExporter::always_executed_hook) ENABLED START -----*/ if(get_state() != Tango::FAULT) diff --git a/src/DataExporter.h b/src/DataExporter.h index 0aaf82649049af403f71eba6d0ba296e1f8d25e3..91333b26b589074527852c9d1fff9481db3838c9 100644 --- a/src/DataExporter.h +++ b/src/DataExporter.h @@ -48,7 +48,7 @@ /** * DataExporter class description: - * + * */ namespace DataExporter_ns @@ -150,7 +150,7 @@ public: DataExporter(Tango::DeviceClass *cl,const char *s,const char *d); /** * The device object destructor. - */ + */ ~DataExporter() {delete_device();}; diff --git a/src/DataExporter.xmi b/src/DataExporter.xmi index 6d53e1aa4e1ed5347885f4cda5f3bfe5aaacc396..22679591a0962cf2738a76cc7b70abbf5cd695a0 100644 --- a/src/DataExporter.xmi +++ b/src/DataExporter.xmi @@ -118,6 +118,8 @@ <type xsi:type="pogoDsl:VoidType"/> </argout> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <excludedStates>ON</excludedStates> + <excludedStates>FAULT</excludedStates> </commands> <commands name="Off" description="Deactivate data exporter" execMethod="off" displayLevel="OPERATOR" polledPeriod="0"> <argin description=""> @@ -127,6 +129,8 @@ <type xsi:type="pogoDsl:VoidType"/> </argout> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <excludedStates>OFF</excludedStates> + <excludedStates>FAULT</excludedStates> </commands> <states name="ON" description="Data exporter is in ON state (ready to incoming connections)"> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> diff --git a/src/DataExporterStateMachine.cpp b/src/DataExporterStateMachine.cpp index 0a16fee3b13fe72bfd3245a64e83ad03812825bd..77ea472150f35db38bd87dcd49a691e3a849f968 100644 --- a/src/DataExporterStateMachine.cpp +++ b/src/DataExporterStateMachine.cpp @@ -64,10 +64,15 @@ namespace DataExporter_ns //-------------------------------------------------------- bool DataExporter::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) { - // Not any excluded states for On command. + // Compare device state with not allowed states. + if (get_state()==Tango::ON || + get_state()==Tango::FAULT) + { /*----- PROTECTED REGION ID(DataExporter::OnStateAllowed) ENABLED START -----*/ /*----- PROTECTED REGION END -----*/ // DataExporter::OnStateAllowed + return false; + } return true; } @@ -79,10 +84,15 @@ bool DataExporter::is_On_allowed(TANGO_UNUSED(const CORBA::Any &any)) //-------------------------------------------------------- bool DataExporter::is_Off_allowed(TANGO_UNUSED(const CORBA::Any &any)) { - // Not any excluded states for Off command. + // Compare device state with not allowed states. + if (get_state()==Tango::OFF || + get_state()==Tango::FAULT) + { /*----- PROTECTED REGION ID(DataExporter::OffStateAllowed) ENABLED START -----*/ /*----- PROTECTED REGION END -----*/ // DataExporter::OffStateAllowed + return false; + } return true; }