Skip to content

Commit

Permalink
Begin to write code to put params into workspace re #8398
Browse files Browse the repository at this point in the history
My original plan of putting the table into a POCO XML document
then putting that into the workspace like LoadParameters does
is not on, because LoadParameters does something dodgy, that
will sometime need fixing and should not be replicated.
So I'm forced to put the parameters in directly. This would lead
to better code, but I presently have no idea how to do it.

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Nov 27, 2013
1 parent 6043245 commit 21ce24e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Expand Up @@ -86,7 +86,7 @@ namespace DataHandling
DataObjects::TableWorkspace_sptr genInfoTableWorkspace(std::vector<int> banks);

/// Put parameters into a metrix workspace
void putParametersIntoWorkspace( const API::ITableWorkspace_sptr tws, API::MatrixWorkspace_sptr ws);
void putParametersIntoWorkspace( const API::ITableWorkspace_sptr &tws, API::MatrixWorkspace_sptr ws);

};

Expand Down
22 changes: 20 additions & 2 deletions Code/Mantid/Framework/DataHandling/src/LoadFullprofResolution.cpp
@@ -1,13 +1,16 @@
/*WIKI*
Load Fullprof resolution (.irf) file to TableWorkspace(s)
Load Fullprof resolution (.irf) file to TableWorkspace(s) and optionally into the instrument of a matrix workspace.
*WIKI*/
#include "MantidDataHandling/LoadFullprofResolution.h"
#include "MantidAPI/FileProperty.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidAPI/TableRow.h"
#include "MantidGeometry/Instrument.h"
#include "MantidAPI/InstrumentDataService.h"
#include "MantidGeometry/Instrument/InstrumentDefinitionParser.h"

#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string.hpp>
Expand All @@ -23,6 +26,11 @@ using namespace Mantid::DataObjects;
using namespace Mantid::Kernel;
using namespace std;

using Geometry::Instrument;
using Geometry::Instrument_sptr;
using Geometry::Instrument_const_sptr;
using Mantid::Geometry::InstrumentDefinitionParser;

namespace Mantid
{
namespace DataHandling
Expand Down Expand Up @@ -742,8 +750,18 @@ namespace DataHandling
return tablews;
}

void LoadFullprofResolution::putParametersIntoWorkspace( const API::ITableWorkspace_sptr tws, API::MatrixWorkspace_sptr ws)
void LoadFullprofResolution::putParametersIntoWorkspace( const API::ITableWorkspace_sptr &tws, API::MatrixWorkspace_sptr ws)
{
Instrument_const_sptr instrument = ws->getInstrument();
//Instrument_const_sptr baseInstrument = ws->getInstrument()->baseInstrument();

//InstrumentDefinitionParser loadInstr;
//loadInstr.setComponentLinks(instrument, pRootElem);

auto & pmap = ws->instrumentParameters();

//pmap.addString(instrument->getComponentID(), blah); // What do I do here?

}

} // namespace DataHandling
Expand Down

0 comments on commit 21ce24e

Please sign in to comment.