From b9c2a3bb1a27aae3a39bd6e1e26841e57b4c2575 Mon Sep 17 00:00:00 2001 From: LamarMoore <lamar.moore@stfc.ac.uk> Date: Tue, 26 Sep 2017 10:52:15 +0100 Subject: [PATCH] clang-format #20436 --- .../API/inc/MantidAPI/AlgorithmHistory.h | 24 +++-- Framework/API/inc/MantidAPI/HistoryView.h | 7 +- Framework/API/inc/MantidAPI/IEventList.h | 3 +- Framework/API/inc/MantidAPI/ILiveListener.h | 3 +- Framework/API/inc/MantidAPI/MatrixWorkspace.h | 2 +- Framework/API/src/Algorithm.cpp | 3 +- Framework/API/src/AlgorithmHistory.cpp | 7 +- Framework/API/test/AlgorithmHistoryTest.h | 3 +- Framework/API/test/WorkspaceHistoryTest.h | 8 +- .../MantidAlgorithms/ExportTimeSeriesLog.h | 12 +-- .../inc/MantidAlgorithms/FilterEvents.h | 8 +- .../MantidAlgorithms/GenerateEventsFilter.h | 9 +- .../GetTimeSeriesLogInformation.h | 9 +- .../Algorithms/src/CalculateCountRate.cpp | 4 +- .../Algorithms/src/ExportTimeSeriesLog.cpp | 6 +- .../Algorithms/src/GenerateEventsFilter.cpp | 16 +-- Framework/Algorithms/test/FilterEventsTest.h | 102 ++++++++++-------- .../test/GenerateEventsFilterTest.h | 3 +- Framework/Beamline/src/DetectorInfo.cpp | 3 +- Framework/Crystal/src/SetGoniometer.cpp | 3 +- .../inc/MantidDataHandling/LoadEventNexus.h | 4 +- .../MantidDataHandling/LoadILLDiffraction.h | 10 +- .../src/CreateSimulationWorkspace.cpp | 3 +- Framework/DataHandling/src/LoadNexusLogs.cpp | 3 +- .../StartAndEndTimeFromNexusFileExtractor.cpp | 18 ++-- .../DataHandling/test/LoadNexusLogsTest.h | 6 +- Framework/DataHandling/test/MergeLogsTest.h | 3 +- .../ScanningWorkspaceBuilder.h | 9 +- Framework/DataObjects/src/EventList.cpp | 9 +- .../src/ScanningWorkspaceBuilder.cpp | 12 ++- .../MantidGeometry/Instrument/DetectorInfo.h | 10 +- .../Geometry/src/Instrument/DetectorInfo.cpp | 11 +- Framework/ICat/src/CatalogKeepAlive.cpp | 3 +- Framework/Kernel/src/ConfigService.cpp | 3 +- Framework/Kernel/src/LogParser.cpp | 4 +- Framework/Kernel/src/TimeSeriesProperty.cpp | 11 +- .../Kernel/test/TimeSeriesPropertyTest.h | 12 ++- .../MantidLiveData/FakeEventDataListener.h | 3 +- .../MantidLiveData/FileEventDataListener.h | 3 +- .../ISIS/ISISHistoDataListener.h | 3 +- .../ISIS/ISISLiveEventDataListener.h | 3 +- .../MantidLiveData/Kafka/KafkaEventListener.h | 3 +- .../MantidLiveData/SNSLiveEventDataListener.h | 6 +- .../TOPAZLiveEventDataListener.h | 3 +- .../LiveData/src/FakeEventDataListener.cpp | 14 +-- .../LiveData/src/SNSLiveEventDataListener.cpp | 3 +- .../src/TOPAZLiveEventDataListener.cpp | 3 +- .../ConvertSpiceDataToRealSpace.h | 15 +-- .../Types/inc/MantidTypes/Core/DateAndTime.h | 2 +- .../Types/inc/MantidTypes/Event/TofEvent.h | 16 ++- .../src/Mantid/AlgorithmHistoryWindow.cpp | 5 +- .../test/MuonAnalysisHelperTest.h | 7 +- 52 files changed, 259 insertions(+), 196 deletions(-) diff --git a/Framework/API/inc/MantidAPI/AlgorithmHistory.h b/Framework/API/inc/MantidAPI/AlgorithmHistory.h index 862bbd41670..7e6fd480818 100644 --- a/Framework/API/inc/MantidAPI/AlgorithmHistory.h +++ b/Framework/API/inc/MantidAPI/AlgorithmHistory.h @@ -74,18 +74,20 @@ class MANTID_API_DLL AlgorithmHistory { public: /// History container - /// The date-and-time will be stored as the Mantid::Types::Core::DateAndTime type - explicit AlgorithmHistory( - const Algorithm *const alg, - const Types::Core::DateAndTime &start = Types::Core::DateAndTime::getCurrentTime(), - const double &duration = -1.0, std::size_t uexeccount = 0); + /// The date-and-time will be stored as the Mantid::Types::Core::DateAndTime + /// type + explicit AlgorithmHistory(const Algorithm *const alg, + const Types::Core::DateAndTime &start = + Types::Core::DateAndTime::getCurrentTime(), + const double &duration = -1.0, + std::size_t uexeccount = 0); ~AlgorithmHistory(); AlgorithmHistory &operator=(const AlgorithmHistory &); AlgorithmHistory(const AlgorithmHistory &); - AlgorithmHistory( - const std::string &name, int vers, - const Types::Core::DateAndTime &start = Types::Core::DateAndTime::getCurrentTime(), - const double &duration = -1.0, std::size_t uexeccount = 0); + AlgorithmHistory(const std::string &name, int vers, + const Types::Core::DateAndTime &start = + Types::Core::DateAndTime::getCurrentTime(), + const double &duration = -1.0, std::size_t uexeccount = 0); void addExecutionInfo(const Types::Core::DateAndTime &start, const double &duration); void addProperty(const std::string &name, const std::string &value, @@ -101,7 +103,9 @@ public: /// get execution duration double executionDuration() const { return m_executionDuration; } /// get execution date - Mantid::Types::Core::DateAndTime executionDate() const { return m_executionDate; } + Mantid::Types::Core::DateAndTime executionDate() const { + return m_executionDate; + } /// get the execution count const std::size_t &execCount() const { return m_execCount; } /// get parameter list of algorithm in history const diff --git a/Framework/API/inc/MantidAPI/HistoryView.h b/Framework/API/inc/MantidAPI/HistoryView.h index 6e5bf7cc90b..ccf5a722147 100644 --- a/Framework/API/inc/MantidAPI/HistoryView.h +++ b/Framework/API/inc/MantidAPI/HistoryView.h @@ -53,9 +53,10 @@ public: void unrollAll(); void roll(size_t index); void rollAll(); - void filterBetweenExecDate(Mantid::Types::Core::DateAndTime start, - Mantid::Types::Core::DateAndTime end = - Mantid::Types::Core::DateAndTime::getCurrentTime()); + void + filterBetweenExecDate(Mantid::Types::Core::DateAndTime start, + Mantid::Types::Core::DateAndTime end = + Mantid::Types::Core::DateAndTime::getCurrentTime()); /** * Get the list of History Items for this view. * diff --git a/Framework/API/inc/MantidAPI/IEventList.h b/Framework/API/inc/MantidAPI/IEventList.h index 748aef66264..6bca72be136 100644 --- a/Framework/API/inc/MantidAPI/IEventList.h +++ b/Framework/API/inc/MantidAPI/IEventList.h @@ -84,7 +84,8 @@ public: /// Return the list of event weight error values virtual void getWeightErrors(std::vector<double> &weightErrors) const = 0; /// Return the list of pulse time values - virtual std::vector<Mantid::Types::Core::DateAndTime> getPulseTimes() const = 0; + virtual std::vector<Mantid::Types::Core::DateAndTime> + getPulseTimes() const = 0; /// Get the minimum TOF from the list virtual double getTofMin() const = 0; /// Get the maximum TOF from the list diff --git a/Framework/API/inc/MantidAPI/ILiveListener.h b/Framework/API/inc/MantidAPI/ILiveListener.h index 65550d60381..1d9d8be5da5 100644 --- a/Framework/API/inc/MantidAPI/ILiveListener.h +++ b/Framework/API/inc/MantidAPI/ILiveListener.h @@ -78,7 +78,8 @@ public: * The value of 'start of run' is 1 second * for compatibility with the SNS live stream and ISIS Kafka live stream. */ - virtual void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) = 0; + virtual void + start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) = 0; /** Get the data that's been buffered since the last call to this method * (or since start() was called). diff --git a/Framework/API/inc/MantidAPI/MatrixWorkspace.h b/Framework/API/inc/MantidAPI/MatrixWorkspace.h index cb938a09ee9..f05f690d58d 100644 --- a/Framework/API/inc/MantidAPI/MatrixWorkspace.h +++ b/Framework/API/inc/MantidAPI/MatrixWorkspace.h @@ -21,7 +21,7 @@ namespace Types { namespace Core { class DateAndTime; } -} +} namespace Geometry { class ParameterMap; diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp index 284457c7b42..811e670bb57 100644 --- a/Framework/API/src/Algorithm.cpp +++ b/Framework/API/src/Algorithm.cpp @@ -1205,7 +1205,8 @@ bool Algorithm::checkGroups() { * * @return whether processGroups succeeds. */ -bool Algorithm::doCallProcessGroups(Mantid::Types::Core::DateAndTime &startTime) { +bool Algorithm::doCallProcessGroups( + Mantid::Types::Core::DateAndTime &startTime) { // In the base implementation of processGroups, this normally calls // this->execute() again on each member of the group. Other algorithms may // choose to override that behavior (examples: CompareWorkspaces, diff --git a/Framework/API/src/AlgorithmHistory.cpp b/Framework/API/src/AlgorithmHistory.cpp index d4d3e5d3e40..c9878d7b954 100644 --- a/Framework/API/src/AlgorithmHistory.cpp +++ b/Framework/API/src/AlgorithmHistory.cpp @@ -82,10 +82,9 @@ void AlgorithmHistory::setProperties(const Algorithm *const alg) { * (optional) * @param uexeccount :: an unsigned int for algorithm execution order */ -void AlgorithmHistory::fillAlgorithmHistory(const Algorithm *const alg, - const Types::Core::DateAndTime &start, - const double &duration, - std::size_t uexeccount) { +void AlgorithmHistory::fillAlgorithmHistory( + const Algorithm *const alg, const Types::Core::DateAndTime &start, + const double &duration, std::size_t uexeccount) { m_name = alg->name(); m_version = alg->version(); m_executionDate = start; diff --git a/Framework/API/test/AlgorithmHistoryTest.h b/Framework/API/test/AlgorithmHistoryTest.h index 68e3e53362e..385f8a55ad2 100644 --- a/Framework/API/test/AlgorithmHistoryTest.h +++ b/Framework/API/test/AlgorithmHistoryTest.h @@ -203,7 +203,8 @@ private: timeinfo->tm_min = 54; timeinfo->tm_sec = 49; // Convert to time_t but assuming the tm is specified in UTC time. - std::time_t execTime_t = Mantid::Types::Core::DateAndTime::utc_mktime(timeinfo); + std::time_t execTime_t = + Mantid::Types::Core::DateAndTime::utc_mktime(timeinfo); // Create a UTC datetime from it Mantid::Types::Core::DateAndTime execTime; execTime.set_from_time_t(execTime_t); diff --git a/Framework/API/test/WorkspaceHistoryTest.h b/Framework/API/test/WorkspaceHistoryTest.h index 79470ca6d26..f6f2b4ab1a4 100644 --- a/Framework/API/test/WorkspaceHistoryTest.h +++ b/Framework/API/test/WorkspaceHistoryTest.h @@ -100,10 +100,10 @@ public: simplesum2.execute(); WorkspaceHistory history; - AlgorithmHistory alg1(&simplesum, - Mantid::Types::Core::DateAndTime::defaultTime(), 1.0, 0); - AlgorithmHistory alg2(&simplesum2, - Mantid::Types::Core::DateAndTime::defaultTime(), 1.0, 1); + AlgorithmHistory alg1( + &simplesum, Mantid::Types::Core::DateAndTime::defaultTime(), 1.0, 0); + AlgorithmHistory alg2( + &simplesum2, Mantid::Types::Core::DateAndTime::defaultTime(), 1.0, 1); history.addHistory(boost::make_shared<AlgorithmHistory>(alg1)); history.addHistory(boost::make_shared<AlgorithmHistory>(alg2)); diff --git a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h index e45369ac992..eb102b7b5e1 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/ExportTimeSeriesLog.h @@ -66,11 +66,10 @@ private: void exec() override; - bool - calculateTimeSeriesRangeByTime(std::vector<Types::Core::DateAndTime> &vec_times, - const double &rel_start_time, size_t &i_start, - const double &rel_stop_time, size_t &i_stop, - const double &time_factor); + bool calculateTimeSeriesRangeByTime( + std::vector<Types::Core::DateAndTime> &vec_times, + const double &rel_start_time, size_t &i_start, + const double &rel_stop_time, size_t &i_stop, const double &time_factor); void exportLog(const std::string &logname, const std::string timeunit, const double &starttime, const double &stoptime, @@ -83,7 +82,8 @@ private: std::vector<double> values, const bool &epochtime); void setupWorkspace2D(const size_t &start_index, const size_t &stop_index, - int numentries, std::vector<Types::Core::DateAndTime> ×, + int numentries, + std::vector<Types::Core::DateAndTime> ×, std::vector<double> values, const bool &epochtime, const double &timeunitfactor, size_t nspec); diff --git a/Framework/Algorithms/inc/MantidAlgorithms/FilterEvents.h b/Framework/Algorithms/inc/MantidAlgorithms/FilterEvents.h index 7ff09523013..f7cb0a4ee73 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/FilterEvents.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/FilterEvents.h @@ -156,10 +156,10 @@ private: std::vector<Kernel::TimeSeriesProperty<bool> *> &bool_tsp_name_vector); template <typename TYPE> - void - splitTimeSeriesProperty(Kernel::TimeSeriesProperty<TYPE> *tsp, - std::vector<Types::Core::DateAndTime> &split_datetime_vec, - const int max_target_index); + void splitTimeSeriesProperty( + Kernel::TimeSeriesProperty<TYPE> *tsp, + std::vector<Types::Core::DateAndTime> &split_datetime_vec, + const int max_target_index); void splitDoubleTimeSeriesLogs( const std::vector<Kernel::TimeSeriesProperty<double> *> &dbl_tsp_vector, diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h b/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h index 7baace79966..7c8f6930d78 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/GenerateEventsFilter.h @@ -123,8 +123,8 @@ private: int istart, int iend, std::vector<Types::Core::DateAndTime> &vecSplitTime, std::vector<int> &vecSplitGroup, std::map<size_t, int> indexwsindexmap, const std::vector<double> &logvalueranges, Types::Core::time_duration tol, - bool filterIncrease, bool filterDecrease, Types::Core::DateAndTime startTime, - Types::Core::DateAndTime stopTime); + bool filterIncrease, bool filterDecrease, + Types::Core::DateAndTime startTime, Types::Core::DateAndTime stopTime); /// Generate event filters for integer sample log void processIntegerValueFilter(int minvalue, int maxvalue, @@ -143,8 +143,9 @@ private: Types::Core::DateAndTime makeSplitterInVector(std::vector<Types::Core::DateAndTime> &vecSplitTime, std::vector<int> &vecGroupIndex, - Types::Core::DateAndTime start, Types::Core::DateAndTime stop, - int group, int64_t tol_ns, Types::Core::DateAndTime lasttime); + Types::Core::DateAndTime start, + Types::Core::DateAndTime stop, int group, int64_t tol_ns, + Types::Core::DateAndTime lasttime); /// Generate a matrix workspace containing splitters void generateSplittersInMatrixWorkspace(); diff --git a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h index 4213a8e7094..8776e174d15 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/GetTimeSeriesLogInformation.h @@ -85,7 +85,8 @@ private: /// Calcualte the distribution of delta T in time stamps DataObjects::Workspace2D_sptr - calDistributions(std::vector<Types::Core::DateAndTime> timevec, double stepsize); + calDistributions(std::vector<Types::Core::DateAndTime> timevec, + double stepsize); void exportLog(API::MatrixWorkspace_sptr ws, std::vector<Types::Core::DateAndTime> abstimevec, double dts); @@ -94,13 +95,15 @@ private: std::vector<Types::Core::DateAndTime> ×, std::vector<double> values); - void setupWorkspace2D(int numentries, std::vector<Types::Core::DateAndTime> ×, + void setupWorkspace2D(int numentries, + std::vector<Types::Core::DateAndTime> ×, std::vector<double> values); void execQuickStatistics(); void exportErrorLog(API::MatrixWorkspace_sptr ws, - std::vector<Types::Core::DateAndTime> abstimevec, double dts); + std::vector<Types::Core::DateAndTime> abstimevec, + double dts); void checkLogValueChanging(std::vector<Types::Core::DateAndTime> timevec, std::vector<double> values, double delta); diff --git a/Framework/Algorithms/src/CalculateCountRate.cpp b/Framework/Algorithms/src/CalculateCountRate.cpp index f7367009e79..50d178346c9 100644 --- a/Framework/Algorithms/src/CalculateCountRate.cpp +++ b/Framework/Algorithms/src/CalculateCountRate.cpp @@ -267,8 +267,8 @@ void CalculateCountRate::calcRateLog( double dt = (dTRangeMax - dTRangeMin) / static_cast<double>(m_numLogSteps); auto t0 = m_TRangeMin.totalNanoseconds(); for (auto i = 0; i < m_numLogSteps; i++) { - times[i] = - Types::Core::DateAndTime(t0 + static_cast<int64_t>((0.5 + double(i)) * dt)); + times[i] = Types::Core::DateAndTime( + t0 + static_cast<int64_t>((0.5 + double(i)) * dt)); } // store calculated values within the target log. targLog->replaceValues(times, countRate); diff --git a/Framework/Algorithms/src/ExportTimeSeriesLog.cpp b/Framework/Algorithms/src/ExportTimeSeriesLog.cpp index f7f59a040f1..081ea587db2 100644 --- a/Framework/Algorithms/src/ExportTimeSeriesLog.cpp +++ b/Framework/Algorithms/src/ExportTimeSeriesLog.cpp @@ -340,9 +340,9 @@ void ExportTimeSeriesLog::setupEventWorkspace( * second is 1E-9 */ bool ExportTimeSeriesLog::calculateTimeSeriesRangeByTime( - std::vector<Types::Core::DateAndTime> &vec_times, const double &rel_start_time, - size_t &i_start, const double &rel_stop_time, size_t &i_stop, - const double &time_factor) { + std::vector<Types::Core::DateAndTime> &vec_times, + const double &rel_start_time, size_t &i_start, const double &rel_stop_time, + size_t &i_stop, const double &time_factor) { // Initialize if there is something wrong. i_start = 0; i_stop = vec_times.size() - 1; diff --git a/Framework/Algorithms/src/GenerateEventsFilter.cpp b/Framework/Algorithms/src/GenerateEventsFilter.cpp index 98ea6562c8c..d1fd9bfd27d 100644 --- a/Framework/Algorithms/src/GenerateEventsFilter.cpp +++ b/Framework/Algorithms/src/GenerateEventsFilter.cpp @@ -904,10 +904,11 @@ void GenerateEventsFilter::makeFilterBySingleValue( * with the old direction) */ bool GenerateEventsFilter::identifyLogEntry( - const int &index, const Types::Core::DateAndTime &currT, const bool &lastgood, - const double &minvalue, const double &maxvalue, - const Types::Core::DateAndTime &startT, const Types::Core::DateAndTime &stopT, - const bool &filterIncrease, const bool &filterDecrease) { + const int &index, const Types::Core::DateAndTime &currT, + const bool &lastgood, const double &minvalue, const double &maxvalue, + const Types::Core::DateAndTime &startT, + const Types::Core::DateAndTime &stopT, const bool &filterIncrease, + const bool &filterDecrease) { double val = m_dblLog->nthValue(index); // Identify by time and value @@ -1654,8 +1655,8 @@ int GenerateEventsFilter::determineChangingDirection(int startindex) { /** Add a new splitter to vector of splitters. It is used by FilterByTime only. */ void GenerateEventsFilter::addNewTimeFilterSplitter( - Types::Core::DateAndTime starttime, Types::Core::DateAndTime stoptime, int wsindex, - string info) { + Types::Core::DateAndTime starttime, Types::Core::DateAndTime stoptime, + int wsindex, string info) { if (m_forFastLog) { // For MatrixWorkspace splitter // Start of splitter @@ -1698,7 +1699,8 @@ void GenerateEventsFilter::addNewTimeFilterSplitter( DateAndTime GenerateEventsFilter::makeSplitterInVector( std::vector<Types::Core::DateAndTime> &vecSplitTime, std::vector<int> &vecGroupIndex, Types::Core::DateAndTime start, - Types::Core::DateAndTime stop, int group, int64_t tol_ns, DateAndTime lasttime) { + Types::Core::DateAndTime stop, int group, int64_t tol_ns, + DateAndTime lasttime) { DateAndTime starttime(start.totalNanoseconds() - tol_ns); DateAndTime stoptime(stop.totalNanoseconds() - tol_ns); // DateAndTime starttime = start-tolerance; diff --git a/Framework/Algorithms/test/FilterEventsTest.h b/Framework/Algorithms/test/FilterEventsTest.h index 8fcd3db350e..7cbc4ae3ecc 100644 --- a/Framework/Algorithms/test/FilterEventsTest.h +++ b/Framework/Algorithms/test/FilterEventsTest.h @@ -162,9 +162,11 @@ public: filteredws0->run().getProperty("splitter")); TS_ASSERT(splitter0); TS_ASSERT_EQUALS(splitter0->size(), 2); - TS_ASSERT_EQUALS(splitter0->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter0->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter0->nthValue(0), 1); - TS_ASSERT_EQUALS(splitter0->nthTime(1), Types::Core::DateAndTime(20035000000)); + TS_ASSERT_EQUALS(splitter0->nthTime(1), + Types::Core::DateAndTime(20035000000)); TS_ASSERT_EQUALS(splitter0->nthValue(1), 0); // Check Workspace group 1 @@ -182,11 +184,14 @@ public: filteredws1->run().getProperty("splitter")); TS_ASSERT(splitter1); TS_ASSERT_EQUALS(splitter1->size(), 3); - TS_ASSERT_EQUALS(splitter1->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter1->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter1->nthValue(0), 0); - TS_ASSERT_EQUALS(splitter1->nthTime(1), Types::Core::DateAndTime(20035000000)); + TS_ASSERT_EQUALS(splitter1->nthTime(1), + Types::Core::DateAndTime(20035000000)); TS_ASSERT_EQUALS(splitter1->nthValue(1), 1); - TS_ASSERT_EQUALS(splitter1->nthTime(2), Types::Core::DateAndTime(20195000000)); + TS_ASSERT_EQUALS(splitter1->nthTime(2), + Types::Core::DateAndTime(20195000000)); TS_ASSERT_EQUALS(splitter1->nthValue(2), 0); // Check Workspace group 2 @@ -219,22 +224,29 @@ public: TS_ASSERT(splitter2); TS_ASSERT_EQUALS(splitter2->size(), 7); - TS_ASSERT_EQUALS(splitter2->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter2->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter2->nthValue(0), 0); - TS_ASSERT_EQUALS(splitter2->nthTime(1), Types::Core::DateAndTime(20200000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(1), + Types::Core::DateAndTime(20200000000)); TS_ASSERT_EQUALS(splitter2->nthValue(1), 1); - TS_ASSERT_EQUALS(splitter2->nthTime(2), Types::Core::DateAndTime(20265000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(2), + Types::Core::DateAndTime(20265000000)); TS_ASSERT_EQUALS(splitter2->nthValue(2), 0); - TS_ASSERT_EQUALS(splitter2->nthTime(3), Types::Core::DateAndTime(20300000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(3), + Types::Core::DateAndTime(20300000000)); TS_ASSERT_EQUALS(splitter2->nthValue(3), 1); - TS_ASSERT_EQUALS(splitter2->nthTime(4), Types::Core::DateAndTime(20365000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(4), + Types::Core::DateAndTime(20365000000)); TS_ASSERT_EQUALS(splitter2->nthValue(4), 0); - TS_ASSERT_EQUALS(splitter2->nthTime(5), Types::Core::DateAndTime(20400000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(5), + Types::Core::DateAndTime(20400000000)); TS_ASSERT_EQUALS(splitter2->nthValue(5), 1); - TS_ASSERT_EQUALS(splitter2->nthTime(6), Types::Core::DateAndTime(20465000000)); + TS_ASSERT_EQUALS(splitter2->nthTime(6), + Types::Core::DateAndTime(20465000000)); TS_ASSERT_EQUALS(splitter2->nthValue(6), 0); // Clean up @@ -680,7 +692,8 @@ public: filteredws0->run().getProperty("splitter")); TS_ASSERT(splitter0); TS_ASSERT_EQUALS(splitter0->size(), 2); - TS_ASSERT_EQUALS(splitter0->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter0->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter0->nthValue(0), 1); TS_ASSERT_EQUALS( splitter0->nthTime(1).totalNanoseconds(), @@ -703,7 +716,8 @@ public: TS_ASSERT(splitter1); TS_ASSERT_EQUALS(splitter1->size(), 3); - TS_ASSERT_EQUALS(splitter1->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter1->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter1->nthValue(0), 0); TS_ASSERT_EQUALS( @@ -711,10 +725,10 @@ public: Types::Core::DateAndTime(static_cast<int>(3.5e+07)).totalNanoseconds() + runstart_i64); TS_ASSERT_EQUALS(splitter1->nthValue(1), 1); - TS_ASSERT_EQUALS( - splitter1->nthTime(2).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(1.95e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter1->nthTime(2).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(1.95e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter1->nthValue(2), 0); // Workspace 2 @@ -734,18 +748,19 @@ public: TS_ASSERT(splitter2); TS_ASSERT_EQUALS(splitter2->size(), 7); - TS_ASSERT_EQUALS(splitter2->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter2->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter2->nthValue(0), 0); - TS_ASSERT_EQUALS( - splitter2->nthTime(1).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(1.95e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter2->nthTime(1).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(1.95e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter2->nthValue(1), 1); - TS_ASSERT_EQUALS( - splitter2->nthTime(2).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(2.65e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter2->nthTime(2).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(2.65e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter2->nthValue(2), 0); // Check spectrum 3 of workspace 2 @@ -873,7 +888,8 @@ public: filteredws0->run().getProperty("splitter")); TS_ASSERT(splitter0); TS_ASSERT_EQUALS(splitter0->size(), 2); - TS_ASSERT_EQUALS(splitter0->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter0->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter0->nthValue(0), 1); TS_ASSERT_EQUALS( splitter0->nthTime(1).totalNanoseconds(), @@ -896,7 +912,8 @@ public: TS_ASSERT(splitter1); TS_ASSERT_EQUALS(splitter1->size(), 3); - TS_ASSERT_EQUALS(splitter1->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter1->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter1->nthValue(0), 0); TS_ASSERT_EQUALS( @@ -904,10 +921,10 @@ public: Types::Core::DateAndTime(static_cast<int>(3.5e+07)).totalNanoseconds() + runstart_i64); TS_ASSERT_EQUALS(splitter1->nthValue(1), 1); - TS_ASSERT_EQUALS( - splitter1->nthTime(2).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(1.95e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter1->nthTime(2).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(1.95e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter1->nthValue(2), 0); // Workspace 2 @@ -925,18 +942,19 @@ public: TS_ASSERT(splitter2); TS_ASSERT_EQUALS(splitter2->size(), 7); - TS_ASSERT_EQUALS(splitter2->nthTime(0), Types::Core::DateAndTime(runstart_i64)); + TS_ASSERT_EQUALS(splitter2->nthTime(0), + Types::Core::DateAndTime(runstart_i64)); TS_ASSERT_EQUALS(splitter2->nthValue(0), 0); - TS_ASSERT_EQUALS( - splitter2->nthTime(1).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(1.95e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter2->nthTime(1).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(1.95e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter2->nthValue(1), 1); - TS_ASSERT_EQUALS( - splitter2->nthTime(2).totalNanoseconds(), - Types::Core::DateAndTime(static_cast<int>(2.65e+08)).totalNanoseconds() + - runstart_i64); + TS_ASSERT_EQUALS(splitter2->nthTime(2).totalNanoseconds(), + Types::Core::DateAndTime(static_cast<int>(2.65e+08)) + .totalNanoseconds() + + runstart_i64); TS_ASSERT_EQUALS(splitter2->nthValue(2), 0); // Check spectrum 3 of workspace 2 diff --git a/Framework/Algorithms/test/GenerateEventsFilterTest.h b/Framework/Algorithms/test/GenerateEventsFilterTest.h index e3885f7b159..cf745b6caa7 100644 --- a/Framework/Algorithms/test/GenerateEventsFilterTest.h +++ b/Framework/Algorithms/test/GenerateEventsFilterTest.h @@ -1151,7 +1151,8 @@ public: if (vecY[i] >= -0.0) { // A valid time interval for Splitters Types::Core::DateAndTime tstart(static_cast<int64_t>(vecX[i] * 1.E9)); - Types::Core::DateAndTime tstop(static_cast<int64_t>(vecX[i + 1] * 1.E9)); + Types::Core::DateAndTime tstop( + static_cast<int64_t>(vecX[i + 1] * 1.E9)); int wsindex = static_cast<int>(vecY[i]); Kernel::SplittingInterval ti(tstart, tstop, wsindex); diff --git a/Framework/Beamline/src/DetectorInfo.cpp b/Framework/Beamline/src/DetectorInfo.cpp index 2a6f90f352b..b321392485c 100644 --- a/Framework/Beamline/src/DetectorInfo.cpp +++ b/Framework/Beamline/src/DetectorInfo.cpp @@ -180,7 +180,8 @@ void checkScanInterval(const std::pair<int64_t, int64_t> &interval) { /** Set the scan interval of the detector with given detector index. * * The interval start and end values would typically correspond to nanoseconds - * since 1990, as in Types::Core::DateAndTime. Note that it is currently not possible + * since 1990, as in Types::Core::DateAndTime. Note that it is currently not + *possible * to modify scan intervals for a DetectorInfo with time-dependent detectors, * i.e., time intervals must be set with this method before merging individual * scans. */ diff --git a/Framework/Crystal/src/SetGoniometer.cpp b/Framework/Crystal/src/SetGoniometer.cpp index 5b2acd46953..5b75f5cea30 100644 --- a/Framework/Crystal/src/SetGoniometer.cpp +++ b/Framework/Crystal/src/SetGoniometer.cpp @@ -88,7 +88,8 @@ void SetGoniometer::exec() { << "_FixedValue\n"; axisName = "GoniometerAxis" + Strings::toString(i) + "_FixedValue"; try { - Types::Core::DateAndTime now = Types::Core::DateAndTime::getCurrentTime(); + Types::Core::DateAndTime now = + Types::Core::DateAndTime::getCurrentTime(); auto tsp = new Kernel::TimeSeriesProperty<double>(axisName); tsp->addValue(now, angle); tsp->setUnits("degree"); diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h index 8c4a5605ea1..d1147342de6 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadEventNexus.h @@ -315,8 +315,8 @@ bool LoadEventNexus::runLoadInstrument(const std::string &nexusfilename, try { nxfile.openData("name"); instrument = nxfile.getStrData(); - alg->getLogger().debug() - << "Instrument name read from NeXus file is " << instrument << '\n'; + alg->getLogger().debug() << "Instrument name read from NeXus file is " + << instrument << '\n'; } catch (::NeXus::Exception &) { // Try to fall back to isis compatibility options nxfile.closeGroup(); diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h b/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h index e9e59f7e91f..e1a0c84ccb1 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadILLDiffraction.h @@ -104,11 +104,11 @@ private: size_t m_numberScanPoints; ///< number of scan points size_t m_resolutionMode; ///< resolution mode; 1:low, 2:nominal, 3:high - std::string m_instName; ///< instrument name to load the IDF - std::set<std::string> m_instNames; ///< supported instruments - std::string m_fileName; ///< file name to load - Types::Core::DateAndTime m_startTime; ///< start time of acquisition - ScanType m_scanType; ///< NoScan, DetectorScan or OtherScan + std::string m_instName; ///< instrument name to load the IDF + std::set<std::string> m_instNames; ///< supported instruments + std::string m_fileName; ///< file name to load + Types::Core::DateAndTime m_startTime; ///< start time of acquisition + ScanType m_scanType; ///< NoScan, DetectorScan or OtherScan std::vector<ScannedVariables> m_scanVar; ///< holds the scan info LoadHelper m_loadHelper; ///< a helper for metadata diff --git a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp index 30af1f28778..1ee59ace516 100644 --- a/Framework/DataHandling/src/CreateSimulationWorkspace.cpp +++ b/Framework/DataHandling/src/CreateSimulationWorkspace.cpp @@ -50,7 +50,8 @@ StartAndEndTime getStartAndEndTimesFromRawFile(std::string filename) { } StartAndEndTime getStartAndEndTimesFromNexusFile( - std::string filename, const Mantid::Types::Core::DateAndTime &startTimeDefault, + std::string filename, + const Mantid::Types::Core::DateAndTime &startTimeDefault, const Mantid::Types::Core::DateAndTime &endTimeDefault) { StartAndEndTime startAndEndTime; try { diff --git a/Framework/DataHandling/src/LoadNexusLogs.cpp b/Framework/DataHandling/src/LoadNexusLogs.cpp index adc40f53f1b..59ea90b9108 100644 --- a/Framework/DataHandling/src/LoadNexusLogs.cpp +++ b/Framework/DataHandling/src/LoadNexusLogs.cpp @@ -286,7 +286,8 @@ void LoadNexusLogs::exec() { std::vector<Mantid::Types::Core::DateAndTime> ptime; pval.reserve(event_frame_number.size()); ptime.reserve(event_frame_number.size()); - std::vector<Mantid::Types::Core::DateAndTime> plogt = plog->timesAsVector(); + std::vector<Mantid::Types::Core::DateAndTime> plogt = + plog->timesAsVector(); std::vector<double> plogv = plog->valuesAsVector(); for (auto number : event_frame_number) { ptime.push_back(plogt[number]); diff --git a/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp b/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp index f978cd534d4..3c75c15496f 100644 --- a/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp +++ b/Framework/DataHandling/src/StartAndEndTimeFromNexusFileExtractor.cpp @@ -19,7 +19,7 @@ enum class NexusType { Muon, Processed, ISIS, TofRaw }; enum class TimeType : unsigned char { StartTime, EndTime }; Mantid::Types::Core::DateAndTime handleMuonNexusFile(TimeType type, - std::string filename) { + std::string filename) { Mantid::NeXus::NXRoot root(filename); if (type == TimeType::StartTime) { return Mantid::Types::Core::DateAndTime(root.getString("run/start_time")); @@ -28,8 +28,8 @@ Mantid::Types::Core::DateAndTime handleMuonNexusFile(TimeType type, } } -Mantid::Types::Core::DateAndTime handleProcessedNexusFile(TimeType type, - std::string filename) { +Mantid::Types::Core::DateAndTime +handleProcessedNexusFile(TimeType type, std::string filename) { Mantid::NeXus::NXRoot root(filename); if (type == TimeType::StartTime) { return Mantid::Types::Core::DateAndTime( @@ -41,17 +41,19 @@ Mantid::Types::Core::DateAndTime handleProcessedNexusFile(TimeType type, } Mantid::Types::Core::DateAndTime handleISISNexusFile(TimeType type, - std::string filename) { + std::string filename) { Mantid::NeXus::NXRoot root(filename); if (type == TimeType::StartTime) { - return Mantid::Types::Core::DateAndTime(root.getString("raw_data_1/start_time")); + return Mantid::Types::Core::DateAndTime( + root.getString("raw_data_1/start_time")); } else { - return Mantid::Types::Core::DateAndTime(root.getString("raw_data_1/end_time")); + return Mantid::Types::Core::DateAndTime( + root.getString("raw_data_1/end_time")); } } Mantid::Types::Core::DateAndTime handleTofRawNexusFile(TimeType type, - std::string filename) { + std::string filename) { Mantid::NeXus::NXRoot root(filename); if (type == TimeType::StartTime) { return Mantid::Types::Core::DateAndTime(root.getString("entry/start_time")); @@ -105,7 +107,7 @@ NexusType whichNexusType(std::string filename) { } Mantid::Types::Core::DateAndTime extractDateAndTime(TimeType type, - std::string filename) { + std::string filename) { auto fullFileName = Mantid::API::FileFinder::Instance().getFullPath(filename); // Figure out the type of the Nexus file. We need to handle them individually // since they store the datetime differently diff --git a/Framework/DataHandling/test/LoadNexusLogsTest.h b/Framework/DataHandling/test/LoadNexusLogsTest.h index 7a6b6b2dd11..37d8c71ade9 100644 --- a/Framework/DataHandling/test/LoadNexusLogsTest.h +++ b/Framework/DataHandling/test/LoadNexusLogsTest.h @@ -64,9 +64,9 @@ public: TS_ASSERT_DELTA(tsp->nthValue(1), 13715.55, 2); // The time diff between the 0th and 1st entry is 0.328 seconds - TS_ASSERT_DELTA( - Types::Core::DateAndTime::secondsFromDuration(tsp->nthInterval(0).length()), - 0.328, 0.01); + TS_ASSERT_DELTA(Types::Core::DateAndTime::secondsFromDuration( + tsp->nthInterval(0).length()), + 0.328, 0.01); // Now the stats } diff --git a/Framework/DataHandling/test/MergeLogsTest.h b/Framework/DataHandling/test/MergeLogsTest.h index 1fdb7c3f48b..042424d5edd 100644 --- a/Framework/DataHandling/test/MergeLogsTest.h +++ b/Framework/DataHandling/test/MergeLogsTest.h @@ -94,7 +94,8 @@ public: TS_ASSERT_EQUALS(mergprop->size(), p1->size() + p2->size()); - std::vector<Types::Core::DateAndTime> mergedtimes = mergprop->timesAsVector(); + std::vector<Types::Core::DateAndTime> mergedtimes = + mergprop->timesAsVector(); for (size_t i = 0; i < 2 * num1; i++) { Types::Core::DateAndTime logtime = mergedtimes[i]; double logvalue = mergprop->getSingleValue(logtime); diff --git a/Framework/DataObjects/inc/MantidDataObjects/ScanningWorkspaceBuilder.h b/Framework/DataObjects/inc/MantidDataObjects/ScanningWorkspaceBuilder.h index 01823a0ba14..ef72731cfcb 100644 --- a/Framework/DataObjects/inc/MantidDataObjects/ScanningWorkspaceBuilder.h +++ b/Framework/DataObjects/inc/MantidDataObjects/ScanningWorkspaceBuilder.h @@ -63,9 +63,9 @@ public: void setHistogram(HistogramData::Histogram histogram); - void - setTimeRanges(std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> - timeRanges); + void setTimeRanges( + std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> + timeRanges); void setTimeRanges(const Types::Core::DateAndTime &startTime, const std::vector<double> &durations); void setPositions(std::vector<std::vector<Kernel::V3D>> positions); @@ -87,7 +87,8 @@ private: HistogramData::Histogram m_histogram; - std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> m_timeRanges; + std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> + m_timeRanges; std::vector<std::vector<Kernel::V3D>> m_positions; std::vector<std::vector<Kernel::Quat>> m_rotations; diff --git a/Framework/DataObjects/src/EventList.cpp b/Framework/DataObjects/src/EventList.cpp index 98eb60ffa88..917b57063dc 100644 --- a/Framework/DataObjects/src/EventList.cpp +++ b/Framework/DataObjects/src/EventList.cpp @@ -2925,8 +2925,9 @@ DateAndTime EventList::getPulseTimeMax() const { return tMax; } -void EventList::getPulseTimeMinMax(Mantid::Types::Core::DateAndTime &tMin, - Mantid::Types::Core::DateAndTime &tMax) const { +void EventList::getPulseTimeMinMax( + Mantid::Types::Core::DateAndTime &tMin, + Mantid::Types::Core::DateAndTime &tMax) const { // set up as the minimum available date time. tMax = DateAndTime::minimum(); tMin = DateAndTime::maximum(); @@ -3622,8 +3623,8 @@ void EventList::filterByPulseTime(DateAndTime start, DateAndTime stop, } void EventList::filterByTimeAtSample(Types::Core::DateAndTime start, - Types::Core::DateAndTime stop, double tofFactor, - double tofOffset, + Types::Core::DateAndTime stop, + double tofFactor, double tofOffset, EventList &output) const { if (this == &output) { throw std::invalid_argument("In-place filtering is not allowed"); diff --git a/Framework/DataObjects/src/ScanningWorkspaceBuilder.cpp b/Framework/DataObjects/src/ScanningWorkspaceBuilder.cpp index 11bcd38ef2d..81ac04dc814 100644 --- a/Framework/DataObjects/src/ScanningWorkspaceBuilder.cpp +++ b/Framework/DataObjects/src/ScanningWorkspaceBuilder.cpp @@ -79,15 +79,17 @@ void ScanningWorkspaceBuilder::setTimeRanges( const std::vector<double> &durations) { verifyTimeIndexSize(durations.size(), "time durations"); - std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> timeRanges = - {std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>( - startTime, startTime + durations[0])}; + std::vector<std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>> + timeRanges = { + std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>( + startTime, startTime + durations[0])}; for (size_t i = 1; i < m_nTimeIndexes; ++i) { const auto newStartTime = timeRanges[i - 1].second; const auto endTime = newStartTime + durations[i]; - timeRanges.push_back(std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>( - newStartTime, endTime)); + timeRanges.push_back( + std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime>( + newStartTime, endTime)); } setTimeRanges(std::move(timeRanges)); diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfo.h b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfo.h index c96ea3e1aff..006bf2878dd 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfo.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/DetectorInfo.h @@ -121,11 +121,11 @@ public: size_t scanCount(const size_t index) const; std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> scanInterval(const std::pair<size_t, size_t> &index) const; - void setScanInterval( - const size_t index, - const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval); - void setScanInterval( - const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval); + void setScanInterval(const size_t index, + const std::pair<Types::Core::DateAndTime, + Types::Core::DateAndTime> &interval); + void setScanInterval(const std::pair<Types::Core::DateAndTime, + Types::Core::DateAndTime> &interval); void merge(const DetectorInfo &other); diff --git a/Framework/Geometry/src/Instrument/DetectorInfo.cpp b/Framework/Geometry/src/Instrument/DetectorInfo.cpp index 3e0ddec4d58..6c24ac4f7a6 100644 --- a/Framework/Geometry/src/Instrument/DetectorInfo.cpp +++ b/Framework/Geometry/src/Instrument/DetectorInfo.cpp @@ -334,13 +334,14 @@ DetectorInfo::scanInterval(const std::pair<size_t, size_t> &index) const { /** Set the scan interval of the detector with given detector index. * * The interval start and end values would typically correspond to nanoseconds - * since 1990, as in Types::Core::DateAndTime. Note that it is currently not possible + * since 1990, as in Types::Core::DateAndTime. Note that it is currently not + *possible * to modify scan intervals for a DetectorInfo with time-dependent detectors, * i.e., time intervals must be set with this method before merging individual * scans. */ void DetectorInfo::setScanInterval( - const size_t index, - const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval) { + const size_t index, const std::pair<Types::Core::DateAndTime, + Types::Core::DateAndTime> &interval) { m_detectorInfo->setScanInterval(index, {interval.first.totalNanoseconds(), interval.second.totalNanoseconds()}); } @@ -349,8 +350,8 @@ void DetectorInfo::setScanInterval( * * Prefer this over setting intervals for individual detectors since it enables * internal performance optimization. See also overload for other details. */ -void DetectorInfo::setScanInterval( - const std::pair<Types::Core::DateAndTime, Types::Core::DateAndTime> &interval) { +void DetectorInfo::setScanInterval(const std::pair< + Types::Core::DateAndTime, Types::Core::DateAndTime> &interval) { m_detectorInfo->setScanInterval( {interval.first.totalNanoseconds(), interval.second.totalNanoseconds()}); } diff --git a/Framework/ICat/src/CatalogKeepAlive.cpp b/Framework/ICat/src/CatalogKeepAlive.cpp index a5b169645fc..c5d74d0b5f7 100644 --- a/Framework/ICat/src/CatalogKeepAlive.cpp +++ b/Framework/ICat/src/CatalogKeepAlive.cpp @@ -22,7 +22,8 @@ void CatalogKeepAlive::exec() { if (timePeriod <= 0) throw std::runtime_error("TimePeriod must be greater than zero."); - Types::Core::DateAndTime lastTimeExecuted = Types::Core::DateAndTime::getCurrentTime(); + Types::Core::DateAndTime lastTimeExecuted = + Types::Core::DateAndTime::getCurrentTime(); // Keep going until cancelled while (true) { diff --git a/Framework/Kernel/src/ConfigService.cpp b/Framework/Kernel/src/ConfigService.cpp index 3515cf2ce93..bb50b064412 100644 --- a/Framework/Kernel/src/ConfigService.cpp +++ b/Framework/Kernel/src/ConfigService.cpp @@ -243,8 +243,7 @@ ConfigServiceImpl::ConfigServiceImpl() << " revision " << MantidVersion::revision() << '\n'; g_log.information() << "running on " << getComputerName() << " starting " << Types::Core::DateAndTime::getCurrentTime() - .toFormattedString("%Y-%m-%dT%H:%MZ") - << "\n"; + .toFormattedString("%Y-%m-%dT%H:%MZ") << "\n"; g_log.information() << "Properties file(s) loaded: " << propertiesFilesList << '\n'; #ifndef MPI_BUILD // There is no logging to file by default in MPI build diff --git a/Framework/Kernel/src/LogParser.cpp b/Framework/Kernel/src/LogParser.cpp index 7fddaf23f6c..70557fb7455 100644 --- a/Framework/Kernel/src/LogParser.cpp +++ b/Framework/Kernel/src/LogParser.cpp @@ -293,8 +293,8 @@ Kernel::TimeSeriesProperty<bool> *LogParser::createRunningLog() const { namespace { /// Define operator for checking for new-style icp events struct hasNewStyleCommands { - bool - operator()(const std::pair<Mantid::Types::Core::DateAndTime, std::string> &p) { + bool operator()( + const std::pair<Mantid::Types::Core::DateAndTime, std::string> &p) { return p.second.find(START_COLLECTION) != std::string::npos || p.second.find(STOP_COLLECTION) != std::string::npos; } diff --git a/Framework/Kernel/src/TimeSeriesProperty.cpp b/Framework/Kernel/src/TimeSeriesProperty.cpp index 7534e9346e7..2c7040864ed 100644 --- a/Framework/Kernel/src/TimeSeriesProperty.cpp +++ b/Framework/Kernel/src/TimeSeriesProperty.cpp @@ -258,8 +258,9 @@ void TimeSeriesProperty<TYPE>::setName(const std::string name) { *are kept. */ template <typename TYPE> -void TimeSeriesProperty<TYPE>::filterByTime(const Types::Core::DateAndTime &start, - const Types::Core::DateAndTime &stop) { +void TimeSeriesProperty<TYPE>::filterByTime( + const Types::Core::DateAndTime &start, + const Types::Core::DateAndTime &stop) { // 0. Sort sortIfNecessary(); @@ -1353,9 +1354,9 @@ template <typename TYPE> void TimeSeriesProperty<TYPE>::clearOutdated() { * Vector sizes must match. */ template <typename TYPE> -void TimeSeriesProperty<TYPE>::create(const Types::Core::DateAndTime &start_time, - const std::vector<double> &time_sec, - const std::vector<TYPE> &new_values) { +void TimeSeriesProperty<TYPE>::create( + const Types::Core::DateAndTime &start_time, + const std::vector<double> &time_sec, const std::vector<TYPE> &new_values) { if (time_sec.size() != new_values.size()) throw std::invalid_argument("TimeSeriesProperty::create: mismatched size " "for the time and values vectors."); diff --git a/Framework/Kernel/test/TimeSeriesPropertyTest.h b/Framework/Kernel/test/TimeSeriesPropertyTest.h index 9d5bf0578f4..2413226e2ce 100644 --- a/Framework/Kernel/test/TimeSeriesPropertyTest.h +++ b/Framework/Kernel/test/TimeSeriesPropertyTest.h @@ -1266,7 +1266,8 @@ public: std::vector<Mantid::Types::Core::DateAndTime> times1 = p->timesAsVector(); std::vector<double> values1 = p->valuesAsVector(); - std::vector<Mantid::Types::Core::DateAndTime> times2 = newp->timesAsVector(); + std::vector<Mantid::Types::Core::DateAndTime> times2 = + newp->timesAsVector(); std::vector<double> values2 = newp->valuesAsVector(); TS_ASSERT_EQUALS(times1, times2); @@ -1407,7 +1408,8 @@ public: TS_ASSERT_EQUALS(p->size(), p1->size()); if (p->size() == p1->size()) { std::vector<Mantid::Types::Core::DateAndTime> times0 = p->timesAsVector(); - std::vector<Mantid::Types::Core::DateAndTime> times1 = p1->timesAsVector(); + std::vector<Mantid::Types::Core::DateAndTime> times1 = + p1->timesAsVector(); for (size_t i = 0; i < static_cast<size_t>(p->size()); i++) { TS_ASSERT_EQUALS(times0[i], times1[i]); TS_ASSERT_DELTA(p->getSingleValue(times0[i]), @@ -1432,7 +1434,8 @@ public: TS_ASSERT_EQUALS(p->size(), p2->size()); if (p->size() == p2->size()) { std::vector<Mantid::Types::Core::DateAndTime> times0 = p->timesAsVector(); - std::vector<Mantid::Types::Core::DateAndTime> times1 = p2->timesAsVector(); + std::vector<Mantid::Types::Core::DateAndTime> times1 = + p2->timesAsVector(); for (size_t i = 0; i < static_cast<size_t>(p->size()); i++) { TS_ASSERT_EQUALS(times0[i], times1[i]); TS_ASSERT_DELTA(p->getSingleValue(times0[i]), @@ -1494,7 +1497,8 @@ public: TS_ASSERT_THROWS_NOTHING(p->addValue("2007-11-30T16:17:30", 4.00)); // 2. Get map - std::map<Mantid::Types::Core::DateAndTime, double> tmap = p->valueAsCorrectMap(); + std::map<Mantid::Types::Core::DateAndTime, double> tmap = + p->valueAsCorrectMap(); // 3. Check std::vector<Mantid::Types::Core::DateAndTime> times; diff --git a/Framework/LiveData/inc/MantidLiveData/FakeEventDataListener.h b/Framework/LiveData/inc/MantidLiveData/FakeEventDataListener.h index b8b3c82e5c6..7d6f192c7b5 100644 --- a/Framework/LiveData/inc/MantidLiveData/FakeEventDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/FakeEventDataListener.h @@ -46,7 +46,8 @@ public: bool buffersEvents() const override { return true; } bool connect(const Poco::Net::SocketAddress &address) override; - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; bool isConnected() override; diff --git a/Framework/LiveData/inc/MantidLiveData/FileEventDataListener.h b/Framework/LiveData/inc/MantidLiveData/FileEventDataListener.h index 838154bb48c..60122f9920c 100644 --- a/Framework/LiveData/inc/MantidLiveData/FileEventDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/FileEventDataListener.h @@ -52,7 +52,8 @@ public: bool buffersEvents() const override { return true; } bool connect(const Poco::Net::SocketAddress &address) override; - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; bool isConnected() override; diff --git a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h index 275bdb8dccf..acc637fc511 100644 --- a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISHistoDataListener.h @@ -59,7 +59,8 @@ public: bool buffersEvents() const override { return false; } bool connect(const Poco::Net::SocketAddress &address) override; - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; bool isConnected() override; diff --git a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISLiveEventDataListener.h b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISLiveEventDataListener.h index ce19feb2c09..64e5871e037 100644 --- a/Framework/LiveData/inc/MantidLiveData/ISIS/ISISLiveEventDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/ISIS/ISISLiveEventDataListener.h @@ -95,7 +95,8 @@ public: * The value of 'now' is zero for compatibility with the SNS * live stream. */ - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; /** Get the data that's been buffered since the last call to this method * (or since start() was called). diff --git a/Framework/LiveData/inc/MantidLiveData/Kafka/KafkaEventListener.h b/Framework/LiveData/inc/MantidLiveData/Kafka/KafkaEventListener.h index 012b34f813a..ef4cd6231ea 100644 --- a/Framework/LiveData/inc/MantidLiveData/Kafka/KafkaEventListener.h +++ b/Framework/LiveData/inc/MantidLiveData/Kafka/KafkaEventListener.h @@ -58,7 +58,8 @@ public: //---------------------------------------------------------------------- bool connect(const Poco::Net::SocketAddress &address) override; - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; //---------------------------------------------------------------------- diff --git a/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h b/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h index d3dc0d40e43..ea02545c233 100644 --- a/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/SNSLiveEventDataListener.h @@ -49,8 +49,8 @@ public: bool buffersEvents() const override { return true; } bool connect(const Poco::Net::SocketAddress &address) override; - void - start(const Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start(const Types::Core::DateAndTime startTime = + Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; ILiveListener::RunStatus runStatus() override; @@ -155,7 +155,7 @@ private: // If true, the thread exits Types::Core::DateAndTime m_startTime; // The requested start time for the data - // stream (needed by the run() function) + // stream (needed by the run() function) // Used to initialize the scan_index property if we haven't received a packet // with the 'real' value by the time we call initWorkspacePart2. (We can't diff --git a/Framework/LiveData/inc/MantidLiveData/TOPAZLiveEventDataListener.h b/Framework/LiveData/inc/MantidLiveData/TOPAZLiveEventDataListener.h index 6ead14320eb..a223102c609 100644 --- a/Framework/LiveData/inc/MantidLiveData/TOPAZLiveEventDataListener.h +++ b/Framework/LiveData/inc/MantidLiveData/TOPAZLiveEventDataListener.h @@ -49,7 +49,8 @@ public: bool buffersEvents() const override { return true; } bool connect(const Poco::Net::SocketAddress &address) override; - void start(Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; + void start( + Types::Core::DateAndTime startTime = Types::Core::DateAndTime()) override; boost::shared_ptr<API::Workspace> extractData() override; ILiveListener::RunStatus runStatus() override; diff --git a/Framework/LiveData/src/FakeEventDataListener.cpp b/Framework/LiveData/src/FakeEventDataListener.cpp index fc358890150..60d5d09b9be 100644 --- a/Framework/LiveData/src/FakeEventDataListener.cpp +++ b/Framework/LiveData/src/FakeEventDataListener.cpp @@ -62,7 +62,8 @@ ILiveListener::RunStatus FakeEventDataListener::runStatus() { int FakeEventDataListener::runNumber() const { return m_runNumber; } void FakeEventDataListener::start( - Types::Core::DateAndTime /*startTime*/) // Ignore the start time for now at least + Types::Core::DateAndTime /*startTime*/) // Ignore the start time for now at + // least { // Set up the workspace buffer (probably won't know its dimensions before this // point) @@ -73,7 +74,8 @@ void FakeEventDataListener::start( WorkspaceFactory::Instance().create("EventWorkspace", 2, 2, 1)); // Set a sample tof range m_rand->setRange(40000, 60000); - m_rand->setSeed(Types::Core::DateAndTime::getCurrentTime().totalNanoseconds()); + m_rand->setSeed( + Types::Core::DateAndTime::getCurrentTime().totalNanoseconds()); // If necessary, calculate the number of events we need to generate on each // call of generateEvents @@ -136,10 +138,10 @@ boost::shared_ptr<Workspace> FakeEventDataListener::extractData() { void FakeEventDataListener::generateEvents(Poco::Timer &) { std::lock_guard<std::mutex> _lock(m_mutex); for (long i = 0; i < m_callbackloop; ++i) { - m_buffer->getSpectrum(0).addEventQuickly( - Types::Event::TofEvent(m_rand->nextValue())); - m_buffer->getSpectrum(1).addEventQuickly( - Types::Event::TofEvent(m_rand->nextValue())); + m_buffer->getSpectrum(0) + .addEventQuickly(Types::Event::TofEvent(m_rand->nextValue())); + m_buffer->getSpectrum(1) + .addEventQuickly(Types::Event::TofEvent(m_rand->nextValue())); } } } // namespace LiveData diff --git a/Framework/LiveData/src/SNSLiveEventDataListener.cpp b/Framework/LiveData/src/SNSLiveEventDataListener.cpp index a3808f27f29..eaa5dbb3d1a 100644 --- a/Framework/LiveData/src/SNSLiveEventDataListener.cpp +++ b/Framework/LiveData/src/SNSLiveEventDataListener.cpp @@ -51,7 +51,8 @@ const std::string SCAN_PROPERTY("scan_index"); const std::string PROTON_CHARGE_PROPERTY("proton_charge"); // Helper function to get a DateAndTime value from an ADARA packet header -Mantid::Types::Core::DateAndTime timeFromPacket(const ADARA::PacketHeader &hdr) { +Mantid::Types::Core::DateAndTime +timeFromPacket(const ADARA::PacketHeader &hdr) { const uint32_t seconds = static_cast<uint32_t>(hdr.pulseId() >> 32); const uint32_t nanoseconds = hdr.pulseId() & 0xFFFFFFFF; diff --git a/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp b/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp index 09e9793276c..8de803f7b2e 100644 --- a/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp +++ b/Framework/LiveData/src/TOPAZLiveEventDataListener.cpp @@ -520,7 +520,8 @@ void TOPAZLiveEventDataListener::initMonitorWorkspace() { /// Adds an event to the workspace void TOPAZLiveEventDataListener::appendEvent( - uint32_t pixelId, double tof, const Mantid::Types::Core::DateAndTime pulseTime) + uint32_t pixelId, double tof, + const Mantid::Types::Core::DateAndTime pulseTime) // NOTE: This function does NOT lock the mutex! Make sure you do that // before calling this function! { diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h index 6997fa367ee..f435fb8a2c1 100644 --- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h +++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/ConvertSpiceDataToRealSpace.h @@ -76,7 +76,8 @@ private: /// Parse data table workspace to a vector of matrix workspaces std::vector<API::MatrixWorkspace_sptr> convertToMatrixWorkspace( DataObjects::TableWorkspace_sptr tablews, - API::MatrixWorkspace_const_sptr parentws, Types::Core::DateAndTime runstart, + API::MatrixWorkspace_const_sptr parentws, + Types::Core::DateAndTime runstart, std::map<std::string, std::vector<double>> &logvecmap, std::vector<Types::Core::DateAndTime> &vectimes); @@ -101,11 +102,13 @@ private: std::map<std::string, std::vector<double>> &logvecmap); /// Load one run (one pt.) to a matrix workspace - API::MatrixWorkspace_sptr loadRunToMatrixWS( - DataObjects::TableWorkspace_sptr tablews, size_t irow, - API::MatrixWorkspace_const_sptr parentws, Types::Core::DateAndTime runstart, - size_t ipt, size_t irotangle, size_t itime, - const std::vector<std::pair<size_t, size_t>> anodelist, double &duration); + API::MatrixWorkspace_sptr + loadRunToMatrixWS(DataObjects::TableWorkspace_sptr tablews, size_t irow, + API::MatrixWorkspace_const_sptr parentws, + Types::Core::DateAndTime runstart, size_t ipt, + size_t irotangle, size_t itime, + const std::vector<std::pair<size_t, size_t>> anodelist, + double &duration); /// Append Experiment Info void diff --git a/Framework/Types/inc/MantidTypes/Core/DateAndTime.h b/Framework/Types/inc/MantidTypes/Core/DateAndTime.h index c57446ca1d3..a2def997c30 100644 --- a/Framework/Types/inc/MantidTypes/Core/DateAndTime.h +++ b/Framework/Types/inc/MantidTypes/Core/DateAndTime.h @@ -153,4 +153,4 @@ private: } // namespace Types } // namespace Mantid -#endif //MANTID_TYPES_DATE_AND_TIME_H \ No newline at end of file +#endif // MANTID_TYPES_DATE_AND_TIME_H \ No newline at end of file diff --git a/Framework/Types/inc/MantidTypes/Event/TofEvent.h b/Framework/Types/inc/MantidTypes/Event/TofEvent.h index fc4bbe4da6b..aa27721e208 100644 --- a/Framework/Types/inc/MantidTypes/Event/TofEvent.h +++ b/Framework/Types/inc/MantidTypes/Event/TofEvent.h @@ -15,12 +15,12 @@ class LoadEventNexus; } namespace Types { namespace Event { - //========================================================================================== - /** Info about a single neutron detection event: - * - * - the time of flight of the neutron (can be converted to other units) - * - the absolute time of the pulse at which it was produced - */ +//========================================================================================== +/** Info about a single neutron detection event: +* +* - the time of flight of the neutron (can be converted to other units) +* - the absolute time of the pulse at which it was produced +*/ #pragma pack(push, 4) // Ensure the structure is no larger than it needs to class MANTID_TYPES_DLL TofEvent { @@ -99,9 +99,7 @@ inline double TofEvent::operator()() const { return m_tof; } inline double TofEvent::tof() const { return m_tof; } /// Return the pulse time -inline Core::DateAndTime TofEvent::pulseTime() const { - return m_pulsetime; -} +inline Core::DateAndTime TofEvent::pulseTime() const { return m_pulsetime; } /// Return the weight of the event - exactly 1.0 always inline double TofEvent::weight() const { return 1.0; } diff --git a/MantidPlot/src/Mantid/AlgorithmHistoryWindow.cpp b/MantidPlot/src/Mantid/AlgorithmHistoryWindow.cpp index 8f61f11ab68..25ed9a55d39 100644 --- a/MantidPlot/src/Mantid/AlgorithmHistoryWindow.cpp +++ b/MantidPlot/src/Mantid/AlgorithmHistoryWindow.cpp @@ -87,8 +87,9 @@ AlgExecSummaryGrpBox::~AlgExecSummaryGrpBox() { m_execDateTimeEdit = NULL; } } -void AlgExecSummaryGrpBox::setData(const double execDuration, - const Mantid::Types::Core::DateAndTime execDate) { +void AlgExecSummaryGrpBox::setData( + const double execDuration, + const Mantid::Types::Core::DateAndTime execDate) { QString dur(""); dur.setNum(execDuration, 'g', 6); dur += " seconds"; diff --git a/qt/scientific_interfaces/test/MuonAnalysisHelperTest.h b/qt/scientific_interfaces/test/MuonAnalysisHelperTest.h index 827781b78f9..f7e99e83f4d 100644 --- a/qt/scientific_interfaces/test/MuonAnalysisHelperTest.h +++ b/qt/scientific_interfaces/test/MuonAnalysisHelperTest.h @@ -732,9 +732,10 @@ private: } // Adds a time series log to the workspace - void addTimeSeriesLog(const Workspace_sptr &ws, const std::string &logName, - const std::vector<Mantid::Types::Core::DateAndTime> ×, - const std::vector<double> &values) { + void + addTimeSeriesLog(const Workspace_sptr &ws, const std::string &logName, + const std::vector<Mantid::Types::Core::DateAndTime> ×, + const std::vector<double> &values) { TS_ASSERT_EQUALS(times.size(), values.size()); auto matrixWS = boost::dynamic_pointer_cast<MatrixWorkspace>(ws); TS_ASSERT(matrixWS); -- GitLab