From d53dbb7a99643a486826741a3ce9163df62b133c Mon Sep 17 00:00:00 2001 From: Mathieu Doucet <doucetm@ornl.gov> Date: Tue, 14 Jun 2011 19:47:41 +0000 Subject: [PATCH] Fixes #3107 This takes care of the algorithms used by SANS that take enough time to be able to read the progress bar. --- .../Algorithms/src/ApplyTransmissionCorrection.cpp | 2 +- .../Framework/Algorithms/src/CalculateEfficiency.cpp | 10 +++++----- .../src/CalculateTransmissionBeamSpreader.cpp | 2 +- .../Algorithms/src/FindCenterOfMassPosition2.cpp | 2 +- .../Framework/Algorithms/src/SANSDirectBeamScaling.cpp | 2 +- .../Algorithms/src/SANSSolidAngleCorrection.cpp | 2 +- .../Framework/DataHandling/src/LoadEventPreNeXus.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Code/Mantid/Framework/Algorithms/src/ApplyTransmissionCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/ApplyTransmissionCorrection.cpp index 66838ee5b63..a9f3a695c23 100644 --- a/Code/Mantid/Framework/Algorithms/src/ApplyTransmissionCorrection.cpp +++ b/Code/Mantid/Framework/Algorithms/src/ApplyTransmissionCorrection.cpp @@ -120,7 +120,7 @@ void ApplyTransmissionCorrection::exec() EOut[j] = sqrt( d1*d1 + d2*d2 ); YOut[j] = YIn[j]/t_term; } - progress.report(); + progress.report("Applying Transmission Correction"); } } diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateEfficiency.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateEfficiency.cpp index 28c9f3b9080..7759423c155 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateEfficiency.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateEfficiency.cpp @@ -64,7 +64,7 @@ void CalculateEfficiency::exec() // Now create the output workspace MatrixWorkspace_sptr outputWS = getProperty("OutputWorkspace"); - Progress progress(this,0.0,1.0,5); + Progress progress(this,0.0,1.0,4); // Sum up all the wavelength bins IAlgorithm_sptr childAlg = createSubAlgorithm("Integration"); @@ -80,7 +80,7 @@ void CalculateEfficiency::exec() } setProperty("OutputWorkspace",outputWS); - progress.report(); + progress.report("Detector Efficiency"); double sum = 0.0; double err = 0.0; @@ -90,7 +90,7 @@ void CalculateEfficiency::exec() // Skip monitors and masked detectors sumUnmaskedDetectors(rebinnedWS, sum, err, npixels); - progress.report(); + progress.report("Detector Efficiency"); // Normalize each detector pixel by the sum we just found to get the // relative efficiency. If the minimum and maximum efficiencies are @@ -101,7 +101,7 @@ void CalculateEfficiency::exec() // the newly masked detectors. normalizeDetectors(rebinnedWS, outputWS, sum, err, npixels, min_eff, max_eff); - progress.report(); + progress.report("Detector Efficiency"); if ( !isEmpty(min_eff) || !isEmpty(max_eff) ) { @@ -109,7 +109,7 @@ void CalculateEfficiency::exec() // the acceptable efficiency range. sumUnmaskedDetectors(rebinnedWS, sum, err, npixels); - progress.report(); + progress.report("Detector Efficiency"); // Now that we have a normalization factor that excludes bad pixels, // recompute the relative efficiency. diff --git a/Code/Mantid/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp b/Code/Mantid/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp index cd08d976b2d..5f561696b16 100644 --- a/Code/Mantid/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CalculateTransmissionBeamSpreader.cpp @@ -195,7 +195,7 @@ void CalculateTransmissionBeamSpreader::exec() { E[i] = std::abs(E[i]/Y[i]); Y[i] = std::log10(Y[i]); - progress.report(); + progress.report("Calculate Transmission"); } // Now fit this to a straight line diff --git a/Code/Mantid/Framework/Algorithms/src/FindCenterOfMassPosition2.cpp b/Code/Mantid/Framework/Algorithms/src/FindCenterOfMassPosition2.cpp index 359d51e6667..21026886df1 100644 --- a/Code/Mantid/Framework/Algorithms/src/FindCenterOfMassPosition2.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FindCenterOfMassPosition2.cpp @@ -210,7 +210,7 @@ void FindCenterOfMassPosition2::exec() distance_check = distance; first_run = false; - progress.report(); + progress.report("Find Beam Center"); } std::string output = getProperty("Output"); diff --git a/Code/Mantid/Framework/Algorithms/src/SANSDirectBeamScaling.cpp b/Code/Mantid/Framework/Algorithms/src/SANSDirectBeamScaling.cpp index c2c7570bf9b..fe346742a90 100644 --- a/Code/Mantid/Framework/Algorithms/src/SANSDirectBeamScaling.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SANSDirectBeamScaling.cpp @@ -134,7 +134,7 @@ void SANSDirectBeamScaling::exec() nPixels += 1; sdd += pixelDistance; } - progress.report("Summing beam counts"); + progress.report("Absolute Scaling"); } // Get the average SDD for the counted pixels, and transform to mm. sdd = sdd/nPixels*1000.0; diff --git a/Code/Mantid/Framework/Algorithms/src/SANSSolidAngleCorrection.cpp b/Code/Mantid/Framework/Algorithms/src/SANSSolidAngleCorrection.cpp index e3790d0440d..ee89716a238 100644 --- a/Code/Mantid/Framework/Algorithms/src/SANSSolidAngleCorrection.cpp +++ b/Code/Mantid/Framework/Algorithms/src/SANSSolidAngleCorrection.cpp @@ -91,7 +91,7 @@ void SANSSolidAngleCorrection::exec() YOut[j] = YIn[j]*corr; EOut[j] = fabs(EIn[j]*corr); } - progress.report(); + progress.report("Solid Angle Correction"); } } diff --git a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNeXus.cpp b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNeXus.cpp index 87cb405cf38..b72c5417dcb 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadEventPreNeXus.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadEventPreNeXus.cpp @@ -455,7 +455,7 @@ void LoadEventPreNeXus::procEvents(DataObjects::EventWorkspace_sptr & workspace) procEventsLinear(workspace, event_buffer, current_event_buffer_size, fileOffset); //Report progress - prog.report(); + prog.report("Load Event PreNeXus"); } //Clean up the buffers -- GitLab