Skip to content

Commit

Permalink
Complete the whole instrument parameters re #7617
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Sep 18, 2013
1 parent 99a5bb2 commit 5980698
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace DataHandling
void addALFBEparameter(const API::ITableWorkspace_sptr & tablews, Poco::XML::Document* mDoc, Poco::XML::Element* parent, const std::string paramName);

/// Get value for XML eq attribute for parameter
std::string ConvertFullprofToXML::getXMLEqValue( const API::ITableWorkspace_sptr & tablews, const std::string name, size_t bankNumber);
std::string ConvertFullprofToXML::getXMLEqValue( const API::ITableWorkspace_sptr & tablews, const std::string name, size_t columnIndex);

// Translate a parameter name from as it appears in the table workspace to its name in the XML file
std::string getXMLParameterName( const std::string name );
Expand Down
11 changes: 8 additions & 3 deletions Code/Mantid/Framework/DataHandling/src/ConvertFullprofToXML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ namespace DataHandling
instrumentElem->setAttribute("name","wholeInstrument");
rootElem->appendChild(instrumentElem);
addALFBEparameter( paramTable, mDoc, instrumentElem, "Alph0");
addALFBEparameter( paramTable, mDoc, instrumentElem, "Beta0");
addALFBEparameter( paramTable, mDoc, instrumentElem, "Alph1");
addALFBEparameter( paramTable, mDoc, instrumentElem, "Beta1");

// Add banks
if(paramTable->columnCount() < 2){
Expand Down Expand Up @@ -193,10 +196,12 @@ namespace DataHandling
* Get the value string to put in the XML eq attribute of the formula element of the paramenter element
* given the name of the parameter in the table workspace.
*/
std::string ConvertFullprofToXML::getXMLEqValue( const API::ITableWorkspace_sptr & tablews, const std::string name, size_t bankNumber)
std::string ConvertFullprofToXML::getXMLEqValue( const API::ITableWorkspace_sptr & tablews, const std::string name, size_t columnIndex)
{
//API::Column_const_sptr column = tablews->getColumn( bankNumber );
return "?"+name+std::to_string(bankNumber);
size_t paramNumber = m_rowNumbers[name];
API::Column_const_sptr column = tablews->getColumn( columnIndex );
double eqValue = column->cell<double>(paramNumber);
return std::to_string(eqValue);
}

/* This function fills in a list of the row numbers starting 0 of the parameters
Expand Down

0 comments on commit 5980698

Please sign in to comment.