From a7eda0876dc7ef38dd11b77cd4f5b6a1d40de0d3 Mon Sep 17 00:00:00 2001 From: Brendan Sullivan <sullivanbt@ornl.gov> Date: Thu, 13 Dec 2018 10:22:09 -0500 Subject: [PATCH] Re #0 allow separate input and output ws --- .../inc/MantidCrystal/SetCrystalLocation.h | 2 +- Framework/Crystal/src/SetCrystalLocation.cpp | 53 ++----------------- 2 files changed, 5 insertions(+), 50 deletions(-) diff --git a/Framework/Crystal/inc/MantidCrystal/SetCrystalLocation.h b/Framework/Crystal/inc/MantidCrystal/SetCrystalLocation.h index 805c681609c..1b445f28426 100644 --- a/Framework/Crystal/inc/MantidCrystal/SetCrystalLocation.h +++ b/Framework/Crystal/inc/MantidCrystal/SetCrystalLocation.h @@ -39,7 +39,7 @@ public: /// Summary of algorithms purpose const std::string summary() const override { return "This algorithm sets the sample location of the " - "input peaks workspace."; + "input event workspace."; } int version() const override { return 1; }; diff --git a/Framework/Crystal/src/SetCrystalLocation.cpp b/Framework/Crystal/src/SetCrystalLocation.cpp index 27c18fc4227..c1b42cadfaa 100644 --- a/Framework/Crystal/src/SetCrystalLocation.cpp +++ b/Framework/Crystal/src/SetCrystalLocation.cpp @@ -9,7 +9,7 @@ * SetCrystalLocation.cpp * * Created on: Dec 12, 2018 - * Author: Brendan + * Author: Brendan Sullivan */ #include "MantidCrystal/SetCrystalLocation.h" @@ -43,45 +43,6 @@ namespace Crystal { DECLARE_ALGORITHM(SetCrystalLocation) -class OrEnabledWhenProperties : public Kernel::IPropertySettings { -public: - OrEnabledWhenProperties(const std::string &prop1Name, - ePropertyCriterion prop1Crit, - const std::string &prop1Value, - const std::string &prop2Name, - ePropertyCriterion prop2Crit, - const std::string &prop2Value) - : IPropertySettings(), propName1(prop1Name), propName2(prop2Name), - Criteria1(prop1Crit), Criteria2(prop2Crit), value1(prop1Value), - value2(prop2Value) - - { - Prop1 = new Kernel::EnabledWhenProperty(propName1, Criteria1, value1); - Prop2 = new Kernel::EnabledWhenProperty(propName2, Criteria2, value2); - } - ~OrEnabledWhenProperties() override // responsible for deleting all supplied - // EnabledWhenProperites - { - delete Prop1; - delete Prop2; - } - - IPropertySettings *clone() const override { - return new OrEnabledWhenProperties(propName1, Criteria1, value1, propName2, - Criteria2, value2); - } - - bool isEnabled(const IPropertyManager *algo) const override { - return Prop1->isEnabled(algo) && Prop2->isEnabled(algo); - } - -private: - std::string propName1, propName2; - ePropertyCriterion Criteria1, Criteria2; - std::string value1, value2; - Kernel::EnabledWhenProperty *Prop1, *Prop2; -}; - void SetCrystalLocation::init() { declareProperty(make_unique<WorkspaceProperty<EventWorkspace>>( "EventWorkspace", "", Direction::Input), @@ -95,14 +56,8 @@ void SetCrystalLocation::init() { declareProperty("NewZ", 0.0, "New Absolute Z position of crystal."); } -/** - * Execute algorithm. Steps: - * a) Get property values - * b) Set up data for call to PeakHKLErrors fitting function - * c) execute and get results - * d) Convert results to output information - * - */ +// simple algorithm that changes the sample position of the input +// event workspace. void SetCrystalLocation::exec() { EventWorkspace_sptr events = getProperty("EventWorkspace"); EventWorkspace_sptr outEvents = getProperty("ModifiedEventWorkspace"); @@ -118,7 +73,7 @@ void SetCrystalLocation::exec() { CalibrationHelpers::adjustUpSampleAndSourcePositions( componentInfo.l1(), newSamplePos, componentInfo); - + setProperty("ModifiedEventWorkspace", outEvents); } // exec } // namespace Crystal -- GitLab