From 2d6b4dce556bc3c0830f6083ebdb0c1ed72c75ea Mon Sep 17 00:00:00 2001 From: elafargue Date: Sat, 14 May 2011 16:31:59 +0200 Subject: [PATCH] Small fix to System Health gadget, to make it behave correctly when started while the connection is up already. --- .../plugins/systemhealth/systemhealthgadgetwidget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetwidget.cpp index 7a0d5066f..440ff58df 100644 --- a/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/systemhealth/systemhealthgadgetwidget.cpp @@ -151,6 +151,16 @@ void SystemHealthGadgetWidget::setSystemFile(QString dfn) QGraphicsScene *l_scene = scene(); l_scene->setSceneRect(background->boundingRect()); fitInView(background, Qt::KeepAspectRatio ); + + // Check whether the autopilot is connected already, by the way: + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); + TelemetryManager* telMngr = pm->getObject(); + if (telMngr->isConnected()) { + onAutopilotConnect(); + SystemAlarms* obj = dynamic_cast(objManager->getObject(QString("SystemAlarms"))); + updateAlarms(obj); + } } } else