mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Various updates: use PDOP on PFD since the INSGPS algo relies on it, and more work on GPS Display gadget, minute improvements...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1524 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
24f5023e10
commit
aa909cf7dd
@ -106,6 +106,7 @@ void GpsDisplayGadget::loadConfiguration(IUAVGadgetConfiguration* config)
|
|||||||
connect(parser, SIGNAL(datetime(double,double)), m_widget,SLOT(setDateTime(double,double)));
|
connect(parser, SIGNAL(datetime(double,double)), m_widget,SLOT(setDateTime(double,double)));
|
||||||
connect(parser, SIGNAL(packet(char*)), m_widget, SLOT(dumpPacket(char*)));
|
connect(parser, SIGNAL(packet(char*)), m_widget, SLOT(dumpPacket(char*)));
|
||||||
connect(parser, SIGNAL(satellite(int,int,int,int,int)), m_widget->gpsSky, SLOT(updateSat(int,int,int,int,int)));
|
connect(parser, SIGNAL(satellite(int,int,int,int,int)), m_widget->gpsSky, SLOT(updateSat(int,int,int,int,int)));
|
||||||
|
connect(parser, SIGNAL(fixtype(QString)), m_widget, SLOT(setFixType(QString)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpsDisplayGadget::onConnect() {
|
void GpsDisplayGadget::onConnect() {
|
||||||
|
@ -53,30 +53,28 @@ GpsDisplayWidget::~GpsDisplayWidget()
|
|||||||
|
|
||||||
void GpsDisplayWidget::setSpeedHeading(double speed, double heading)
|
void GpsDisplayWidget::setSpeedHeading(double speed, double heading)
|
||||||
{
|
{
|
||||||
QString temp = "Speed: ";
|
|
||||||
temp.append(QString::number(speed,'g',10));
|
|
||||||
temp.append(" Heaging: ");
|
|
||||||
temp.append(QString::number(heading,'g',10));
|
|
||||||
speed_value->setText(QString::number(speed,'g',10));
|
speed_value->setText(QString::number(speed,'g',10));
|
||||||
speed_value->adjustSize();
|
speed_value->adjustSize();
|
||||||
bear_value->setText(QString::number(heading,'g',10));
|
bear_value->setText(QString::number(heading,'g',10));
|
||||||
bear_value->adjustSize();
|
bear_value->adjustSize();
|
||||||
|
|
||||||
// widget->textBrowser->append(temp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpsDisplayWidget::setDateTime(double date, double time)
|
void GpsDisplayWidget::setDateTime(double date, double time)
|
||||||
{
|
{
|
||||||
QString temp = "Date: ";
|
QString dstring = QString::number(date,'g',10);
|
||||||
temp.append(QString::number(date,'g',10));
|
dstring.insert(6,".");
|
||||||
temp.append(" Time: ");
|
dstring.insert(4,".");
|
||||||
temp.append(QString::number(time,'g',10));
|
gdate_value->setText(dstring);
|
||||||
gdate_value->setText(QString::number(date,'g',10));
|
//gdate_value->adjustSize();
|
||||||
gdate_value->adjustSize();
|
|
||||||
gtime_value->setText(QString::number(time,'g',10));
|
gtime_value->setText(QString::number(time,'g',10));
|
||||||
gdate_value->adjustSize();
|
gdate_value->adjustSize();
|
||||||
|
|
||||||
//textBrowser->append(temp);
|
}
|
||||||
|
|
||||||
|
void GpsDisplayWidget::setFixType(QString fixtype)
|
||||||
|
{
|
||||||
|
fix_value->setText(fixtype);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GpsDisplayWidget::dumpPacket(char *packet)
|
void GpsDisplayWidget::dumpPacket(char *packet)
|
||||||
|
@ -52,6 +52,7 @@ private slots:
|
|||||||
void setDateTime(double, double);
|
void setDateTime(double, double);
|
||||||
void setSpeedHeading(double, double);
|
void setSpeedHeading(double, double);
|
||||||
void dumpPacket(char*);
|
void dumpPacket(char*);
|
||||||
|
void setFixType(QString fixtype);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GpsConstellationWidget * gpsConstellation;
|
GpsConstellationWidget * gpsConstellation;
|
||||||
|
@ -50,6 +50,7 @@ signals:
|
|||||||
void speedheading(double,double);
|
void speedheading(double,double);
|
||||||
void packet(char*); // Raw NMEA Packet (or just info)
|
void packet(char*); // Raw NMEA Packet (or just info)
|
||||||
void satellite(int,int,int,int,int); // Index, PRN, Elevation, Azimuth, SNR
|
void satellite(int,int,int,int,int); // Index, PRN, Elevation, Azimuth, SNR
|
||||||
|
void fixtype(QString); // Type of fix (none, 2D, 3D, etc).
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -75,6 +75,13 @@ void TelemetryParser::updateGPS( UAVObject* object1) {
|
|||||||
double alt = object1->getField(QString("Altitude"))->getDouble();
|
double alt = object1->getField(QString("Altitude"))->getDouble();
|
||||||
emit position(lat,lon,alt);
|
emit position(lat,lon,alt);
|
||||||
|
|
||||||
|
double hdg = object1->getField(QString("Heading"))->getDouble();
|
||||||
|
double spd = object1->getField(QString("Groundspeed"))->getDouble();
|
||||||
|
emit speedheading(spd,hdg);
|
||||||
|
|
||||||
|
QString fix = object1->getField(QString("Status"))->getValue().toString();
|
||||||
|
emit fixtype(fix);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TelemetryParser::updateTime( UAVObject* object1) {
|
void TelemetryParser::updateTime( UAVObject* object1) {
|
||||||
|
@ -182,9 +182,9 @@ void PFDGadgetWidget::connectNeedles() {
|
|||||||
*/
|
*/
|
||||||
void PFDGadgetWidget::updateGPS(UAVObject *object1) {
|
void PFDGadgetWidget::updateGPS(UAVObject *object1) {
|
||||||
UAVObjectField* field = object1->getField(QString("Satellites"));
|
UAVObjectField* field = object1->getField(QString("Satellites"));
|
||||||
UAVObjectField* field1 = object1->getField(QString("HDOP"));
|
UAVObjectField* field1 = object1->getField(QString("PDOP"));
|
||||||
if (field && field1) {
|
if (field && field1) {
|
||||||
QString s = QString("GPS: ") + field->getValue().toString() + "\nHDP: "
|
QString s = QString("GPS: ") + field->getValue().toString() + "\nPDP: "
|
||||||
+ field1->getValue().toString();
|
+ field1->getValue().toString();
|
||||||
if (s != satString) {
|
if (s != satString) {
|
||||||
gcsGPSStats->setPlainText(s);
|
gcsGPSStats->setPlainText(s);
|
||||||
|
Loading…
Reference in New Issue
Block a user