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
08ace3c5
Commit
08ace3c5
authored
Mar 26, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New Plan sync user model
parent
c2e3fa26
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
399 additions
and
278 deletions
+399
-278
MissionController.cc
src/MissionManager/MissionController.cc
+37
-0
MissionController.h
src/MissionManager/MissionController.h
+3
-0
MissionSettings.FactMetaData.json
src/MissionManager/MissionSettings.FactMetaData.json
+8
-2
MissionSettingsItem.cc
src/MissionManager/MissionSettingsItem.cc
+32
-26
MissionSettingsItem.h
src/MissionManager/MissionSettingsItem.h
+23
-10
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+1
-1
MissionSettingsEditor.qml
src/PlanView/MissionSettingsEditor.qml
+273
-162
PlanToolBar.qml
src/PlanView/PlanToolBar.qml
+3
-45
PlanView.qml
src/PlanView/PlanView.qml
+17
-31
ParameterEditorDialog.qml
src/QmlControls/ParameterEditorDialog.qml
+1
-0
QFileDialogController.cc
src/QmlControls/QFileDialogController.cc
+1
-1
No files found.
src/MissionManager/MissionController.cc
View file @
08ace3c5
...
@@ -646,6 +646,21 @@ void MissionController::loadFromFile(const QString& filename)
...
@@ -646,6 +646,21 @@ void MissionController::loadFromFile(const QString& filename)
MissionController
::
_scanForAdditionalSettings
(
_visualItems
,
_activeVehicle
);
MissionController
::
_scanForAdditionalSettings
(
_visualItems
,
_activeVehicle
);
_initAllVisualItems
();
_initAllVisualItems
();
QString
filenameOnly
=
filename
;
int
lastSepIndex
=
filename
.
lastIndexOf
(
QStringLiteral
(
"/"
));
if
(
lastSepIndex
!=
-
1
)
{
filenameOnly
=
filename
.
right
(
filename
.
length
()
-
lastSepIndex
-
1
);
}
QString
extension
=
AppSettings
::
missionFileExtension
;
if
(
filenameOnly
.
endsWith
(
"."
+
extension
))
{
filenameOnly
=
filenameOnly
.
left
(
filenameOnly
.
length
()
-
extension
.
length
()
-
1
);
}
_settingsItem
->
missionName
()
->
setRawValue
(
filenameOnly
);
_settingsItem
->
setExistingMission
(
true
);
sendToVehicle
();
}
}
bool
MissionController
::
loadItemsFromFile
(
Vehicle
*
vehicle
,
const
QString
&
filename
,
QmlObjectListModel
**
visualItems
)
bool
MissionController
::
loadItemsFromFile
(
Vehicle
*
vehicle
,
const
QString
&
filename
,
QmlObjectListModel
**
visualItems
)
...
@@ -1577,3 +1592,25 @@ bool MissionController::missionInProgress(void) const
...
@@ -1577,3 +1592,25 @@ bool MissionController::missionInProgress(void) const
{
{
return
_visualItems
&&
_visualItems
->
count
()
>
1
&&
(
!
_visualItems
->
value
<
VisualMissionItem
*>
(
0
)
->
isCurrentItem
()
&&
!
_visualItems
->
value
<
VisualMissionItem
*>
(
1
)
->
isCurrentItem
());
return
_visualItems
&&
_visualItems
->
count
()
>
1
&&
(
!
_visualItems
->
value
<
VisualMissionItem
*>
(
0
)
->
isCurrentItem
()
&&
!
_visualItems
->
value
<
VisualMissionItem
*>
(
1
)
->
isCurrentItem
());
}
}
void
MissionController
::
save
(
void
)
{
// Save to file if the mission is named
QString
missionFullPath
=
_settingsItem
->
missionFullPath
()
->
rawValue
().
toString
();
if
(
!
missionFullPath
.
isEmpty
())
{
saveToFile
(
missionFullPath
);
}
// Send to vehicle if we are connected
if
(
!
_activeVehicle
->
isOfflineEditingVehicle
())
{
sendToVehicle
();
}
_settingsItem
->
setExistingMission
(
_visualItems
->
count
()
>
1
&&
!
missionFullPath
.
isEmpty
());
}
void
MissionController
::
clearMission
(
void
)
{
removeAll
();
save
();
}
src/MissionManager/MissionController.h
View file @
08ace3c5
...
@@ -88,6 +88,9 @@ public:
...
@@ -88,6 +88,9 @@ public:
/// Sends the mission items to the specified vehicle
/// Sends the mission items to the specified vehicle
static
void
sendItemsToVehicle
(
Vehicle
*
vehicle
,
QmlObjectListModel
*
visualMissionItems
);
static
void
sendItemsToVehicle
(
Vehicle
*
vehicle
,
QmlObjectListModel
*
visualMissionItems
);
Q_INVOKABLE
void
save
(
void
);
Q_INVOKABLE
void
clearMission
(
void
);
// Overrides from PlanElementController
// Overrides from PlanElementController
void
start
(
bool
editMode
)
final
;
void
start
(
bool
editMode
)
final
;
void
startStaticActiveVehicle
(
Vehicle
*
vehicle
)
final
;
void
startStaticActiveVehicle
(
Vehicle
*
vehicle
)
final
;
...
...
src/MissionManager/MissionSettings.FactMetaData.json
View file @
08ace3c5
...
@@ -19,8 +19,14 @@
...
@@ -19,8 +19,14 @@
"name"
:
"MissionEndAction"
,
"name"
:
"MissionEndAction"
,
"shortDescription"
:
"The action to take when the mission completed."
,
"shortDescription"
:
"The action to take when the mission completed."
,
"type"
:
"uint32"
,
"type"
:
"uint32"
,
"enumStrings"
:
"No action on mission
completion,Loiter after mission completes,RTL after mission completes,Land after mission completes
"
,
"enumStrings"
:
"No action on mission
end,Loiter after mission end,RTL after mission end
"
,
"enumValues"
:
"0,1,2
,3
"
,
"enumValues"
:
"0,1,2"
,
"defaultValue"
:
0
"defaultValue"
:
0
},
{
"name"
:
"MissionName"
,
"shortDescription"
:
"Name for the mission."
,
"type"
:
"string"
,
"defaultValue"
:
""
}
}
]
]
src/MissionManager/MissionSettingsItem.cc
View file @
08ace3c5
...
@@ -23,15 +23,20 @@ QGC_LOGGING_CATEGORY(MissionSettingsComplexItemLog, "MissionSettingsComplexItemL
...
@@ -23,15 +23,20 @@ QGC_LOGGING_CATEGORY(MissionSettingsComplexItemLog, "MissionSettingsComplexItemL
const
char
*
MissionSettingsItem
::
jsonComplexItemTypeValue
=
"MissionSettings"
;
const
char
*
MissionSettingsItem
::
jsonComplexItemTypeValue
=
"MissionSettings"
;
const
char
*
MissionSettingsItem
::
_plannedHomePositionAltitudeName
=
"PlannedHomePositionAltitude"
;
const
char
*
MissionSettingsItem
::
_missionNameName
=
"MissionName"
;
const
char
*
MissionSettingsItem
::
_missionFlightSpeedName
=
"FlightSpeed"
;
const
char
*
MissionSettingsItem
::
_missionFullPathName
=
"MissionFullPath"
;
const
char
*
MissionSettingsItem
::
_missionEndActionName
=
"MissionEndAction"
;
const
char
*
MissionSettingsItem
::
_plannedHomePositionAltitudeName
=
"PlannedHomePositionAltitude"
;
const
char
*
MissionSettingsItem
::
_missionFlightSpeedName
=
"FlightSpeed"
;
const
char
*
MissionSettingsItem
::
_missionEndActionName
=
"MissionEndAction"
;
QMap
<
QString
,
FactMetaData
*>
MissionSettingsItem
::
_metaDataMap
;
QMap
<
QString
,
FactMetaData
*>
MissionSettingsItem
::
_metaDataMap
;
MissionSettingsItem
::
MissionSettingsItem
(
Vehicle
*
vehicle
,
QObject
*
parent
)
MissionSettingsItem
::
MissionSettingsItem
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
ComplexMissionItem
(
vehicle
,
parent
)
:
ComplexMissionItem
(
vehicle
,
parent
)
,
_existingMission
(
false
)
,
_specifyMissionFlightSpeed
(
false
)
,
_specifyMissionFlightSpeed
(
false
)
,
_missionNameFact
(
0
,
_missionNameName
,
FactMetaData
::
valueTypeString
)
,
_missionFullPathFact
(
0
,
_missionFullPathName
,
FactMetaData
::
valueTypeString
)
,
_plannedHomePositionAltitudeFact
(
0
,
_plannedHomePositionAltitudeName
,
FactMetaData
::
valueTypeDouble
)
,
_plannedHomePositionAltitudeFact
(
0
,
_plannedHomePositionAltitudeName
,
FactMetaData
::
valueTypeDouble
)
,
_missionFlightSpeedFact
(
0
,
_missionFlightSpeedName
,
FactMetaData
::
valueTypeDouble
)
,
_missionFlightSpeedFact
(
0
,
_missionFlightSpeedName
,
FactMetaData
::
valueTypeDouble
)
,
_missionEndActionFact
(
0
,
_missionEndActionName
,
FactMetaData
::
valueTypeUint32
)
,
_missionEndActionFact
(
0
,
_missionEndActionName
,
FactMetaData
::
valueTypeUint32
)
...
@@ -44,10 +49,12 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, QObject* parent)
...
@@ -44,10 +49,12 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, QObject* parent)
_metaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/MissionSettings.FactMetaData.json"
),
NULL
/* metaDataParent */
);
_metaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/MissionSettings.FactMetaData.json"
),
NULL
/* metaDataParent */
);
}
}
_missionNameFact
.
setMetaData
(
_metaDataMap
[
_missionNameName
]);
_plannedHomePositionAltitudeFact
.
setMetaData
(
_metaDataMap
[
_plannedHomePositionAltitudeName
]);
_plannedHomePositionAltitudeFact
.
setMetaData
(
_metaDataMap
[
_plannedHomePositionAltitudeName
]);
_missionFlightSpeedFact
.
setMetaData
(
_metaDataMap
[
_missionFlightSpeedName
]);
_missionFlightSpeedFact
.
setMetaData
(
_metaDataMap
[
_missionFlightSpeedName
]);
_missionEndActionFact
.
setMetaData
(
_metaDataMap
[
_missionEndActionName
]);
_missionEndActionFact
.
setMetaData
(
_metaDataMap
[
_missionEndActionName
]);
_missionNameFact
.
setRawValue
(
_missionNameFact
.
rawDefaultValue
());
_plannedHomePositionAltitudeFact
.
setRawValue
(
_plannedHomePositionAltitudeFact
.
rawDefaultValue
());
_plannedHomePositionAltitudeFact
.
setRawValue
(
_plannedHomePositionAltitudeFact
.
rawDefaultValue
());
_missionEndActionFact
.
setRawValue
(
_missionEndActionFact
.
rawDefaultValue
());
_missionEndActionFact
.
setRawValue
(
_missionEndActionFact
.
rawDefaultValue
());
...
@@ -58,6 +65,8 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, QObject* parent)
...
@@ -58,6 +65,8 @@ MissionSettingsItem::MissionSettingsItem(Vehicle* vehicle, QObject* parent)
setHomePositionSpecialCase
(
true
);
setHomePositionSpecialCase
(
true
);
connect
(
&
_missionNameFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionSettingsItem
::
_missionNameChanged
);
connect
(
this
,
&
MissionSettingsItem
::
specifyMissionFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
this
,
&
MissionSettingsItem
::
specifyMissionFlightSpeedChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_cameraSection
,
&
CameraSection
::
missionItemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
connect
(
&
_cameraSection
,
&
CameraSection
::
missionItemCountChanged
,
this
,
&
MissionSettingsItem
::
_setDirtyAndUpdateLastSequenceNumber
);
...
@@ -232,21 +241,6 @@ bool MissionSettingsItem::addMissionEndAction(QList<MissionItem*>& items, int se
...
@@ -232,21 +241,6 @@ bool MissionSettingsItem::addMissionEndAction(QList<MissionItem*>& items, int se
false
,
// isCurrentItem
false
,
// isCurrentItem
missionItemParent
);
missionItemParent
);
break
;
break
;
case
MissionEndLand
:
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Appending end action Land seqNum"
<<
seqNum
;
item
=
new
MissionItem
(
seqNum
,
MAV_CMD_NAV_LAND
,
MAV_FRAME_GLOBAL_RELATIVE_ALT
,
0
,
// abort Altitude
0
,
0
,
// not used
0
,
// yaw
lastWaypointCoord
.
latitude
(),
lastWaypointCoord
.
longitude
(),
0
,
// altitude
true
,
// autoContinue
false
,
// isCurrentItem
missionItemParent
);
break
;
case
MissionEndRTL
:
case
MissionEndRTL
:
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Appending end action RTL seqNum"
<<
seqNum
;
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Appending end action RTL seqNum"
<<
seqNum
;
item
=
new
MissionItem
(
seqNum
,
item
=
new
MissionItem
(
seqNum
,
...
@@ -351,14 +345,6 @@ bool MissionSettingsItem::scanForMissionSettings(QmlObjectListModel* visualItems
...
@@ -351,14 +345,6 @@ bool MissionSettingsItem::scanForMissionSettings(QmlObjectListModel* visualItems
}
}
break
;
break
;
case
MAV_CMD_NAV_LAND
:
if
(
missionItem
.
param1
()
==
0
&&
missionItem
.
param2
()
==
0
&&
missionItem
.
param3
()
==
0
&&
missionItem
.
param4
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Scan: Found end action Land"
;
settingsItem
->
missionEndAction
()
->
setRawValue
(
MissionEndLand
);
visualItems
->
removeAt
(
lastIndex
)
->
deleteLater
();
}
break
;
case
MAV_CMD_NAV_RETURN_TO_LAUNCH
:
case
MAV_CMD_NAV_RETURN_TO_LAUNCH
:
if
(
missionItem
.
param1
()
==
0
&&
missionItem
.
param2
()
==
0
&&
missionItem
.
param3
()
==
0
&&
missionItem
.
param4
()
==
0
&&
missionItem
.
param5
()
==
0
&&
missionItem
.
param6
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
if
(
missionItem
.
param1
()
==
0
&&
missionItem
.
param2
()
==
0
&&
missionItem
.
param3
()
==
0
&&
missionItem
.
param4
()
==
0
&&
missionItem
.
param5
()
==
0
&&
missionItem
.
param6
()
==
0
&&
missionItem
.
param7
()
==
0
)
{
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Scan: Found end action RTL"
;
qCDebug
(
MissionSettingsComplexItemLog
)
<<
"Scan: Found end action RTL"
;
...
@@ -429,3 +415,23 @@ void MissionSettingsItem::_updateAltitudeInCoordinate(QVariant value)
...
@@ -429,3 +415,23 @@ void MissionSettingsItem::_updateAltitudeInCoordinate(QVariant value)
emit
exitCoordinateChanged
(
_plannedHomePositionCoordinate
);
emit
exitCoordinateChanged
(
_plannedHomePositionCoordinate
);
}
}
}
}
void
MissionSettingsItem
::
_missionNameChanged
(
QVariant
value
)
{
QString
missionDir
=
qgcApp
()
->
toolbox
()
->
settingsManager
()
->
appSettings
()
->
missionSavePath
();
QString
missionName
=
value
.
toString
();
if
(
missionName
.
isEmpty
())
{
_missionFullPathFact
.
setRawValue
(
QString
());
}
else
{
_missionFullPathFact
.
setRawValue
(
missionDir
+
"/"
+
missionName
);
}
}
void
MissionSettingsItem
::
setExistingMission
(
bool
existingMission
)
{
if
(
existingMission
!=
_existingMission
)
{
_existingMission
=
existingMission
;
emit
existingMissionChanged
(
existingMission
);
}
}
src/MissionManager/MissionSettingsItem.h
View file @
08ace3c5
...
@@ -28,23 +28,29 @@ public:
...
@@ -28,23 +28,29 @@ public:
enum
MissionEndAction
{
enum
MissionEndAction
{
MissionEndNoAction
,
MissionEndNoAction
,
MissionEndLoiter
,
MissionEndLoiter
,
MissionEndRTL
,
MissionEndRTL
MissionEndLand
};
};
Q_ENUMS
(
MissionEndAction
)
Q_ENUMS
(
MissionEndAction
)
Q_PROPERTY
(
bool
specifyMissionFlightSpeed
READ
specifyMissionFlightSpeed
WRITE
setSpecifyMissionFlightSpeed
NOTIFY
specifyMissionFlightSpeedChanged
)
Q_PROPERTY
(
Fact
*
missionName
READ
missionName
CONSTANT
)
Q_PROPERTY
(
Fact
*
missionFlightSpeed
READ
missionFlightSpeed
CONSTANT
)
Q_PROPERTY
(
Fact
*
missionFullPath
READ
missionFullPath
CONSTANT
)
Q_PROPERTY
(
Fact
*
missionEndAction
READ
missionEndAction
CONSTANT
)
Q_PROPERTY
(
bool
existingMission
READ
existingMission
WRITE
setExistingMission
NOTIFY
existingMissionChanged
)
Q_PROPERTY
(
Fact
*
plannedHomePositionAltitude
READ
plannedHomePositionAltitude
CONSTANT
)
Q_PROPERTY
(
bool
specifyMissionFlightSpeed
READ
specifyMissionFlightSpeed
WRITE
setSpecifyMissionFlightSpeed
NOTIFY
specifyMissionFlightSpeedChanged
)
Q_PROPERTY
(
QObject
*
cameraSection
READ
cameraSection
CONSTANT
)
Q_PROPERTY
(
Fact
*
missionFlightSpeed
READ
missionFlightSpeed
CONSTANT
)
Q_PROPERTY
(
Fact
*
missionEndAction
READ
missionEndAction
CONSTANT
)
bool
specifyMissionFlightSpeed
(
void
)
const
{
return
_specifyMissionFlightSpeed
;
}
Q_PROPERTY
(
Fact
*
plannedHomePositionAltitude
READ
plannedHomePositionAltitude
CONSTANT
)
Q_PROPERTY
(
QObject
*
cameraSection
READ
cameraSection
CONSTANT
)
Fact
*
missionName
(
void
)
{
return
&
_missionNameFact
;
}
Fact
*
missionFullPath
(
void
)
{
return
&
_missionFullPathFact
;
}
Fact
*
plannedHomePositionAltitude
(
void
)
{
return
&
_plannedHomePositionAltitudeFact
;
}
Fact
*
plannedHomePositionAltitude
(
void
)
{
return
&
_plannedHomePositionAltitudeFact
;
}
Fact
*
missionFlightSpeed
(
void
)
{
return
&
_missionFlightSpeedFact
;
}
Fact
*
missionFlightSpeed
(
void
)
{
return
&
_missionFlightSpeedFact
;
}
Fact
*
missionEndAction
(
void
)
{
return
&
_missionEndActionFact
;
}
Fact
*
missionEndAction
(
void
)
{
return
&
_missionEndActionFact
;
}
bool
specifyMissionFlightSpeed
(
void
)
const
{
return
_specifyMissionFlightSpeed
;
}
bool
existingMission
(
void
)
const
{
return
_existingMission
;
}
void
setSpecifyMissionFlightSpeed
(
bool
specifyMissionFlightSpeed
);
void
setSpecifyMissionFlightSpeed
(
bool
specifyMissionFlightSpeed
);
void
setExistingMission
(
bool
existingMission
);
QObject
*
cameraSection
(
void
)
{
return
&
_cameraSection
;
}
QObject
*
cameraSection
(
void
)
{
return
&
_cameraSection
;
}
/// Scans the loaded items for settings items
/// Scans the loaded items for settings items
...
@@ -94,17 +100,22 @@ public:
...
@@ -94,17 +100,22 @@ public:
static
const
char
*
jsonComplexItemTypeValue
;
static
const
char
*
jsonComplexItemTypeValue
;
signals:
signals:
bool
specifyMissionFlightSpeedChanged
(
bool
specifyMissionFlightSpeed
);
void
specifyMissionFlightSpeedChanged
(
bool
specifyMissionFlightSpeed
);
void
existingMissionChanged
(
bool
existingMission
);
private
slots
:
private
slots
:
void
_setDirtyAndUpdateLastSequenceNumber
(
void
);
void
_setDirtyAndUpdateLastSequenceNumber
(
void
);
void
_setDirty
(
void
);
void
_setDirty
(
void
);
void
_cameraSectionDirtyChanged
(
bool
dirty
);
void
_cameraSectionDirtyChanged
(
bool
dirty
);
void
_updateAltitudeInCoordinate
(
QVariant
value
);
void
_updateAltitudeInCoordinate
(
QVariant
value
);
void
_missionNameChanged
(
QVariant
value
);
private:
private:
bool
_existingMission
;
bool
_specifyMissionFlightSpeed
;
bool
_specifyMissionFlightSpeed
;
QGeoCoordinate
_plannedHomePositionCoordinate
;
// Does not include altitde
QGeoCoordinate
_plannedHomePositionCoordinate
;
// Does not include altitde
Fact
_missionNameFact
;
Fact
_missionFullPathFact
;
Fact
_plannedHomePositionAltitudeFact
;
Fact
_plannedHomePositionAltitudeFact
;
Fact
_missionFlightSpeedFact
;
Fact
_missionFlightSpeedFact
;
Fact
_missionEndActionFact
;
Fact
_missionEndActionFact
;
...
@@ -115,6 +126,8 @@ private:
...
@@ -115,6 +126,8 @@ private:
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
static
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
static
const
char
*
_missionNameName
;
static
const
char
*
_missionFullPathName
;
static
const
char
*
_plannedHomePositionAltitudeName
;
static
const
char
*
_plannedHomePositionAltitudeName
;
static
const
char
*
_missionFlightSpeedName
;
static
const
char
*
_missionFlightSpeedName
;
static
const
char
*
_missionEndActionName
;
static
const
char
*
_missionEndActionName
;
...
...
src/PlanView/MissionItemEditor.qml
View file @
08ace3c5
...
@@ -28,7 +28,7 @@ Rectangle {
...
@@ -28,7 +28,7 @@ Rectangle {
property
bool
_currentItem
:
missionItem
.
isCurrentItem
property
bool
_currentItem
:
missionItem
.
isCurrentItem
property
color
_outerTextColor
:
_currentItem
?
"
black
"
:
qgcPal
.
text
property
color
_outerTextColor
:
_currentItem
?
"
black
"
:
qgcPal
.
text
property
bool
_noMissionItemsAdded
:
ListView
.
view
.
model
.
count
==
1
property
bool
_noMissionItemsAdded
:
ListView
.
view
.
model
.
count
==
=
1
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
property
real
_sectionSpacer
:
ScreenTools
.
defaultFontPixelWidth
/
2
// spacing between section headings
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
readonly
property
real
_editFieldWidth
:
Math
.
min
(
width
-
_margin
*
2
,
ScreenTools
.
defaultFontPixelWidth
*
12
)
...
...
src/PlanView/MissionSettingsEditor.qml
View file @
08ace3c5
...
@@ -9,6 +9,7 @@ import QGroundControl.Controls 1.0
...
@@ -9,6 +9,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
Controllers
1.0
// Editor for Mission Settings
// Editor for Mission Settings
Rectangle
{
Rectangle
{
...
@@ -19,6 +20,38 @@ Rectangle {
...
@@ -19,6 +20,38 @@ Rectangle {
visible
:
missionItem
.
isCurrentItem
visible
:
missionItem
.
isCurrentItem
radius
:
_radius
radius
:
_radius
property
var
_missionVehicle
:
missionController
.
vehicle
property
bool
_vehicleHasHomePosition
:
_missionVehicle
.
homePosition
.
isValid
property
bool
_offlineEditing
:
_missionVehicle
.
isOfflineEditingVehicle
property
bool
_showOfflineVehicleCombos
:
_offlineEditing
&&
_multipleFirmware
&&
_noMissionItemsAdded
property
bool
_showCruiseSpeed
:
!
_missionVehicle
.
multiRotor
property
bool
_showHoverSpeed
:
_missionVehicle
.
multiRotor
||
_missionVehicle
.
vtol
property
bool
_multipleFirmware
:
QGroundControl
.
supportedFirmwareCount
>
2
property
real
_fieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
16
property
bool
_mobile
:
ScreenTools
.
isMobile
property
var
_savePath
:
QGroundControl
.
settingsManager
.
appSettings
.
missionSavePath
property
var
_fileExtension
:
QGroundControl
.
settingsManager
.
appSettings
.
missionFileExtension
property
bool
_newMissionAlreadyExists
:
false
property
bool
_noMissionName
:
missionItem
.
missionName
.
valueString
===
""
property
bool
_showMissionList
:
_noMissionItemsAdded
&&
(
_noMissionName
||
_newMissionAlreadyExists
)
property
bool
_existingMissionLoaded
:
missionItem
.
existingMission
readonly
property
string
_firmwareLabel
:
qsTr
(
"
Firmware
"
)
readonly
property
string
_vehicleLabel
:
qsTr
(
"
Vehicle
"
)
QGCPalette
{
id
:
qgcPal
}
QFileDialogController
{
id
:
fileController
}
Connections
{
target
:
missionItem
.
missionName
onRawValueChanged
:
{
if
(
!
_existingMissionLoaded
)
{
_newMissionAlreadyExists
=
!
_noMissionName
&&
fileController
.
fileExists
(
_savePath
+
"
/
"
+
missionItem
.
missionName
.
valueString
+
"
.
"
+
_fileExtension
)
}
}
}
Loader
{
Loader
{
id
:
deferedload
id
:
deferedload
active
:
valuesRect
.
visible
active
:
valuesRect
.
visible
...
@@ -33,21 +66,6 @@ Rectangle {
...
@@ -33,21 +66,6 @@ Rectangle {
id
:
valuesItem
id
:
valuesItem
height
:
valuesColumn
.
height
+
(
_margin
*
2
)
height
:
valuesColumn
.
height
+
(
_margin
*
2
)
property
var
_missionVehicle
:
missionController
.
vehicle
property
bool
_vehicleHasHomePosition
:
_missionVehicle
.
homePosition
.
isValid
property
bool
_offlineEditing
:
_missionVehicle
.
isOfflineEditingVehicle
property
bool
_showOfflineVehicleCombos
:
_offlineEditing
&&
_multipleFirmware
&&
_noMissionItemsAdded
property
bool
_showCruiseSpeed
:
!
_missionVehicle
.
multiRotor
property
bool
_showHoverSpeed
:
_missionVehicle
.
multiRotor
||
_missionVehicle
.
vtol
property
bool
_multipleFirmware
:
QGroundControl
.
supportedFirmwareCount
>
2
property
real
_fieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
16
property
bool
_mobile
:
ScreenTools
.
isMobile
readonly
property
string
_firmwareLabel
:
qsTr
(
"
Firmware
"
)
readonly
property
string
_vehicleLabel
:
qsTr
(
"
Vehicle
"
)
QGCPalette
{
id
:
qgcPal
}
Column
{
Column
{
id
:
valuesColumn
id
:
valuesColumn
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
...
@@ -55,176 +73,269 @@ Rectangle {
...
@@ -55,176 +73,269 @@ Rectangle {
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
spacing
:
_margin
spacing
:
_margin
SectionHeader
{
QGCLabel
{
id
:
plannedHomePositionSection
text
:
qsTr
(
"
Mission name
"
)
text
:
qsTr
(
"
Planned Home Position
"
)
font.pointSize
:
ScreenTools
.
smallFontPointSize
showSpacer
:
false
visible
:
!
_vehicleHasHomePosition
}
}
Column
{
FactTextField
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
spacing
:
_margin
fact
:
missionItem
.
missionName
visible
:
plannedHomePositionSection
.
checked
&&
!
_vehicleHasHomePosition
visible
:
!
_existingMissionLoaded
}
GridLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
rowSpacing
:
columnSpacing
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
Altitude
"
)
}
FactTextField
{
fact
:
missionItem
.
plannedHomePositionAltitude
Layout.fillWidth
:
true
}
}
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
text
:
missionItem
.
missionName
.
valueString
wrapMode
:
Text
.
WordWrap
visible
:
_existingMissionLoaded
font.pointSize
:
ScreenTools
.
smallFontPointSize
}
text
:
qsTr
(
"
Actual position set by vehicle at flight time.
"
)
horizontalAlignment
:
Text
.
AlignHCenter
}
QGCButton
{
QGCLabel
{
text
:
qsTr
(
"
Set Home To Map Center
"
)
text
:
qsTr
(
"
Mission already exists
"
)
onClicked
:
missionItem
.
coordinate
=
map
.
center
font.pointSize
:
ScreenTools
.
smallFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
color
:
qgcPal
.
warningText
}
visible
:
!
_existingMissionLoaded
&&
_newMissionAlreadyExists
}
}
SectionHeader
{
QGCButton
{
id
:
vehicleInfoSectionHeader
text
:
qsTr
(
"
Clear mission
"
)
text
:
qsTr
(
"
Vehicle Info
"
)
visible
:
!
_noMissionItemsAdded
visible
:
_offlineEditing
onClicked
:
missionController
.
clearMission
()
checked
:
false
}
}
GridLayout
{
Loader
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
sourceComponent
:
_showMissionList
?
missionList
:
missionSettings
rowSpacing
:
columnSpacing
}
columns
:
2
}
// Column
visible
:
vehicleInfoSectionHeader
.
visible
&&
vehicleInfoSectionHeader
.
checked
}
// Item
}
// Component
QGCLabel
{
}
// Loader
text
:
_firmwareLabel
Layout.fillWidth
:
true
visible
:
_showOfflineVehicleCombos
}
FactComboBox
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingFirmwareType
indexModel
:
false
Layout.preferredWidth
:
_fieldWidth
visible
:
_showOfflineVehicleCombos
}
QGCLabel
{
Component
{
text
:
_vehicleLabel
id
:
missionList
Layout.fillWidth
:
true
visible
:
_showOfflineVehicleCombos
}
FactComboBox
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingVehicleType
indexModel
:
false
Layout.preferredWidth
:
_fieldWidth
visible
:
_showOfflineVehicleCombos
}
QGCLabel
{
QGCFlickable
{
text
:
qsTr
(
"
Cruise speed
"
)
anchors.left
:
parent
.
left
visible
:
_showCruiseSpeed
anchors.right
:
parent
.
right
Layout.fillWidth
:
true
height
:
missionColumn
.
height
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingCruiseSpeed
visible
:
_showCruiseSpeed
Layout.preferredWidth
:
_fieldWidth
}
QGCLabel
{
Column
{
text
:
qsTr
(
"
Hover speed
"
)
id
:
missionColumn
visible
:
_showHoverSpeed
anchors.left
:
parent
.
left
Layout.fillWidth
:
true
anchors.right
:
parent
.
right
}
spacing
:
_margin
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingHoverSpeed
SectionHeader
{
visible
:
_showHoverSpeed
text
:
qsTr
(
"
Load Mission
"
)
Layout.preferredWidth
:
_fieldWidth
showSpacer
:
false
}
}
}
// GridLayout
SectionHeader
{
QGCButton
{
id
:
missionDefaultsSectionHeader
anchors.left
:
parent
.
left
text
:
qsTr
(
"
Mission Defaults
"
)
anchors.right
:
parent
.
right
checked
:
true
text
:
qsTr
(
"
Load from Vehicle
"
)
visible
:
!
_offlineEditing
onClicked
:
{
missionController
.
loadFromVehicle
()
}
}
}
QGCLabel
{
text
:
qsTr
(
"
No mission files
"
)
visible
:
missionRepeater
.
model
.
length
===
0
}
Column
{
Repeater
{
id
:
missionRepeater
model
:
fileController
.
getFiles
(
_savePath
,
_fileExtension
);
QGCButton
{
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
spacing
:
_margin
text
:
modelData
visible
:
missionDefaultsSectionHeader
.
checked
onClicked
:
{
GridLayout
{
missionController
.
loadFromFile
(
fileController
.
fullyQualifiedFilename
(
_savePath
,
modelData
,
_fileExtension
))
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
rowSpacing
:
columnSpacing
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
Altitude
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
defaultMissionItemAltitude
Layout.fillWidth
:
true
}
QGCCheckBox
{
id
:
flightSpeedCheckBox
text
:
qsTr
(
"
Flight speed
"
)
visible
:
!
_missionVehicle
.
vtol
checked
:
missionItem
.
specifyMissionFlightSpeed
onClicked
:
missionItem
.
specifyMissionFlightSpeed
=
checked
}
FactTextField
{
Layout.fillWidth
:
true
fact
:
missionItem
.
missionFlightSpeed
visible
:
flightSpeedCheckBox
.
visible
enabled
:
flightSpeedCheckBox
.
checked
}
}
// GridLayout
FactComboBox
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
fact
:
missionItem
.
missionEndAction
indexModel
:
false
}
}
}
}
}
}
}
}
Component
{
id
:
missionSettings
Column
{
id
:
valuesColumn
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
spacing
:
_margin
SectionHeader
{
id
:
missionDefaultsSectionHeader
text
:
qsTr
(
"
Mission Defaults
"
)
checked
:
true
showSpacer
:
false
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_margin
visible
:
missionDefaultsSectionHeader
.
checked
GridLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
rowSpacing
:
columnSpacing
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
Waypoint alt
"
)
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
defaultMissionItemAltitude
Layout.fillWidth
:
true
}
CameraSection
{
QGCCheckBox
{
checked
:
missionItem
.
cameraSection
.
settingsSpecified
id
:
flightSpeedCheckBox
text
:
qsTr
(
"
Flight speed
"
)
visible
:
!
_missionVehicle
.
vtol
checked
:
missionItem
.
specifyMissionFlightSpeed
onClicked
:
missionItem
.
specifyMissionFlightSpeed
=
checked
}
FactTextField
{
Layout.fillWidth
:
true
fact
:
missionItem
.
missionFlightSpeed
visible
:
flightSpeedCheckBox
.
visible
enabled
:
flightSpeedCheckBox
.
checked
}
}
}
// GridLayout
FactComboBox
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
fact
:
missionItem
.
missionEndAction
indexModel
:
false
}
}
CameraSection
{
checked
:
missionItem
.
cameraSection
.
settingsSpecified
}
SectionHeader
{
id
:
vehicleInfoSectionHeader
text
:
qsTr
(
"
Vehicle Info
"
)
visible
:
_offlineEditing
checked
:
false
}
GridLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
rowSpacing
:
columnSpacing
columns
:
2
visible
:
vehicleInfoSectionHeader
.
visible
&&
vehicleInfoSectionHeader
.
checked
QGCLabel
{
text
:
_firmwareLabel
Layout.fillWidth
:
true
visible
:
_showOfflineVehicleCombos
}
FactComboBox
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingFirmwareType
indexModel
:
false
Layout.preferredWidth
:
_fieldWidth
visible
:
_showOfflineVehicleCombos
}
QGCLabel
{
text
:
_vehicleLabel
Layout.fillWidth
:
true
visible
:
_showOfflineVehicleCombos
}
FactComboBox
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingVehicleType
indexModel
:
false
Layout.preferredWidth
:
_fieldWidth
visible
:
_showOfflineVehicleCombos
}
QGCLabel
{
text
:
qsTr
(
"
Cruise speed
"
)
visible
:
_showCruiseSpeed
Layout.fillWidth
:
true
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingCruiseSpeed
visible
:
_showCruiseSpeed
Layout.preferredWidth
:
_fieldWidth
}
QGCLabel
{
text
:
qsTr
(
"
Hover speed
"
)
visible
:
_showHoverSpeed
Layout.fillWidth
:
true
}
FactTextField
{
fact
:
QGroundControl
.
settingsManager
.
appSettings
.
offlineEditingHoverSpeed
visible
:
_showHoverSpeed
Layout.preferredWidth
:
_fieldWidth
}
}
// GridLayout
SectionHeader
{
id
:
plannedHomePositionSection
text
:
qsTr
(
"
Planned Home Position
"
)
visible
:
!
_vehicleHasHomePosition
checked
:
false
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_margin
visible
:
plannedHomePositionSection
.
checked
&&
!
_vehicleHasHomePosition
GridLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
rowSpacing
:
columnSpacing
columns
:
2
QGCLabel
{
QGCLabel
{
width
:
parent
.
width
text
:
qsTr
(
"
Altitude
"
)
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Speeds are only used for time calculations. Actual vehicle speed will not be affected.
"
)
horizontalAlignment
:
Text
.
AlignHCenter
visible
:
_offlineEditing
&&
_missionVehicle
.
vtol
}
}
}
// Column
FactTextField
{
}
// Item
fact
:
missionItem
.
plannedHomePositionAltitude
}
// Component
Layout.fillWidth
:
true
}
// Loader
}
}
QGCLabel
{
width
:
parent
.
width
wrapMode
:
Text
.
WordWrap
font.pointSize
:
ScreenTools
.
smallFontPointSize
text
:
qsTr
(
"
Actual position set by vehicle at flight time.
"
)
horizontalAlignment
:
Text
.
AlignHCenter
}
QGCButton
{
text
:
qsTr
(
"
Set Home To Map Center
"
)
onClicked
:
missionItem
.
coordinate
=
map
.
center
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
}
}
// Column
}
}
// Rectangle
}
// Rectangle
src/PlanView/PlanToolBar.qml
View file @
08ace3c5
...
@@ -80,26 +80,10 @@ Rectangle {
...
@@ -80,26 +80,10 @@ Rectangle {
checked
:
false
checked
:
false
onClicked
:
{
onClicked
:
{
console
.
log
(
"
Leave plan clicked
"
)
checked
=
false
checked
=
false
if
(
missionController
.
dirty
)
{
missionController
.
saveOnSwitch
()
uploadPrompt
.
visible
=
true
showFlyView
()
}
else
{
showFlyView
()
}
}
MessageDialog
{
id
:
uploadPrompt
title
:
_activeVehicle
?
qsTr
(
"
Unsent changes
"
)
:
qsTr
(
"
Unsaved changes
"
)
text
:
qsTr
(
"
You have %1 changes to your mission. Are you sure you want to leave before you %2?
"
).
arg
(
_activeVehicle
?
qsTr
(
"
unsent
"
)
:
qsTr
(
"
unsaved
"
)).
arg
(
_activeVehicle
?
qsTr
(
"
send the mission to the vehicle
"
)
:
qsTr
(
"
save the mission to a file
"
))
standardButtons
:
StandardButton
.
Yes
|
StandardButton
.
No
onNo
:
visible
=
false
onYes
:
{
visible
=
false
showFlyView
()
}
}
}
}
}
...
@@ -180,31 +164,5 @@ Rectangle {
...
@@ -180,31 +164,5 @@ Rectangle {
QGCLabel
{
text
:
"
--
"
}
QGCLabel
{
text
:
"
--
"
}
}
}
}
}
QGCButton
{
anchors.rightMargin
:
_margins
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
_activeVehicle
?
qsTr
(
"
Upload
"
)
:
qsTr
(
"
Save
"
)
visible
:
missionDirty
primary
:
true
onClicked
:
{
if
(
_activeVehicle
)
{
missionController
.
sendToVehicle
()
}
else
{
missionController
.
saveToSelectedFile
()
}
}
NumberAnimation
on
opacity
{
id
:
opacityAnimation
running
:
missionDirty
from
:
0.5
to
:
1.0
loops
:
Animation
.
Infinite
duration
:
2000
}
}
}
}
src/PlanView/PlanView.qml
View file @
08ace3c5
...
@@ -103,15 +103,16 @@ QGCView {
...
@@ -103,15 +103,16 @@ QGCView {
setCurrentItem
(
0
)
setCurrentItem
(
0
)
}
}
// Users is switching away from Plan View
function
saveOnSwitch
()
{
save
()
}
function
loadFromSelectedFile
()
{
function
loadFromSelectedFile
()
{
fileDialog
.
title
=
qsTr
(
"
Select Mission File
"
)
fileDialog
.
title
=
qsTr
(
"
Select Mission File
"
)
fileDialog
.
selectExisting
=
true
fileDialog
.
selectExisting
=
true
fileDialog
.
nameFilters
=
missionController
.
nameFilters
fileDialog
.
nameFilters
=
missionController
.
nameFilters
fileDialog
.
openForLoad
()
fileDialog
.
openForLoad
()
// FIXME: Hmm
//mapFitFunctions.fitMapViewportToMissionItems()
//_currentMissionItem = _visualItems.get(0)
}
}
function
saveToSelectedFile
()
{
function
saveToSelectedFile
()
{
...
@@ -464,13 +465,12 @@ QGCView {
...
@@ -464,13 +465,12 @@ QGCView {
// Plan Element selector (Mission/Fence/Rally)
// Plan Element selector (Mission/Fence/Rally)
Row
{
Row
{
id
:
planElementSelectorRow
id
:
planElementSelectorRow
anchors.topMargin
:
parent
.
height
-
ScreenTools
.
availableHeight
+
_margin
anchors.top
:
toolStrip
.
top
anchors.top
:
parent
.
top
anchors.leftMargin
:
parent
.
width
-
_rightPanelWidth
anchors.leftMargin
:
parent
.
width
-
_rightPanelWidth
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
spacing
:
_horizontalMargin
spacing
:
_horizontalMargin
visible
:
QGroundControl
.
corePlugin
.
options
.
enablePlanViewSelector
visible
:
false
// WIP: Temporarily remove -
QGroundControl.corePlugin.options.enablePlanViewSelector
readonly
property
real
_buttonRadius
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
readonly
property
real
_buttonRadius
:
ScreenTools
.
defaultFontPixelHeight
*
0.75
...
@@ -531,7 +531,7 @@ QGCView {
...
@@ -531,7 +531,7 @@ QGCView {
// Mission Item Editor
// Mission Item Editor
Item
{
Item
{
id
:
missionItemEditor
id
:
missionItemEditor
anchors.topMargin
:
_margin
anchors.topMargin
:
planElementSelectorRow
.
visible
?
_margin
:
0
anchors.top
:
planElementSelectorRow
.
visible
?
planElementSelectorRow
.
bottom
:
planElementSelectorRow
.
top
anchors.top
:
planElementSelectorRow
.
visible
?
planElementSelectorRow
.
bottom
:
planElementSelectorRow
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
...
@@ -673,10 +673,10 @@ QGCView {
...
@@ -673,10 +673,10 @@ QGCView {
color
:
qgcPal
.
window
color
:
qgcPal
.
window
title
:
qsTr
(
"
Plan
"
)
title
:
qsTr
(
"
Plan
"
)
z
:
QGroundControl
.
zOrderWidgets
z
:
QGroundControl
.
zOrderWidgets
showAlternateIcon
:
[
false
,
false
,
_syncDropDownController
.
dirty
,
false
,
false
,
false
]
showAlternateIcon
:
[
false
,
false
,
false
,
false
,
false
]
rotateImage
:
[
false
,
false
,
_syncDropDownController
.
syncInProgress
,
false
,
false
,
false
]
rotateImage
:
[
false
,
false
,
false
,
false
,
false
]
animateImage
:
[
false
,
false
,
_syncDropDownController
.
dirty
,
false
,
false
,
false
]
animateImage
:
[
false
,
false
,
false
,
false
,
false
]
buttonEnabled
:
[
true
,
true
,
!
_syncDropDownController
.
syncInProgress
,
true
,
true
,
true
]
buttonEnabled
:
[
true
,
true
,
true
,
true
,
true
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
buttonVisible
:
[
true
,
true
,
true
,
true
,
_showZoom
,
_showZoom
]
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
maxHeight
:
mapScale
.
y
-
toolStrip
.
y
...
@@ -684,8 +684,6 @@ QGCView {
...
@@ -684,8 +684,6 @@ QGCView {
property
bool
mySingleComplexItem
:
_singleComplexItem
property
bool
mySingleComplexItem
:
_singleComplexItem
onMySingleComplexItemChanged
:
console
.
log
(
model
[
1
].
dropPanelComponent
)
model
:
[
model
:
[
{
{
name
:
"
Waypoint
"
,
name
:
"
Waypoint
"
,
...
@@ -697,12 +695,6 @@ QGCView {
...
@@ -697,12 +695,6 @@ QGCView {
iconSource
:
"
/qmlimages/MapDrawShape.svg
"
,
iconSource
:
"
/qmlimages/MapDrawShape.svg
"
,
dropPanelComponent
:
_singleComplexItem
?
undefined
:
patternDropPanel
dropPanelComponent
:
_singleComplexItem
?
undefined
:
patternDropPanel
},
},
{
name
:
"
Sync
"
,
iconSource
:
"
/qmlimages/MapSync.svg
"
,
alternateIconSource
:
"
/qmlimages/MapSyncChanged.svg
"
,
dropPanelComponent
:
syncDropPanel
},
{
{
name
:
"
Center
"
,
name
:
"
Center
"
,
iconSource
:
"
/qmlimages/MapCenter.svg
"
,
iconSource
:
"
/qmlimages/MapCenter.svg
"
,
...
@@ -728,16 +720,10 @@ QGCView {
...
@@ -728,16 +720,10 @@ QGCView {
addComplexItem
(
missionController
.
complexMissionItemNames
[
0
])
addComplexItem
(
missionController
.
complexMissionItemNames
[
0
])
}
}
break
break
case
5
:
case
3
:
editorMap
.
zoomLevel
+=
0.5
editorMap
.
zoomLevel
+=
0.5
break
break
case
6
:
case
4
:
editorMap
.
zoomLevel
-=
0.5
break
case
5
:
editorMap
.
zoomLevel
+=
0.5
break
case
6
:
editorMap
.
zoomLevel
-=
0.5
editorMap
.
zoomLevel
-=
0.5
break
break
}
}
...
@@ -834,12 +820,12 @@ QGCView {
...
@@ -834,12 +820,12 @@ QGCView {
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
QGCButton
{
QGCButton
{
text
:
qsTr
(
"
S
end To Vehicl
e
"
)
text
:
qsTr
(
"
S
av
e
"
)
Layout.fillWidth
:
true
Layout.fillWidth
:
true
enabled
:
_activeVehicle
&&
!
_syncDropDownController
.
syncInProgress
enabled
:
!
_syncDropDownController
.
syncInProgress
onClicked
:
{
onClicked
:
{
dropPanel
.
hide
()
dropPanel
.
hide
()
_syncDropDownController
.
s
endToVehicl
e
()
_syncDropDownController
.
s
av
e
()
}
}
}
}
...
...
src/QmlControls/ParameterEditorDialog.qml
View file @
08ace3c5
...
@@ -200,6 +200,7 @@ QGCViewDialog {
...
@@ -200,6 +200,7 @@ QGCViewDialog {
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss.
"
)
+
text
:
qsTr
(
"
Warning: Modifying values while vehicle is in flight can lead to vehicle instability and possible vehicle loss.
"
)
+
qsTr
(
"
Make sure you know what you are doing and double-check your values before Save!
"
)
qsTr
(
"
Make sure you know what you are doing and double-check your values before Save!
"
)
visible
:
fact
.
componentId
!=
-
1
}
}
QGCCheckBox
{
QGCCheckBox
{
...
...
src/QmlControls/QFileDialogController.cc
View file @
08ace3c5
...
@@ -27,7 +27,7 @@ QStringList QFileDialogController::getFiles(const QString& directoryPath, const
...
@@ -27,7 +27,7 @@ QStringList QFileDialogController::getFiles(const QString& directoryPath, const
foreach
(
const
QFileInfo
&
fileInfo
,
fileInfoList
)
{
foreach
(
const
QFileInfo
&
fileInfo
,
fileInfoList
)
{
qCDebug
(
QFileDialogControllerLog
)
<<
"getFiles found"
<<
fileInfo
.
baseName
();
qCDebug
(
QFileDialogControllerLog
)
<<
"getFiles found"
<<
fileInfo
.
baseName
();
files
<<
fileInfo
.
baseName
()
+
QStringLiteral
(
"."
)
+
fileExtension
;
files
<<
fileInfo
.
baseName
();
}
}
return
files
;
return
files
;
...
...
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