diff --git a/files/images/px4/rc/cessna_back.png b/files/images/px4/rc/cessna_back.png
new file mode 100644
index 0000000000000000000000000000000000000000..ae54c7eb0c03bff52b0c681bbcf940ac4910714c
Binary files /dev/null and b/files/images/px4/rc/cessna_back.png differ
diff --git a/files/images/px4/rc/cessna_side.png b/files/images/px4/rc/cessna_side.png
new file mode 100644
index 0000000000000000000000000000000000000000..5fc19e68ba5ceb47e23f6ec36961fc0038898633
Binary files /dev/null and b/files/images/px4/rc/cessna_side.png differ
diff --git a/files/images/px4/rc/rc_backgrounds.graffle b/files/images/px4/rc/rc_backgrounds.graffle
new file mode 100644
index 0000000000000000000000000000000000000000..a3b5c1703ac9dfdf7ae1481ba805370c76b1354c
--- /dev/null
+++ b/files/images/px4/rc/rc_backgrounds.graffle
@@ -0,0 +1,674 @@
+
+
+
+
+ ActiveLayerIndex
+ 0
+ ApplicationVersion
+
+ com.omnigroup.OmniGraffle
+ 139.18.0.187838
+
+ AutoAdjust
+
+ BackgroundGraphic
+
+ Bounds
+ {{0, 0}, {559.28001499176025, 782.8900146484375}}
+ Class
+ SolidGraphic
+ ID
+ 2
+ Style
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+
+ BaseZoom
+ 0
+ CanvasOrigin
+ {0, 0}
+ ColumnAlign
+ 1
+ ColumnSpacing
+ 36
+ CreationDate
+ 2013-08-23 20:20:16 +0000
+ Creator
+ Lorenz
+ DisplayScale
+ 1 0/72 in = 1 0/72 in
+ GraphDocumentVersion
+ 8
+ GraphicsList
+
+
+ Bounds
+ {{188.3818359375, 271.5}, {29, 16}}
+ Class
+ ShapedGraphic
+ FitText
+ YES
+ Flow
+ Resize
+ FontInfo
+
+ Color
+
+ b
+ 0.379293
+ g
+ 0.379287
+ r
+ 0.379298
+
+ Font
+ Helvetica-Bold
+ Size
+ 13
+
+ ID
+ 38
+ Shape
+ Rectangle
+ Style
+
+ fill
+
+ Draws
+ NO
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ Pad
+ 0
+ RTFD
+
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKwVyaWdodIaEAmlJAQWShISEDE5TRGljdGlv
+ bmFyeQCUhAFpA5KElpYHTlNDb2xvcoaShISEB05TQ29s
+ b3IAlIQBYwKEBGZmZmaD6ujoPoPq6Og+g+ro6D4BhpKE
+ lpYQTlNQYXJhZ3JhcGhTdHlsZYaShISEEE5TUGFyYWdy
+ YXBoU3R5bGUAlIQEQ0NAUwIAhISEB05TQXJyYXkAlJkM
+ koSEhAlOU1RleHRUYWIAlIQCQ2YAHIaShKKhADiGkoSi
+ oQBUhpKEoqEAcIaShKKhAIGMAIaShKKhAIGoAIaShKKh
+ AIHEAIaShKKhAIHgAIaShKKhAIH8AIaShKKhAIEYAYaS
+ hKKhAIE0AYaShKKhAIFQAYaGgQAIhARbMWZdg83MTD2G
+ koSWlgZOU0ZvbnSGkoSEhAZOU0ZvbnQelJkohAVbNDBj
+ XQYAAAAeAAAA//5IAGUAbAB2AGUAdABpAGMAYQAtAEIA
+ bwBsAGQAAACEAWYNmwCbAZsAmwCGhoY=
+
+ Text
+ {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red97\green97\blue97;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\b\fs26 \cf2 right}
+ VerticalPad
+ 0
+
+ Wrap
+ NO
+
+
+ Bounds
+ {{153, 271.5}, {20, 16}}
+ Class
+ ShapedGraphic
+ FitText
+ YES
+ Flow
+ Resize
+ FontInfo
+
+ Color
+
+ b
+ 0.379293
+ g
+ 0.379287
+ r
+ 0.379298
+
+ Font
+ Helvetica-Bold
+ Size
+ 13
+
+ ID
+ 36
+ Shape
+ Rectangle
+ Style
+
+ fill
+
+ Draws
+ NO
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ Pad
+ 0
+ RTFD
+
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
+ ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
+ bmcBlIQBKwRsZWZ0hoQCaUkBBJKEhIQMTlNEaWN0aW9u
+ YXJ5AJSEAWkEkoSWlg5OU09yaWdpbmFsRm9udIaShISE
+ Bk5TRm9udB6UmRyEBVsyOGNdBgAAABQAAAD//kgAZQBs
+ AHYAZQB0AGkAYwBhAIQBZgyEAWMAnQGdAJ0AhpKElpYQ
+ TlNQYXJhZ3JhcGhTdHlsZYaShISEF05TTXV0YWJsZVBh
+ cmFncmFwaFN0eWxlAISEEE5TUGFyYWdyYXBoU3R5bGUA
+ lIQEQ0NAUwIAhYEACIQEWzFmXYPNzEw9hpKElpYGTlNG
+ b250hpKEm5kohAVbNDBjXQYAAAAeAAAA//5IAGUAbAB2
+ AGUAdABpAGMAYQAtAEIAbwBsAGQAAACcDZ0AnQGdAJ0A
+ hpKElpYHTlNDb2xvcoaShISEB05TQ29sb3IAlJ0ChARm
+ ZmZmg+ro6D6D6ujoPoPq6Og+AYaGhg==
+
+ Text
+ {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;\red97\green97\blue97;}
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
+
+\f0\b\fs26 \cf2 left}
+ VerticalPad
+ 0
+
+ Wrap
+ NO
+
+
+ Bounds
+ {{124, 268}, {23, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 35
+ Rotation
+ 180
+ Shape
+ HorizontalTriangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.380387
+ g
+ 0.380387
+ r
+ 0.380387
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ Bounds
+ {{224, 268}, {23, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 34
+ Shape
+ HorizontalTriangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.380387
+ g
+ 0.380387
+ r
+ 0.380387
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ Bounds
+ {{251.99999284744263, 106}, {23, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 33
+ Rotation
+ 270
+ Shape
+ HorizontalTriangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.380387
+ g
+ 0.380387
+ r
+ 0.380387
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ Bounds
+ {{167.80909729003906, 160}, {42.381816864013672, 42}}
+ Class
+ ShapedGraphic
+ ID
+ 32
+ Shape
+ Circle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.379293
+ g
+ 0.379287
+ r
+ 0.379298
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ Bounds
+ {{252, 205}, {23, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 13
+ Rotation
+ 90
+ Shape
+ HorizontalTriangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.380387
+ g
+ 0.380387
+ r
+ 0.380387
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ Bounds
+ {{171.5, 147.5}, {128, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 30
+ Rotation
+ 90
+ Shape
+ Rectangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.409312
+ g
+ 0.828576
+ r
+ 0.468975
+
+
+ shadow
+
+ Draws
+ NO
+
+
+
+
+ Bounds
+ {{119, 237}, {128, 23}}
+ Class
+ ShapedGraphic
+ ID
+ 29
+ Shape
+ Rectangle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.409312
+ g
+ 0.828576
+ r
+ 0.468975
+
+
+ shadow
+
+ Draws
+ NO
+
+
+
+
+ Bounds
+ {{78, 71}, {222, 220}}
+ Class
+ ShapedGraphic
+ ID
+ 28
+ Shape
+ Circle
+ Style
+
+ fill
+
+ Color
+
+ b
+ 0.877468
+ g
+ 0.877468
+ r
+ 0.877468
+
+
+ shadow
+
+ Draws
+ NO
+
+ stroke
+
+ Draws
+ NO
+
+
+ Text
+
+ VerticalPad
+ 0
+
+
+
+ GridInfo
+
+ GuidesLocked
+ NO
+ GuidesVisible
+ YES
+ HPages
+ 1
+ ImageCounter
+ 1
+ KeepToScale
+
+ Layers
+
+
+ Lock
+ NO
+ Name
+ Ebene 1
+ Print
+ YES
+ View
+ YES
+
+
+ LayoutInfo
+
+ Animate
+ NO
+ circoMinDist
+ 18
+ circoSeparation
+ 0.0
+ layoutEngine
+ dot
+ neatoSeparation
+ 0.0
+ twopiSeparation
+ 0.0
+
+ LinksVisible
+ NO
+ MagnetsVisible
+ NO
+ MasterSheets
+
+ ModificationDate
+ 2013-08-26 18:20:11 +0000
+ Modifier
+ Lorenz
+ NotesVisible
+ NO
+ Orientation
+ 2
+ OriginVisible
+ NO
+ PageBreaks
+ YES
+ PrintInfo
+
+ NSBottomMargin
+
+ float
+ 41
+
+ NSHorizonalPagination
+
+ coded
+ BAtzdHJlYW10eXBlZIHoA4QBQISEhAhOU051bWJlcgCEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAFxlwCG
+
+ NSLeftMargin
+
+ float
+ 18
+
+ NSPaperSize
+
+ size
+ {595.28001499176025, 841.8900146484375}
+
+ NSPrintReverseOrientation
+
+ int
+ 0
+
+ NSRightMargin
+
+ float
+ 18
+
+ NSTopMargin
+
+ float
+ 18
+
+
+ PrintOnePage
+
+ ReadOnly
+ NO
+ RowAlign
+ 1
+ RowSpacing
+ 36
+ SheetTitle
+ Arbeitsfläche 1
+ SmartAlignmentGuidesActive
+ YES
+ SmartDistanceGuidesActive
+ YES
+ UniqueID
+ 1
+ UseEntirePage
+
+ VPages
+ 1
+ WindowInfo
+
+ CurrentSheet
+ 0
+ ExpandedCanvases
+
+ Frame
+ {{76, 4}, {918, 774}}
+ ListView
+
+ OutlineWidth
+ 142
+ RightSidebar
+
+ ShowRuler
+
+ Sidebar
+
+ SidebarWidth
+ 120
+ VisibleRegion
+ {{-112, 0}, {783, 635}}
+ Zoom
+ 1
+ ZoomValues
+
+
+ Arbeitsfläche 1
+ 1
+ 1
+
+
+
+
+
diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index 0e5a041496de986b3453658309a1e47e4a1a1134..d9bd57f2f6633166c8531a2b55aa507e9d37135a 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -180,6 +180,8 @@
files/images/px4/menu/plane.png
files/images/px4/menu/remote.png
files/images/px4/menu/cogwheels.png
+ files/images/px4/rc/cessna_back.png
+ files/images/px4/rc/cessna_side.png
files/styles/Vera.ttf
diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc
index c7b882a21f4a2a6a1df88f72e2e44e3070c6c4fd..cb1675fd3203b2dbd59bf53a59a0a39dcbf384e6 100644
--- a/src/ui/QGCPX4VehicleConfig.cc
+++ b/src/ui/QGCPX4VehicleConfig.cc
@@ -60,6 +60,8 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
#ifdef QUPGRADE_SUPPORT
firmwareDialog(NULL),
#endif
+ planeBack(":/files/images/px4/rc/cessna_back.png"),
+ planeSide(":/files/images/px4/rc/cessna_side.png"),
ui(new Ui::QGCPX4VehicleConfig)
{
doneLoadingConfig = false;
@@ -142,6 +144,15 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
connect(ui->advancedCheckBox, SIGNAL(clicked(bool)), ui->advancedGroupBox, SLOT(setVisible(bool)));
ui->advancedGroupBox->setVisible(false);
+ connect(ui->advancedCheckBox, SIGNAL(clicked(bool)), ui->graphicsView, SLOT(setHidden(bool)));
+ ui->graphicsView->setScene(&scene);
+
+ scene.addPixmap(planeBack);
+ scene.addPixmap(planeSide);
+
+ // XXX hide while WIP
+ ui->graphicsView->hide();
+
ui->rcCalibrationButton->setCheckable(true);
connect(ui->rcCalibrationButton, SIGNAL(clicked(bool)), this, SLOT(toggleCalibrationRC(bool)));
@@ -209,6 +220,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
rcMappedMin[i] = 1000;
rcMappedMax[i] = 2000;
rcMappedValue[i] = UINT16_MAX;
+ rcMappedValueRev[i] = UINT16_MAX;
rcMappedNormalizedValue[i] = 0.0f;
}
@@ -217,6 +229,7 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
rcMappedMin[i] = 1000;
rcMappedMax[i] = 2000;
rcMappedValue[i] = UINT16_MAX;
+ rcMappedValueRev[i] = UINT16_MAX;
rcMappedNormalizedValue[i] = 0.0f;
}
@@ -1184,13 +1197,12 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
}
// Raw value
- float mappedVal = rcMappedValue[rcToFunctionMapping[chan]];
float deltaRaw = fabsf(fval - rcValue[chan]);
- float delta = fabsf(fval - mappedVal);
+ float delta = fabsf(fval - rcMappedValue[rcToFunctionMapping[chan]]);
if (!configEnabled && !calibrationEnabled &&
(deltaRaw < 12.0f && delta < 12.0f && rcValue[chan] > 800 && rcValue[chan] < 2200))
{
- //ignore tiny jitter values
+ // ignore tiny jitter values
return;
}
else {
@@ -1281,17 +1293,13 @@ void QGCPX4VehicleConfig::remoteControlChannelRawChanged(int chan, float fval)
normalized = (rcRev[chan]) ? -1.0f*normalized : normalized;
// Find correct mapped channel
- for (unsigned int i = 0; i < chanCount; i++) {
- if (chan == rcMapping[i]) {
- rcMappedValue[i] = (rcRev[chan]) ? rcMax[chan] - (fval - rcMin[chan]) : fval;
+ rcMappedValueRev[rcToFunctionMapping[chan]] = (rcRev[chan]) ? rcMax[chan] - (fval - rcMin[chan]) : fval;
+ rcMappedValue[rcToFunctionMapping[chan]] = fval;
- // Copy min / max
- rcMappedMin[i] = rcMin[chan];
- rcMappedMax[i] = rcMax[chan];
-
- rcMappedNormalizedValue[i] = normalized;
- }
- }
+ // Copy min / max
+ rcMappedMin[rcToFunctionMapping[chan]] = rcMin[chan];
+ rcMappedMax[rcToFunctionMapping[chan]] = rcMax[chan];
+ rcMappedNormalizedValue[rcToFunctionMapping[chan]] = normalized;
if (chan == rcMapping[0]) {
rcRoll = normalized;
diff --git a/src/ui/QGCPX4VehicleConfig.h b/src/ui/QGCPX4VehicleConfig.h
index 1be13079cb81cb4f6c7eb0964c849a8fcc4e5f6d..62d11c014379b5094a97f584e29f748f75ac3b3d 100644
--- a/src/ui/QGCPX4VehicleConfig.h
+++ b/src/ui/QGCPX4VehicleConfig.h
@@ -8,6 +8,7 @@
#include
#include
#include
+#include
#include "QGCToolWidget.h"
#include "UASInterface.h"
@@ -285,10 +286,11 @@ protected:
float rcScaling[chanMax]; ///< Scaling of channel input to control commands
bool rcRev[chanMax]; ///< Channel reverse
int rcValue[chanMax]; ///< Last values, RAW
- float rcValueReversed[chanMax]; ///< Last values, accounted for reverse
- float rcMappedMin[chanMappedMax]; ///< Mapped channels in default order
- float rcMappedMax[chanMappedMax]; ///< Mapped channels in default order
- float rcMappedValue[chanMappedMax]; ///< Mapped channels in default order
+ int rcValueReversed[chanMax]; ///< Last values, accounted for reverse
+ int rcMappedMin[chanMappedMax]; ///< Mapped channels in default order
+ int rcMappedMax[chanMappedMax]; ///< Mapped channels in default order
+ int rcMappedValue[chanMappedMax]; ///< Mapped channels in default order
+ int rcMappedValueRev[chanMappedMax];
float rcMappedNormalizedValue[chanMappedMax]; ///< Mapped channels in default order
int channelWanted; ///< During channel assignment search the requested default index
int channelReverseStateWanted;
@@ -323,8 +325,11 @@ protected:
QGCPX4AirframeConfig* px4AirframeConfig;
DialogBare* firmwareDialog;
+ QPixmap planeBack;
+ QPixmap planeSide;
QGCPX4SensorCalibration* px4SensorCalibration;
QMessageBox msgBox;
+ QGraphicsScene scene;
QPushButton* skipActionButton;
private:
diff --git a/src/ui/QGCPX4VehicleConfig.ui b/src/ui/QGCPX4VehicleConfig.ui
index f23424e64e61c2e5d3b88006a8cc450808f87045..c9d9fb63b72a9e91245d105e28cce7a22a82218d 100644
--- a/src/ui/QGCPX4VehicleConfig.ui
+++ b/src/ui/QGCPX4VehicleConfig.ui
@@ -42,7 +42,7 @@
-
- 0
+ 1
@@ -205,6 +205,9 @@
+ -
+
+
-
@@ -819,8 +822,8 @@
0
0
- 98
- 28
+ 21
+ 16
@@ -856,8 +859,8 @@
0
0
- 98
- 28
+ 21
+ 16
@@ -907,8 +910,8 @@
0
0
- 98
- 28
+ 16
+ 16