Commit b608ed5d authored by LamarMoore's avatar LamarMoore Committed by Lamar Moore
Browse files

Updated codebase with new DateAndTime

parent c94f7774
......@@ -423,7 +423,7 @@ private:
bool executeAsyncImpl(const Poco::Void &i);
bool doCallProcessGroups(Mantid::Kernel::DateAndTime &start_time);
bool doCallProcessGroups(Mantid::Types::DateAndTime &start_time);
// Report that the algorithm has completed.
void reportCompleted(const double &duration,
......
......@@ -6,7 +6,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/PropertyHistory.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include <nexus/NeXusFile.hpp>
#include <boost/bind.hpp>
......@@ -74,19 +74,19 @@ class MANTID_API_DLL AlgorithmHistory {
public:
/// History container
/// The date-and-time will be stored as the Mantid::Kernel::DateAndTime type
/// The date-and-time will be stored as the Mantid::Types::DateAndTime type
explicit AlgorithmHistory(
const Algorithm *const alg,
const Kernel::DateAndTime &start = Kernel::DateAndTime::getCurrentTime(),
const Mantid::Types::DateAndTime &start = Mantid::Types::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 Kernel::DateAndTime &start = Kernel::DateAndTime::getCurrentTime(),
const Mantid::Types::DateAndTime &start = Mantid::Types::DateAndTime::getCurrentTime(),
const double &duration = -1.0, std::size_t uexeccount = 0);
void addExecutionInfo(const Kernel::DateAndTime &start,
void addExecutionInfo(const Mantid::Types::DateAndTime &start,
const double &duration);
void addProperty(const std::string &name, const std::string &value,
bool isdefault, const unsigned int &direction = 99);
......@@ -101,7 +101,7 @@ public:
/// get execution duration
double executionDuration() const { return m_executionDuration; }
/// get execution date
Mantid::Kernel::DateAndTime executionDate() const { return m_executionDate; }
Mantid::Types::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
......@@ -141,7 +141,7 @@ public:
void setExecCount(std::size_t execCount) { m_execCount = execCount; }
/// Set data on history after it is created
void fillAlgorithmHistory(const Algorithm *const alg,
const Kernel::DateAndTime &start,
const Mantid::Types::DateAndTime &start,
const double &duration, std::size_t uexeccount);
// Allow Algorithm::execute to change the exec count & duration after the
// algorithm was executed
......@@ -157,7 +157,7 @@ private:
/// The version of the algorithm
int m_version{-1};
/// The execution date of the algorithm
Mantid::Kernel::DateAndTime m_executionDate;
Mantid::Types::DateAndTime m_executionDate;
/// The execution duration of the algorithm
double m_executionDuration{-1.0};
/// The PropertyHistory's defined for the algorithm
......
......@@ -7,7 +7,7 @@
#include "MantidAPI/DllConfig.h"
#include "MantidAPI/HistoryItem.h"
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include <list>
#include <vector>
......@@ -53,9 +53,9 @@ public:
void unrollAll();
void roll(size_t index);
void rollAll();
void filterBetweenExecDate(Mantid::Kernel::DateAndTime start,
Mantid::Kernel::DateAndTime end =
Mantid::Kernel::DateAndTime::getCurrentTime());
void filterBetweenExecDate(Mantid::Types::DateAndTime start,
Mantid::Types::DateAndTime end =
Mantid::Types::DateAndTime::getCurrentTime());
/**
* Get the list of History Items for this view.
*
......
#ifndef MANTID_API_IEVENTLIST_H_
#define MANTID_API_IEVENTLIST_H_
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include "MantidAPI/MatrixWorkspace_fwd.h"
#include "MantidAPI/ISpectrum.h"
#include <functional>
......@@ -84,21 +84,21 @@ 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::Kernel::DateAndTime> getPulseTimes() const = 0;
virtual std::vector<Mantid::Types::DateAndTime> getPulseTimes() const = 0;
/// Get the minimum TOF from the list
virtual double getTofMin() const = 0;
/// Get the maximum TOF from the list
virtual double getTofMax() const = 0;
/// Get the minimum pulse time from the list
virtual Mantid::Kernel::DateAndTime getPulseTimeMin() const = 0;
virtual Mantid::Types::DateAndTime getPulseTimeMin() const = 0;
/// Get the maximum pulse time from the list
virtual Mantid::Kernel::DateAndTime getPulseTimeMax() const = 0;
virtual Mantid::Types::DateAndTime getPulseTimeMax() const = 0;
/// Get the maximum time at sample.
virtual Mantid::Kernel::DateAndTime
virtual Mantid::Types::DateAndTime
getTimeAtSampleMax(const double &tofFactor,
const double &tofOffset) const = 0;
/// Get the minimum time at sample
virtual Mantid::Kernel::DateAndTime
virtual Mantid::Types::DateAndTime
getTimeAtSampleMin(const double &tofFactor,
const double &tofOffset) const = 0;
/// Set the TOFs from the given list
......
......@@ -56,11 +56,11 @@ public:
virtual std::size_t getNumberEvents() const = 0;
virtual double getTofMin() const = 0;
virtual double getTofMax() const = 0;
virtual Mantid::Kernel::DateAndTime getPulseTimeMax() const = 0;
virtual Mantid::Kernel::DateAndTime getPulseTimeMin() const = 0;
virtual Mantid::Kernel::DateAndTime
virtual Mantid::Types::DateAndTime getPulseTimeMax() const = 0;
virtual Mantid::Types::DateAndTime getPulseTimeMin() const = 0;
virtual Mantid::Types::DateAndTime
getTimeAtSampleMax(double tofOffset = 0) const = 0;
virtual Mantid::Kernel::DateAndTime
virtual Mantid::Types::DateAndTime
getTimeAtSampleMin(double tofOffset = 0) const = 0;
virtual EventType getEventType() const = 0;
void generateHistogram(const std::size_t index, const MantidVec &X,
......
......@@ -6,7 +6,7 @@
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidGeometry/IDTypes.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include "MantidKernel/PropertyManager.h"
#include <Poco/Net/SocketAddress.h>
#include <string>
......@@ -78,7 +78,7 @@ 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(Kernel::DateAndTime startTime = Kernel::DateAndTime()) = 0;
virtual void start(Mantid::Types::DateAndTime startTime = Mantid::Types::DateAndTime()) = 0;
/** Get the data that's been buffered since the last call to this method
* (or since start() was called).
......
......@@ -2,7 +2,7 @@
#define MANTID_KERNEL_IREMOTEJOBMANAGER_H
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
namespace Mantid {
namespace API {
......@@ -91,13 +91,13 @@ public:
/// Date-time of submission. No particular format can be assumed
/// from the specific remote job managers, and some of them may
/// not provide this info
Mantid::Kernel::DateAndTime submitDate;
Mantid::Types::DateAndTime submitDate;
/// Date-time the job actually started running. No particular
/// format can be assumed
Mantid::Kernel::DateAndTime startDate;
Mantid::Types::DateAndTime startDate;
/// Date-time the job finished. No particular format can be
/// assumed
Mantid::Kernel::DateAndTime completionTime;
Mantid::Types::DateAndTime completionTime;
/// Command line for this job (when running a command ideally this
/// would be provided by the underlying job scheduling
/// mechanism). As examples, Platform LSF provides this. For the
......
......@@ -2,9 +2,9 @@
#define MANTID_API_LOGMANAGER_H_
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/make_unique.h"
#include "MantidKernel/PropertyWithValue.h"
#include "MantidKernel/Statistics.h"
#include "MantidKernel/make_unique.h"
#include <memory>
#include <vector>
......@@ -13,14 +13,16 @@ class File;
}
namespace Mantid {
namespace Types {
class DateAndTime;
}
namespace Kernel {
template <class KEYTYPE, class VALUETYPE> class Cache;
template <typename TYPE> class TimeSeriesProperty;
class SplittingInterval;
typedef std::vector<SplittingInterval> TimeSplitterType;
class DateAndTime;
class PropertyManager;
}
} // namespace Kernel
namespace API {
......@@ -63,17 +65,17 @@ public:
//-------------------------------------------------------------
/// Set the run start and end
void setStartAndEndTime(const Kernel::DateAndTime &start,
const Kernel::DateAndTime &end);
void setStartAndEndTime(const Mantid::Types::DateAndTime &start,
const Mantid::Types::DateAndTime &end);
/// Return the run start time
const Kernel::DateAndTime startTime() const;
const Mantid::Types::DateAndTime startTime() const;
/// Return the run end time
const Kernel::DateAndTime endTime() const;
const Mantid::Types::DateAndTime endTime() const;
//-------------------------------------------------------------
/// Filter the logs by time
virtual void filterByTime(const Kernel::DateAndTime start,
const Kernel::DateAndTime stop);
virtual void filterByTime(const Mantid::Types::DateAndTime start,
const Mantid::Types::DateAndTime stop);
/// Split the logs based on the given intervals
virtual void splitByTime(Kernel::TimeSplitterType &splitter,
std::vector<LogManager *> outputs) const;
......@@ -241,7 +243,7 @@ void LogManager::addProperty(const std::string &name, const TYPE &value,
newProp->setUnits(units);
addProperty(std::move(newProp), overwrite);
}
}
}
} // namespace API
} // namespace Mantid
#endif // MANTID_API_LOGMANAGER_H_
......@@ -17,7 +17,7 @@ namespace Indexing {
class IndexInfo;
}
namespace Kernel {
namespace Types {
class DateAndTime;
}
......@@ -153,8 +153,8 @@ public:
/// Gets MatrixWorkspace title (same as Run object run_title property)
const std::string getTitle() const override;
virtual Kernel::DateAndTime getFirstPulseTime() const;
Kernel::DateAndTime getLastPulseTime() const;
virtual Mantid::Types::DateAndTime getFirstPulseTime() const;
Mantid::Types::DateAndTime getLastPulseTime() const;
/// Returns the bin index for a given X value of a given workspace index
size_t binIndexOf(const double xValue, const std::size_t = 0) const;
......
......@@ -9,7 +9,7 @@
#include "MantidKernel/Exception.h"
#include "MantidKernel/V3D.h"
#include "MantidKernel/Quat.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidGeometry/IComponent.h"
#include "MantidGeometry/IDetector.h"
......
......@@ -65,8 +65,8 @@ public:
Run &operator+=(const Run &rhs);
/// Filter the logs by time
void filterByTime(const Kernel::DateAndTime start,
const Kernel::DateAndTime stop) override;
void filterByTime(const Mantid::Types::DateAndTime start,
const Mantid::Types::DateAndTime stop) override;
/// Split the logs based on the given intervals
void splitByTime(Kernel::TimeSplitterType &splitter,
std::vector<LogManager *> outputs) const override;
......
......@@ -4,7 +4,7 @@
#include <string>
#include <vector>
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include "MantidAPI/DllConfig.h"
#include <vector>
......@@ -16,7 +16,7 @@ struct ScriptInfo {
/// Identification of the author of the script.
std::string author;
/// Time of the last update of this file (remotelly)
Kernel::DateAndTime pub_date;
Mantid::Types::DateAndTime pub_date;
/// Marked for auto update
bool auto_update;
/// Directory Flag to indicate if the entry is a directory.
......
......@@ -9,7 +9,7 @@
#include "MantidAPI/WorkspaceHistory.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidTypes/DateAndTime.h"
#include "MantidKernel/EmptyValues.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/Strings.h"
......@@ -437,7 +437,7 @@ bool Algorithm::execute() {
}
notificationCenter().postNotification(new StartedNotification(this));
Mantid::Kernel::DateAndTime startTime;
Mantid::Types::DateAndTime startTime;
// Return a failure if the algorithm hasn't been initialized
if (!isInitialized()) {
......@@ -549,7 +549,7 @@ bool Algorithm::execute() {
m_running = true;
}
startTime = Mantid::Kernel::DateAndTime::getCurrentTime();
startTime = Mantid::Types::DateAndTime::getCurrentTime();
// Start a timer
Timer timer;
// Call the concrete algorithm's exec method
......@@ -1205,13 +1205,13 @@ bool Algorithm::checkGroups() {
*
* @return whether processGroups succeeds.
*/
bool Algorithm::doCallProcessGroups(Mantid::Kernel::DateAndTime &startTime) {
bool Algorithm::doCallProcessGroups(Mantid::Types::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,
// CheckWorkspacesMatch, RenameWorkspace)
startTime = Mantid::Kernel::DateAndTime::getCurrentTime();
startTime = Mantid::Types::DateAndTime::getCurrentTime();
// Start a timer
Timer timer;
......
......@@ -9,7 +9,7 @@ namespace Mantid {
namespace API {
using Kernel::Property;
using Kernel::DateAndTime;
using Mantid::Types::DateAndTime;
using Kernel::PropertyHistory;
using Kernel::PropertyHistory_sptr;
using Kernel::PropertyHistory_const_sptr;
......@@ -24,7 +24,7 @@ using Kernel::PropertyHistories;
* @param uexeccount :: an unsigned int for algorithm execution order
*/
AlgorithmHistory::AlgorithmHistory(const Algorithm *const alg,
const Kernel::DateAndTime &start,
const Mantid::Types::DateAndTime &start,
const double &duration,
std::size_t uexeccount)
: m_name(alg->name()), m_version(alg->version()), m_executionDate(start),
......@@ -49,7 +49,7 @@ AlgorithmHistory::~AlgorithmHistory() = default;
@param uexeccount :: an unsigned int for algorithm execution order
*/
AlgorithmHistory::AlgorithmHistory(const std::string &name, int vers,
const Kernel::DateAndTime &start,
const Mantid::Types::DateAndTime &start,
const double &duration,
std::size_t uexeccount)
: m_name(name), m_version(vers), m_executionDate(start),
......@@ -83,7 +83,7 @@ void AlgorithmHistory::setProperties(const Algorithm *const alg) {
* @param uexeccount :: an unsigned int for algorithm execution order
*/
void AlgorithmHistory::fillAlgorithmHistory(const Algorithm *const alg,
const Kernel::DateAndTime &start,
const Mantid::Types::DateAndTime &start,
const double &duration,
std::size_t uexeccount) {
m_name = alg->name();
......
#include "MantidAPI/DeprecatedAlgorithm.h"
#include "MantidAPI/AlgorithmFactory.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/DateAndTimeHelpers.h"
#include "MantidKernel/DateAndTimeHelpers.h"
#include "MantidKernel/Logger.h"
#include <sstream>
......
......@@ -15,9 +15,9 @@
#include "MantidGeometry/Instrument/Detector.h"
#include "MantidGeometry/Instrument/DetectorInfo.h"
#include "MantidGeometry/Instrument/InstrumentDefinitionParser.h"
#include "MantidGeometry/Instrument/ParComponentFactory.h"
#include "MantidGeometry/Instrument/ParameterFactory.h"
#include "MantidGeometry/Instrument/ParameterMap.h"
#include "MantidGeometry/Instrument/ParComponentFactory.h"
#include "MantidGeometry/Instrument/RectangularDetector.h"
#include "MantidGeometry/Instrument/XMLInstrumentParameter.h"
......@@ -26,13 +26,13 @@
#include "MantidBeamline/SpectrumInfo.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/DateAndTime.h"
#include "MantidKernel/DateAndTimeHelpers.h"
#include "MantidKernel/EigenConversionHelpers.h"
#include "MantidKernel/InstrumentInfo.h"
#include "MantidKernel/IPropertyManager.h"
#include "MantidKernel/InstrumentInfo.h"
#include "MantidKernel/Property.h"
#include "MantidKernel/Strings.h"
#include "MantidKernel/StringTokenizer.h"
#include "MantidKernel/Strings.h"
#include "MantidKernel/make_unique.h"
#include "MantidTypes/SpectrumDefinition.h"
......@@ -53,6 +53,7 @@
using namespace Mantid::Geometry;
using namespace Mantid::Kernel;
using namespace Poco::XML;
using namespace Mantid::Types;
namespace Mantid {
......@@ -60,7 +61,7 @@ namespace API {
namespace {
/// static logger object
Kernel::Logger g_log("ExperimentInfo");
}
} // namespace
/** Constructor
*/
......@@ -181,11 +182,11 @@ void checkDetectorInfoSize(const Instrument &instr,
"DetectorInfo and number of detectors in "
"instrument");
}
}
} // namespace
/** Set the instrument
* @param instr :: Shared pointer to an instrument.
*/
* @param instr :: Shared pointer to an instrument.
*/
void ExperimentInfo::setInstrument(const Instrument_const_sptr &instr) {
m_spectrumInfoWrapper = nullptr;
if (instr->isParametrized()) {
......@@ -208,10 +209,10 @@ void ExperimentInfo::setInstrument(const Instrument_const_sptr &instr) {
}
/** Get a shared pointer to the parametrized instrument associated with this
*workspace
*
* @return The instrument class
*/
*workspace
*
* @return The instrument class
*/
Instrument_const_sptr ExperimentInfo::getInstrument() const {
populateIfNotLoaded();
checkDetectorInfoSize(*sptr_instrument, detectorInfo());
......@@ -220,24 +221,24 @@ Instrument_const_sptr ExperimentInfo::getInstrument() const {
}
/** Returns a new copy of the instrument parameters
* @return a (new) copy of the instruments parameter map
*/
* @return a (new) copy of the instruments parameter map
*/
Geometry::ParameterMap &ExperimentInfo::instrumentParameters() {
populateIfNotLoaded();
return *m_parmap;
}
/** Returns a const reference to the instrument parameters.
* @return a const reference to the instrument ParameterMap.
*/
* @return a const reference to the instrument ParameterMap.
*/
const Geometry::ParameterMap &ExperimentInfo::instrumentParameters() const {
populateIfNotLoaded();
return *m_parmap;
}
/** Returns a const reference to the instrument parameters.
* @return a const reference to the instrument ParameterMap.
*/
* @return a const reference to the instrument ParameterMap.
*/
const Geometry::ParameterMap &
ExperimentInfo::constInstrumentParameters() const {
populateIfNotLoaded();
......@@ -283,7 +284,7 @@ struct ParameterValue {
const Run &runData;
};
///@endcond
}
} // namespace
namespace {
bool isPositionParameter(const std::string &name) {
......@@ -350,14 +351,14 @@ void adjustPositionsFromScaleFactor(ComponentInfo &componentInfo,
applyRectangularDetectorScaleToComponentInfo(
componentInfo, component->getComponentID(), ScaleX, ScaleY);
}
}
} // namespace
/** Add parameters to the instrument parameter map that are defined in
* instrument
* definition file or parameter file, which may contain parameters that require
* logfile data to be available. Logs must be loaded before running this
* method.
*/
* instrument
* definition file or parameter file, which may contain parameters that
* require logfile data to be available. Logs must be loaded before running this
* method.
*/
void ExperimentInfo::populateInstrumentParameters() {
populateIfNotLoaded();
......@@ -591,8 +592,8 @@ ChopperModel &ExperimentInfo::chopperModel(const size_t index) const {
}
/** Get a constant reference to the Sample associated with this workspace.
* @return const reference to Sample object
*/
* @return const reference to Sample object
*/
const Sample &ExperimentInfo::sample() const {
populateIfNotLoaded();
std::lock_guard<std::recursive_mutex> lock(m_mutex);
......@@ -600,11 +601,11 @@ const Sample &ExperimentInfo::sample() const {
}
/** Get a reference to the Sample associated with this workspace.
* This non-const method will copy the sample if it is shared between
* more than one workspace, and the reference returned will be to the copy.
* Can ONLY be taken by reference!
* @return reference to sample object
*/
* This non-const method will copy the sample if it is shared between
* more than one workspace, and the reference returned will be to the copy.
* Can ONLY be taken by reference!
* @return reference to sample object
*/
Sample &ExperimentInfo::mutableSample() {
populateIfNotLoaded();
// Use a double-check for sharing so that we only
......@@ -622,8 +623,8 @@ Sample &ExperimentInfo::mutableSample() {
}
/** Get a constant reference to the Run object associated with this workspace.
* @return const reference to run object
*/
* @return const reference to run object
*/
const Run &ExperimentInfo::run() const {
populateIfNotLoaded();
std::lock_guard<std::recursive_mutex> lock(m_mutex);
......@@ -631,11 +632,11 @@ const Run &ExperimentInfo::run() const {
}
/** Get a reference to the Run object associated with this workspace.
* This non-const method will copy the Run object if it is shared between
* more than one workspace, and the reference returned will be to the copy.
* Can ONLY be taken by reference!
* @return reference to Run object
*/
* This non-const method will copy the Run object if it is shared between
* more than one workspace, and the reference returned will be to the copy.
* Can ONLY be taken by reference!
* @return reference to Run object
*/
Run &ExperimentInfo::mutableRun() {
populateIfNotLoaded();
// Use a double-check for sharing so that we only
......@@ -749,9 +750,8 @@ Kernel::DeltaEMode::Type ExperimentInfo::getEMode() const {
std::string emodeStr;
if (run().hasProperty(emodeTag)) {
emodeStr = run().getPropertyValueAsType<std::string>(emodeTag);
} else if (sptr_instrument &&
constInstrumentParameters().contains(sptr_instrument.get(),
emodeTag)) {
} else if (sptr_instrument && constInstrumentParameters().contains(
sptr_instrument.get(), emodeTag)) {
Geometry::Parameter_sptr param =
constInstrumentParameters().get(sptr_instrument.get(), emodeTag);
emodeStr = param->asString();
......@@ -865,11 +865,11 @@ class myContentHandler : public Poco::XML::ContentHandler {
};
/** Return from an IDF the values of the valid-from and valid-to attributes
*
* @param IDFfilename :: Full path of an IDF
* @param[out] outValidFrom :: Used to return valid-from date
* @param[out] outValidTo :: Used to return valid-to date
*/
*
* @param IDFfilename :: Full path of an IDF
* @param[out] outValidFrom :: Used to return valid-from date
* @param[out] outValidTo :: Used to return valid-to date
*/
void ExperimentInfo::getValidFromTo(const std::string &IDFfilename,
std::string &outValidFrom,
std::string &outValidTo) {
......@@ -890,13 +890,13 @@ void ExperimentInfo::getValidFromTo(const std::string &IDFfilename,
}