playing around with adding data

This commit is contained in:
Jan Grewe 2018-09-12 17:44:35 +02:00
parent d61ced8498
commit cd2dfc1dac
2 changed files with 20 additions and 8 deletions

View File

@ -56,9 +56,21 @@ bool Chart::myWheelEvent(QGraphicsSceneWheelEvent *event) {
}
void Chart::XRangeChanged(qreal min, qreal max) {
std::cerr << "XRangeChanged" << min << "\t"<< max << std::endl;
if (series().at(0)->type() == QtCharts::QAbstractSeries::SeriesTypeLine) {
QLineSeries *s = static_cast<QLineSeries *>(series().at(0));
std::cerr << s->at(0).x() << "\t"<< s->at(s->count()-1).x() << std::endl;
std::cerr << "XRangeChanged" << min << "\t"<< max << std::endl;
if (series().at(0)->type() == QtCharts::QAbstractSeries::SeriesTypeLine) {
QLineSeries *s = static_cast<QLineSeries *>(series().at(0));
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);
}
}
}

View File

@ -25,11 +25,11 @@ MainWindow::MainWindow(QWidget *parent) :
DataLoader *loader = new DataLoader();
loader->moveToThread(&dataQueue);
dataQueue.start();
//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",
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::Block b = file.getBlock(0);
this->voltage = b.getDataArray("V-1");
this->eod = b.getDataArray("EOD");