Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
bdfacbd2
Commit
bdfacbd2
authored
Feb 04, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
General Clean Up
parent
0064bb76
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
152 additions
and
138 deletions
+152
-138
ESP8266ComponentSummary.qml
src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml
+2
-2
AirframeComponentSummary.qml
src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
+4
-4
FlightModesComponentSummary.qml
src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
+4
-4
PX4RadioComponentSummary.qml
src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml
+7
-7
PowerComponentSummary.qml
src/AutoPilotPlugins/PX4/PowerComponentSummary.qml
+4
-4
SafetyComponentSummary.qml
src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
+5
-5
SensorsComponentSummary.qml
src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
+4
-4
SensorsComponentSummaryFixedWing.qml
...AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
+4
-4
FactTextField.qml
src/FactSystem/FactControls/FactTextField.qml
+2
-2
MissionController.cc
src/MissionManager/MissionController.cc
+1
-1
QGCDockWidget.cc
src/QGCDockWidget.cc
+4
-2
VehicleSummary.qml
src/VehicleSetup/VehicleSummary.qml
+2
-2
CustomCommandWidget.qml
src/ViewWidgets/CustomCommandWidget.qml
+72
-70
CustomCommandWidgetController.cc
src/ViewWidgets/CustomCommandWidgetController.cc
+13
-16
CustomCommandWidgetController.h
src/ViewWidgets/CustomCommandWidgetController.h
+9
-6
LinkInterface.h
src/comm/LinkInterface.h
+14
-2
UDPLink.cc
src/comm/UDPLink.cc
+1
-3
No files found.
src/AutoPilotPlugins/Common/ESP8266ComponentSummary.qml
View file @
bdfacbd2
...
@@ -34,7 +34,7 @@ FactPanel {
...
@@ -34,7 +34,7 @@ FactPanel {
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
WiFi Channel:
"
labelText
:
"
WiFi Channel:
"
valueText
:
wifiChannel
.
valueString
valueText
:
wifiChannel
?
wifiChannel
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
WiFi SSID:
"
labelText
:
"
WiFi SSID:
"
...
@@ -46,7 +46,7 @@ FactPanel {
...
@@ -46,7 +46,7 @@ FactPanel {
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
UART Baud Rate:
"
labelText
:
"
UART Baud Rate:
"
valueText
:
uartBaud
.
valueString
valueText
:
uartBaud
?
uartBaud
.
valueString
:
""
}
}
}
}
}
}
src/AutoPilotPlugins/PX4/AirframeComponentSummary.qml
View file @
bdfacbd2
...
@@ -18,15 +18,15 @@ FactPanel {
...
@@ -18,15 +18,15 @@ FactPanel {
property
Fact
sysIdFact
:
controller
.
getParameterFact
(
-
1
,
"
MAV_SYS_ID
"
)
property
Fact
sysIdFact
:
controller
.
getParameterFact
(
-
1
,
"
MAV_SYS_ID
"
)
property
Fact
sysAutoStartFact
:
controller
.
getParameterFact
(
-
1
,
"
SYS_AUTOSTART
"
)
property
Fact
sysAutoStartFact
:
controller
.
getParameterFact
(
-
1
,
"
SYS_AUTOSTART
"
)
property
bool
autoStartSet
:
sysAutoStartFact
.
value
!=
0
property
bool
autoStartSet
:
sysAutoStartFact
?
(
sysAutoStartFact
.
value
!==
0
)
:
false
Column
{
Column
{
anchors.fill
:
parent
anchors.fill
:
parent
anchors.margins
:
8
anchors.margins
:
8
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
System ID:
"
labelText
:
"
System ID:
"
valueText
:
sysIdFact
.
valueString
valueText
:
sysIdFact
?
sysIdFact
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
...
@@ -39,4 +39,4 @@ FactPanel {
...
@@ -39,4 +39,4 @@ FactPanel {
valueText
:
autoStartSet
?
controller
.
currentVehicleName
:
"
Setup required
"
valueText
:
autoStartSet
?
controller
.
currentVehicleName
:
"
Setup required
"
}
}
}
}
}
}
\ No newline at end of file
src/AutoPilotPlugins/PX4/FlightModesComponentSummary.qml
View file @
bdfacbd2
...
@@ -25,22 +25,22 @@ FactPanel {
...
@@ -25,22 +25,22 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Mode switch:
"
labelText
:
"
Mode switch:
"
valueText
:
modeSwFact
.
value
==
0
?
"
Setup required
"
:
modeSwFact
.
valueString
valueText
:
modeSwFact
?
(
modeSwFact
.
value
===
0
?
"
Setup required
"
:
modeSwFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Position Ctl switch:
"
labelText
:
"
Position Ctl switch:
"
valueText
:
posCtlSwFact
.
value
==
0
?
"
Disabled
"
:
posCtlSwFact
.
valueString
valueText
:
posCtlSwFact
?
(
posCtlSwFact
.
value
===
0
?
"
Disabled
"
:
posCtlSwFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Loiter switch:
"
labelText
:
"
Loiter switch:
"
valueText
:
loiterSwFact
.
value
==
0
?
"
Disabled
"
:
loiterSwFact
.
valueString
valueText
:
loiterSwFact
?
(
loiterSwFact
.
value
===
0
?
"
Disabled
"
:
loiterSwFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Return switch:
"
labelText
:
"
Return switch:
"
valueText
:
returnSwFact
.
value
==
0
?
"
Disabled
"
:
returnSwFact
.
valueString
valueText
:
returnSwFact
?
(
returnSwFact
.
value
===
0
?
"
Disabled
"
:
returnSwFact
.
valueString
)
:
""
}
}
}
}
}
}
src/AutoPilotPlugins/PX4/PX4RadioComponentSummary.qml
View file @
bdfacbd2
...
@@ -28,37 +28,37 @@ FactPanel {
...
@@ -28,37 +28,37 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Roll:
"
labelText
:
"
Roll:
"
valueText
:
mapRollFact
.
value
==
0
?
"
Setup required
"
:
mapRollFact
.
valueString
valueText
:
mapRollFact
?
(
mapRollFact
.
value
===
0
?
"
Setup required
"
:
mapRollFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Pitch:
"
labelText
:
"
Pitch:
"
valueText
:
mapPitchFact
.
value
==
0
?
"
Setup required
"
:
mapPitchFact
.
valueString
valueText
:
mapPitchFact
?
(
mapPitchFact
.
value
===
0
?
"
Setup required
"
:
mapPitchFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Yaw:
"
labelText
:
"
Yaw:
"
valueText
:
mapYawFact
.
value
==
0
?
"
Setup required
"
:
mapYawFact
.
valueString
valueText
:
mapYawFact
?
(
mapYawFact
.
value
===
0
?
"
Setup required
"
:
mapYawFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Throttle:
"
labelText
:
"
Throttle:
"
valueText
:
mapThrottleFact
.
value
==
0
?
"
Setup required
"
:
mapThrottleFact
.
valueString
valueText
:
mapThrottleFact
?
(
mapThrottleFact
.
value
===
0
?
"
Setup required
"
:
mapThrottleFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Flaps:
"
labelText
:
"
Flaps:
"
valueText
:
mapFlapsFact
.
value
==
0
?
"
Disabled
"
:
mapFlapsFact
.
valueString
valueText
:
mapFlapsFact
?
(
mapFlapsFact
.
value
===
0
?
"
Disabled
"
:
mapFlapsFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Aux1:
"
labelText
:
"
Aux1:
"
valueText
:
mapAux1Fact
.
value
==
0
?
"
Disabled
"
:
mapAux1Fact
.
valueString
valueText
:
mapAux1Fact
?
(
mapAux1Fact
.
value
===
0
?
"
Disabled
"
:
mapAux1Fact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Aux2:
"
labelText
:
"
Aux2:
"
valueText
:
mapAux2Fact
.
value
==
0
?
"
Disabled
"
:
mapAux2Fact
.
valueString
valueText
:
mapAux2Fact
?
(
mapAux2Fact
.
value
===
0
?
"
Disabled
"
:
mapAux2Fact
.
valueString
)
:
""
}
}
}
}
}
}
src/AutoPilotPlugins/PX4/PowerComponentSummary.qml
View file @
bdfacbd2
...
@@ -51,17 +51,17 @@ FactPanel {
...
@@ -51,17 +51,17 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Battery Full:
"
labelText
:
"
Battery Full:
"
valueText
:
batVChargedFact
.
valueString
valueText
:
batVChargedFact
?
batVChargedFact
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Battery Empty:
"
labelText
:
"
Battery Empty:
"
valueText
:
batVEmptyFact
.
valueString
valueText
:
batVEmptyFact
?
batVEmptyFact
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Number of Cells:
"
labelText
:
"
Number of Cells:
"
valueText
:
batCellsFact
.
valueString
valueText
:
batCellsFact
?
batCellsFact
.
valueString
:
""
}
}
}
}
}
}
\ No newline at end of file
src/AutoPilotPlugins/PX4/SafetyComponentSummary.qml
View file @
bdfacbd2
...
@@ -26,27 +26,27 @@ FactPanel {
...
@@ -26,27 +26,27 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
RTL min alt:
"
labelText
:
"
RTL min alt:
"
valueText
:
returnAltFact
.
valueString
valueText
:
returnAltFact
?
returnAltFact
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
RTL home alt:
"
labelText
:
"
RTL home alt:
"
valueText
:
descendAltFact
.
valueString
valueText
:
descendAltFact
?
descendAltFact
.
valueString
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
RTL loiter delay:
"
labelText
:
"
RTL loiter delay:
"
valueText
:
landDelayFact
.
value
<
0
?
"
Disabled
"
:
landDelayFact
.
valueString
valueText
:
landDelayFact
?
(
landDelayFact
.
value
<
0
?
"
Disabled
"
:
landDelayFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Telemetry loss RTL:
"
labelText
:
"
Telemetry loss RTL:
"
valueText
:
commDLLossFact
.
value
!=
-
1
?
"
Disabled
"
:
commDLLossFact
.
valueString
valueText
:
commDLLossFact
?
(
commDLLossFact
.
value
!=
-
1
?
"
Disabled
"
:
commDLLossFact
.
valueString
)
:
""
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
RC loss RTL (seconds):
"
labelText
:
"
RC loss RTL (seconds):
"
valueText
:
commRCLossFact
.
valueString
valueText
:
commRCLossFact
?
commRCLossFact
.
valueString
:
""
}
}
}
}
}
}
src/AutoPilotPlugins/PX4/SensorsComponentSummary.qml
View file @
bdfacbd2
...
@@ -29,17 +29,17 @@ FactPanel {
...
@@ -29,17 +29,17 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Compass:
"
labelText
:
"
Compass:
"
valueText
:
mag0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
mag0IdFact
?
(
mag0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Gyro:
"
labelText
:
"
Gyro:
"
valueText
:
gyro0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
gyro0IdFact
?
(
gyro0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Accelerometer:
"
labelText
:
"
Accelerometer:
"
valueText
:
accel0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
accel0IdFact
?
(
accel0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
}
}
}
}
\ No newline at end of file
src/AutoPilotPlugins/PX4/SensorsComponentSummaryFixedWing.qml
View file @
bdfacbd2
...
@@ -29,22 +29,22 @@ FactPanel {
...
@@ -29,22 +29,22 @@ FactPanel {
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Compass:
"
labelText
:
"
Compass:
"
valueText
:
mag0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
mag0IdFact
?
(
mag0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Gyro:
"
labelText
:
"
Gyro:
"
valueText
:
gyro0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
gyro0IdFact
?
(
gyro0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Accelerometer:
"
labelText
:
"
Accelerometer:
"
valueText
:
accel0IdFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
accel0IdFact
?
(
accel0IdFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Airspeed:
"
labelText
:
"
Airspeed:
"
valueText
:
dpressOffFact
.
value
==
0
?
"
Setup required
"
:
"
Ready
"
valueText
:
dpressOffFact
?
(
dpressOffFact
.
value
===
0
?
"
Setup required
"
:
"
Ready
"
)
:
"
"
}
}
}
}
}
}
src/FactSystem/FactControls/FactTextField.qml
View file @
bdfacbd2
...
@@ -11,8 +11,8 @@ import QGroundControl.Controls 1.0
...
@@ -11,8 +11,8 @@ import QGroundControl.Controls 1.0
QGCTextField
{
QGCTextField
{
id
:
_textField
id
:
_textField
text
:
fact
.
valueString
text
:
fact
?
fact
.
valueString
:
""
unitsLabel
:
fact
.
units
unitsLabel
:
fact
?
fact
.
units
:
""
showUnits
:
true
showUnits
:
true
property
Fact
fact
:
null
property
Fact
fact
:
null
...
...
src/MissionManager/MissionController.cc
View file @
bdfacbd2
...
@@ -514,7 +514,7 @@ void MissionController::_initAllMissionItems(void)
...
@@ -514,7 +514,7 @@ void MissionController::_initAllMissionItems(void)
homeItem
->
setCoordinate
(
QGeoCoordinate
(
37.803784
,
-
122.462276
,
0.0
));
homeItem
->
setCoordinate
(
QGeoCoordinate
(
37.803784
,
-
122.462276
,
0.0
));
}
}
qDebug
()
<<
"home item"
<<
homeItem
->
homePositionValid
()
<<
homeItem
->
coordinate
();
//
qDebug() << "home item" << homeItem->homePositionValid() << homeItem->coordinate();
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
_missionItems
->
count
();
i
++
)
{
_initMissionItem
(
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
)));
_initMissionItem
(
qobject_cast
<
MissionItem
*>
(
_missionItems
->
get
(
i
)));
...
...
src/QGCDockWidget.cc
View file @
bdfacbd2
...
@@ -52,7 +52,8 @@ void QGCDockWidget::closeEvent(QCloseEvent* event)
...
@@ -52,7 +52,8 @@ void QGCDockWidget::closeEvent(QCloseEvent* event)
void
QGCDockWidget
::
loadSettings
(
void
)
void
QGCDockWidget
::
loadSettings
(
void
)
{
{
if
(
_action
)
{
// TODO: This is crashing for some reason. Disabled until sorted out.
if
(
0
/*_action*/
)
{
QSettings
settings
;
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
settings
.
beginGroup
(
_settingsGroup
);
if
(
settings
.
contains
(
_title
))
{
if
(
settings
.
contains
(
_title
))
{
...
@@ -64,7 +65,8 @@ void QGCDockWidget::loadSettings(void)
...
@@ -64,7 +65,8 @@ void QGCDockWidget::loadSettings(void)
void
QGCDockWidget
::
saveSettings
(
void
)
void
QGCDockWidget
::
saveSettings
(
void
)
{
{
if
(
_action
)
{
// TODO: This is crashing for some reason. Disabled until sorted out.
if
(
0
/*_action*/
)
{
QSettings
settings
;
QSettings
settings
;
settings
.
beginGroup
(
_settingsGroup
);
settings
.
beginGroup
(
_settingsGroup
);
settings
.
setValue
(
_title
,
saveGeometry
());
settings
.
setValue
(
_title
,
saveGeometry
());
...
...
src/VehicleSetup/VehicleSummary.qml
View file @
bdfacbd2
...
@@ -95,7 +95,7 @@ Rectangle {
...
@@ -95,7 +95,7 @@ Rectangle {
text
:
setupComplete
?
text
:
setupComplete
?
"
Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component.
"
:
"
Below you will find a summary of the settings for your vehicle. To the left are the setup menus for each component.
"
:
"
WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left.
"
"
WARNING: Your vehicle requires setup prior to flight. Please resolve the items marked in red using the menu on the left.
"
property
bool
setupComplete
:
multiVehicleManager
.
activeVehicle
.
autopilot
.
setupComplet
e
property
bool
setupComplete
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
setupComplete
:
fals
e
}
}
Flow
{
Flow
{
...
@@ -104,7 +104,7 @@ Rectangle {
...
@@ -104,7 +104,7 @@ Rectangle {
spacing
:
_summaryBoxSpace
spacing
:
_summaryBoxSpace
Repeater
{
Repeater
{
model
:
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
model
:
multiVehicleManager
.
activeVehicle
?
multiVehicleManager
.
activeVehicle
.
autopilot
.
vehicleComponents
:
undefined
// Outer summary item rectangle
// Outer summary item rectangle
Rectangle
{
Rectangle
{
...
...
src/ViewWidgets/CustomCommandWidget.qml
View file @
bdfacbd2
...
@@ -24,87 +24,89 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
...
@@ -24,87 +24,89 @@ along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
/// @file
/// @file
/// @author Don Gagne <don@thegagnes.com>
/// @author Don Gagne <don@thegagnes.com>
import
QtQuick
2.2
import
QtQuick
2.5
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
Palette
1.0
import
QtQuick
.
Controls
.
Styles
1.2
import
QGroundControl
.
Controls
1.0
import
QtQuick
.
Dialogs
1.2
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
Palette
1.0
ViewWidget
{
import
QGroundControl
.
Controls
1.0
connectedComponent
:
commandComponenet
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
ScreenTools
1.0
Component
{
id
:
commandComponenet
QGCView
{
viewPanel
:
panel
Item
{
id
:
bogusFactPanel
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
property
string
_emptyText
:
"
<p>
"
+
// We aren't really using the controller in a FactPanel for this usage so we
"
You can create your own commands and parameter editing user interface in this widget.
"
+
// pass in a bogus item to keep it from getting upset.
"
You do this by providing your own Qml file.
"
+
CustomCommandWidgetController
{
id
:
controller
;
factPanel
:
bogusFactPanel
}
"
This support is a work in progress and the details may change somewhat in the future.
"
+
"
By using this feature you are connecting directly to the internals of QGroundControl.
"
+
Item
{
"
Doing so incorrectly may cause instability both in QGroundControl and/or your vehicle.
"
+
anchors.top
:
parent
.
top
"
So make sure to test your changes thoroughly before using them in flight.</p>
"
+
anchors.bottom
:
buttonRow
.
top
"
<p>Click 'Load Custom Qml file' to provide your custom qml file.</p>
"
+
width
:
parent
.
width
"
<p>Click 'Reset' to reset to none.</p>
"
+
"
<p>Example usage: http://www.qgroundcontrol.org/custom_command_qml_widgets</p>
"
QGCLabel
{
id
:
errorOutput
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
anchors.fill
:
parent
CustomCommandWidgetController
{
id
:
controller
;
factPanel
:
panel
}
wrapMode
:
Text
.
WordWrap
visible
:
false
QGCViewPanel
{
}
id
:
panel
anchors.fill
:
parent
QGCLabel
{
Rectangle
{
id
:
warning
anchors.fill
:
parent
anchors.fill
:
parent
color
:
qgcPal
.
window
wrapMode
:
Text
.
WordWrap
QGCLabel
{
visible
:
!
controller
.
customQmlFile
id
:
textOutput
text
:
"
You can create your own commands and parameter editing user interface in this widget.
"
+
anchors.margins
:
_margins
"
You do this by providing your own Qml file.
"
+
anchors.left
:
parent
.
left
"
This support is a work in progress and the details may change somewhat in the future.
"
+
anchors.right
:
parent
.
right
"
By using this feature you are connecting directly to the internals of QGroundControl.
"
+
anchors.top
:
parent
.
top
"
Doing so incorrectly may cause instability both in QGroundControl and/or your vehicle.
"
+
anchors.bottom
:
buttonRow
.
top
"
So make sure to test your changes thoroughly before using them in flight.
\n\n
"
+
wrapMode
:
Text
.
WordWrap
"
Click 'Select Qml file' to provide your custom qml file.
\n
"
+
textFormat
:
Text
.
RichText
"
Click 'Clear Qml file' to reset to none.
\n
"
+
text
:
_emptyText
"
Example usage: http://www.qgroundcontrol.org/custom_command_qml_widgets
"
visible
:
!
loader
.
visible
}
}
Loader
{
Loader
{
id
:
loader
id
:
loader
anchors.margins
:
_margins
anchors.fill
:
parent
anchors.left
:
parent
.
left
source
:
controller
.
customQmlFile
anchors.right
:
parent
.
right
visible
:
controller
.
customQmlFile
anchors.top
:
parent
.
top
anchors.bottom
:
buttonRow
.
top
onStatusChanged
:
{
source
:
controller
.
customQmlFile
if
(
loader
.
status
==
Loader
.
Error
)
{
visible
:
false
if
(
sourceComponent
.
status
==
Component
.
Error
)
{
onStatusChanged
:
{
errorOutput
.
text
=
sourceComponent
.
errorString
()
loader
.
visible
=
true
errorOutput
.
visible
=
true
if
(
loader
.
status
==
Loader
.
Error
)
{
loader
.
visible
=
false
if
(
sourceComponent
.
status
==
Component
.
Error
)
{
}
textOutput
.
text
=
sourceComponent
.
errorString
()
loader
.
visible
=
false
}
}
}
}
}
}
}
}
Row
{
Row
{
id
:
buttonRow
id
:
buttonRow
spacing
:
10
spacing
:
ScreenTools
.
defaultFontPixelWidth
anchors.bottom
:
parent
.
bottom
anchors.margins
:
_margins
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCButton
{
QGCButton
{
text
:
"
Select Qml file...
"
text
:
"
Load Custom Qml file...
"
width
:
ScreenTools
.
defaultFontPixelWidth
*
22
onClicked
:
controller
.
selectQmlFile
()
onClicked
:
controller
.
selectQmlFile
()
}
}
QGCButton
{
QGCButton
{
text
:
"
Clear Qml file
"
text
:
"
Reset
"
width
:
ScreenTools
.
defaultFontPixelWidth
*
22
onClicked
:
{
onClicked
:
{
errorOutput
.
visible
=
false
controller
.
clearQmlFile
()
controller
.
clearQmlFile
()
loader
.
visible
=
false
textOutput
.
text
=
_emptyText
}
}
}
}
}
}
...
...
src/ViewWidgets/CustomCommandWidgetController.cc
View file @
bdfacbd2
...
@@ -36,32 +36,30 @@ const char* CustomCommandWidgetController::_settingsKey = "CustomCommand.QmlFile
...
@@ -36,32 +36,30 @@ const char* CustomCommandWidgetController::_settingsKey = "CustomCommand.QmlFile
CustomCommandWidgetController
::
CustomCommandWidgetController
(
void
)
:
CustomCommandWidgetController
::
CustomCommandWidgetController
(
void
)
:
_uas
(
NULL
)
_uas
(
NULL
)
{
{
_uas
=
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
uas
();
if
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
())
{
Q_ASSERT
(
_uas
);
_uas
=
qgcApp
()
->
toolbox
()
->
multiVehicleManager
()
->
activeVehicle
()
->
uas
(
);
}
QSettings
settings
;
QSettings
settings
;
_customQmlFile
=
settings
.
value
(
_settingsKey
).
toString
();
_customQmlFile
=
settings
.
value
(
_settingsKey
).
toString
();
connect
(
qgcApp
()
->
toolbox
()
->
multiVehicleManager
(),
&
MultiVehicleManager
::
activeVehicleChanged
,
this
,
&
CustomCommandWidgetController
::
_activeVehicleChanged
);
}
}
void
CustomCommandWidgetController
::
sendCommand
(
int
commandId
,
QVariant
componentId
,
QVariant
confirm
,
QVariant
param1
,
QVariant
param2
,
QVariant
param3
,
QVariant
param4
,
QVariant
param5
,
QVariant
param6
,
QVariant
param7
)
void
CustomCommandWidgetController
::
sendCommand
(
int
commandId
,
QVariant
componentId
,
QVariant
confirm
,
QVariant
param1
,
QVariant
param2
,
QVariant
param3
,
QVariant
param4
,
QVariant
param5
,
QVariant
param6
,
QVariant
param7
)
{
{
Q_UNUSED
(
commandId
);
if
(
_uas
)
{
Q_UNUSED
(
componentId
);
_uas
->
executeCommand
((
MAV_CMD
)
commandId
,
confirm
.
toInt
(),
param1
.
toFloat
(),
param2
.
toFloat
(),
param3
.
toFloat
(),
param4
.
toFloat
(),
param5
.
toFloat
(),
param6
.
toFloat
(),
param7
.
toFloat
(),
componentId
.
toInt
());
Q_UNUSED
(
confirm
);
}
Q_UNUSED
(
param1
);
}
Q_UNUSED
(
param2
);
Q_UNUSED
(
param3
);
void
CustomCommandWidgetController
::
_activeVehicleChanged
(
Vehicle
*
activeVehicle
)
Q_UNUSED
(
param4
);
{
Q_UNUSED
(
param5
);
if
(
activeVehicle
)
Q_UNUSED
(
param6
);
_uas
=
activeVehicle
->
uas
();
Q_UNUSED
(
param7
);
_uas
->
executeCommand
((
MAV_CMD
)
commandId
,
confirm
.
toInt
(),
param1
.
toFloat
(),
param2
.
toFloat
(),
param3
.
toFloat
(),
param4
.
toFloat
(),
param5
.
toFloat
(),
param6
.
toFloat
(),
param7
.
toFloat
(),
componentId
.
toInt
());
}
}
void
CustomCommandWidgetController
::
selectQmlFile
(
void
)
void
CustomCommandWidgetController
::
selectQmlFile
(
void
)
{
{
QSettings
settings
;
QSettings
settings
;
QString
qmlFile
=
QGCFileDialog
::
getOpenFileName
(
NULL
,
"Select custom Qml file"
,
QString
(),
"Qml files (*.qml)"
);
QString
qmlFile
=
QGCFileDialog
::
getOpenFileName
(
NULL
,
"Select custom Qml file"
,
QString
(),
"Qml files (*.qml)"
);
if
(
qmlFile
.
isEmpty
())
{
if
(
qmlFile
.
isEmpty
())
{
_customQmlFile
.
clear
();
_customQmlFile
.
clear
();
...
@@ -71,7 +69,6 @@ void CustomCommandWidgetController::selectQmlFile(void)
...
@@ -71,7 +69,6 @@ void CustomCommandWidgetController::selectQmlFile(void)
_customQmlFile
=
url
.
toString
();
_customQmlFile
=
url
.
toString
();
settings
.
setValue
(
_settingsKey
,
_customQmlFile
);
settings
.
setValue
(
_settingsKey
,
_customQmlFile
);
}
}
emit
customQmlFileChanged
(
_customQmlFile
);
emit
customQmlFileChanged
(
_customQmlFile
);
}
}
...
...
src/ViewWidgets/CustomCommandWidgetController.h
View file @
bdfacbd2
...
@@ -39,17 +39,20 @@ public:
...
@@ -39,17 +39,20 @@ public:
Q_PROPERTY
(
QString
customQmlFile
MEMBER
_customQmlFile
NOTIFY
customQmlFileChanged
)
Q_PROPERTY
(
QString
customQmlFile
MEMBER
_customQmlFile
NOTIFY
customQmlFileChanged
)
Q_INVOKABLE
void
sendCommand
(
int
commandId
,
QVariant
componentId
,
QVariant
confirm
,
QVariant
param1
,
QVariant
param2
,
QVariant
param3
,
QVariant
param4
,
QVariant
param5
,
QVariant
param6
,
QVariant
param7
);
Q_INVOKABLE
void
sendCommand
(
int
commandId
,
QVariant
componentId
,
QVariant
confirm
,
QVariant
param1
,
QVariant
param2
,
QVariant
param3
,
QVariant
param4
,
QVariant
param5
,
QVariant
param6
,
QVariant
param7
);
Q_INVOKABLE
void
selectQmlFile
(
void
);
Q_INVOKABLE
void
selectQmlFile
(
void
);
Q_INVOKABLE
void
clearQmlFile
(
void
);
Q_INVOKABLE
void
clearQmlFile
(
void
);
signals:
signals:
void
customQmlFileChanged
(
const
QString
&
customQmlFile
);
void
customQmlFileChanged
(
const
QString
&
customQmlFile
);
private
slots
:
void
_activeVehicleChanged
(
Vehicle
*
activeVehicle
);
private:
private:
UASInterface
*
_uas
;
UASInterface
*
_uas
;
QString
_customQmlFile
;
QString
_customQmlFile
;
static
const
char
*
_settingsKey
;
static
const
char
*
_settingsKey
;
};
};
#endif
#endif
\ No newline at end of file
src/comm/LinkInterface.h
View file @
bdfacbd2
...
@@ -101,6 +101,14 @@ public:
...
@@ -101,6 +101,14 @@ public:
/// @return true: This link is replaying a log file, false: Normal two-way communication link
/// @return true: This link is replaying a log file, false: Normal two-way communication link
virtual
bool
isLogReplay
(
void
)
{
return
false
;
}
virtual
bool
isLogReplay
(
void
)
{
return
false
;
}
/**
* @Enable/Disable data rate collection
**/
void
enableDataRate
(
bool
enable
)
{
_enableRateCollection
=
enable
;
}
/**
/**
* @Brief Get the current incoming data rate.
* @Brief Get the current incoming data rate.
*
*
...
@@ -192,6 +200,7 @@ protected:
...
@@ -192,6 +200,7 @@ protected:
QThread
(
0
)
QThread
(
0
)
,
_mavlinkChannelSet
(
false
)
,
_mavlinkChannelSet
(
false
)
,
_active
(
false
)
,
_active
(
false
)
,
_enableRateCollection
(
false
)
{
{
// Initialize everything for the data rate calculation buffers.
// Initialize everything for the data rate calculation buffers.
_inDataIndex
=
0
;
_inDataIndex
=
0
;
...
@@ -211,7 +220,8 @@ protected:
...
@@ -211,7 +220,8 @@ protected:
/// @param byteCount Number of bytes received
/// @param byteCount Number of bytes received
/// @param time Time in ms send occured
/// @param time Time in ms send occured
void
_logInputDataRate
(
quint64
byteCount
,
qint64
time
)
{
void
_logInputDataRate
(
quint64
byteCount
,
qint64
time
)
{
_logDataRateToBuffer
(
_inDataWriteAmounts
,
_inDataWriteTimes
,
&
_inDataIndex
,
byteCount
,
time
);
if
(
_enableRateCollection
)
_logDataRateToBuffer
(
_inDataWriteAmounts
,
_inDataWriteTimes
,
&
_inDataIndex
,
byteCount
,
time
);
}
}
/// This function logs the send times and amounts of datas for output. Data is used for calculating
/// This function logs the send times and amounts of datas for output. Data is used for calculating
...
@@ -219,7 +229,8 @@ protected:
...
@@ -219,7 +229,8 @@ protected:
/// @param byteCount Number of bytes sent
/// @param byteCount Number of bytes sent
/// @param time Time in ms receive occured
/// @param time Time in ms receive occured
void
_logOutputDataRate
(
quint64
byteCount
,
qint64
time
)
{
void
_logOutputDataRate
(
quint64
byteCount
,
qint64
time
)
{
_logDataRateToBuffer
(
_outDataWriteAmounts
,
_outDataWriteTimes
,
&
_outDataIndex
,
byteCount
,
time
);
if
(
_enableRateCollection
)
_logDataRateToBuffer
(
_outDataWriteAmounts
,
_outDataWriteTimes
,
&
_outDataIndex
,
byteCount
,
time
);
}
}
protected
slots
:
protected
slots
:
...
@@ -354,6 +365,7 @@ private:
...
@@ -354,6 +365,7 @@ private:
mutable
QMutex
_dataRateMutex
;
// Mutex for accessing the data rate member variables
mutable
QMutex
_dataRateMutex
;
// Mutex for accessing the data rate member variables
bool
_active
;
///< true: link is actively receiving mavlink messages
bool
_active
;
///< true: link is actively receiving mavlink messages
bool
_enableRateCollection
;
};
};
typedef
QSharedPointer
<
LinkInterface
>
SharedLinkInterface
;
typedef
QSharedPointer
<
LinkInterface
>
SharedLinkInterface
;
...
...
src/comm/UDPLink.cc
View file @
bdfacbd2
...
@@ -99,8 +99,6 @@ UDPLink::UDPLink(UDPConfiguration* config)
...
@@ -99,8 +99,6 @@ UDPLink::UDPLink(UDPConfiguration* config)
// We're doing it wrong - because the Qt folks got the API wrong:
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread
(
this
);
moveToThread
(
this
);
//qDebug() << "UDP Created " << _config->name();
}
}
UDPLink
::~
UDPLink
()
UDPLink
::~
UDPLink
()
...
@@ -140,7 +138,7 @@ void UDPLink::run()
...
@@ -140,7 +138,7 @@ void UDPLink::run()
if
(
!
_running
)
if
(
!
_running
)
break
;
break
;
//-- Settle down (it gets here if there is nothing to read or write)
//-- Settle down (it gets here if there is nothing to read or write)
this
->
msleep
(
5
);
_socket
->
waitForReadyRead
(
5
);
}
}
}
else
{
}
else
{
exec
();
exec
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment