Commit 7b6c8bf3 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

unsetSources in multi reader

parent e678d76a
......@@ -117,7 +117,7 @@ void I0mapmon::applyWavelenX() {
w->setAutoDestroy(true);
w->setTarget(tgt);
w->execute(vals);
qDebug() << __PRETTY_FUNCTION__ << "*WOULD WRITE ON* target" << w->target() << "values" << vals;
qDebug() << __PRETTY_FUNCTION__ << "*WRITING ON* target" << w->target() << "values" << vals;
}
}
......
......@@ -44,6 +44,10 @@ I0MMonPlot::I0MMonPlot(QWidget *parent, CumbiaPool *cup, const CuControlsFactory
setYAxisAutoscaleEnabled(false);
}
I0MMonPlot::~I0MMonPlot() {
if(m_multiread_plu_i) m_multiread_plu_i->unsetSources();
}
bool I0MMonPlot::pluginLoaded() const {
return m_multiread_plu_i != nullptr;
}
......@@ -107,6 +111,7 @@ void I0MMonPlot::setYBoundsAuto(bool a) {
void I0MMonPlot::m_set_bounds(const QVector<double> &xv, const QVector<double> &yv)
{
qDebug() << __PRETTY_FUNCTION__ << "y" << m_ymin << m_ymax << "m_empty ? " << m_empty << yv;
if(m_ymin == m_ymax) { // auto scale Y
double ylb, yub;
const auto [ym, yM] = std::minmax_element(begin(yv), end(yv));
......@@ -129,6 +134,7 @@ void I0MMonPlot::m_set_bounds(const QVector<double> &xv, const QVector<double> &
setYLowerBound(ylb);
if(yub != yUpperBound())
setYUpperBound(yub);
qDebug() << __PRETTY_FUNCTION__ << "y" << ylb << "->" << yub << "ym, yM" << *ym << *yM;
}
const auto [xm, xM] = std::minmax_element(begin(xv), end(xv));
......@@ -152,6 +158,7 @@ void I0MMonPlot::m_set_bounds(const QVector<double> &xv, const QVector<double> &
setXLowerBound(xlb);
if(xub != xUpperBound())
setXUpperBound(xub);
qDebug() << __PRETTY_FUNCTION__ << "x" << xlb << "->" << xub << "xm, xM" << *xm << *xM << xv;
}
......@@ -163,6 +170,9 @@ void I0MMonPlot::onDataReady(const QList<CuData> &dl) {
QVector<double> yv, xv;
const CuData& xd = dl[0];
const CuData& yd = dl[1];
printf("\e[1;33mI0MMonPlot::onDataReady xd %s\e[0m\n", datos(xd));
printf("\e[0;33mI0MMonPlot::onDataReady yd %s\e[0m\n", datos(yd));
printf("\e[1;35mx %s , y %s\e[0m\n", vtoc2(xd, "value"), vtoc2(yd, "value"));
if(xd.has("data_format_str", "vector")) {
// average
......
......@@ -15,6 +15,7 @@ class I0MMonPlot : public QuPlotBase
Q_OBJECT
public:
explicit I0MMonPlot(QWidget *parent, CumbiaPool *cup, const CuControlsFactoryPool & fpoo);
~I0MMonPlot();
bool pluginLoaded() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment