|
|
|
@ -54,11 +54,11 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
@@ -54,11 +54,11 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
|
|
|
|
|
// Alternate colors to increase visibility
|
|
|
|
|
if ((ms / 1000) % 2 == 0) |
|
|
|
|
{ |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.dark(250).name())); |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.dark(250).name())); |
|
|
|
|
} |
|
|
|
|
toolBarTimeoutLabel->setText(tr("CONNECTION LOST: %1 s").arg((ms / 1000.0f), 2, 'f', 1, ' ')); |
|
|
|
|
} |
|
|
|
@ -91,12 +91,12 @@ void QGCToolBar::createUI()
@@ -91,12 +91,12 @@ void QGCToolBar::createUI()
|
|
|
|
|
|
|
|
|
|
toolBarTimeoutLabel = new QLabel("UNCONNECTED", this); |
|
|
|
|
toolBarTimeoutLabel->setToolTip(tr("System timed out, interval since last message")); |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); |
|
|
|
|
toolBarTimeoutLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorDarkWhite.name()).arg(QGC::colorMagenta.name())); |
|
|
|
|
toolBarTimeoutLabel->setAlignment(Qt::AlignCenter); |
|
|
|
|
addWidget(toolBarTimeoutLabel); |
|
|
|
|
|
|
|
|
|
toolBarSafetyLabel = new QLabel("SAFE", this); |
|
|
|
|
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #14C814; }"); |
|
|
|
|
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: #14C814; }"); |
|
|
|
|
toolBarSafetyLabel->setToolTip(tr("Vehicle safety state")); |
|
|
|
|
toolBarSafetyLabel->setAlignment(Qt::AlignCenter); |
|
|
|
|
addWidget(toolBarSafetyLabel); |
|
|
|
@ -353,12 +353,12 @@ void QGCToolBar::updateView()
@@ -353,12 +353,12 @@ void QGCToolBar::updateView()
|
|
|
|
|
|
|
|
|
|
if (systemArmed) |
|
|
|
|
{ |
|
|
|
|
toolBarSafetyLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name())); |
|
|
|
|
toolBarSafetyLabel->setStyleSheet(QString("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}").arg(QGC::colorRed.name()).arg(QGC::colorYellow.name())); |
|
|
|
|
toolBarSafetyLabel->setText(tr("ARMED")); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; font: 14px; color: #14C814; }"); |
|
|
|
|
toolBarSafetyLabel->setStyleSheet("QLabel { margin: 3px 2px; padding: 2px; padding-left: 4px; padding-right: 4px; font: 14px; color: #14C814; }"); |
|
|
|
|
toolBarSafetyLabel->setText(tr("SAFE")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|