diff --git a/Framework/DataHandling/src/LoadEventNexus.cpp b/Framework/DataHandling/src/LoadEventNexus.cpp index a6d3b0512de0e8dee5b51024f7f580f94eb9706b..330b3d6ae06cf9c6182b0c0406972653141f777e 100644 --- a/Framework/DataHandling/src/LoadEventNexus.cpp +++ b/Framework/DataHandling/src/LoadEventNexus.cpp @@ -1550,11 +1550,10 @@ boost::shared_ptr<BankPulseTimes> LoadEventNexus::runLoadNexusLogs( loadLogs->setPropertyValue("Filename", nexusfilename); loadLogs->setProperty<API::MatrixWorkspace_sptr>("Workspace", localWorkspace); - try{ - loadLogs->setPropertyValue("NXentryName",alg.getPropertyValue("NXentryName")); - } catch(...) - { - + try { + loadLogs->setPropertyValue("NXentryName", + alg.getPropertyValue("NXentryName")); + } catch (...) { } loadLogs->execute(); diff --git a/Framework/DataHandling/src/LoadNexusLogs.cpp b/Framework/DataHandling/src/LoadNexusLogs.cpp index c9cea8046bc67b3add5e639e33461f73e8998fe1..3e79c4ae0dc6ec4f4c7e853b9aa8e40c39ce205c 100644 --- a/Framework/DataHandling/src/LoadNexusLogs.cpp +++ b/Framework/DataHandling/src/LoadNexusLogs.cpp @@ -93,10 +93,9 @@ void LoadNexusLogs::init() { Direction::Input), "If true then existing logs will be overwritten, if false they will " "not."); - declareProperty( - make_unique<PropertyWithValue<std::string>>("NXentryName", "", - Direction::Input), - "Entry in the nexus file from which to read the logs"); + declareProperty(make_unique<PropertyWithValue<std::string>>("NXentryName", "", + Direction::Input), + "Entry in the nexus file from which to read the logs"); } /** Executes the algorithm. Reading in the file and creating and populating @@ -110,11 +109,11 @@ void LoadNexusLogs::exec() { std::string filename = getPropertyValue("Filename"); MatrixWorkspace_sptr workspace = getProperty("Workspace"); - std::string entry_name= getPropertyValue("NXentryName"); + std::string entry_name = getPropertyValue("NXentryName"); // Find the entry name to use (normally "entry" for SNS, "raw_data_1" for // ISIS) if entry name is empty - if(entry_name.empty()) { - entry_name = LoadTOFRawNexus::getEntryName(filename); + if (entry_name.empty()) { + entry_name = LoadTOFRawNexus::getEntryName(filename); } ::NeXus::File file(filename); // Find the root entry diff --git a/Framework/DataHandling/test/LoadNexusLogsTest.h b/Framework/DataHandling/test/LoadNexusLogsTest.h index e9918e292899b2188a684bf8bada8f4ba7028dc5..6d1eb923a585eaeb9b53c5e7e93e8088fdc7a76e 100644 --- a/Framework/DataHandling/test/LoadNexusLogsTest.h +++ b/Framework/DataHandling/test/LoadNexusLogsTest.h @@ -173,7 +173,7 @@ public: auto testWS = createTestWorkspace(); LoadNexusLogs loader; - //default entry Off-Off + // default entry Off-Off loader.setChild(true); loader.initialize(); loader.setProperty("Workspace", testWS); @@ -181,24 +181,26 @@ public: loader.execute(); auto run = testWS->run(); TimeSeriesProperty<double> *pclog = - dynamic_cast<TimeSeriesProperty<double> *>(run.getLogData("proton_charge")); + dynamic_cast<TimeSeriesProperty<double> *>( + run.getLogData("proton_charge")); TS_ASSERT(pclog); TS_ASSERT_EQUALS(pclog->size(), 23806); - TS_ASSERT(pclog->getStatistics().duration>4e9); + TS_ASSERT(pclog->getStatistics().duration > 4e9); - //3rd entry On-Off + // 3rd entry On-Off testWS = createTestWorkspace(); loader.setChild(true); loader.initialize(); loader.setProperty("Workspace", testWS); loader.setPropertyValue("Filename", "REF_M_9709_event.nxs"); - loader.setProperty("NXentryName","entry-On_Off"); + loader.setProperty("NXentryName", "entry-On_Off"); loader.execute(); run = testWS->run(); - pclog = dynamic_cast<TimeSeriesProperty<double> *>(run.getLogData("proton_charge")); + pclog = dynamic_cast<TimeSeriesProperty<double> *>( + run.getLogData("proton_charge")); TS_ASSERT(pclog); TS_ASSERT_EQUALS(pclog->size(), 24150); - TS_ASSERT(pclog->getStatistics().duration<3e9); + TS_ASSERT(pclog->getStatistics().duration < 3e9); } private: