Skip to content
Snippets Groups Projects
Commit fd33bced authored by Ian Bush's avatar Ian Bush
Browse files

Refs #16928 Clang format

parent 04150ba0
No related branches found
No related tags found
No related merge requests found
...@@ -53,8 +53,7 @@ public: ...@@ -53,8 +53,7 @@ public:
bool isNumeric; bool isNumeric;
}; };
SampleLogsBehaviour(API::MatrixWorkspace &ws, SampleLogsBehaviour(API::MatrixWorkspace &ws, Kernel::Logger &logger,
Kernel::Logger &logger,
const std::string sampleLogsTimeSeries, const std::string sampleLogsTimeSeries,
const std::string sampleLogsList, const std::string sampleLogsList,
const std::string sampleLogsWarn, const std::string sampleLogsWarn,
...@@ -74,9 +73,8 @@ private: ...@@ -74,9 +73,8 @@ private:
typedef std::map<const std::string, SampleLogBehaviour> SampleLogsMap; typedef std::map<const std::string, SampleLogBehaviour> SampleLogsMap;
SampleLogsMap m_logMap; SampleLogsMap m_logMap;
void void createSampleLogsMapsFromInstrumentParams(SampleLogsMap &instrumentMap,
createSampleLogsMapsFromInstrumentParams(SampleLogsMap &instrumentMap, API::MatrixWorkspace &ws);
API::MatrixWorkspace &ws);
std::shared_ptr<Kernel::Property> std::shared_ptr<Kernel::Property>
addPropertyForTimeSeries(const std::string item, const double value, addPropertyForTimeSeries(const std::string item, const double value,
...@@ -84,12 +82,11 @@ private: ...@@ -84,12 +82,11 @@ private:
std::shared_ptr<Kernel::Property> std::shared_ptr<Kernel::Property>
addPropertyForList(const std::string item, const std::string value, addPropertyForList(const std::string item, const std::string value,
API::MatrixWorkspace &ws); API::MatrixWorkspace &ws);
bool setNumericValue(const std::string item, bool setNumericValue(const std::string item, const API::MatrixWorkspace &ws,
const API::MatrixWorkspace &ws, double &value); double &value);
void setSampleMap(SampleLogsMap &map, const MergeLogType &, void setSampleMap(SampleLogsMap &map, const MergeLogType &,
const std::string &params, const std::string &params, API::MatrixWorkspace &ws,
API::MatrixWorkspace &ws,
const std::string paramsTolerances = "", const std::string paramsTolerances = "",
bool skipIfInPrimaryMap = false); bool skipIfInPrimaryMap = false);
...@@ -115,10 +112,11 @@ private: ...@@ -115,10 +112,11 @@ private:
const double addeeWSNumber, const double outWSNumber, const double addeeWSNumber, const double outWSNumber,
const std::string name); const std::string name);
bool isWithinTolerance(const SampleLogBehaviour &behaviour, const double addeeWSNumber, const double outWSNumber); bool isWithinTolerance(const SampleLogBehaviour &behaviour,
bool stringPropertiesMatch(const SampleLogBehaviour &behaviour, const Kernel::Property *addeeWSProperty); const double addeeWSNumber, const double outWSNumber);
bool stringPropertiesMatch(const SampleLogBehaviour &behaviour,
}; const Kernel::Property *addeeWSProperty);
};
} // namespace Algorithms } // namespace Algorithms
} // namespace Mantid } // namespace Mantid
......
...@@ -58,11 +58,13 @@ const std::string SampleLogsBehaviour::LIST_SUFFIX = "_list"; ...@@ -58,11 +58,13 @@ const std::string SampleLogsBehaviour::LIST_SUFFIX = "_list";
* @return An instance of SampleLogsBehaviour initialised with the merge types * @return An instance of SampleLogsBehaviour initialised with the merge types
* from the IPF and parent algorithm * from the IPF and parent algorithm
*/ */
SampleLogsBehaviour::SampleLogsBehaviour( SampleLogsBehaviour::SampleLogsBehaviour(MatrixWorkspace &ws, Logger &logger,
MatrixWorkspace &ws, Logger &logger, std::string sampleLogsTimeSeries,
std::string sampleLogsTimeSeries, std::string sampleLogsList, std::string sampleLogsList,
std::string sampleLogsWarn, std::string sampleLogsWarnTolerances, std::string sampleLogsWarn,
std::string sampleLogsFail, std::string sampleLogsFailTolerances) std::string sampleLogsWarnTolerances,
std::string sampleLogsFail,
std::string sampleLogsFailTolerances)
: m_logger(logger) { : m_logger(logger) {
setSampleMap(m_logMap, MergeLogType::TimeSeries, sampleLogsTimeSeries, ws, setSampleMap(m_logMap, MergeLogType::TimeSeries, sampleLogsTimeSeries, ws,
""); "");
...@@ -242,8 +244,7 @@ std::vector<double> SampleLogsBehaviour::createTolerancesVector( ...@@ -242,8 +244,7 @@ std::vector<double> SampleLogsBehaviour::createTolerancesVector(
* @return a shared pointer to the added property * @return a shared pointer to the added property
*/ */
std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForTimeSeries( std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForTimeSeries(
const std::string item, const double value, const std::string item, const double value, MatrixWorkspace &ws) {
MatrixWorkspace &ws) {
std::shared_ptr<Property> returnProp; std::shared_ptr<Property> returnProp;
try { try {
...@@ -275,10 +276,8 @@ std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForTimeSeries( ...@@ -275,10 +276,8 @@ std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForTimeSeries(
* @param ws the first workspace in the merge * @param ws the first workspace in the merge
* @return a shared pointer to the added property * @return a shared pointer to the added property
*/ */
std::shared_ptr<Property> std::shared_ptr<Property> SampleLogsBehaviour::addPropertyForList(
SampleLogsBehaviour::addPropertyForList(const std::string item, const std::string item, const std::string value, MatrixWorkspace &ws) {
const std::string value,
MatrixWorkspace &ws) {
std::shared_ptr<Property> returnProp; std::shared_ptr<Property> returnProp;
try { try {
...@@ -324,9 +323,8 @@ bool SampleLogsBehaviour::setNumericValue(const std::string item, ...@@ -324,9 +323,8 @@ bool SampleLogsBehaviour::setNumericValue(const std::string item,
* @param addeeWS the workspace being merged * @param addeeWS the workspace being merged
* @param outWS the workspace the others are merged into * @param outWS the workspace the others are merged into
*/ */
void SampleLogsBehaviour::mergeSampleLogs( void SampleLogsBehaviour::mergeSampleLogs(MatrixWorkspace &addeeWS,
MatrixWorkspace &addeeWS, MatrixWorkspace &outWS) {
MatrixWorkspace &outWS) {
for (auto item : m_logMap) { for (auto item : m_logMap) {
Property *addeeWSProperty = addeeWS.getLog(item.first); Property *addeeWSProperty = addeeWS.getLog(item.first);
...@@ -373,9 +371,9 @@ void SampleLogsBehaviour::mergeSampleLogs( ...@@ -373,9 +371,9 @@ void SampleLogsBehaviour::mergeSampleLogs(
* @param outWS the workspace the others are merged into * @param outWS the workspace the others are merged into
* @param name the name of the property * @param name the name of the property
*/ */
void SampleLogsBehaviour::updateTimeSeriesProperty( void SampleLogsBehaviour::updateTimeSeriesProperty(MatrixWorkspace &addeeWS,
MatrixWorkspace &addeeWS, MatrixWorkspace &outWS, MatrixWorkspace &outWS,
const std::string name) { const std::string name) {
try { try {
// If this already exists we do not need to do anything, Time Series Logs // If this already exists we do not need to do anything, Time Series Logs
// are combined when adding workspaces. // are combined when adding workspaces.
...@@ -399,9 +397,10 @@ void SampleLogsBehaviour::updateTimeSeriesProperty( ...@@ -399,9 +397,10 @@ void SampleLogsBehaviour::updateTimeSeriesProperty(
* @param addeeWSProperty the relevant property in addeeWS * @param addeeWSProperty the relevant property in addeeWS
* @param name the name of the property * @param name the name of the property
*/ */
void SampleLogsBehaviour::updateListProperty( void SampleLogsBehaviour::updateListProperty(MatrixWorkspace &addeeWS,
MatrixWorkspace &addeeWS, MatrixWorkspace &outWS, MatrixWorkspace &outWS,
Property *addeeWSProperty, const std::string name) { Property *addeeWSProperty,
const std::string name) {
try { try {
// If this already exists we combine the two strings. // If this already exists we combine the two strings.
auto propertyAddeeWS = addeeWS.getLog(name + LIST_SUFFIX); auto propertyAddeeWS = addeeWS.getLog(name + LIST_SUFFIX);
...@@ -506,8 +505,7 @@ bool SampleLogsBehaviour::stringPropertiesMatch( ...@@ -506,8 +505,7 @@ bool SampleLogsBehaviour::stringPropertiesMatch(
* *
* @param ws the merged workspace * @param ws the merged workspace
*/ */
void SampleLogsBehaviour::setUpdatedSampleLogs( void SampleLogsBehaviour::setUpdatedSampleLogs(MatrixWorkspace &ws) {
MatrixWorkspace &ws) {
for (auto &item : m_logMap) { for (auto &item : m_logMap) {
std::string propertyToReset = item.first; std::string propertyToReset = item.first;
...@@ -519,7 +517,8 @@ void SampleLogsBehaviour::setUpdatedSampleLogs( ...@@ -519,7 +517,8 @@ void SampleLogsBehaviour::setUpdatedSampleLogs(
continue; continue;
} }
const Property *outWSProperty = ws.mutableRun().getProperty(propertyToReset); const Property *outWSProperty =
ws.mutableRun().getProperty(propertyToReset);
item.second.property = std::shared_ptr<Property>(outWSProperty->clone()); item.second.property = std::shared_ptr<Property>(outWSProperty->clone());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment