playing around with adding data
This commit is contained in:
parent
d61ced8498
commit
cd2dfc1dac
20
chart.cpp
20
chart.cpp
@ -56,9 +56,21 @@ bool Chart::myWheelEvent(QGraphicsSceneWheelEvent *event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Chart::XRangeChanged(qreal min, qreal max) {
|
void Chart::XRangeChanged(qreal min, qreal max) {
|
||||||
std::cerr << "XRangeChanged" << min << "\t"<< max << std::endl;
|
std::cerr << "XRangeChanged" << min << "\t"<< max << std::endl;
|
||||||
if (series().at(0)->type() == QtCharts::QAbstractSeries::SeriesTypeLine) {
|
if (series().at(0)->type() == QtCharts::QAbstractSeries::SeriesTypeLine) {
|
||||||
QLineSeries *s = static_cast<QLineSeries *>(series().at(0));
|
QLineSeries *s = static_cast<QLineSeries *>(series().at(0));
|
||||||
std::cerr << s->at(0).x() << "\t"<< s->at(s->count()-1).x() << std::endl;
|
qreal xmax = s->at(s->count()-1).x();
|
||||||
|
if (max > s->at(s->count()-1).x()) {
|
||||||
|
QList<QPointF> buffer;
|
||||||
|
|
||||||
|
std::cerr << "new DATA!!!" << std::endl;
|
||||||
|
double si = s->at(1).x() - s->at(0).x();
|
||||||
|
qreal currentx = xmax;
|
||||||
|
buffer.reserve(1000);
|
||||||
|
for (int i = 0; i < 1000; ++i) {
|
||||||
|
buffer.push_back({xmax + i * si, 0.0});
|
||||||
|
}
|
||||||
|
s->append(buffer);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,11 +25,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
DataLoader *loader = new DataLoader();
|
DataLoader *loader = new DataLoader();
|
||||||
loader->moveToThread(&dataQueue);
|
loader->moveToThread(&dataQueue);
|
||||||
dataQueue.start();
|
dataQueue.start();
|
||||||
//file = nix::File::open("/home/grewe/zwischenlager/2017-08-17-af-invivo-1/2017-08-17-af-invivo-1.nix",
|
file = nix::File::open("/home/grewe/zwischenlager/2017-08-17-af-invivo-1/2017-08-17-af-invivo-1.nix",
|
||||||
// nix::FileMode::ReadOnly);
|
|
||||||
|
|
||||||
file = nix::File::open("/Users/jan/zwischenlager/threading_test/dataservice/data/2017-08-17-af-invivo-1.nix",
|
|
||||||
nix::FileMode::ReadOnly);
|
nix::FileMode::ReadOnly);
|
||||||
|
|
||||||
|
//file = nix::File::open("/Users/jan/zwischenlager/threading_test/dataservice/data/2017-08-17-af-invivo-1.nix",
|
||||||
|
//nix::FileMode::ReadOnly);
|
||||||
nix::Block b = file.getBlock(0);
|
nix::Block b = file.getBlock(0);
|
||||||
this->voltage = b.getDataArray("V-1");
|
this->voltage = b.getDataArray("V-1");
|
||||||
this->eod = b.getDataArray("EOD");
|
this->eod = b.getDataArray("EOD");
|
||||||
|
Loading…
Reference in New Issue
Block a user