Commit b5b1d616 authored by Don Gagne's avatar Don Gagne

APM Stack Camera Config

parent 09e505e2
......@@ -14,6 +14,7 @@
<file alias="arrow-down.png">src/QmlControls/arrow-down.png</file>
<file alias="FirmwareUpgradeIcon.png">src/VehicleSetup/FirmwareUpgradeIcon.png</file>
<file alias="FlightModesComponentIcon.png">src/AutoPilotPlugins/PX4/Images/FlightModesComponentIcon.png</file>
<file alias="CameraComponentIcon.png">src/AutoPilotPlugins/PX4/Images/CameraComponentIcon.png</file>
<file alias="PowerComponentBattery_01cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_01cell.svg</file>
<file alias="PowerComponentBattery_02cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_02cell.svg</file>
<file alias="PowerComponentBattery_03cell.svg">src/AutoPilotPlugins/PX4/Images/PowerComponentBattery_03cell.svg</file>
......@@ -25,6 +26,7 @@
<file alias="ReturnToHomeAltitude.svg">src/AutoPilotPlugins/PX4/Images/ReturnToHomeAltitude.svg</file>
<file alias="SafetyComponentIcon.png">src/AutoPilotPlugins/PX4/Images/SafetyComponentIcon.png</file>
<file alias="SensorsComponentIcon.png">src/AutoPilotPlugins/PX4/Images/SensorsComponentIcon.png</file>
<file alias="TuningComponentIcon.png">src/AutoPilotPlugins/PX4/Images/TuningComponentIcon.png</file>
<file alias="subMenuButtonImage.png">resources/CogWheels.png</file>
<file alias="VehicleDown.png">src/AutoPilotPlugins/PX4/Images/VehicleDown.png</file>
<file alias="VehicleDownRotate.png">src/AutoPilotPlugins/PX4/Images/VehicleDownRotate.png</file>
......
......@@ -560,6 +560,7 @@ HEADERS+= \
src/AutoPilotPlugins/APM/APMAirframeComponent.h \
src/AutoPilotPlugins/APM/APMAirframeComponentController.h \
src/AutoPilotPlugins/APM/APMAirframeComponentAirframes.h \
src/AutoPilotPlugins/APM/APMCameraComponent.h \
src/AutoPilotPlugins/APM/APMCompassCal.h \
src/AutoPilotPlugins/APM/APMComponent.h \
src/AutoPilotPlugins/APM/APMFlightModesComponent.h \
......@@ -614,6 +615,7 @@ SOURCES += \
src/AutoPilotPlugins/APM/APMAutoPilotPlugin.cc \
src/AutoPilotPlugins/APM/APMAirframeComponent.cc \
src/AutoPilotPlugins/APM/APMAirframeComponentController.cc \
src/AutoPilotPlugins/APM/APMCameraComponent.cc \
src/AutoPilotPlugins/APM/APMCompassCal.cc \
src/AutoPilotPlugins/APM/APMComponent.cc \
src/AutoPilotPlugins/APM/APMFlightModesComponent.cc \
......
......@@ -106,6 +106,8 @@
<file alias="RadioComponent.qml">src/AutoPilotPlugins/Common/RadioComponent.qml</file>
<file alias="PX4RadioComponentSummary.qml">src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml</file>
<file alias="APMNotSupported.qml">src/AutoPilotPlugins/APM/APMNotSupported.qml</file>
<file alias="APMCameraComponent.qml">src/AutoPilotPlugins/APM/APMCameraComponent.qml</file>
<file alias="APMCameraComponentSummary.qml">src/AutoPilotPlugins/APM/APMCameraComponentSummary.qml</file>
<file alias="APMPowerComponent.qml">src/AutoPilotPlugins/APM/APMPowerComponent.qml</file>
<file alias="APMPowerComponentSummary.qml">src/AutoPilotPlugins/APM/APMPowerComponentSummary.qml</file>
<file alias="APMRadioComponentSummary.qml">src/AutoPilotPlugins/APM/APMRadioComponentSummary.qml</file>
......
......@@ -39,12 +39,14 @@
#include "APMTuningComponent.h"
#include "APMSensorsComponent.h"
#include "APMPowerComponent.h"
#include "APMCameraComponent.h"
/// This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_ARDUPILOT type.
APMAutoPilotPlugin::APMAutoPilotPlugin(Vehicle* vehicle, QObject* parent)
: AutoPilotPlugin(vehicle, parent)
, _incorrectParameterVersion(false)
, _airframeComponent(NULL)
, _cameraComponent(NULL)
, _flightModesComponent(NULL)
, _powerComponent(NULL)
, _radioComponent(NULL)
......@@ -75,6 +77,10 @@ const QVariantList& APMAutoPilotPlugin::vehicleComponents(void)
qWarning() << "new APMAirframeComponent failed";
}
_cameraComponent = new APMCameraComponent(_vehicle, this);
_cameraComponent->setupTriggerSignals();
_components.append(QVariant::fromValue((VehicleComponent*)_cameraComponent));
_flightModesComponent = new APMFlightModesComponent(_vehicle, this);
if (_flightModesComponent) {
_flightModesComponent->setupTriggerSignals();
......
......@@ -35,6 +35,7 @@ class APMTuningComponent;
class APMSafetyComponent;
class APMSensorsComponent;
class APMPowerComponent;
class APMCameraComponent;
/// This is the APM specific implementation of the AutoPilot class.
class APMAutoPilotPlugin : public AutoPilotPlugin
......@@ -49,6 +50,7 @@ public:
virtual const QVariantList& vehicleComponents(void);
APMAirframeComponent* airframeComponent (void) { return _airframeComponent; }
APMCameraComponent* cameraComponent (void) { return _cameraComponent; }
APMFlightModesComponent* flightModesComponent(void) { return _flightModesComponent; }
APMPowerComponent* powerComponent (void) { return _powerComponent; }
APMRadioComponent* radioComponent (void) { return _radioComponent; }
......@@ -65,13 +67,14 @@ private:
QVariantList _components;
APMAirframeComponent* _airframeComponent;
APMCameraComponent* _cameraComponent;
APMFlightModesComponent* _flightModesComponent;
APMPowerComponent* _powerComponent;
APMRadioComponent* _radioComponent;
APMSafetyComponent* _safetyComponent;
APMSensorsComponent* _sensorsComponent;
APMTuningComponent* _tuningComponent;
APMAirframeLoader* _airframeFacts;
APMAirframeLoader* _airframeFacts;
};
#endif
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 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>
#include "APMCameraComponent.h"
#include "QGCQmlWidgetHolder.h"
#include "APMAutoPilotPlugin.h"
#include "APMAirframeComponent.h"
APMCameraComponent::APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
: APMComponent(vehicle, autopilot, parent)
, _name(tr("Camera"))
{
}
QString APMCameraComponent::name(void) const
{
return _name;
}
QString APMCameraComponent::description(void) const
{
return tr("The Camera Component is used to setup camera and gimbal settings.");
}
QString APMCameraComponent::iconResource(void) const
{
return "/qmlimages/CameraComponentIcon.png";
}
bool APMCameraComponent::requiresSetup(void) const
{
return false;
}
bool APMCameraComponent::setupComplete(void) const
{
return true;
}
QStringList APMCameraComponent::setupCompleteChangedTriggerList(void) const
{
return QStringList();
}
QUrl APMCameraComponent::setupSource(void) const
{
return QUrl::fromUserInput("qrc:/qml/APMCameraComponent.qml");
}
QUrl APMCameraComponent::summaryQmlSource(void) const
{
return QUrl::fromUserInput("qrc:/qml/APMCameraComponentSummary.qml");
}
QString APMCameraComponent::prerequisiteSetup(void) const
{
APMAutoPilotPlugin* plugin = dynamic_cast<APMAutoPilotPlugin*>(_autopilot);
Q_ASSERT(plugin);
if (!plugin->airframeComponent()->setupComplete()) {
return plugin->airframeComponent()->name();
}
return QString();
}
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2014 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/>.
======================================================================*/
#ifndef APMCameraComponent_H
#define APMCameraComponent_H
#include "APMComponent.h"
class APMCameraComponent : public APMComponent
{
Q_OBJECT
public:
APMCameraComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL);
// Virtuals from PX4Component
virtual QStringList setupCompleteChangedTriggerList(void) const;
// Virtuals from VehicleComponent
virtual QString name(void) const;
virtual QString description(void) const;
virtual QString iconResource(void) const;
virtual bool requiresSetup(void) const;
virtual bool setupComplete(void) const;
virtual QUrl setupSource(void) const;
virtual QUrl summaryQmlSource(void) const;
virtual QString prerequisiteSetup(void) const;
private:
const QString _name;
};
#endif
This diff is collapsed.
import QtQuick 2.5
import QtQuick.Controls 1.2
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
FactPanel {
id: panel
anchors.fill: parent
color: qgcPal.windowShadeDark
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact _mountRCInTilt: controller.getParameterFact(-1, "MNT_RC_IN_TILT")
property Fact _mountRCInRoll: controller.getParameterFact(-1, "MNT_RC_IN_ROLL")
property Fact _mountRCInPan: controller.getParameterFact(-1, "MNT_RC_IN_PAN")
property Fact _mountType: controller.getParameterFact(-1, "MNT_TYPE")
Column {
anchors.fill: parent
anchors.margins: 8
VehicleSummaryRow {
labelText: "Gimbal type:"
valueText: _mountType.enumStringValue
}
VehicleSummaryRow {
labelText: "Tilt input channel:"
valueText: _mountRCInTilt.enumStringValue
}
VehicleSummaryRow {
labelText: "Pan input channel:"
valueText: _mountRCInPan.enumStringValue
}
VehicleSummaryRow {
labelText: "Roll input channel:"
valueText: _mountRCInRoll.enumStringValue
}
}
}
......@@ -43,7 +43,7 @@ QString APMTuningComponent::description(void) const
QString APMTuningComponent::iconResource(void) const
{
return "/qmlimages/subMenuButtonImage.png";
return "/qmlimages/TuningComponentIcon.png";
}
bool APMTuningComponent::requiresSetup(void) const
......
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