diff --git a/databuffer.cpp b/databuffer.cpp new file mode 100644 index 0000000..280d924 --- /dev/null +++ b/databuffer.cpp @@ -0,0 +1,18 @@ +#include "databuffer.h" + +DataBuffer::DataBuffer(const nix::DataArray &array) : arrayId(array.id()), minRange(0.0), maxRange(0.0) +{ + buffer = new QVector; +} + +DataBuffer::~DataBuffer() { + delete buffer; +} + +double DataBuffer::rangeMaximum() { + return rangeMax; +} + +void DataBuffer::rangeMaximum(double max) { + rangeMax = max; +} diff --git a/databuffer.h b/databuffer.h new file mode 100644 index 0000000..7a14115 --- /dev/null +++ b/databuffer.h @@ -0,0 +1,26 @@ +#ifndef DATABUFFER_H +#define DATABUFFER_H + +#include + +class DataBuffer +{ +public: + DataBuffer(const nix::DataArray &array); + ~DataBuffer(); + +private: + std::string arrayId; + QVector *buffer; + double rangeMin, rangeMax; + + double rangeMaximum(); + void rangeMaximum(double max); + + double rangeMinimum(); + void rangeMinimum(double min); + + +}; + +#endif // DATABUFFER_H diff --git a/multichartview.cpp b/multichartview.cpp index 1da28db..d7197a8 100644 --- a/multichartview.cpp +++ b/multichartview.cpp @@ -101,13 +101,6 @@ ChartView* MultiChartView::createChartView(Chart *chart, const ArrayInfo &info) view->setLineWidth(1); view->setRenderHint(QPainter::Antialiasing); - /* - QMargins margins = voltageChart->margins(); - int marg1 = margins.left(); - margins.setLeft(marg1 * 4); - eodChart->setMargins(margins); - */ - this->viewMap.insert(std::pair(info.arrayid, view)); return view; } @@ -136,8 +129,7 @@ void MultiChartView::newDataRequest(const std::string &entity_id, qreal max) { void MultiChartView::dataReady(QString requestId){ // need to make sure, that only one task does the conversion on the same buffer at the same time. - std::cerr << "converting data for array: " << requestId.toStdString() << std::endl; - DataResult1D data = dataQueue->getData(requestId); + DataResult1D data = dataQueue->getData(requestId); if (data.id.empty()) { return; } @@ -145,7 +137,6 @@ void MultiChartView::dataReady(QString requestId){ } void MultiChartView::dataConverted(QString entityId, double ymin, double ymax) { - std::cerr << "data converted for: " << entityId.toStdString() << std::endl; Chart *chart = chartMap[entityId.toStdString()]; QLineSeries *series; bool newSeries = false;