1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

added tooltip to the pfd stating the current refresh rate

This commit is contained in:
zedamota 2011-11-20 20:47:37 +00:00
parent 0875831f6d
commit a1f3035f15
2 changed files with 12 additions and 2 deletions

View File

@ -74,6 +74,7 @@ PFDGadgetWidget::PFDGadgetWidget(QWidget *parent) : QGraphicsView(parent)
connect(&skyDialTimer, SIGNAL(timeout()), this, SLOT(moveSky()));
skyDialTimer.start(30);
}
PFDGadgetWidget::~PFDGadgetWidget()
@ -82,6 +83,14 @@ PFDGadgetWidget::~PFDGadgetWidget()
dialTimer.stop();
}
void PFDGadgetWidget::setToolTipPrivate()
{
static qint32 updateRate=0;
UAVObject::Metadata mdata=attitudeObj->getMetadata();
if(mdata.flightTelemetryUpdatePeriod!=updateRate)
this->setToolTip("Current refresh rate:"+QString::number(mdata.flightTelemetryUpdatePeriod)+" miliseconds"+"\nIf you want to change it please edit the AttitudeActual metadata on the object browser.");
}
/*!
\brief Enables/Disables OpenGL
*/
@ -174,7 +183,6 @@ void PFDGadgetWidget::connectNeedles() {
qDebug() << "Error: Object is unknown (FlightBatteryState).";
}
}
}
@ -229,6 +237,7 @@ void PFDGadgetWidget::updateLinkStatus(UAVObject *object1) {
Resolution is 1 degree roll & 1/7.5 degree pitch.
*/
void PFDGadgetWidget::updateAttitude(UAVObject *object1) {
setToolTipPrivate();
UAVObjectField * rollField = object1->getField(QString("Roll"));
UAVObjectField * yawField = object1->getField(QString("Yaw"));
UAVObjectField * pitchField = object1->getField(QString("Pitch"));

View File

@ -54,6 +54,7 @@ public:
void setHqFonts(bool flag) { hqFonts = flag; }
void enableSmoothUpdates(bool flag) { beSmooth = flag; }
public slots:
void updateAttitude(UAVObject *object1);
void updateHeading(UAVObject *object1);
@ -72,7 +73,7 @@ private slots:
void moveNeedles();
void moveVerticalScales();
void moveSky();
void setToolTipPrivate();
private:
QSvgRenderer *m_renderer;