Skip to content
Snippets Groups Projects
Commit 83f5eed9 authored by Russell Taylor's avatar Russell Taylor
Browse files

LoadInstrumentFromRaw modified to clear any existing instrument instance from...

LoadInstrumentFromRaw modified to clear any existing instrument instance from the workspace before getting to work. Necessary since this algorithm is called when LoadInstrument fails, which can happen when a partial Instrument is loaded, leading to confusion. Re #703.
parent d0f824dc
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,10 @@ void LoadInstrumentFromRaw::exec()
g_log.error("Unable to open file " + m_filename);
throw Exception::FileError("Unable to open File:" , m_filename);
}
// Clear off any existing instrument for this workspace
localWorkspace->setInstrument(boost::shared_ptr<Instrument>(new Instrument));
// Get reference to Instrument and set its name
boost::shared_ptr<API::Instrument> instrument = localWorkspace->getBaseInstrument();
if (instrument.get() == 0)
......
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