Brief description of class still missing. More...
#include <GpsTableModel.h>
Public Member Functions | |
| virtual int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| virtual QVariant | data (const QModelIndex &index, int role) const |
| virtual Qt::ItemFlags | flags (const QModelIndex &) const |
| GpsTableModel (QObject *parent=0) | |
| virtual QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
| void | resetGpsResults () |
| virtual int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| virtual bool | setData (const QModelIndex &index, const QVariant &value, int role) |
| void | setStations (QList< GpsStation * > *stations) |
| ~GpsTableModel () | |
Brief description of class still missing.
Full description of class still missing
| GpsTableModel::GpsTableModel | ( | QObject * | parent = 0 | ) |
| int GpsTableModel::columnCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| QVariant GpsTableModel::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const [virtual] |
References GpsStation::altitude(), QGpCoreTools::Statistics::count(), GpsStation::eastingDop(), GpsStation::horizontalAccuracy(), GpsStation::horizontalDop(), GpsStation::info(), GpsStation::latitude(), GpsStation::longitude(), QGpCoreTools::Statistics::mean(), GpsStation::name(), GpsStation::northingDop(), GpsStation::sateliteCount(), GpsStation::solution(), QGpCoreTools::Statistics::stddev(), and TRACE.
{
TRACE;
if( !index.isValid()) return QVariant();
GpsStation * stat=_stations->at(index.row());
switch (role) {
case Qt::DisplayRole:
switch(index.column()) {
case 0:
return stat->name();
case 1:
return QString::number(stat->longitude().mean(),'f',7);
case 2:
return QString::number(stat->latitude().mean(),'f',7);
case 3:
return QString::number(stat->altitude().mean(),'f',3);
case 4:
return QString::number(stat->longitude().stddev(),'f',7);
case 5:
return QString::number(stat->latitude().stddev(),'f',7);
case 6:
return QString::number(stat->altitude().stddev(),'f',3);
case 7:
return QString::number(stat->longitude().count());
case 8:
return QString::number(stat->horizontalAccuracy(),'f',3);
case 9:
return QString::number(stat->horizontalDop(),'f',1);
case 10:
return QString::number(stat->northingDop(),'f',1);
case 11:
return QString::number(stat->eastingDop(),'f',1);
case 12:
return QString::number(stat->sateliteCount());
case 13:
return stat->solution();
default:
return QVariant();
}
case Qt::ToolTipRole:
return stat->info();
default:
return QVariant();
}
}
| Qt::ItemFlags GpsTableModel::flags | ( | const QModelIndex & | index | ) | const [virtual] |
{
if(_stations->at(index.row())->isAvailable()) {
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
} else {
return 0;
}
}
| QVariant GpsTableModel::headerData | ( | int | section, |
| Qt::Orientation | orientation, | ||
| int | role | ||
| ) | const [virtual] |
References QGpCoreTools::tr(), and TRACE.
{
TRACE;
if(role!=Qt::DisplayRole) return QVariant();
if(orientation==Qt::Horizontal) {
switch (section) {
case 0: return tr( "Station" );
case 1: return tr( "Long. (aver)" );
case 2: return tr( "Lat. (aver)" );
case 3: return tr( "Alt. (aver)" );
case 4: return tr( "Long. (dev)" );
case 5: return tr( "Lat. (dev)" );
case 6: return tr( "Alt. (dev)" );
case 7: return tr( "Count" );
case 8: return tr( "H Accuracy" );
case 9: return tr( "H DOP" );
case 10: return tr( "N DOP" );
case 11: return tr( "E DOP" );
case 12: return tr( "Satelites" );
case 13: return tr( "Solution" );
default: return QVariant();
}
} else {
return section + 1;;
}
}
| void GpsTableModel::resetGpsResults | ( | ) |
| int GpsTableModel::rowCount | ( | const QModelIndex & | parent = QModelIndex() | ) | const [virtual] |
| bool GpsTableModel::setData | ( | const QModelIndex & | index, |
| const QVariant & | value, | ||
| int | role | ||
| ) | [virtual] |
| void GpsTableModel::setStations | ( | QList< GpsStation * > * | stations | ) |
References TRACE.
Referenced by WaranGpsWidget::WaranGpsWidget().
{
TRACE;
_stations=stations;
reset();
}