--- a/mainwindow.cc Fri Jan 27 17:16:26 2012 +0100
+++ b/mainwindow.cc Fri Jan 27 17:21:51 2012 +0100
@@ -85,16 +85,47 @@
t->setItem(r, V, new QTableWidgetItem(igc_.glider()));
++r;
+ t->setRowCount(t->rowCount() + 1);
+ t->setItem(r, K, new QTableWidgetItem(tr("Place")));
+ t->setItem(r, V, new QTableWidgetItem(igc_.start().longitude() + " / " + igc_.start().latitude()));
+ ++r;
+
+
showProfile();
}
void MainWindow::showProfile()
{
- Plot *plot = new Plot(tr("Altitude"), this);
+ Plot *plot = new Plot(this);
+
+ /*
+ for (IGC::Iterator i = igc_.begin()
+ i != igc_.end();
+ ++i) {
+ qDebug() << *i;
+ }
+ */
+ // get all the altitudes
+ const Fixes f = igc_.fixes();
+ QList< QPair<QTime, int> > altitudesBaro;
+ QList< QPair<QTime, int> > altitudesGPS;
+
+ for (Fixes::const_iterator i = f.begin();
+ i != f.end();
+ i++) {
+ altitudesBaro << i->altitudeFix(Fix::baro);
+ altitudesGPS << i->altitudeFix(Fix::gps);
+ }
+
+ /*
plot->setXAxis(0, 100, 10);
plot->setYAxis(0, 200, 10);
+ */
+ plot->draw(altitudesBaro.begin(), altitudesBaro.end());
+ plot->draw(altitudesGPS.begin(), altitudesGPS.end());
ui->altitude->setScene(plot);
+
// ui->altitude->show();
}