Commit c038ecf4 authored by Don Gagne's avatar Don Gagne

Fix RadioConfigTest for new SetupPage usage

parent 8bc1336d
...@@ -18,6 +18,7 @@ import QGroundControl.FactControls 1.0 ...@@ -18,6 +18,7 @@ import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0 import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Controllers 1.0 import QGroundControl.Controllers 1.0
import QGroundControl.Palette 1.0
SetupPage { SetupPage {
id: radioPage id: radioPage
...@@ -48,6 +49,8 @@ SetupPage { ...@@ -48,6 +49,8 @@ SetupPage {
{ {
} }
QGCPalette { id: qgcPal; colorGroupEnabled: radioPage.enabled }
RadioComponentController { RadioComponentController {
id: controller id: controller
factPanel: radioPage.viewPanel factPanel: radioPage.viewPanel
......
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
#include "RadioComponentController.h" #include "RadioComponentController.h"
#include "MultiVehicleManager.h" #include "MultiVehicleManager.h"
#include "QGCApplication.h" #include "QGCApplication.h"
#include "PX4/PX4AutoPilotPlugin.h"
#include "APM/APMAutoPilotPlugin.h"
#include "APM/APMRadioComponent.h"
/// @file /// @file
/// @brief QRadioComponentController Widget unit test /// @brief QRadioComponentController Widget unit test
...@@ -200,6 +203,13 @@ void RadioConfigTest::_init(MAV_AUTOPILOT firmwareType) ...@@ -200,6 +203,13 @@ void RadioConfigTest::_init(MAV_AUTOPILOT firmwareType)
_calWidget->resize(600, 600); _calWidget->resize(600, 600);
Q_CHECK_PTR(_calWidget); Q_CHECK_PTR(_calWidget);
_calWidget->setAutoPilot(_autopilot); _calWidget->setAutoPilot(_autopilot);
QObject* vehicleComponent;
if (firmwareType == MAV_AUTOPILOT_PX4) {
vehicleComponent = dynamic_cast<QObject*>(dynamic_cast<PX4AutoPilotPlugin*>(_autopilot)->radioComponent());
} else {
vehicleComponent = dynamic_cast<QObject*>(dynamic_cast<APMAutoPilotPlugin*>(_autopilot)->radioComponent());
}
_calWidget->setContextPropertyObject("vehicleComponent", vehicleComponent);
_calWidget->setSource(QUrl::fromUserInput("qrc:/qml/RadioComponent.qml")); _calWidget->setSource(QUrl::fromUserInput("qrc:/qml/RadioComponent.qml"));
// Nasty hack to get to controller // Nasty hack to get to controller
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment