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
51a6792a
Commit
51a6792a
authored
Feb 28, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling Date/Time
Flight management with date range, delete flights.
parent
60453a88
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
423 additions
and
108 deletions
+423
-108
AirMapFlightPlanManager.cc
src/Airmap/AirMapFlightPlanManager.cc
+170
-54
AirMapFlightPlanManager.h
src/Airmap/AirMapFlightPlanManager.h
+17
-9
AirMapManager.cc
src/Airmap/AirMapManager.cc
+2
-2
AirmapSettings.qml
src/Airmap/AirmapSettings.qml
+176
-37
AirspaceFlightPlanProvider.cc
src/AirspaceManagement/AirspaceFlightPlanProvider.cc
+38
-0
AirspaceFlightPlanProvider.h
src/AirspaceManagement/AirspaceFlightPlanProvider.h
+19
-5
FactTextField.qml
src/FactSystem/FactControls/FactTextField.qml
+1
-1
No files found.
src/Airmap/AirMapFlightPlanManager.cc
View file @
51a6792a
This diff is collapsed.
Click to expand it.
src/Airmap/AirMapFlightPlanManager.h
View file @
51a6792a
...
...
@@ -29,10 +29,10 @@ class AirMapFlightInfo : public AirspaceFlightInfo
public:
AirMapFlightInfo
(
const
airmap
::
Flight
&
flight
,
QObject
*
parent
=
nullptr
);
QString
flightID
()
override
{
return
QString
::
fromStdString
(
_flight
.
id
);
}
QString
flightPlanID
()
override
{
return
QString
::
fromStdString
(
_flight
.
flight_plan_id
.
get
()
);
}
QString
createdTime
()
override
{
return
QDateTime
::
currentDateTime
().
toString
(
Qt
::
SystemLocaleShortDate
);
}
//-- TODO: Need to get rid of boost first
QString
startTime
()
override
{
return
QDateTime
::
currentDateTime
().
toString
(
Qt
::
SystemLocaleShortDate
);
}
//-- TODO: Need to get rid of boost first
QString
endTime
()
override
{
return
QDateTime
::
currentDateTime
().
toString
(
Qt
::
SystemLocaleShortDate
);
}
//-- TODO: Need to get rid of boost first
QString
flightPlanID
()
override
{
return
_flight
.
flight_plan_id
?
QString
::
fromStdString
(
_flight
.
flight_plan_id
.
get
())
:
QString
(
);
}
QString
createdTime
()
override
;
QString
startTime
()
override
;
QString
endTime
()
override
;
QGeoCoordinate
takeOff
()
override
{
return
QGeoCoordinate
(
_flight
.
latitude
,
_flight
.
longitude
);}
QmlObjectListModel
*
boundingBox
()
override
{
return
&
_boundingBox
;
}
private:
...
...
@@ -66,13 +66,17 @@ public:
QmlObjectListModel
*
rulesFollowing
()
override
{
return
&
_rulesFollowing
;
}
QmlObjectListModel
*
briefFeatures
()
override
{
return
&
_briefFeatures
;
}
AirspaceFlightModel
*
flightList
()
override
{
return
&
_flightList
;
}
bool
loadingFlightList
()
override
{
return
_loadingFlightList
;
}
void
updateFlightPlan
()
override
;
void
submitFlightPlan
()
override
;
void
startFlightPlanning
(
PlanMasterController
*
planController
)
override
;
void
setFlightStartTime
(
QDateTime
start
)
override
;
void
setFlightEndTime
(
QDateTime
end
)
override
;
void
loadFlightList
()
override
;
void
loadFlightList
(
QDateTime
startTime
,
QDateTime
endTime
)
override
;
void
deleteFlightPlan
(
QString
flightPlanID
)
override
;
void
deleteSelectedFlightPlans
()
override
;
signals:
void
error
(
const
QString
&
what
,
const
QString
&
airmapdMessage
,
const
QString
&
airmapdDetails
);
...
...
@@ -80,14 +84,14 @@ signals:
private
slots
:
void
_pollBriefing
();
void
_missionChanged
();
private:
void
_deleteFlightPlan
();
void
_uploadFlightPlan
();
void
_updateFlightPlan
();
void
_loadFlightList
();
private:
void
_createFlightPlan
();
void
_deleteFlightPlan
();
bool
_collectFlightDtata
();
void
_loadFlightList
();
private:
enum
class
State
{
...
...
@@ -121,8 +125,10 @@ private:
QString
_flightPlan
;
///< Current flight plan
QString
_flightId
;
///< Current flight ID, not necessarily accepted yet
QString
_pilotID
;
///< Pilot ID in the form "auth0|abc123"
QStringList
_flightsToDelete
;
PlanMasterController
*
_planController
=
nullptr
;
bool
_valid
=
false
;
bool
_loadingFlightList
=
false
;
QDateTime
_flightStartTime
;
QDateTime
_flightEndTime
;
QmlObjectListModel
_advisories
;
...
...
@@ -133,6 +139,8 @@ private:
QmlObjectListModel
_rulesFollowing
;
QmlObjectListModel
_briefFeatures
;
AirspaceFlightModel
_flightList
;
QDateTime
_rangeStart
;
QDateTime
_rangeEnd
;
AirspaceAdvisoryProvider
::
AdvisoryColor
_airspaceColor
;
AirspaceFlightPlanProvider
::
PermitStatus
_flightPermitStatus
=
AirspaceFlightPlanProvider
::
PermitNone
;
...
...
src/Airmap/AirMapManager.cc
View file @
51a6792a
...
...
@@ -37,8 +37,8 @@ AirMapManager::AirMapManager(QGCApplication* app, QGCToolbox* toolbox)
{
_logger
=
std
::
make_shared
<
qt
::
Logger
>
();
qt
::
register_types
();
// TODO: still needed?
_logger
->
logging_category
().
setEnabled
(
QtDebugMsg
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
fals
e
);
_logger
->
logging_category
().
setEnabled
(
QtDebugMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtInfoMsg
,
tru
e
);
_logger
->
logging_category
().
setEnabled
(
QtWarningMsg
,
true
);
_dispatchingLogger
=
std
::
make_shared
<
qt
::
DispatchingLogger
>
(
_logger
);
connect
(
&
_shared
,
&
AirMapSharedState
::
error
,
this
,
&
AirMapManager
::
_error
);
...
...
src/Airmap/AirmapSettings.qml
View file @
51a6792a
This diff is collapsed.
Click to expand it.
src/AirspaceManagement/AirspaceFlightPlanProvider.cc
View file @
51a6792a
...
...
@@ -7,12 +7,14 @@
*
****************************************************************************/
#include "AirspaceManager.h"
#include "AirspaceFlightPlanProvider.h"
#include <QQmlEngine>
//-----------------------------------------------------------------------------
AirspaceFlightInfo
::
AirspaceFlightInfo
(
QObject
*
parent
)
:
QObject
(
parent
)
,
_beingDeleted
(
false
)
,
_selected
(
false
)
{
}
...
...
@@ -40,6 +42,18 @@ AirspaceFlightModel::get(int index)
return
_flightEntries
[
index
];
}
//-----------------------------------------------------------------------------
int
AirspaceFlightModel
::
findFlightPlanID
(
QString
flightPlanID
)
{
for
(
int
i
=
0
;
i
<
_flightEntries
.
count
();
i
++
)
{
if
(
_flightEntries
[
i
]
->
flightPlanID
()
==
flightPlanID
)
{
return
i
;
}
}
return
-
1
;
}
//-----------------------------------------------------------------------------
int
AirspaceFlightModel
::
count
()
const
...
...
@@ -58,6 +72,30 @@ AirspaceFlightModel::append(AirspaceFlightInfo* object)
emit
countChanged
();
}
//-----------------------------------------------------------------------------
void
AirspaceFlightModel
::
remove
(
const
QString
&
flightPlanID
)
{
remove
(
findFlightPlanID
(
flightPlanID
));
}
//-----------------------------------------------------------------------------
void
AirspaceFlightModel
::
remove
(
int
index
)
{
if
(
index
>=
0
&&
index
<
_flightEntries
.
count
())
{
beginRemoveRows
(
QModelIndex
(),
index
,
index
);
AirspaceFlightInfo
*
entry
=
_flightEntries
[
index
];
if
(
entry
)
{
qCDebug
(
AirspaceManagementLog
)
<<
"Deleting flight plan"
<<
entry
->
flightPlanID
();
entry
->
deleteLater
();
}
_flightEntries
.
removeAt
(
index
);
endRemoveRows
();
emit
countChanged
();
}
}
//-----------------------------------------------------------------------------
void
AirspaceFlightModel
::
clear
(
void
)
...
...
src/AirspaceManagement/AirspaceFlightPlanProvider.h
View file @
51a6792a
...
...
@@ -38,7 +38,8 @@ public:
Q_PROPERTY
(
QString
endTime
READ
endTime
CONSTANT
)
Q_PROPERTY
(
QGeoCoordinate
takeOff
READ
takeOff
CONSTANT
)
Q_PROPERTY
(
QmlObjectListModel
*
boundingBox
READ
boundingBox
CONSTANT
)
Q_PROPERTY
(
bool
selected
READ
selected
WRITE
setSelected
NOTIFY
selectedChanged
)
Q_PROPERTY
(
bool
beingDeleted
READ
beingDeleted
WRITE
setBeingDeleted
NOTIFY
beingDeletedChanged
)
Q_PROPERTY
(
bool
selected
READ
selected
WRITE
setSelected
NOTIFY
selectedChanged
)
virtual
QString
flightID
()
=
0
;
virtual
QString
flightPlanID
()
=
0
;
...
...
@@ -48,13 +49,17 @@ public:
virtual
QGeoCoordinate
takeOff
()
=
0
;
virtual
QmlObjectListModel
*
boundingBox
()
=
0
;
virtual
bool
beingDeleted
()
{
return
_beingDeleted
;
}
virtual
void
setBeingDeleted
(
bool
val
)
{
_beingDeleted
=
val
;
emit
beingDeletedChanged
();
}
virtual
bool
selected
()
{
return
_selected
;
}
virtual
void
setSelected
(
bool
sel
)
{
_selected
=
sel
;
emit
selectedChanged
();
}
signals:
void
selectedChanged
();
void
beingDeletedChanged
();
protected:
bool
_beingDeleted
;
bool
_selected
;
};
...
...
@@ -71,10 +76,14 @@ public:
AirspaceFlightModel
(
QObject
*
parent
=
0
);
Q_PROPERTY
(
int
count
READ
count
NOTIFY
countChanged
)
Q_INVOKABLE
AirspaceFlightInfo
*
get
(
int
index
);
Q_INVOKABLE
AirspaceFlightInfo
*
get
(
int
index
);
Q_INVOKABLE
int
findFlightPlanID
(
QString
flightPlanID
);
int
count
(
void
)
const
;
void
append
(
AirspaceFlightInfo
*
entry
);
void
remove
(
const
QString
&
flightPlanID
);
void
remove
(
int
index
);
void
clear
(
void
);
AirspaceFlightInfo
*
...
...
@@ -124,11 +133,14 @@ public:
Q_PROPERTY
(
QmlObjectListModel
*
rulesFollowing
READ
rulesFollowing
NOTIFY
rulesChanged
)
Q_PROPERTY
(
QmlObjectListModel
*
briefFeatures
READ
briefFeatures
NOTIFY
rulesChanged
)
Q_PROPERTY
(
AirspaceFlightModel
*
flightList
READ
flightList
NOTIFY
flightListChanged
)
Q_PROPERTY
(
bool
loadingFlightList
READ
loadingFlightList
NOTIFY
loadingFlightListChanged
)
//-- TODO: This will submit the current flight plan in memory.
Q_INVOKABLE
virtual
void
submitFlightPlan
()
=
0
;
Q_INVOKABLE
virtual
void
updateFlightPlan
()
=
0
;
Q_INVOKABLE
virtual
void
loadFlightList
()
=
0
;
Q_INVOKABLE
virtual
void
submitFlightPlan
()
=
0
;
Q_INVOKABLE
virtual
void
updateFlightPlan
()
=
0
;
Q_INVOKABLE
virtual
void
loadFlightList
(
QDateTime
startTime
,
QDateTime
endTime
)
=
0
;
Q_INVOKABLE
virtual
void
deleteFlightPlan
(
QString
flighPlanID
)
=
0
;
Q_INVOKABLE
virtual
void
deleteSelectedFlightPlans
()
=
0
;
virtual
PermitStatus
flightPermitStatus
()
const
{
return
PermitNone
;
}
virtual
QDateTime
flightStartTime
()
const
=
0
;
...
...
@@ -145,6 +157,7 @@ public:
virtual
QmlObjectListModel
*
rulesFollowing
()
=
0
;
///< List of AirspaceRule following
virtual
QmlObjectListModel
*
briefFeatures
()
=
0
;
///< List of AirspaceRule in violation
virtual
AirspaceFlightModel
*
flightList
()
=
0
;
///< List of AirspaceFlightInfo
virtual
bool
loadingFlightList
()
=
0
;
virtual
void
setFlightStartTime
(
QDateTime
start
)
=
0
;
virtual
void
setFlightEndTime
(
QDateTime
end
)
=
0
;
...
...
@@ -158,4 +171,5 @@ signals:
void
missionAreaChanged
();
void
rulesChanged
();
void
flightListChanged
();
void
loadingFlightListChanged
();
};
src/FactSystem/FactControls/FactTextField.qml
View file @
51a6792a
...
...
@@ -32,7 +32,7 @@ QGCTextField {
}
if
(
typeof
qgcView
!==
'
undefined
'
&&
qgcView
)
{
var
errorString
=
fact
.
validate
(
text
,
false
/* convertOnly */
)
if
(
errorString
==
""
)
{
if
(
errorString
==
=
""
)
{
fact
.
value
=
text
}
else
{
_validateString
=
text
...
...
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