Skip to content
Snippets Groups Projects
Commit 64570567 authored by Alexandre MALFREYT's avatar Alexandre MALFREYT
Browse files

cleanup: _CPTC(("xxx") -> "xxx"

parent 0fdab6c3
No related branches found
No related tags found
1 merge request!1Cleanup: clean code (DODD)
......@@ -83,9 +83,9 @@ namespace SingleShotAO_ns
do \
{ \
if (! m_manager) \
THROW_DEVFAILED(_CPTC("DEVICE_ERROR"), \
_CPTC("request aborted - the manager isn't accessible "), \
_CPTC("SingleShotAO::check_manager")); \
THROW_DEVFAILED("DEVICE_ERROR", \
"request aborted - the manager isn't accessible ", \
"SingleShotAO::check_manager"); \
} while (0)
......@@ -686,9 +686,9 @@ void SingleShotAO::write_frequency(Tango::WAttribute &attr)
DEBUG_STREAM << "SingleShotAO::write_frequency(Tango::WAttribute &attr) entering... "<< endl;
if (dev_state() != Tango::ON)
{
THROW_DEVFAILED(_CPTC("DEVICE_ERROR"),
_CPTC("could not write frequency. The state must be ON."),
_CPTC("SingleShotAO::write_frequency"));
THROW_DEVFAILED("DEVICE_ERROR",
"could not write frequency. The state must be ON.",
"SingleShotAO::write_frequency");
}
CHECK_MANAGER();
attr.get_write_value(m_frequency);
......@@ -801,16 +801,16 @@ void SingleShotAO::write_channel(yat4tango::DynamicAttributeWriteCallbackData &
{
ERROR_STREAM << df<< endl;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [caught Tango::DevFailed]"),
_CPTC("SingleShotAO::write_channel"));
"DRIVER_FAILURE",
"could not write channel [caught Tango::DevFailed]",
"SingleShotAO::write_channel");
}
catch(...)
{
ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught"<<std::endl;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [unknown error]"),
_CPTC("SingleShotAO::write_channel"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write channel [unknown error]",
"SingleShotAO::write_channel");
}
}
......@@ -874,16 +874,16 @@ void SingleShotAO::write_speed(yat4tango::DynamicAttributeWriteCallbackData & cb
{
ERROR_STREAM << df<< endl;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not write initial [caught Tango::DevFailed]"),
_CPTC("SingleShotAO::write_initial"));
"DRIVER_FAILURE",
"could not write initial [caught Tango::DevFailed]",
"SingleShotAO::write_initial");
}
catch(...)
{
ERROR_STREAM << "SingleShotAO::write_initial::unknown exception caught"<<std::endl;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not write initial [unknown error]"),
_CPTC("SingleShotAO::write_initial"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write initial [unknown error]",
"SingleShotAO::write_initial");
}
// To be activated with Tango 8
//yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
......@@ -947,16 +947,16 @@ void SingleShotAO::write_initial(yat4tango::DynamicAttributeWriteCallbackData &
{
ERROR_STREAM << df<< endl;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not write initial [caught Tango::DevFailed]"),
_CPTC("SingleShotAO::write_initial"));
"DRIVER_FAILURE",
"could not write initial [caught Tango::DevFailed]",
"SingleShotAO::write_initial");
}
catch(...)
{
ERROR_STREAM << "SingleShotAO::write_initial::unknown exception caught"<<std::endl;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not write initial [unknown error]"),
_CPTC("SingleShotAO::write_initial"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write initial [unknown error]",
"SingleShotAO::write_initial");
}
// To be activated with Tango 8
//yat4tango::PropertyHelper::set_memorized_attribute(this, l_attr_name, l_val);
......@@ -989,16 +989,16 @@ void SingleShotAO::abort()
{
ERROR_STREAM << df<< endl;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not abort [caught Tango::DevFailed]"),
_CPTC("SingleShotAO::abort"));
"DRIVER_FAILURE",
"could not abort [caught Tango::DevFailed]",
"SingleShotAO::abort");
}
catch(...)
{
ERROR_STREAM << "SingleShotAOManager::abort::unknown exception caught"<<std::endl;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not abort [unknown error]"),
_CPTC("SingleShotAO::abort"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not abort [unknown error]",
"SingleShotAO::abort");
}
}
......
......@@ -296,9 +296,9 @@ protected :
{
ERROR_STREAM << df << endl;
RETHROW_DEVFAILED(df,
_CPTC("SOFTWARE_FAILURE"),
_CPTC("Error while storing properties in database"),
_CPTC("SingleShotAO::store_value_as_property"));
"SOFTWARE_FAILURE",
"Error while storing properties in database",
"SingleShotAO::store_value_as_property");
}
}
......@@ -312,9 +312,9 @@ protected :
if (!Tango::Util::instance()->_UseDb)
{
//- throw exception
THROW_DEVFAILED(_CPTC("DEVICE_ERROR"),
_CPTC("No DATA BASE!"),
_CPTC("SingleShotAO::get_memorized_attribute"));
THROW_DEVFAILED("DEVICE_ERROR",
"No DATA BASE!",
"SingleShotAO::get_memorized_attribute");
}
Tango::DbData dev_prop;
......@@ -328,9 +328,9 @@ protected :
{
//- rethrow exception
RETHROW_DEVFAILED(df,
_CPTC("DEVICE_ERROR"),
_CPTC("could not get Device properties! [caught Tango::DevFailed]"),
_CPTC("SingleShotAO::get_memorized_attribute"));
"DEVICE_ERROR",
"could not get Device properties! [caught Tango::DevFailed]",
"SingleShotAO::get_memorized_attribute");
}
if (dev_prop[0].is_empty()==false)
......@@ -340,9 +340,9 @@ protected :
else
{
//- throw exception
THROW_DEVFAILED(_CPTC("DATA_ERROR"),
_CPTC("No property stored in database!"),
_CPTC("SingleShotAO::get_memorized_attribute"));
THROW_DEVFAILED("DATA_ERROR",
"No property stored in database!",
"SingleShotAO::get_memorized_attribute");
}
return value;
}
......
......@@ -21,9 +21,9 @@ namespace SingleShotAO_ns
do \
{ \
if (! m_ssao) \
THROW_DEVFAILED(_CPTC("DEVICE_ERROR"), \
_CPTC("request aborted - the AO board isn't accessible "), \
_CPTC("SingleShotAOManager::check_ssao")); \
THROW_DEVFAILED("DEVICE_ERROR", \
"request aborted - the AO board isn't accessible ", \
"SingleShotAOManager::check_ssao"); \
} while (0)
// ============================================================================
......@@ -226,17 +226,17 @@ void SingleShotAOManager::periodic_job_i()
ERROR_STREAM << df<< endl;
m_state = Tango::FAULT;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [caught asl::DAQException]"),
_CPTC("SingleShotAOManager::write_channel"));
"DRIVER_FAILURE",
"could not write channel [caught asl::DAQException]",
"SingleShotAOManager::write_channel");
}
catch(...)
{
ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught"<<std::endl;
m_state = Tango::FAULT;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [unknown error]"),
_CPTC("SingleShotAOManager::write_channel"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write channel [unknown error]",
"SingleShotAOManager::write_channel");
}
//check if there is another value
......@@ -285,17 +285,17 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
ERROR_STREAM << df<< endl;
m_state = Tango::FAULT;
RETHROW_DEVFAILED(df,
_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [caught asl::DAQException]"),
_CPTC("SingleShotAOManager::write_channel"));
"DRIVER_FAILURE",
"could not write channel [caught asl::DAQException]",
"SingleShotAOManager::write_channel");
}
catch(...)
{
ERROR_STREAM << "SingleShotAOManager::write_channel::unknown exception caught"<<std::endl;
m_state = Tango::FAULT;
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not write channel [unknown error]"),
_CPTC("SingleShotAOManager::write_channel"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not write channel [unknown error]",
"SingleShotAOManager::write_channel");
}
}
else
......@@ -308,9 +308,9 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
{
if (m_frequency == 0)
{
THROW_DEVFAILED(_CPTC("DRIVER_FAILURE"),
_CPTC("could not set a ramp on this channel. The frequency is 0"),
_CPTC("SingleShotAOManager::write_channel"));
THROW_DEVFAILED("DRIVER_FAILURE",
"could not set a ramp on this channel. The frequency is 0",
"SingleShotAOManager::write_channel");
}
//ramp determination
......@@ -369,9 +369,9 @@ void SingleShotAOManager::write_channel(ChannelId_t p_chIdx, double p_val)
}
else
{
THROW_DEVFAILED(_CPTC("DEVICE_FAILURE"),
_CPTC("could not write channel : a ramp is still in progress on this channel"),
_CPTC("SingleShotAOManager::write_channel"));
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write channel : a ramp is still in progress on this channel",
"SingleShotAOManager::write_channel");
}
}
}
......@@ -391,9 +391,9 @@ void SingleShotAOManager::set_initial(ChannelId_t p_chIdx, Intial_t p_initial)
{
if (m_isRunning[p_chIdx])
{
THROW_DEVFAILED(_CPTC("DEVICE_FAILURE"),
_CPTC("could not write initial : a ramp is still in progress on this channel"),
_CPTC("SingleShotAOManager::set_initial"));
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write initial : a ramp is still in progress on this channel",
"SingleShotAOManager::set_initial");
}
else
{
......@@ -416,9 +416,9 @@ void SingleShotAOManager::set_speed(ChannelId_t p_chIdx, Intial_t p_speed)
{
if (m_isRunning[p_chIdx])
{
THROW_DEVFAILED(_CPTC("DEVICE_FAILURE"),
_CPTC("could not write speed : a ramp is still in progress on this channel"),
_CPTC("SingleShotAOManager::set_speed"));
THROW_DEVFAILED("DEVICE_FAILURE",
"could not write speed : a ramp is still in progress on this channel",
"SingleShotAOManager::set_speed");
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment