-
Notifications
You must be signed in to change notification settings - Fork 2
/
PassTable.cpp
57 lines (37 loc) · 1.38 KB
/
PassTable.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "PassTable.h"
#include <QStringList>
#include <QDebug>
#define RAD2DEG (180.0/M_PI)
#define DEG2RAD (M_PI/180.0)
PassTable::PassTable(QWidget *parent) :
QTableWidget(parent)
{
QStringList columns;
columns << "AOS" << "LOS" << "Duration" << "Peak Elev";
setColumnCount(columns.size());
setHorizontalHeaderLabels(columns);
setEditTriggers(QAbstractItemView::NoEditTriggers);
//sortItems(0);
}
void PassTable::updateList(const QList<PassDetails>& passList) {
while(rowCount() > 0)
removeRow(0);
setSortingEnabled(false);
foreach (const PassDetails& details, passList) {
qDebug() << details.aos.ToString().c_str();
bool found = false;
/*
for(int i = 0; i < this->rowCount(); i++) {
QTableWidgetItem* item = item(i)
}
if (found == false) {
}*/
int r = rowCount();
insertRow(r);
//setItem(r, 0, new QTableWidgetItem("ESTCube-1"));
setItem(r, 0, new QTableWidgetItem(QString("%1:%2").arg((int)details.aos.Hour()).arg((int)details.aos.Minute())) );
setItem(r, 1, new QTableWidgetItem(QString("%1:%2").arg(details.los.Hour()).arg(details.los.Minute())) );
setItem(r, 2, new QTableWidgetItem(details.duration()) );
setItem(r, 3, new QTableWidgetItem(QString("%1").arg(RAD2DEG*details.max_elevation,0,'f',1)) );
}
}