Commit 094eaf2f authored by Don Gagne's avatar Don Gagne

New ParameterEditor control and dock widget

parent 2fa10f5f
...@@ -147,7 +147,6 @@ INCLUDEPATH += \ ...@@ -147,7 +147,6 @@ INCLUDEPATH += \
src/input \ src/input \
src/lib/qmapcontrol \ src/lib/qmapcontrol \
src/ui/mavlink \ src/ui/mavlink \
src/ui/param \
src/ui/map3D \ src/ui/map3D \
src/ui/mission \ src/ui/mission \
src/ui/designer \ src/ui/designer \
...@@ -159,7 +158,8 @@ INCLUDEPATH += \ ...@@ -159,7 +158,8 @@ INCLUDEPATH += \
src/ui/mapdisplay \ src/ui/mapdisplay \
src/VehicleSetup \ src/VehicleSetup \
src/AutoPilotPlugins \ src/AutoPilotPlugins \
src/QmlControls src/QmlControls \
src/ViewWidgets
FORMS += \ FORMS += \
src/ui/MainWindow.ui \ src/ui/MainWindow.ui \
...@@ -169,13 +169,11 @@ FORMS += \ ...@@ -169,13 +169,11 @@ FORMS += \
src/ui/UASInfo.ui \ src/ui/UASInfo.ui \
src/ui/Linechart.ui \ src/ui/Linechart.ui \
src/ui/UASView.ui \ src/ui/UASView.ui \
src/ui/ParameterInterface.ui \
src/ui/WaypointList.ui \ src/ui/WaypointList.ui \
src/ui/JoystickWidget.ui \ src/ui/JoystickWidget.ui \
src/ui/DebugConsole.ui \ src/ui/DebugConsole.ui \
src/ui/HDDisplay.ui \ src/ui/HDDisplay.ui \
src/ui/MAVLinkSettingsWidget.ui \ src/ui/MAVLinkSettingsWidget.ui \
src/ui/QGCSensorSettingsWidget.ui \
src/ui/QGCDataPlot2D.ui \ src/ui/QGCDataPlot2D.ui \
src/ui/QMap3D.ui \ src/ui/QMap3D.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \ src/ui/uas/QGCUnconnectedInfoWidget.ui \
...@@ -263,7 +261,7 @@ HEADERS += \ ...@@ -263,7 +261,7 @@ HEADERS += \
src/comm/MAVLinkSimulationLink.h \ src/comm/MAVLinkSimulationLink.h \
src/comm/UDPLink.h \ src/comm/UDPLink.h \
src/comm/TCPLink.h \ src/comm/TCPLink.h \
src/ui/ParameterInterface.h \ src/ViewWidgets/ParameterEditorWidget.h \
src/ui/WaypointList.h \ src/ui/WaypointList.h \
src/Waypoint.h \ src/Waypoint.h \
src/input/JoystickInput.h \ src/input/JoystickInput.h \
...@@ -273,8 +271,6 @@ HEADERS += \ ...@@ -273,8 +271,6 @@ HEADERS += \
src/ui/MAVLinkSettingsWidget.h \ src/ui/MAVLinkSettingsWidget.h \
src/GAudioOutput.h \ src/GAudioOutput.h \
src/LogCompressor.h \ src/LogCompressor.h \
src/ui/QGCParamWidget.h \
src/ui/QGCSensorSettingsWidget.h \
src/ui/linechart/Linecharts.h \ src/ui/linechart/Linecharts.h \
src/uas/UASWaypointManager.h \ src/uas/UASWaypointManager.h \
src/ui/HSIDisplay.h \ src/ui/HSIDisplay.h \
...@@ -352,8 +348,6 @@ HEADERS += \ ...@@ -352,8 +348,6 @@ HEADERS += \
src/ui/configuration/ApmHighlighter.h \ src/ui/configuration/ApmHighlighter.h \
src/uas/UASParameterDataModel.h \ src/uas/UASParameterDataModel.h \
src/uas/UASParameterCommsMgr.h \ src/uas/UASParameterCommsMgr.h \
src/ui/QGCPendingParamWidget.h \
src/ui/QGCBaseParamWidget.h \
src/ui/px4_configuration/PX4RCCalibration.h \ src/ui/px4_configuration/PX4RCCalibration.h \
src/ui/px4_configuration/RCValueWidget.h \ src/ui/px4_configuration/RCValueWidget.h \
src/uas/UASManagerInterface.h \ src/uas/UASManagerInterface.h \
...@@ -369,7 +363,6 @@ HEADERS += \ ...@@ -369,7 +363,6 @@ HEADERS += \
src/QGCQuickWidget.h \ src/QGCQuickWidget.h \
src/QGCPalette.h \ src/QGCPalette.h \
src/QGCQmlWidgetHolder.h \ src/QGCQmlWidgetHolder.h \
src/ui/QGCParamTreeWidget.h \
src/ui/QGCMapRCToParamDialog.h \ src/ui/QGCMapRCToParamDialog.h \
src/QGCDockWidget.h \ src/QGCDockWidget.h \
src/ui/QGCLinkConfiguration.h \ src/ui/QGCLinkConfiguration.h \
...@@ -379,9 +372,11 @@ HEADERS += \ ...@@ -379,9 +372,11 @@ HEADERS += \
src/uas/UASMessageHandler.h \ src/uas/UASMessageHandler.h \
src/ui/toolbar/MainToolBar.h \ src/ui/toolbar/MainToolBar.h \
src/QmlControls/ScreenTools.h \ src/QmlControls/ScreenTools.h \
src/QmlControls/ParameterEditorController.h \
src/QGCLoggingCategory.h \ src/QGCLoggingCategory.h \
src/ui/flightdisplay/QGCFlightDisplay.h \ src/ui/flightdisplay/QGCFlightDisplay.h \
src/ui/mapdisplay/QGCMapDisplay.h src/ui/mapdisplay/QGCMapDisplay.h \
src/ViewWidgets/ViewWidgetController.h \
SOURCES += \ SOURCES += \
src/main.cc \ src/main.cc \
...@@ -410,7 +405,7 @@ SOURCES += \ ...@@ -410,7 +405,7 @@ SOURCES += \
src/comm/MAVLinkSimulationLink.cc \ src/comm/MAVLinkSimulationLink.cc \
src/comm/UDPLink.cc \ src/comm/UDPLink.cc \
src/comm/TCPLink.cc \ src/comm/TCPLink.cc \
src/ui/ParameterInterface.cc \ src/ViewWidgets/ParameterEditorWidget.cc \
src/ui/WaypointList.cc \ src/ui/WaypointList.cc \
src/Waypoint.cc \ src/Waypoint.cc \
src/input/JoystickInput.cc \ src/input/JoystickInput.cc \
...@@ -420,8 +415,6 @@ SOURCES += \ ...@@ -420,8 +415,6 @@ SOURCES += \
src/ui/MAVLinkSettingsWidget.cc \ src/ui/MAVLinkSettingsWidget.cc \
src/GAudioOutput.cc \ src/GAudioOutput.cc \
src/LogCompressor.cc \ src/LogCompressor.cc \
src/ui/QGCParamWidget.cc \
src/ui/QGCSensorSettingsWidget.cc \
src/ui/linechart/Linecharts.cc \ src/ui/linechart/Linecharts.cc \
src/uas/UASWaypointManager.cc \ src/uas/UASWaypointManager.cc \
src/ui/HSIDisplay.cc \ src/ui/HSIDisplay.cc \
...@@ -496,8 +489,6 @@ SOURCES += \ ...@@ -496,8 +489,6 @@ SOURCES += \
src/ui/configuration/ApmHighlighter.cc \ src/ui/configuration/ApmHighlighter.cc \
src/uas/UASParameterDataModel.cc \ src/uas/UASParameterDataModel.cc \
src/uas/UASParameterCommsMgr.cc \ src/uas/UASParameterCommsMgr.cc \
src/ui/QGCPendingParamWidget.cc \
src/ui/QGCBaseParamWidget.cc \
src/ui/px4_configuration/PX4RCCalibration.cc \ src/ui/px4_configuration/PX4RCCalibration.cc \
src/ui/px4_configuration/RCValueWidget.cc \ src/ui/px4_configuration/RCValueWidget.cc \
src/uas/QGCUASFileManager.cc \ src/uas/QGCUASFileManager.cc \
...@@ -510,7 +501,6 @@ SOURCES += \ ...@@ -510,7 +501,6 @@ SOURCES += \
src/QGCQuickWidget.cc \ src/QGCQuickWidget.cc \
src/QGCPalette.cc \ src/QGCPalette.cc \
src/QGCQmlWidgetHolder.cpp \ src/QGCQmlWidgetHolder.cpp \
src/ui/QGCParamTreeWidget.cpp \
src/ui/QGCMapRCToParamDialog.cpp \ src/ui/QGCMapRCToParamDialog.cpp \
src/QGCDockWidget.cc \ src/QGCDockWidget.cc \
src/ui/QGCLinkConfiguration.cc \ src/ui/QGCLinkConfiguration.cc \
...@@ -520,9 +510,11 @@ SOURCES += \ ...@@ -520,9 +510,11 @@ SOURCES += \
src/uas/UASMessageHandler.cc \ src/uas/UASMessageHandler.cc \
src/ui/toolbar/MainToolBar.cc \ src/ui/toolbar/MainToolBar.cc \
src/QmlControls/ScreenTools.cc \ src/QmlControls/ScreenTools.cc \
src/QmlControls/ParameterEditorController.cc \
src/QGCLoggingCategory.cc \ src/QGCLoggingCategory.cc \
src/ui/flightdisplay/QGCFlightDisplay.cc \ src/ui/flightdisplay/QGCFlightDisplay.cc \
src/ui/mapdisplay/QGCMapDisplay.cc src/ui/mapdisplay/QGCMapDisplay.cc \
src/ViewWidgets/ViewWidgetController.cc \
# #
# Unit Test specific configuration goes here # Unit Test specific configuration goes here
...@@ -605,7 +597,6 @@ HEADERS+= \ ...@@ -605,7 +597,6 @@ HEADERS+= \
src/VehicleSetup/SetupView.h \ src/VehicleSetup/SetupView.h \
src/VehicleSetup/VehicleComponent.h \ src/VehicleSetup/VehicleComponent.h \
src/VehicleSetup/FirmwareUpgradeController.h \ src/VehicleSetup/FirmwareUpgradeController.h \
src/VehicleSetup/ParameterEditorController.h \
src/VehicleSetup/PX4Bootloader.h \ src/VehicleSetup/PX4Bootloader.h \
src/VehicleSetup/PX4FirmwareUpgradeThread.h \ src/VehicleSetup/PX4FirmwareUpgradeThread.h \
src/AutoPilotPlugins/AutoPilotPluginManager.h \ src/AutoPilotPlugins/AutoPilotPluginManager.h \
...@@ -630,7 +621,6 @@ SOURCES += \ ...@@ -630,7 +621,6 @@ SOURCES += \
src/VehicleSetup/SetupView.cc \ src/VehicleSetup/SetupView.cc \
src/VehicleSetup/VehicleComponent.cc \ src/VehicleSetup/VehicleComponent.cc \
src/VehicleSetup/FirmwareUpgradeController.cc \ src/VehicleSetup/FirmwareUpgradeController.cc \
src/VehicleSetup/ParameterEditorController.cc \
src/VehicleSetup/PX4Bootloader.cc \ src/VehicleSetup/PX4Bootloader.cc \
src/VehicleSetup/PX4FirmwareUpgradeThread.cc \ src/VehicleSetup/PX4FirmwareUpgradeThread.cc \
src/AutoPilotPlugins/AutoPilotPluginManager.cc \ src/AutoPilotPlugins/AutoPilotPluginManager.cc \
......
...@@ -29,13 +29,17 @@ ...@@ -29,13 +29,17 @@
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file> <file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file> <file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file> <file alias="QGroundControl/Controls/arrow-down.png">src/QmlControls/arrow-down.png</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="ParameterEditorWidget.qml">src/ViewWidgets/ParameterEditorWidget.qml</file>
<file alias="SetupViewButtonsConnected.qml">src/VehicleSetup/SetupViewButtonsConnected.qml</file> <file alias="SetupViewButtonsConnected.qml">src/VehicleSetup/SetupViewButtonsConnected.qml</file>
<file alias="SetupViewButtonsDisconnected.qml">src/VehicleSetup/SetupViewButtonsDisconnected.qml</file> <file alias="SetupViewButtonsDisconnected.qml">src/VehicleSetup/SetupViewButtonsDisconnected.qml</file>
<file alias="VehicleSummary.qml">src/VehicleSetup/VehicleSummary.qml</file> <file alias="VehicleSummary.qml">src/VehicleSetup/VehicleSummary.qml</file>
<file alias="FirmwareUpgrade.qml">src/VehicleSetup/FirmwareUpgrade.qml</file> <file alias="FirmwareUpgrade.qml">src/VehicleSetup/FirmwareUpgrade.qml</file>
<file alias="ParameterEditor.qml">src/VehicleSetup/ParameterEditor.qml</file> <file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file> <file alias="SafetyComponent.qml">src/AutoPilotPlugins/PX4/SafetyComponent.qml</file>
<file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file> <file alias="PowerComponent.qml">src/AutoPilotPlugins/PX4/PowerComponent.qml</file>
<file alias="SensorsComponent.qml">src/AutoPilotPlugins/PX4/SensorsComponent.qml</file> <file alias="SensorsComponent.qml">src/AutoPilotPlugins/PX4/SensorsComponent.qml</file>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// If you need to make an incompatible changes to stored settings, bump this version number // If you need to make an incompatible changes to stored settings, bump this version number
// up by 1. This will caused store settings to be cleared on next boot. // up by 1. This will caused store settings to be cleared on next boot.
#define QGC_SETTINGS_VERSION 4 #define QGC_SETTINGS_VERSION 5
#define QGC_APPLICATION_NAME "QGroundControl" #define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_ORG_NAME "QGroundControl.org" #define QGC_ORG_NAME "QGroundControl.org"
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
======================================================================*/ ======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2 import QtQuick.Controls.Styles 1.2
...@@ -33,61 +36,51 @@ import QGroundControl.FactSystem 1.0 ...@@ -33,61 +36,51 @@ import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0 import QGroundControl.FactControls 1.0
Rectangle { Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: true } /// true: show full information, false: for use in smaller widgets
ScreenTools { id: screenTools } property bool fullMode: true
ParameterEditorController { id: controller }
QGCLabel { id: charWidth; text: "X"; visible: false } QGCPalette { id: __qgcPal; colorGroupEnabled: true }
ScreenTools { id: __screenTools }
ParameterEditorController { id: __controller }
QGCLabel { id: __charWidth; text: "X"; visible: false }
readonly property real leftMargin: 10 readonly property real __leftMargin: 10
readonly property real rightMargin: 20 readonly property real __rightMargin: 20
readonly property int maxParamChars: 16 readonly property int __maxParamChars: 16
color: qgcPal.window color: __qgcPal.window
// We use an ExclusiveGroup to maintain the visibility of a single editing control at a time // We use an ExclusiveGroup to maintain the visibility of a single editing control at a time
ExclusiveGroup { ExclusiveGroup {
id: exclusiveEditorGroup id: __exclusiveEditorGroup
} }
Column { Column {
anchors.fill:parent anchors.fill:parent
QGCLabel {
text: "PARAMETER EDITOR"
font.pointSize: screenTools.dpiAdjustedPointSize(20)
}
Item {
height: 20
width: 5
}
Row { Row {
spacing: 10 spacing: 10
layoutDirection: Qt.RightToLeft layoutDirection: Qt.RightToLeft
width: parent.width width: parent.width
QGCButton { QGCButton {
text: "Clear RC to Param" text: "Clear RC to Param"
onClicked: controller.clearRCToParam() onClicked: __controller.clearRCToParam()
} }
QGCButton { QGCButton {
text: "Save to file" text: "Save to file"
onClicked: controller.saveToFile() visible: fullMode
onClicked: __controller.saveToFile()
} }
QGCButton { QGCButton {
text: "Load from file" text: "Load from file"
onClicked: controller.loadFromFile() visible: fullMode
onClicked: __controller.loadFromFile()
} }
QGCButton { QGCButton {
id: firstButton id: firstButton
text: "Refresh" text: "Refresh"
onClicked: controller.refresh() onClicked: __controller.refresh()
}
QGCLabel {
width: firstButton.x - parent.spacing
wrapMode: Text.WordWrap
text: "Click a parameter value to modify. Right-click to set an RC to Param mapping. Use caution when modifying parameters here since the values are not checked for validity."
} }
} }
...@@ -104,7 +97,7 @@ Rectangle { ...@@ -104,7 +97,7 @@ Rectangle {
Column { Column {
Repeater { Repeater {
model: controller.componentIds model: __controller.componentIds
Column { Column {
id: componentColumn id: componentColumn
...@@ -113,7 +106,7 @@ Rectangle { ...@@ -113,7 +106,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: "Component #: " + componentId.toString() text: "Component #: " + componentId.toString()
font.pointSize: screenTools.dpiAdjustedPointSize(qgcPal.defaultFontPointSize + 4); font.pointSize: __screenTools.dpiAdjustedPointSize(__qgcPal.defaultFontPointSize + 4);
} }
Item { Item {
...@@ -122,51 +115,51 @@ Rectangle { ...@@ -122,51 +115,51 @@ Rectangle {
} }
Repeater { Repeater {
model: controller.getGroupsForComponent(componentColumn.componentId) model: __controller.getGroupsForComponent(componentColumn.componentId)
Column { Column {
Rectangle { Rectangle {
id: groupRect id: groupRect
color: qgcPal.windowShade color: __qgcPal.windowShade
height: groupBlock.height height: groupBlock.height
width: scrollView.viewport.width - rightMargin width: scrollView.viewport.width - __rightMargin
Column { Column {
id: groupBlock id: groupBlock
Rectangle { Rectangle {
color: qgcPal.windowShadeDark color: __qgcPal.windowShadeDark
height: groupLabel.height height: groupLabel.height
width: groupRect.width width: groupRect.width
QGCLabel { QGCLabel {
id: groupLabel id: groupLabel
height: contentHeight + 5 height: contentHeight + 5
x: leftMargin x: __leftMargin
text: modelData text: modelData
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pointSize: screenTools.dpiAdjustedPointSize(qgcPal.defaultFontPointSize + 2); font.pointSize: __screenTools.dpiAdjustedPointSize(__qgcPal.defaultFontPointSize + 2);
} }
} }
Repeater { Repeater {
model: controller.getFactsForGroup(componentColumn.componentId, modelData) model: __controller.getFactsForGroup(componentColumn.componentId, modelData)
Row { Row {
spacing: 10 spacing: 10
x: leftMargin x: __leftMargin
Fact { id: modelFact; name: modelData + ":" + componentColumn.componentId } Fact { id: modelFact; name: modelData + ":" + componentColumn.componentId }
QGCLabel { QGCLabel {
text: modelFact.name text: modelFact.name
width: charWidth.contentWidth * (maxParamChars + 2) width: __charWidth.contentWidth * (__maxParamChars + 2)
} }
QGCLabel { QGCLabel {
text: modelFact.valueString + " " + modelFact.units text: modelFact.valueString + " " + modelFact.units
width: charWidth.contentWidth * 20 width: __charWidth.contentWidth * 20
height: contentHeight height: contentHeight
MouseArea { MouseArea {
...@@ -178,7 +171,7 @@ Rectangle { ...@@ -178,7 +171,7 @@ Rectangle {
editor.checked = true editor.checked = true
editor.focus = true editor.focus = true
} else if (mouse.button == Qt.RightButton) { } else if (mouse.button == Qt.RightButton) {
controller.setRCToParam(modelData) __controller.setRCToParam(modelData)
} }
} }
} }
...@@ -195,7 +188,7 @@ Rectangle { ...@@ -195,7 +188,7 @@ Rectangle {
// We use an ExclusiveGroup to manage visibility // We use an ExclusiveGroup to manage visibility
property bool checked: false property bool checked: false
property ExclusiveGroup exclusiveGroup: exclusiveEditorGroup property ExclusiveGroup exclusiveGroup: __exclusiveEditorGroup
onExclusiveGroupChanged: { onExclusiveGroupChanged: {
if (exclusiveGroup) if (exclusiveGroup)
exclusiveGroup.bindCheckable(editor) exclusiveGroup.bindCheckable(editor)
...@@ -205,6 +198,7 @@ Rectangle { ...@@ -205,6 +198,7 @@ Rectangle {
QGCLabel { QGCLabel {
text: modelFact.shortDescription text: modelFact.shortDescription
visible: fullMode
} }
} // Row - Fact value } // Row - Fact value
} // Repeater - Facts } // Repeater - Facts
......
...@@ -13,4 +13,6 @@ SubMenuButton 1.0 SubMenuButton.qml ...@@ -13,4 +13,6 @@ SubMenuButton 1.0 SubMenuButton.qml
IndicatorButton 1.0 IndicatorButton.qml IndicatorButton 1.0 IndicatorButton.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ParameterEditor 1.0 ParameterEditor.qml
ViewWidget 1.0 ViewWidget.qml
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
QGroundControl Open Source Ground Control Station QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project This file is part of the QGROUNDCONTROL project
...@@ -21,31 +21,47 @@ ...@@ -21,31 +21,47 @@
======================================================================*/ ======================================================================*/
/// @file import QtQuick 2.3
/// @brief A treeview with context menus for parameters import QtQuick.Controls 1.2
/// @author Thomas Gubler <thomasgubler@gmail.com>
#ifndef QGCPARAMTREEWIDGET_H import QGroundControl.Controls 1.0
#define QGCPARAMTREEWIDGET_H import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
#include <QTreeWidget> Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: true }
ScreenTools { id: screenTools }
/// Implements individual context menus for the QTreeWidgetItems color: qgcPal.window
class QGCParamTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
QGCParamTreeWidget(QWidget *parent = 0);
~QGCParamTreeWidget();
signals: // We use an ExclusiveGroup to maintain the visibility of a single editing control at a time
void mapRCToParamRequest(QString param_id); ExclusiveGroup {
void refreshParamRequest(QString param_id); id: exclusiveEditorGroup
}
public slots: Column {
void showContextMenu(const QPoint &pos); anchors.fill:parent
void contextMenuAction();
}; QGCLabel {
text: "PARAMETER EDITOR"
font.pointSize: screenTools.dpiAdjustedPointSize(20)
}
#endif // QGCPARAMTREEWIDGET_H Item {
height: 20
width: 5
}
QGCLabel {
id: infoLabel
width: parent.width
wrapMode: Text.WordWrap
text: "Click a parameter value to modify. Right-click to set an RC to Param mapping. Use caution when modifying parameters here since the values are not checked for validity."
}
ParameterEditor {
width: parent.width
height: parent.height - (infoLabel.y + infoLabel.height)
}
}
}
...@@ -55,7 +55,6 @@ SetupView::SetupView(QWidget* parent) : ...@@ -55,7 +55,6 @@ SetupView::SetupView(QWidget* parent) :
Q_ASSERT(fSucceeded); Q_ASSERT(fSucceeded);
qmlRegisterType<FirmwareUpgradeController>("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController"); qmlRegisterType<FirmwareUpgradeController>("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController");
qmlRegisterType<ParameterEditorController>("QGroundControl.Controllers", 1, 0, "ParameterEditorController");
_ui->buttonHolder->rootContext()->setContextProperty("controller", this); _ui->buttonHolder->rootContext()->setContextProperty("controller", this);
_ui->buttonHolder->setAutoPilot(NULL); _ui->buttonHolder->setAutoPilot(NULL);
...@@ -137,7 +136,7 @@ void SetupView::parametersButtonClicked(void) ...@@ -137,7 +136,7 @@ void SetupView::parametersButtonClicked(void)
Q_ASSERT(_autoPilotPlugin); Q_ASSERT(_autoPilotPlugin);
setup->setAutoPilot(_autoPilotPlugin); setup->setAutoPilot(_autoPilotPlugin);
setup->setSource(QUrl::fromUserInput("qrc:/qml/ParameterEditor.qml")); setup->setSource(QUrl::fromUserInput("qrc:/qml/SetupParameterEditor.qml"));
_changeSetupWidget(setup); _changeSetupWidget(setup);
} }
......
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
#ifndef PARAMETEREDITORWIDGET_H
#define PARAMETEREDITORWIDGET_H
#include "QGCQmlWidgetHolder.h"
class ParameterEditorWidget : public QGCQmlWidgetHolder
{
Q_OBJECT
public:
ParameterEditorWidget(QWidget *parent = 0);
};
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/// @file
/// @author Don Gagne <don@thegagnes.com>
import QtQuick 2.2
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
ViewWidget {
connectedComponent: editorComponent
Component {
id: editorComponent
ParameterEditor {
fullMode: false
}
}
}
...@@ -338,12 +338,7 @@ void MainWindow::resizeEvent(QResizeEvent * event) ...@@ -338,12 +338,7 @@ void MainWindow::resizeEvent(QResizeEvent * event)
QString MainWindow::_getWindowStateKey() QString MainWindow::_getWindowStateKey()
{ {
if (UASManager::instance()->getActiveUAS()) return QString::number(_currentView)+"_windowstate_";
{
return QString::number(_currentView)+"_windowstate_" + UASManager::instance()->getActiveUAS()->getAutopilotTypeName();
}
else
return QString::number(_currentView)+"_windowstate_";
} }
QString MainWindow::_getWindowGeometryKey() QString MainWindow::_getWindowGeometryKey()
...@@ -372,22 +367,26 @@ void MainWindow::_buildCustomWidgets(void) ...@@ -372,22 +367,26 @@ void MainWindow::_buildCustomWidgets(void)
void MainWindow::_createDockWidget(const QString& title, const QString& name, Qt::DockWidgetArea area, QWidget* innerWidget) void MainWindow::_createDockWidget(const QString& title, const QString& name, Qt::DockWidgetArea area, QWidget* innerWidget)
{ {
Q_ASSERT(!_mapName2DockWidget.contains(name)); Q_ASSERT(!_mapName2DockWidget.contains(name));
QGCDockWidget* dockWidget = new QGCDockWidget(title, this);
Q_CHECK_PTR(dockWidget);
dockWidget->setObjectName(name);
dockWidget->setVisible (false);
if (innerWidget) {
// Put inner widget inside QDockWidget
innerWidget->setParent(dockWidget);
dockWidget->setWidget(innerWidget);
innerWidget->setVisible(true);
}
// Add to menu // Add to menu
QAction* action = new QAction(title, NULL); QAction* action = new QAction(title, NULL);
action->setCheckable(true); action->setCheckable(true);
action->setData(name); action->setData(name);
connect(action, &QAction::triggered, this, &MainWindow::_showDockWidgetAction); connect(action, &QAction::triggered, this, &MainWindow::_showDockWidgetAction);
_ui.menuTools->addAction(action); _ui.menuTools->addAction(action);
// Create widget
QGCDockWidget* dockWidget = new QGCDockWidget(title, action, this);
Q_CHECK_PTR(dockWidget);
dockWidget->setObjectName(name);
dockWidget->setVisible (false);
if (innerWidget) {
// Put inner widget inside QDockWidget
innerWidget->setParent(dockWidget);
dockWidget->setWidget(innerWidget);
innerWidget->setVisible(true);
}
_mapName2DockWidget[name] = dockWidget; _mapName2DockWidget[name] = dockWidget;
_mapDockWidget2Action[dockWidget] = action; _mapDockWidget2Action[dockWidget] = action;
addDockWidget(area, dockWidget); addDockWidget(area, dockWidget);
...@@ -421,7 +420,7 @@ void MainWindow::_buildCommonWidgets(void) ...@@ -421,7 +420,7 @@ void MainWindow::_buildCommonWidgets(void)
{ _uasListDockWidgetName, "Unmanned Systems", Qt::RightDockWidgetArea }, { _uasListDockWidgetName, "Unmanned Systems", Qt::RightDockWidgetArea },
{ _waypointsDockWidgetName, "Mission Plan", Qt::BottomDockWidgetArea }, { _waypointsDockWidgetName, "Mission Plan", Qt::BottomDockWidgetArea },
{ _mavlinkDockWidgetName, "MAVLink Inspector", Qt::RightDockWidgetArea }, { _mavlinkDockWidgetName, "MAVLink Inspector", Qt::RightDockWidgetArea },
{ _parametersDockWidgetName, "Onboard Parameters", Qt::RightDockWidgetArea }, { _parametersDockWidgetName, "Parameter Editor", Qt::RightDockWidgetArea },
{ _filesDockWidgetName, "Onboard Files", Qt::RightDockWidgetArea }, { _filesDockWidgetName, "Onboard Files", Qt::RightDockWidgetArea },
{ _uasStatusDetailsDockWidgetName, "Status Details", Qt::RightDockWidgetArea }, { _uasStatusDetailsDockWidgetName, "Status Details", Qt::RightDockWidgetArea },
{ _mapViewDockWidgetName, "Map view", Qt::RightDockWidgetArea }, { _mapViewDockWidgetName, "Map view", Qt::RightDockWidgetArea },
...@@ -431,7 +430,7 @@ void MainWindow::_buildCommonWidgets(void) ...@@ -431,7 +430,7 @@ void MainWindow::_buildCommonWidgets(void)
{ _pfdDockWidgetName, "Primary Flight Display", Qt::RightDockWidgetArea }, { _pfdDockWidgetName, "Primary Flight Display", Qt::RightDockWidgetArea },
{ _hudDockWidgetName, "Video Downlink", Qt::RightDockWidgetArea }, { _hudDockWidgetName, "Video Downlink", Qt::RightDockWidgetArea },
{ _uasInfoViewDockWidgetName, "Info View", Qt::LeftDockWidgetArea }, { _uasInfoViewDockWidgetName, "Info View", Qt::LeftDockWidgetArea },
{ _debugConsoleDockWidgetName, "Communications Console", Qt::LeftDockWidgetArea } { _debugConsoleDockWidgetName, "Communications Console", Qt::LeftDockWidgetArea },
}; };
static const size_t cDockWidgetInfo = sizeof(rgDockWidgetInfo) / sizeof(rgDockWidgetInfo[0]); static const size_t cDockWidgetInfo = sizeof(rgDockWidgetInfo) / sizeof(rgDockWidgetInfo[0]);
...@@ -550,7 +549,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName) ...@@ -550,7 +549,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
} else if (widgetName == _mavlinkDockWidgetName) { } else if (widgetName == _mavlinkDockWidgetName) {
widget = new QGCMAVLinkInspector(MAVLinkProtocol::instance(),this); widget = new QGCMAVLinkInspector(MAVLinkProtocol::instance(),this);
} else if (widgetName == _parametersDockWidgetName) { } else if (widgetName == _parametersDockWidgetName) {
widget = new ParameterInterface(this); widget = new ParameterEditorWidget(this);
} else if (widgetName == _filesDockWidgetName) { } else if (widgetName == _filesDockWidgetName) {
widget = new QGCUASFileViewMulti(this); widget = new QGCUASFileViewMulti(this);
} else if (widgetName == _uasStatusDetailsDockWidgetName) { } else if (widgetName == _uasStatusDetailsDockWidgetName) {
...@@ -614,7 +613,7 @@ void MainWindow::_showHILConfigurationWidgets(void) ...@@ -614,7 +613,7 @@ void MainWindow::_showHILConfigurationWidgets(void)
if (!_mapUasId2HilDockWidget.contains(uasId)) { if (!_mapUasId2HilDockWidget.contains(uasId)) {
// Create QDockWidget // Create QDockWidget
QGCDockWidget* dockWidget = new QGCDockWidget(tr("HIL Config %1").arg(uasId), this); QGCDockWidget* dockWidget = new QGCDockWidget(tr("HIL Config %1").arg(uasId), NULL, this);
Q_CHECK_PTR(dockWidget); Q_CHECK_PTR(dockWidget);
dockWidget->setObjectName(tr("HIL_CONFIG_%1").arg(uasId)); dockWidget->setObjectName(tr("HIL_CONFIG_%1").arg(uasId));
dockWidget->setVisible (false); dockWidget->setVisible (false);
...@@ -765,12 +764,11 @@ void MainWindow::storeSettings() ...@@ -765,12 +764,11 @@ void MainWindow::storeSettings()
settings.setValue("SHOW_STATUSBAR", _showStatusBar); settings.setValue("SHOW_STATUSBAR", _showStatusBar);
settings.endGroup(); settings.endGroup();
settings.setValue(_getWindowGeometryKey(), saveGeometry()); settings.setValue(_getWindowGeometryKey(), saveGeometry());
// Save the last current view in any case // Save the last current view in any case
settings.setValue("CURRENT_VIEW", _currentView); settings.setValue("CURRENT_VIEW", _currentView);
// Save the current window state, but only if a system is connected (else no real number of widgets would be present)) settings.setValue(_getWindowStateKey(), saveState());
if (UASManager::instance()->getUASList().length() > 0) settings.setValue(_getWindowStateKey(), saveState());
// Save the current UAS view if a UAS is connected
if (UASManager::instance()->getUASList().length() > 0) settings.setValue("CURRENT_VIEW_WITH_UAS_CONNECTED", _currentView);
// And save any custom weidgets // And save any custom weidgets
QGCToolWidget::storeWidgetsToSettings(settings); QGCToolWidget::storeWidgetsToSettings(settings);
} }
...@@ -877,7 +875,6 @@ void MainWindow::connectCommonActions() ...@@ -877,7 +875,6 @@ void MainWindow::connectCommonActions()
// Connect internal actions // Connect internal actions
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*))); connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(UASCreated(UASInterface*)));
connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*)));
// Unmanned System controls // Unmanned System controls
connect(_ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS())); connect(_ui.actionLiftoff, SIGNAL(triggered()), UASManager::instance(), SLOT(launchActiveUAS()));
...@@ -978,21 +975,6 @@ void MainWindow::commsWidgetDestroyed(QObject *obj) ...@@ -978,21 +975,6 @@ void MainWindow::commsWidgetDestroyed(QObject *obj)
} }
} }
void MainWindow::setActiveUAS(UASInterface* uas)
{
Q_UNUSED(uas);
if (settings.contains(_getWindowStateKey()))
{
restoreState(settings.value(_getWindowStateKey()).toByteArray());
}
}
void MainWindow::UASSpecsChanged(int uas)
{
Q_UNUSED(uas);
// TODO: Update UAS properties if its specs change
}
void MainWindow::UASCreated(UASInterface* uas) void MainWindow::UASCreated(UASInterface* uas)
{ {
// The UAS actions are not enabled without connection to system // The UAS actions are not enabled without connection to system
...@@ -1002,7 +984,6 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1002,7 +984,6 @@ void MainWindow::UASCreated(UASInterface* uas)
_ui.actionEmergency_Land->setEnabled(true); _ui.actionEmergency_Land->setEnabled(true);
_ui.actionShutdownMAV->setEnabled(true); _ui.actionShutdownMAV->setEnabled(true);
connect(uas, SIGNAL(systemSpecsChanged(int)), this, SLOT(UASSpecsChanged(int)));
connect(uas, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)), this, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64))); connect(uas, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)), this, SIGNAL(valueChanged(int,QString,QString,QVariant,quint64)));
connect(uas, SIGNAL(misconfigurationDetected(UASInterface*)), this, SLOT(handleMisconfiguration(UASInterface*))); connect(uas, SIGNAL(misconfigurationDetected(UASInterface*)), this, SLOT(handleMisconfiguration(UASInterface*)));
...@@ -1020,15 +1001,6 @@ void MainWindow::UASCreated(UASInterface* uas) ...@@ -1020,15 +1001,6 @@ void MainWindow::UASCreated(UASInterface* uas)
{ {
_analyzeView = linechartWidget; _analyzeView = linechartWidget;
} }
// Reload view state in case new widgets were added
_loadCurrentViewState();
}
void MainWindow::UASDeleted(UASInterface* uas)
{
Q_UNUSED(uas);
// TODO: Update the UI when a UAS is deleted
} }
/// Stores the state of the toolbar, status bar and widgets associated with the current view /// Stores the state of the toolbar, status bar and widgets associated with the current view
......
...@@ -53,7 +53,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -53,7 +53,7 @@ This file is part of the QGROUNDCONTROL project
#include "Mouse6dofInput.h" #include "Mouse6dofInput.h"
#endif // QGC_MOUSE_ENABLED_WIN #endif // QGC_MOUSE_ENABLED_WIN
#include "DebugConsole.h" #include "DebugConsole.h"
#include "ParameterInterface.h" #include "ParameterEditorWidget.h"
#include "HDDisplay.h" #include "HDDisplay.h"
#include "HSIDisplay.h" #include "HSIDisplay.h"
#include "opmapcontrol.h" #include "opmapcontrol.h"
...@@ -132,15 +132,9 @@ public slots: ...@@ -132,15 +132,9 @@ public slots:
void showSettings(); void showSettings();
/** @brief Simulate a link */ /** @brief Simulate a link */
void simulateLink(bool simulate); void simulateLink(bool simulate);
/** @brief Set the currently controlled UAS */
void setActiveUAS(UASInterface* uas);
/** @brief Add a new UAS */ /** @brief Add a new UAS */
void UASCreated(UASInterface* uas); void UASCreated(UASInterface* uas);
/** Delete an UAS */
void UASDeleted(UASInterface* uas);
/** @brief Update system specs of a UAS */
void UASSpecsChanged(int uas);
void handleMisconfiguration(UASInterface* uas); void handleMisconfiguration(UASInterface* uas);
/** @brief Load configuration views */ /** @brief Load configuration views */
......
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