mainwindow.cc
changeset 23 8396f7857013
parent 22 fa3d7ce5d0a7
child 26 4d79c3f357ad
equal deleted inserted replaced
22:fa3d7ce5d0a7 23:8396f7857013
    83     t->setRowCount(t->rowCount() + 1);
    83     t->setRowCount(t->rowCount() + 1);
    84     t->setItem(r, K, new QTableWidgetItem(tr("Glider")));
    84     t->setItem(r, K, new QTableWidgetItem(tr("Glider")));
    85     t->setItem(r, V, new QTableWidgetItem(igc_.glider()));
    85     t->setItem(r, V, new QTableWidgetItem(igc_.glider()));
    86     ++r;
    86     ++r;
    87 
    87 
       
    88     t->setRowCount(t->rowCount() + 1);
       
    89     t->setItem(r, K, new QTableWidgetItem(tr("Place")));
       
    90     t->setItem(r, V, new QTableWidgetItem(igc_.start().longitude() + " / " + igc_.start().latitude()));
       
    91     ++r;
       
    92 
       
    93 
    88     showProfile();
    94     showProfile();
    89 
    95 
    90 }
    96 }
    91 
    97 
    92 void MainWindow::showProfile()
    98 void MainWindow::showProfile()
    93 {
    99 {
    94     Plot *plot = new Plot(tr("Altitude"), this);
   100     Plot *plot = new Plot(this);
    95 
   101 
       
   102     /*
       
   103     for (IGC::Iterator i = igc_.begin()
       
   104 	 i != igc_.end();
       
   105 	 ++i) {
       
   106 	 qDebug() << *i;
       
   107     }
       
   108     */
       
   109 
       
   110     // get all the altitudes
       
   111     const Fixes f = igc_.fixes();
       
   112     QList< QPair<QTime, int> > altitudesBaro;
       
   113     QList< QPair<QTime, int> > altitudesGPS;
       
   114 
       
   115     for (Fixes::const_iterator i = f.begin();
       
   116 	 i != f.end();
       
   117 	 i++) {
       
   118 	 altitudesBaro << i->altitudeFix(Fix::baro);
       
   119 	 altitudesGPS << i->altitudeFix(Fix::gps);
       
   120     }
       
   121 
       
   122     /*
    96     plot->setXAxis(0, 100, 10);
   123     plot->setXAxis(0, 100, 10);
    97     plot->setYAxis(0, 200, 10);
   124     plot->setYAxis(0, 200, 10);
       
   125     */
       
   126     plot->draw(altitudesBaro.begin(), altitudesBaro.end());
       
   127     plot->draw(altitudesGPS.begin(), altitudesGPS.end());
    98     ui->altitude->setScene(plot);
   128     ui->altitude->setScene(plot);
       
   129 
    99    // ui->altitude->show();
   130    // ui->altitude->show();
   100 }
   131 }