Skip to content

Commit

Permalink
Re #12398 Update setDataCurve method to accept errors as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Jun 15, 2015
1 parent b6d4220 commit b4f74f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace CustomInterfaces
std::string calculationType() const;
boost::optional< std::pair<double,double> > timeRange() const;

void setDataCurve(const QwtData& data);
void setDataCurve(const QwtData &data, const std::vector<double> &errors);
void displayError(const std::string &error);
void setAvailableLogs(const std::vector<std::string> &logs);
void setAvailablePeriods(const std::vector<std::string> &periods);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ namespace CustomInterfaces

/// Updates the data curve
/// @param data :: New curve data to set
virtual void setDataCurve(const QwtData& data) = 0;
/// @param errors :: New curve errors to set
virtual void setDataCurve(const QwtData &data,
const std::vector<double> &errors) = 0;

/// Displays an error
/// @param error :: Error message to display
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ namespace CustomInterfaces

// Plot spectrum 0. It is either red period (if subtract is unchecked) or
// red - green (if subtract is checked)
m_view->setDataCurve(*(ALCHelper::curveDataFromWs(m_loadedData, 0)));
m_view->setDataCurve(*(ALCHelper::curveDataFromWs(m_loadedData, 0)),
ALCHelper::curveErrorsFromWs(m_loadedData, 0));

}
catch(std::exception& e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,15 @@ namespace CustomInterfaces
return boost::make_optional(range);
}

void ALCDataLoadingView::setDataCurve(const QwtData& data)
{
void ALCDataLoadingView::setDataCurve(const QwtData &data,
const std::vector<double> &errors) {

// Set data
m_dataCurve->setData(data);

// Set errors
// TODO

m_ui.dataPlot->replot();
}

Expand Down

0 comments on commit b4f74f6

Please sign in to comment.