From a9c520a4b9b3ab6ace7a779790d00f084442b9bb Mon Sep 17 00:00:00 2001 From: Walter Van Herck <w.van.herck@fz-juelich.de> Date: Mon, 12 Jan 2015 14:21:11 +0100 Subject: [PATCH] Rename enumerations and enumerators (2) --- App/src/FitSuiteDrawObserver.cpp | 1 - App/src/TestSpecularMatrix.cpp | 16 ++++++++-------- Core/Algorithms/inc/ISimulation.h | 10 +++++----- .../src/DecoratedLayerDWBASimulation.cpp | 6 +++--- Core/Algorithms/src/DiffuseDWBASimulation.cpp | 6 +++--- Core/Algorithms/src/MultiLayerDWBASimulation.cpp | 6 +++--- .../src/MultiLayerRoughnessDWBASimulation.cpp | 6 +++--- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/App/src/FitSuiteDrawObserver.cpp b/App/src/FitSuiteDrawObserver.cpp index f4ab568585c..a153fd6926d 100644 --- a/App/src/FitSuiteDrawObserver.cpp +++ b/App/src/FitSuiteDrawObserver.cpp @@ -52,7 +52,6 @@ void FitSuiteDrawObserver::update(IObservable *subject) // preparing data to draw const char *hname[]={ "RealData", "SimulatedData", "RelativeDifference","Chi2Map"}; -// enum EHistogramKeys {REAL, SIMUL, DIFF, CHI2}; std::vector<OutputData<double > *> data2draw; data2draw.push_back( fitObject->getChiSquaredModule()->getRealData()->clone() ); data2draw.push_back( fitObject->getChiSquaredModule()->getSimulationData()->clone() ); //chi module have normalized simulation diff --git a/App/src/TestSpecularMatrix.cpp b/App/src/TestSpecularMatrix.cpp index 8fd040b19f6..28f965b6e32 100644 --- a/App/src/TestSpecularMatrix.cpp +++ b/App/src/TestSpecularMatrix.cpp @@ -91,7 +91,7 @@ void TestSpecularMatrix::draw_standard_samples() // graphics for R,T coefficients in layers as a function of alpha_i size_t ncoeffs = 2; - enum key_coeffs { kCoeffR, kCoeffT}; + enum EKeyCoeffs { COEFF_R, COEFF_T }; const char *coeffs_title[]={" |R| "," |T| "}; int coeffs_color[] = {kBlue, kRed}; @@ -114,10 +114,10 @@ void TestSpecularMatrix::draw_standard_samples() // Filling graphics for R,T as a function of alpha_i for(size_t i_layer=0; i_layer<nlayers; ++i_layer ) { - gr_coeff[i_layer][kCoeffR]->SetPoint(i_point, + gr_coeff[i_layer][COEFF_R]->SetPoint(i_point, Units::rad2deg(alpha_i), std::abs(coeffs[i_layer].getScalarR()) ); - gr_coeff[i_layer][kCoeffT]->SetPoint(i_point, + gr_coeff[i_layer][COEFF_T]->SetPoint(i_point, Units::rad2deg(alpha_i), std::abs(coeffs[i_layer].getScalarT()) ); } @@ -162,7 +162,7 @@ void TestSpecularMatrix::draw_standard_samples() double xmin(0), ymin(0), xmax(0), ymax(0); for(size_t i_coeff=0; i_coeff<ncoeffs; i_coeff++){ double x1(0), y1(0), x2(0), y2(0); - gr_coeff[i_layer][kCoeffT]->ComputeRange(x1, y1, x2, y2); + gr_coeff[i_layer][COEFF_T]->ComputeRange(x1, y1, x2, y2); if(x1 < xmin ) xmin= x1; if(x2 > xmax ) xmax = x2; if(y1 < ymin ) ymin = y1; @@ -255,7 +255,7 @@ void TestSpecularMatrix::draw_roughness_set() // graphics for R,T coefficients in layers as a function of alpha_i size_t ncoeffs = 2; - enum key_coeffs { kCoeffR, kCoeffT}; + enum EKeyCoeffs { COEFF_R, COEFF_T }; const IAxis *p_rough = mp_coeffs->getAxis("roughness"); size_t nroughness = p_rough->getSize(); @@ -284,10 +284,10 @@ void TestSpecularMatrix::draw_roughness_set() // Filling graphics for R,T as a function of alpha_i for(size_t i_layer=0; i_layer<nlayers; ++i_layer ) { - gr_coeff[i_layer][kCoeffR][i_rough]->SetPoint((int)i_alpha, + gr_coeff[i_layer][COEFF_R][i_rough]->SetPoint((int)i_alpha, Units::rad2deg(alpha_i), std::abs(coeffs[i_layer].getScalarR()) ); - gr_coeff[i_layer][kCoeffT][i_rough]->SetPoint((int)i_alpha, + gr_coeff[i_layer][COEFF_T][i_rough]->SetPoint((int)i_alpha, Units::rad2deg(alpha_i), std::abs(coeffs[i_layer].getScalarT()) ); } @@ -308,7 +308,7 @@ void TestSpecularMatrix::draw_roughness_set() if( nlayers+1 > 4 ) ndiv = int(sqrt(nlayers+1)+1); c1->Divide(ndiv,ndiv); - int i_coeff_sel = kCoeffR; + int i_coeff_sel = COEFF_R; for(size_t i_layer=0; i_layer<nlayers; i_layer++) { c1->cd((int)i_layer+1); gPad->SetLogy(); diff --git a/Core/Algorithms/inc/ISimulation.h b/Core/Algorithms/inc/ISimulation.h index 3da67ef4799..0a47909ac86 100644 --- a/Core/Algorithms/inc/ISimulation.h +++ b/Core/Algorithms/inc/ISimulation.h @@ -25,8 +25,8 @@ class BA_CORE_API_ ISimulation : public ICloneable { public: - ISimulation() : m_status(Idle) {} - enum SimulationStatus {Idle, Running, Completed, Failed}; + ISimulation() : m_status(IDLE) {} + enum ESimulationStatus { IDLE, RUNNING, COMPLETED, FAILED }; virtual ~ISimulation() {} ISimulation *clone() const @@ -36,16 +36,16 @@ public: } virtual void run() {} - bool isCompleted() const { return m_status == Completed;} + bool isCompleted() const { return m_status == COMPLETED;} std::string getRunMessage() const { return m_run_message; } protected: virtual void runProtected() {} - void setStatus(SimulationStatus status) { m_status = status; } + void setStatus(ESimulationStatus status) { m_status = status; } void setRunMessage(const std::string &message) { m_run_message = message; } - SimulationStatus m_status; + ESimulationStatus m_status; std::string m_run_message; }; diff --git a/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp b/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp index 7d428a11bfd..55aa91f2653 100644 --- a/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp +++ b/Core/Algorithms/src/DecoratedLayerDWBASimulation.cpp @@ -45,14 +45,14 @@ void DecoratedLayerDWBASimulation::init(const Simulation& simulation) void DecoratedLayerDWBASimulation::run() { - setStatus(Running); + setStatus(RUNNING); try { runProtected(); - setStatus(Completed); + setStatus(COMPLETED); } catch(const std::exception &ex) { setRunMessage(std::string(ex.what())); - setStatus(Failed); + setStatus(FAILED); } } diff --git a/Core/Algorithms/src/DiffuseDWBASimulation.cpp b/Core/Algorithms/src/DiffuseDWBASimulation.cpp index 2e076388ae9..69917f546b8 100644 --- a/Core/Algorithms/src/DiffuseDWBASimulation.cpp +++ b/Core/Algorithms/src/DiffuseDWBASimulation.cpp @@ -25,14 +25,14 @@ void DiffuseDWBASimulation::run() { - setStatus(Running); + setStatus(RUNNING); try { runProtected(); - setStatus(Completed); + setStatus(COMPLETED); } catch(const std::exception &ex) { setRunMessage(std::string(ex.what())); - setStatus(Failed); + setStatus(FAILED); } } diff --git a/Core/Algorithms/src/MultiLayerDWBASimulation.cpp b/Core/Algorithms/src/MultiLayerDWBASimulation.cpp index 5a13c164bb8..b360e4ecf23 100644 --- a/Core/Algorithms/src/MultiLayerDWBASimulation.cpp +++ b/Core/Algorithms/src/MultiLayerDWBASimulation.cpp @@ -91,14 +91,14 @@ void MultiLayerDWBASimulation::setThreadInfo(const ThreadInfo& thread_info) void MultiLayerDWBASimulation::run() { - setStatus(Running); + setStatus(RUNNING); try { runProtected(); - setStatus(Completed); + setStatus(COMPLETED); } catch(const std::exception &ex) { setRunMessage(std::string(ex.what())); - setStatus(Failed); + setStatus(FAILED); } } diff --git a/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp b/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp index dfb136839ae..0f11471d5dd 100644 --- a/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp +++ b/Core/Algorithms/src/MultiLayerRoughnessDWBASimulation.cpp @@ -37,14 +37,14 @@ MultiLayerRoughnessDWBASimulation::~MultiLayerRoughnessDWBASimulation() void MultiLayerRoughnessDWBASimulation::run() { - setStatus(Running); + setStatus(RUNNING); try { runProtected(); - setStatus(Completed); + setStatus(COMPLETED); } catch(const std::exception &ex) { setRunMessage(std::string(ex.what())); - setStatus(Failed); + setStatus(FAILED); } } -- GitLab