Skip to content
Snippets Groups Projects
Commit 9d0deed6 authored by System User's avatar System User
Browse files

Correcting on_fault method name, and removing unnecessary _ASL_TRY

parent a57c1581
No related branches found
No related tags found
1 merge request!2Refactoring of ContinuousAO code : Communalisation of copy/pasted portions of code
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -200,7 +200,7 @@ namespace ContinuousAO ...@@ -200,7 +200,7 @@ namespace ContinuousAO
//- check memory allocation //- check memory allocation
if (m_ao == nullptr) if (m_ao == nullptr)
{ {
raise_error("ContinuousAO::init_device\nout of memory error while initializing ADLinkContinuousAO"); on_fault("ContinuousAO::init_device\nout of memory error while initializing ADLinkContinuousAO");
return; return;
} }
...@@ -211,7 +211,7 @@ namespace ContinuousAO ...@@ -211,7 +211,7 @@ namespace ContinuousAO
m_channel[i] = new double[bufferDepth]; m_channel[i] = new double[bufferDepth];
if(m_channel[i] == nullptr) if(m_channel[i] == nullptr)
{ {
raise_error("ContinuousAO::init_device\nout of memory error while initializing channel's datas"); on_fault("ContinuousAO::init_device\nout of memory error while initializing channel's datas");
return; return;
} }
} }
...@@ -303,29 +303,21 @@ namespace ContinuousAO ...@@ -303,29 +303,21 @@ namespace ContinuousAO
DEBUG_STREAM<<"ContinuousAO::init_device : init acq"<<std::endl; DEBUG_STREAM<<"ContinuousAO::init_device : init acq"<<std::endl;
try{ try{
_ASL_TRY( m_ao->init(adl::DAQ2502, boardNum);
m_ao->init(adl::DAQ2502, boardNum),
"init",
"ContinuousAO::init_device"
);
DEBUG_STREAM<<"ContinuousAO::init_device : config acq"<<std::endl; DEBUG_STREAM<<"ContinuousAO::init_device : config acq"<<std::endl;
try{ try{
_ASL_TRY( m_ao->configure(config);
m_ao->configure(config),
"configure",
"ContinuousAO::init_device"
);
} }
catch (...) catch (...)
{ {
raise_error("ContinuousAO::init_device\nError while configuring driver"); on_fault("ContinuousAO::init_device\nError while configuring driver");
return; return;
} }
} }
catch (...) catch (...)
{ {
raise_error("ContinuousAO::init_device\nError while initializing the driver"); on_fault("ContinuousAO::init_device\nError while initializing the driver");
return; return;
} }
...@@ -1184,7 +1176,7 @@ namespace ContinuousAO ...@@ -1184,7 +1176,7 @@ namespace ContinuousAO
); );
} }
void ContinuousAO::raise_error(std::string p_error_message) void ContinuousAO::on_fault(std::string p_error_message)
{ {
m_error_message = p_error_message; m_error_message = p_error_message;
set_state(Tango::FAULT); set_state(Tango::FAULT);
......
...@@ -338,7 +338,7 @@ namespace ContinuousAO ...@@ -338,7 +338,7 @@ namespace ContinuousAO
// asl::ContinuousAOConfig* config; // asl::ContinuousAOConfig* config;
void set_internal_state(void); void set_internal_state(void);
void raise_error(std::string p_error_message); void on_fault(std::string p_error_message);
// save a channel waveform in the database // save a channel waveform in the database
void ContinuousAO::save_waveform(double* waveform, string wfm_channel); void ContinuousAO::save_waveform(double* waveform, string wfm_channel);
asl::AOScaledData assign_default_waveform(Tango::DevDouble p_ref, std::function <double(int, int)> p_lambda, int p_first_channel, int p_last_channel); asl::AOScaledData assign_default_waveform(Tango::DevDouble p_ref, std::function <double(int, int)> p_lambda, int p_first_channel, int p_last_channel);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment