forked from mavlink/qgroundcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lights settings component for Sub.
- Loading branch information
Showing
10 changed files
with
430 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
|
||
/// @file | ||
/// @author Don Gagne <[email protected]> | ||
/// @author Rustom Jehangir <[email protected]> | ||
|
||
#include "APMLightsComponent.h" | ||
#include "QGCQmlWidgetHolder.h" | ||
#include "APMAutoPilotPlugin.h" | ||
#include "APMAirframeComponent.h" | ||
|
||
APMLightsComponent::APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) | ||
: VehicleComponent(vehicle, autopilot, parent) | ||
, _name(tr("Lights")) | ||
{ | ||
} | ||
|
||
QString APMLightsComponent::name(void) const | ||
{ | ||
return _name; | ||
} | ||
|
||
QString APMLightsComponent::description(void) const | ||
{ | ||
return tr("The Lights Component is used to setup lights settings."); | ||
} | ||
|
||
QString APMLightsComponent::iconResource(void) const | ||
{ | ||
return QStringLiteral("/qmlimages/LightsComponentIcon.png"); | ||
} | ||
|
||
bool APMLightsComponent::requiresSetup(void) const | ||
{ | ||
return false; | ||
} | ||
|
||
bool APMLightsComponent::setupComplete(void) const | ||
{ | ||
return true; | ||
} | ||
|
||
QStringList APMLightsComponent::setupCompleteChangedTriggerList(void) const | ||
{ | ||
return QStringList(); | ||
} | ||
|
||
QUrl APMLightsComponent::setupSource(void) const | ||
{ | ||
return QUrl::fromUserInput(QStringLiteral("qrc:/qml/APMLightsComponent.qml")); | ||
} | ||
|
||
QUrl APMLightsComponent::summaryQmlSource(void) const | ||
{ | ||
return QUrl::fromUserInput(QStringLiteral("qrc:/qml/APMLightsComponentSummary.qml")); | ||
} | ||
|
||
QString APMLightsComponent::prerequisiteSetup(void) const | ||
{ | ||
APMAutoPilotPlugin* plugin = dynamic_cast<APMAutoPilotPlugin*>(_autopilot); | ||
Q_ASSERT(plugin); | ||
|
||
if (!plugin->airframeComponent()->setupComplete()) { | ||
return plugin->airframeComponent()->name(); | ||
} | ||
|
||
return QString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/**************************************************************************** | ||
* | ||
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> | ||
* | ||
* QGroundControl is licensed according to the terms in the file | ||
* COPYING.md in the root of the source code directory. | ||
* | ||
****************************************************************************/ | ||
|
||
|
||
#ifndef APMLightsComponent_H | ||
#define APMLightsComponent_H | ||
|
||
#include "VehicleComponent.h" | ||
|
||
class APMLightsComponent : public VehicleComponent | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
APMLightsComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent = NULL); | ||
|
||
// Virtuals from VehicleComponent | ||
QStringList setupCompleteChangedTriggerList(void) const final; | ||
|
||
// Virtuals from VehicleComponent | ||
QString name(void) const final; | ||
QString description(void) const final; | ||
QString iconResource(void) const final; | ||
bool requiresSetup(void) const final; | ||
bool setupComplete(void) const final; | ||
QUrl setupSource(void) const final; | ||
QUrl summaryQmlSource(void) const final; | ||
QString prerequisiteSetup(void) const final; | ||
|
||
private: | ||
const QString _name; | ||
}; | ||
|
||
#endif |
Oops, something went wrong.