diff --git a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonStrategy.h b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonStrategy.h index 082b4edea014..b1541e89bd67 100644 --- a/Framework/DataHandling/inc/MantidDataHandling/LoadMuonStrategy.h +++ b/Framework/DataHandling/inc/MantidDataHandling/LoadMuonStrategy.h @@ -19,8 +19,7 @@ namespace DataHandling { class LoadMuonNexusV2NexusHelper; // Create time zero table -MANTID_DATAHANDLING_DLL DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, - const std::vector &timeZeros); +DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, const std::vector &timeZeros); class MANTID_DATAHANDLING_DLL LoadMuonStrategy { public: diff --git a/Framework/Muon/CMakeLists.txt b/Framework/Muon/CMakeLists.txt index 5bb74f06e793..b42f1aa68a14 100644 --- a/Framework/Muon/CMakeLists.txt +++ b/Framework/Muon/CMakeLists.txt @@ -112,7 +112,7 @@ set_property(TARGET Muon PROPERTY FOLDER "MantidFramework") target_link_libraries( Muon PUBLIC Mantid::API Mantid::Kernel Mantid::Geometry - PRIVATE Mantid::DataHandling Mantid::DataObjects Mantid::Indexing Mantid::Nexus + PRIVATE Mantid::DataObjects Mantid::Indexing Mantid::Nexus ) # Add the unit tests directory add_subdirectory(test) diff --git a/Framework/Muon/src/LoadMuonNexus1.cpp b/Framework/Muon/src/LoadMuonNexus1.cpp index ad3dea991302..02b2eecae5f5 100644 --- a/Framework/Muon/src/LoadMuonNexus1.cpp +++ b/Framework/Muon/src/LoadMuonNexus1.cpp @@ -16,8 +16,8 @@ #include "MantidAPI/TableRow.h" #include "MantidAPI/WorkspaceFactory.h" #include "MantidAPI/WorkspaceGroup.h" -#include "MantidDataHandling/ISISRunLogs.h" -#include "MantidDataHandling/LoadMuonStrategy.h" +// #include "MantidDataHandling/ISISRunLogs.h" +// #include "MantidDataHandling/LoadMuonStrategy.h" #include "MantidDataObjects/TableWorkspace.h" #include "MantidDataObjects/Workspace2D.h" #include "MantidGeometry/Instrument/Detector.h" @@ -46,6 +46,25 @@ #include #include +namespace { + +Mantid::DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, + const std::vector &timeZeros) { + Mantid::DataObjects::TableWorkspace_sptr timeZeroTable = + std::dynamic_pointer_cast( + Mantid::API::WorkspaceFactory::Instance().createTable("TableWorkspace")); + timeZeroTable->addColumn("double", "time zero"); + + for (size_t specNum = 0; specNum < numSpec; ++specNum) { + Mantid::API::TableRow row = timeZeroTable->appendRow(); + row << timeZeros[specNum]; + } + + return timeZeroTable; +} + +} // namespace + namespace Mantid::Algorithms { using namespace DataObjects; @@ -343,7 +362,7 @@ void LoadMuonNexus1::exec() { auto timeZeroList = std::vector(m_numberOfSpectra, getProperty("TimeZero")); setProperty("TimeZeroList", timeZeroList); if (!getPropertyValue("TimeZeroTable").empty()) - setProperty("TimeZeroTable", DataHandling::createTimeZeroTable(m_numberOfSpectra, timeZeroList)); + setProperty("TimeZeroTable", createTimeZeroTable(m_numberOfSpectra, timeZeroList)); } if (m_numberOfPeriods == 1) @@ -774,8 +793,8 @@ void LoadMuonNexus1::runLoadLog(const DataObjects::Workspace2D_sptr &localWorksp setProperty("MainFieldDirection", mainFieldDirection); run.addProperty("main_field_direction", mainFieldDirection); - DataHandling::ISISRunLogs runLogs(run); - runLogs.addStatusLog(run); + // DataHandling::ISISRunLogs runLogs(run); + // runLogs.addStatusLog(run); } /** @@ -784,14 +803,14 @@ void LoadMuonNexus1::runLoadLog(const DataObjects::Workspace2D_sptr &localWorksp * @param period A period for this workspace. */ void LoadMuonNexus1::addPeriodLog(const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period) { - auto &run = localWorkspace->mutableRun(); - DataHandling::ISISRunLogs runLogs(run); - if (period == 0) { - runLogs.addPeriodLogs(1, run); - } else { - run.removeLogData("period 1"); - runLogs.addPeriodLog(static_cast(period) + 1, run); - } + // auto &run = localWorkspace->mutableRun(); + // DataHandling::ISISRunLogs runLogs(run); + // if (period == 0) { + // runLogs.addPeriodLogs(1, run); + // } else { + // run.removeLogData("period 1"); + // runLogs.addPeriodLog(static_cast(period) + 1, run); + // } } void LoadMuonNexus1::addGoodFrames(const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period, int nperiods) {