Skip to content

Commit

Permalink
Re #12398 Display errors in ALC DataLoading step
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Jun 15, 2015
1 parent 4bba4a3 commit 47e4ad4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

#include <qwt_plot_curve.h>

namespace MantidQt
{
namespace MantidWidgets
{
class ErrorCurve;
}
}

namespace MantidQt
{
namespace CustomInterfaces
Expand Down Expand Up @@ -45,6 +53,7 @@ namespace CustomInterfaces
{
public:
ALCDataLoadingView(QWidget* widget);
~ALCDataLoadingView();

// -- IALCDataLoadingView interface ------------------------------------------------------------

Expand Down Expand Up @@ -86,6 +95,10 @@ namespace CustomInterfaces

/// Loaded data curve
QwtPlotCurve* m_dataCurve;

/// Loaded errors
MantidQt::MantidWidgets::ErrorCurve* m_dataErrorCurve;

};

} // namespace CustomInterfaces
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "MantidQtCustomInterfaces/Muon/ALCDataLoadingView.h"

#include "MantidQtAPI/HelpWindow.h"
#include "MantidQtMantidWidgets/ErrorCurve.h"

#include <QMessageBox>

Expand All @@ -11,9 +12,18 @@ namespace MantidQt
namespace CustomInterfaces
{
ALCDataLoadingView::ALCDataLoadingView(QWidget* widget)
: m_widget(widget), m_dataCurve(new QwtPlotCurve())
: m_widget(widget), m_dataCurve(new QwtPlotCurve()), m_dataErrorCurve(NULL)
{}

ALCDataLoadingView::~ALCDataLoadingView() {
m_dataCurve->detach();
delete m_dataCurve;
if (m_dataErrorCurve) {
m_dataErrorCurve->detach();
delete m_dataErrorCurve;
}
}

void ALCDataLoadingView::initialize()
{
m_ui.setupUi(m_widget);
Expand Down Expand Up @@ -138,7 +148,13 @@ namespace CustomInterfaces
m_dataCurve->setData(data);

// Set errors
// TODO
if (m_dataErrorCurve) {
m_dataErrorCurve->detach();
delete m_dataErrorCurve;
}
m_dataErrorCurve =
new MantidQt::MantidWidgets::ErrorCurve(m_dataCurve, errors);
m_dataErrorCurve->attach(m_ui.dataPlot);

m_ui.dataPlot->replot();
}
Expand Down

0 comments on commit 47e4ad4

Please sign in to comment.