Skip to content

Commit

Permalink
Convert RadioCal to Qml
Browse files Browse the repository at this point in the history
  • Loading branch information
DonLakeFlyer committed May 28, 2015
1 parent 85ad9e0 commit 20df7eb
Show file tree
Hide file tree
Showing 13 changed files with 962 additions and 2,114 deletions.
13 changes: 6 additions & 7 deletions QGCApplication.pro
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ FORMS += \
src/ui/mission/QGCMissionNavTakeoff.ui \
src/ui/mission/QGCMissionNavWaypoint.ui \
src/ui/mission/QGCMissionOther.ui \
src/ui/px4_configuration/PX4RCCalibration.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCHilConfiguration.ui \
Expand Down Expand Up @@ -305,8 +304,6 @@ HEADERS += \
src/ui/mission/QGCMissionNavTakeoff.h \
src/ui/mission/QGCMissionNavWaypoint.h \
src/ui/mission/QGCMissionOther.h \
src/ui/px4_configuration/PX4RCCalibration.h \
src/ui/px4_configuration/RCValueWidget.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCHilConfiguration.h \
Expand Down Expand Up @@ -431,8 +428,6 @@ SOURCES += \
src/ui/mission/QGCMissionNavTakeoff.cc \
src/ui/mission/QGCMissionNavWaypoint.cc \
src/ui/mission/QGCMissionOther.cc \
src/ui/px4_configuration/PX4RCCalibration.cc \
src/ui/px4_configuration/RCValueWidget.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCHilConfiguration.cc \
Expand Down Expand Up @@ -517,11 +512,12 @@ HEADERS += \
src/qgcunittest/MainWindowTest.h \
src/qgcunittest/MavlinkLogTest.h \
src/qgcunittest/MessageBoxTest.h \
src/qgcunittest/PX4RCCalibrationTest.h \
src/qgcunittest/UnitTest.h \
src/VehicleSetup/SetupViewTest.h \
src/qgcunittest/FileManagerTest.h \

#src/qgcunittest/PX4RCCalibrationTest.h \

SOURCES += \
src/qgcunittest/FlightGearTest.cc \
src/qgcunittest/MultiSignalSpy.cc \
Expand All @@ -535,11 +531,12 @@ SOURCES += \
src/qgcunittest/MainWindowTest.cc \
src/qgcunittest/MavlinkLogTest.cc \
src/qgcunittest/MessageBoxTest.cc \
src/qgcunittest/PX4RCCalibrationTest.cc \
src/qgcunittest/UnitTest.cc \
src/VehicleSetup/SetupViewTest.cc \
src/qgcunittest/FileManagerTest.cc \

#src/qgcunittest/PX4RCCalibrationTest.cc \

} # DebugBuild|WindowsDebugAndRelease
} # AndroidBuild

Expand Down Expand Up @@ -570,6 +567,7 @@ HEADERS+= \
src/AutoPilotPlugins/PX4/PX4Component.h \
src/AutoPilotPlugins/PX4/PX4ParameterLoader.h \
src/AutoPilotPlugins/PX4/RadioComponent.h \
src/AutoPilotPlugins/PX4/RadioComponentController.h \
src/AutoPilotPlugins/PX4/SafetyComponent.h \
src/AutoPilotPlugins/PX4/SensorsComponent.h \
src/AutoPilotPlugins/PX4/SensorsComponentController.h \
Expand Down Expand Up @@ -599,6 +597,7 @@ SOURCES += \
src/AutoPilotPlugins/PX4/PX4Component.cc \
src/AutoPilotPlugins/PX4/PX4ParameterLoader.cc \
src/AutoPilotPlugins/PX4/RadioComponent.cc \
src/AutoPilotPlugins/PX4/RadioComponentController.cc \
src/AutoPilotPlugins/PX4/SafetyComponent.cc \
src/AutoPilotPlugins/PX4/SensorsComponent.cc \
src/AutoPilotPlugins/PX4/SensorsComponentController.cc \
Expand Down
7 changes: 4 additions & 3 deletions qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<file alias="FirmwareUpgrade.qml">src/VehicleSetup/FirmwareUpgrade.qml</file>
<file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file>
<file alias="RadioComponent.qml">src/AutoPilotPlugins/PX4/RadioComponent.qml</file>
<file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file>
<file alias="SensorsComponent.qml">src/AutoPilotPlugins/PX4/SensorsComponent.qml</file>
<file alias="FlightModesComponent.qml">src/AutoPilotPlugins/PX4/FlightModesComponent.qml</file>
Expand Down Expand Up @@ -220,15 +221,15 @@
</qresource>

<qresource prefix="/res/calibration">
<file alias ="accel_back.png">resources/calibration/accel_back.png</file>
<file alias="accel_back.png">resources/calibration/accel_back.png</file>
<file alias="accel_front.png">resources/calibration/accel_front.png</file>
<file alias="accel_right.png">resources/calibration/accel_right.png</file>
<file alias="accel_down.png">resources/calibration/accel_down.png</file>
<file alias="accel_up.png">resources/calibration/accel_up.png</file>
<file alias="accel_left.png">resources/calibration/accel_left.png</file>
</qresource>

<qresource prefix="/res/calibration/mode1">
<qresource prefix="/qml/calibration/mode1">
<file alias="radioCenter.png">resources/calibration/mode1/radioCenter.png</file>
<file alias="radioHome.png">resources/calibration/mode1/radioHome.png</file>
<file alias="radioRollLeft.png">resources/calibration/mode1/radioRollLeft.png</file>
Expand All @@ -242,7 +243,7 @@
<file alias="radioSwitchMinMax.png">resources/calibration/mode1/radioSwitchMinMax.png</file>
</qresource>

<qresource prefix="/res/calibration/mode2">
<qresource prefix="/qml/calibration/mode2">
<file alias="radioCenter.png">resources/calibration/mode2/radioCenter.png</file>
<file alias="radioHome.png">resources/calibration/mode2/radioHome.png</file>
<file alias="radioRollLeft.png">resources/calibration/mode2/radioRollLeft.png</file>
Expand Down
1 change: 0 additions & 1 deletion src/AutoPilotPlugins/PX4/PowerComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
/// @author Gus Grubba <[email protected]>

#include "PowerComponent.h"
#include "PX4RCCalibration.h"
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"

Expand Down
8 changes: 6 additions & 2 deletions src/AutoPilotPlugins/PX4/RadioComponent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/// @author Don Gagne <[email protected]>

#include "RadioComponent.h"
#include "PX4RCCalibration.h"
#include "QGCQmlWidgetHolder.h"
#include "PX4AutoPilotPlugin.h"

RadioComponent::RadioComponent(UASInterface* uas, AutoPilotPlugin* autopilot, QObject* parent) :
Expand Down Expand Up @@ -140,7 +140,11 @@ QStringList RadioComponent::paramFilterList(void) const

QWidget* RadioComponent::setupWidget(void) const
{
return new PX4RCCalibration;
QGCQmlWidgetHolder* holder = new QGCQmlWidgetHolder();
Q_CHECK_PTR(holder);
holder->setAutoPilot(_autopilot);
holder->setSource(QUrl::fromUserInput("qrc:/qml/RadioComponent.qml"));
return holder;
}

QUrl RadioComponent::summaryQmlSource(void) const
Expand Down
Loading

0 comments on commit 20df7eb

Please sign in to comment.