Skip to content

Commit

Permalink
Re #6931 Make file basename, extension and number of zeros static
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Apr 23, 2015
1 parent e4bf11b commit b63868d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Expand Up @@ -104,11 +104,11 @@ class DLLExport PlotAsymmetryByLogValue : public API::Algorithm {
void checkProperties ();

/// Stores base name shared by all runs
std::string m_filenameBase;
static std::string g_filenameBase;
/// Stores extension shared by all runs
std::string m_filenameExt;
static std::string g_filenameExt;
/// Sotres number of zeros in run name
int m_filenameZeros;
static int g_filenameZeros;
/// Stores property "Int"
bool m_int;
/// Store forward spectra
Expand Down
Expand Up @@ -99,6 +99,9 @@ int PlotAsymmetryByLogValue::g_red = 1;
int PlotAsymmetryByLogValue::g_green = EMPTY_INT();
std::string PlotAsymmetryByLogValue::g_dtcType;
std::string PlotAsymmetryByLogValue::g_dtcFile;
std::string PlotAsymmetryByLogValue::g_filenameBase;
std::string PlotAsymmetryByLogValue::g_filenameExt;
int PlotAsymmetryByLogValue::g_filenameZeros = 0;

/** Initialisation method. Declares properties to be used in algorithm.
*
Expand Down Expand Up @@ -187,7 +190,7 @@ void PlotAsymmetryByLogValue::exec() {
std::string lastFN = getProperty("LastRun");

// Parse run names and get the number of runs
parseRunNames( firstFN, lastFN, m_filenameBase, m_filenameExt, m_filenameZeros);
parseRunNames( firstFN, lastFN, g_filenameBase, g_filenameExt, g_filenameZeros);
size_t is = atoi(firstFN.c_str()); // starting run number
size_t ie = atoi(lastFN.c_str()); // last run number

Expand Down Expand Up @@ -298,8 +301,8 @@ Workspace_sptr PlotAsymmetryByLogValue::doLoad (int64_t runNumber ) {

// Get complete run name
std::ostringstream fn, fnn;
fnn << std::setw(m_filenameZeros) << std::setfill('0') << runNumber;
fn << m_filenameBase << fnn.str() << m_filenameExt;
fnn << std::setw(g_filenameZeros) << std::setfill('0') << runNumber;
fn << g_filenameBase << fnn.str() << g_filenameExt;

// Load run
IAlgorithm_sptr load = createChildAlgorithm("LoadMuonNexus");
Expand Down

0 comments on commit b63868d

Please sign in to comment.