Commit ae02bcd2 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4205 from DonLakeFlyer/MapViewport

Better Plan view map viewport handling
parents 0b83a2da 49177bc2
...@@ -22,11 +22,12 @@ APMGeoFenceManager::APMGeoFenceManager(Vehicle* vehicle) ...@@ -22,11 +22,12 @@ APMGeoFenceManager::APMGeoFenceManager(Vehicle* vehicle)
: GeoFenceManager(vehicle) : GeoFenceManager(vehicle)
, _fenceSupported(false) , _fenceSupported(false)
, _breachReturnSupported(vehicle->fixedWing()) , _breachReturnSupported(vehicle->fixedWing())
, _circleSupported(false)
, _polygonSupported(false)
, _firstParamLoadComplete(false) , _firstParamLoadComplete(false)
, _circleRadiusFact(NULL) , _circleRadiusFact(NULL)
, _readTransactionInProgress(false) , _readTransactionInProgress(false)
, _writeTransactionInProgress(false) , _writeTransactionInProgress(false)
, _fenceEnableFact(NULL)
, _fenceTypeFact(NULL) , _fenceTypeFact(NULL)
{ {
connect(_vehicle, &Vehicle::mavlinkMessageReceived, this, &APMGeoFenceManager::_mavlinkMessageReceived); connect(_vehicle, &Vehicle::mavlinkMessageReceived, this, &APMGeoFenceManager::_mavlinkMessageReceived);
...@@ -80,7 +81,7 @@ void APMGeoFenceManager::sendToVehicle(const QGeoCoordinate& breachReturn, const ...@@ -80,7 +81,7 @@ void APMGeoFenceManager::sendToVehicle(const QGeoCoordinate& breachReturn, const
fenceEnableFact->setRawValue(0); fenceEnableFact->setRawValue(0);
// Total point count, +1 polygon close in last index, +1 for breach in index 0 // Total point count, +1 polygon close in last index, +1 for breach in index 0
_cWriteFencePoints = (validatedPolygonCount ? (validatedPolygonCount + 1) : 0) + 1 ; _cWriteFencePoints = validatedPolygonCount ? validatedPolygonCount + 1 + 1 : 0;
_vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _fenceTotalParam)->setRawValue(_cWriteFencePoints); _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _fenceTotalParam)->setRawValue(_cWriteFencePoints);
// FIXME: No validation of correct fence received // FIXME: No validation of correct fence received
...@@ -106,11 +107,11 @@ void APMGeoFenceManager::loadFromVehicle(void) ...@@ -106,11 +107,11 @@ void APMGeoFenceManager::loadFromVehicle(void)
return; return;
} }
// Point 0: Breach return point (ArduPlane only) // Point 0: Breach return point (always sent, but supported by ArduPlane only)
// Point [1,N]: Polygon points // Point [1,N]: Polygon points
// Point N+1: Close polygon point (same as point 1) // Point N+1: Close polygon point (same as point 1)
int cFencePoints = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _fenceTotalParam)->rawValue().toInt(); int cFencePoints = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, _fenceTotalParam)->rawValue().toInt();
int minFencePoints = 6; int minFencePoints = 5;
qCDebug(GeoFenceManagerLog) << "APMGeoFenceManager::loadFromVehicle" << cFencePoints; qCDebug(GeoFenceManagerLog) << "APMGeoFenceManager::loadFromVehicle" << cFencePoints;
if (cFencePoints == 0) { if (cFencePoints == 0) {
// No fence // No fence
...@@ -242,8 +243,19 @@ bool APMGeoFenceManager::_geoFenceSupported(void) ...@@ -242,8 +243,19 @@ bool APMGeoFenceManager::_geoFenceSupported(void)
void APMGeoFenceManager::_updateSupportedFlags(void) void APMGeoFenceManager::_updateSupportedFlags(void)
{ {
emit circleSupportedChanged(circleSupported()); bool newCircleSupported = _fenceSupported && _vehicle->multiRotor() && _fenceTypeFact && (_fenceTypeFact->rawValue().toInt() & 2);
emit polygonSupportedChanged(polygonSupported()); if (newCircleSupported != _circleSupported) {
_circleSupported = newCircleSupported;
emit circleSupportedChanged(newCircleSupported);
}
bool newPolygonSupported = _fenceSupported &&
((_vehicle->multiRotor() && _fenceTypeFact && (_fenceTypeFact->rawValue().toInt() & 4)) ||
_vehicle->fixedWing());
if (newPolygonSupported != _polygonSupported) {
_polygonSupported = newPolygonSupported;
emit polygonSupportedChanged(newPolygonSupported);
}
} }
void APMGeoFenceManager::_parametersReady(void) void APMGeoFenceManager::_parametersReady(void)
...@@ -258,10 +270,8 @@ void APMGeoFenceManager::_parametersReady(void) ...@@ -258,10 +270,8 @@ void APMGeoFenceManager::_parametersReady(void)
QStringList paramLabels; QStringList paramLabels;
if (_vehicle->multiRotor()) { if (_vehicle->multiRotor()) {
_fenceEnableFact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("FENCE_ENABLE"));
_fenceTypeFact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("FENCE_TYPE")); _fenceTypeFact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("FENCE_TYPE"));
connect(_fenceEnableFact, &Fact::rawValueChanged, this, &APMGeoFenceManager::_updateSupportedFlags);
connect(_fenceTypeFact, &Fact::rawValueChanged, this, &APMGeoFenceManager::_updateSupportedFlags); connect(_fenceTypeFact, &Fact::rawValueChanged, this, &APMGeoFenceManager::_updateSupportedFlags);
_circleRadiusFact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("FENCE_RADIUS")); _circleRadiusFact = _vehicle->parameterManager()->getParameter(FactSystem::defaultComponentId, QStringLiteral("FENCE_RADIUS"));
...@@ -293,8 +303,7 @@ void APMGeoFenceManager::_parametersReady(void) ...@@ -293,8 +303,7 @@ void APMGeoFenceManager::_parametersReady(void)
emit paramLabelsChanged(_paramLabels); emit paramLabelsChanged(_paramLabels);
emit fenceSupportedChanged(_fenceSupported); emit fenceSupportedChanged(_fenceSupported);
emit circleSupportedChanged(circleSupported()); _updateSupportedFlags();
emit polygonSupportedChanged(polygonSupported());
} }
qCDebug(GeoFenceManagerLog) << "fenceSupported:circleSupported:polygonSupported:breachReturnSupported" << qCDebug(GeoFenceManagerLog) << "fenceSupported:circleSupported:polygonSupported:breachReturnSupported" <<
...@@ -318,26 +327,12 @@ void APMGeoFenceManager::_circleRadiusRawValueChanged(QVariant value) ...@@ -318,26 +327,12 @@ void APMGeoFenceManager::_circleRadiusRawValueChanged(QVariant value)
bool APMGeoFenceManager::circleSupported(void) const bool APMGeoFenceManager::circleSupported(void) const
{ {
if (_fenceSupported && _vehicle->multiRotor() && _fenceEnableFact && _fenceTypeFact) { return _circleSupported;
return _fenceEnableFact->rawValue().toBool() && (_fenceTypeFact->rawValue().toInt() & 2);
}
return false;
} }
bool APMGeoFenceManager::polygonSupported(void) const bool APMGeoFenceManager::polygonSupported(void) const
{ {
if (_fenceSupported) { return _polygonSupported;
if (_vehicle->multiRotor()) {
if (_fenceEnableFact && _fenceTypeFact) {
return _fenceEnableFact->rawValue().toBool() && (_fenceTypeFact->rawValue().toInt() & 4);
}
} else if (_vehicle->fixedWing()) {
return true;
}
}
return false;
} }
QString APMGeoFenceManager::editorQml(void) const QString APMGeoFenceManager::editorQml(void) const
......
...@@ -49,6 +49,8 @@ private: ...@@ -49,6 +49,8 @@ private:
private: private:
bool _fenceSupported; bool _fenceSupported;
bool _breachReturnSupported; bool _breachReturnSupported;
bool _circleSupported;
bool _polygonSupported;
bool _firstParamLoadComplete; bool _firstParamLoadComplete;
QVariantList _params; QVariantList _params;
...@@ -63,7 +65,6 @@ private: ...@@ -63,7 +65,6 @@ private:
uint8_t _cWriteFencePoints; uint8_t _cWriteFencePoints;
uint8_t _currentFencePoint; uint8_t _currentFencePoint;
Fact* _fenceEnableFact;
Fact* _fenceTypeFact; Fact* _fenceTypeFact;
static const char* _fenceTotalParam; static const char* _fenceTotalParam;
......
...@@ -90,7 +90,7 @@ void APMRallyPointManager::_mavlinkMessageReceived(const mavlink_message_t& mess ...@@ -90,7 +90,7 @@ void APMRallyPointManager::_mavlinkMessageReceived(const mavlink_message_t& mess
QGeoCoordinate point((float)rallyPoint.lat / 1e7, (float)rallyPoint.lng / 1e7, rallyPoint.alt); QGeoCoordinate point((float)rallyPoint.lat / 1e7, (float)rallyPoint.lng / 1e7, rallyPoint.alt);
_rgPoints.append(point); _rgPoints.append(point);
if (rallyPoint.idx < _cReadRallyPoints - 2) { if (rallyPoint.idx < _cReadRallyPoints - 1) {
// Still more points to request // Still more points to request
_requestRallyPoint(++_currentRallyPoint); _requestRallyPoint(++_currentRallyPoint);
} else { } else {
......
...@@ -86,31 +86,114 @@ QGCView { ...@@ -86,31 +86,114 @@ QGCView {
return lon + 180.0 return lon + 180.0
} }
/// Fix the map viewport to the current mission items. /// Fits the visible region of the map to inclues all of the specified coordinates. If no coordinates
function fitViewportToMissionItems() { /// are specified the map will fit to the home position
if (_visualItems.count == 1) { function fitMapViewportToAllCoordinates(coordList) {
if (coordList.length == 0) {
editorMap.center = _visualItems.get(0).coordinate editorMap.center = _visualItems.get(0).coordinate
} else { return
var missionItem = _visualItems.get(0) }
var north = normalizeLat(missionItem.coordinate.latitude)
var south = north
var east = normalizeLon(missionItem.coordinate.longitude)
var west = east
for (var i=1; i<_visualItems.count; i++) { // Determine the size of the inner portion of the map available for display
missionItem = _visualItems.get(i) var toolbarHeight = qgcView.height - ScreenTools.availableHeight
var rightPanelWidth = _rightPanelWidth
var leftToolWidth = centerMapButton.x + centerMapButton.width
var availableWidth = qgcView.width - rightPanelWidth - leftToolWidth
var availableHeight = qgcView.height - toolbarHeight
if (missionItem.specifiesCoordinate && !missionItem.isStandaloneCoordinate) { // Create the normalized lat/lon corners for the coordinate bounding rect from the list of coordinates
var lat = normalizeLat(missionItem.coordinate.latitude) var north = normalizeLat(coordList[0].latitude)
var lon = normalizeLon(missionItem.coordinate.longitude) var south = north
var east = normalizeLon(coordList[0].longitude)
var west = east
for (var i=1; i<coordList.length; i++) {
var lat = normalizeLat(coordList[i].latitude)
var lon = normalizeLon(coordList[i].longitude)
north = Math.max(north, lat) north = Math.max(north, lat)
south = Math.min(south, lat) south = Math.min(south, lat)
east = Math.max(east, lon) east = Math.max(east, lon)
west = Math.min(west, lon) west = Math.min(west, lon)
} }
// Expand the coordinate bounding rect to make room for the tools around the edge of the map
var latDegreesPerPixel = (north - south) / availableWidth
var lonDegreesPerPixel = (east - west) / availableHeight
north = Math.min(north + (toolbarHeight * latDegreesPerPixel), 180)
west = Math.max(west - (leftToolWidth * lonDegreesPerPixel), 0)
east = Math.min(east + (rightPanelWidth * lonDegreesPerPixel), 360)
// Fix the map region to the new bounding rect
var topLeftCoord = QtPositioning.coordinate(north - 90.0, west - 180.0)
var bottomRightCoord = QtPositioning.coordinate(south - 90.0, east - 180.0)
editorMap.visibleRegion = QtPositioning.rectangle(topLeftCoord, bottomRightCoord)
} }
editorMap.visibleRegion = QtPositioning.rectangle(QtPositioning.coordinate(north - 90.0, west - 180.0), QtPositioning.coordinate(south - 90.0, east - 180.0))
function addMissionItemCoordsForFit(coordList) {
for (var i=1; i<qgcView._visualItems.count; i++) {
missionItem = qgcView._visualItems.get(i)
if (missionItem.specifiesCoordinate && !missionItem.isStandaloneCoordinate) {
coordList.push(missionItem.coordinate)
}
}
}
function fitMapViewportToMissionItems() {
var coordList = [ ]
addMissionItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList)
}
function addFenceItemCoordsForFit(coordList) {
if (geoFenceController.circleSupported) {
var azimuthList = [ 0, 180, 90, 270 ]
for (var i=0; i<azimuthList.length; i++) {
var edgeCoordinate = homePos.coordinate.atDistanceAndAzimuth(geoFenceController.circleRadius, azimuthList[i])
coordList.push(edgeCoordinate)
}
}
if (geoFenceController.polygonSupported && geoFenceController.polygon.count() > 2) {
for (var i=0; i<geoFenceController.polygon.count(); i++) {
coordList.push(geoFenceController.polygon.path[i])
}
}
}
function fitMapViewportToFenceItems() {
var coordList = [ ]
addFenceItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList)
}
function addRallyItemCoordsForFit(coordList) {
for (var i=0; i<rallyPointController.points.count; i++) {
coordList.push(rallyPointController.points.get(i).coordinate)
}
}
function fitMapViewportToRallyItems() {
var coordList = [ ]
addRallyItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList)
}
function fitMapViewportToAllItems() {
var coordList = [ ]
addMissionItemCoordsForFit(coordList)
addFenceItemCoordsForFit(coordList)
addRallyItemCoordsForFit(coordList)
fitMapViewportToAllCoordinates(coordList)
}
property bool _firstMissionLoadComplete: false
property bool _firstFenceLoadComplete: false
property bool _firstRallyLoadComplete: false
property bool _firstLoadComplete: false
function checkFirstLoadComplete() {
if (!_firstLoadComplete && _firstMissionLoadComplete && _firstRallyLoadComplete && _firstFenceLoadComplete) {
_firstLoadComplete = true
fitMapViewportToAllItems()
} }
} }
...@@ -127,7 +210,7 @@ QGCView { ...@@ -127,7 +210,7 @@ QGCView {
qgcView.showDialog(mobileFilePicker, qsTr("Select Mission File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) qgcView.showDialog(mobileFilePicker, qsTr("Select Mission File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else { } else {
missionController.loadFromFilePicker() missionController.loadFromFilePicker()
fitViewportToMissionItems() fitMapViewportToMissionItems()
_currentMissionItem = _visualItems.get(0) _currentMissionItem = _visualItems.get(0)
} }
} }
...@@ -140,13 +223,19 @@ QGCView { ...@@ -140,13 +223,19 @@ QGCView {
} }
} }
function fitViewportToItems() {
fitMapViewportToMissionItems()
}
onVisualItemsChanged: { onVisualItemsChanged: {
itemDragger.clearItem() itemDragger.clearItem()
} }
onNewItemsFromVehicle: { onNewItemsFromVehicle: {
fitViewportToMissionItems() fitMapViewportToMissionItems()
setCurrentItem(0) setCurrentItem(0)
_firstMissionLoadComplete = true
checkFirstLoadComplete()
} }
} }
...@@ -168,6 +257,7 @@ QGCView { ...@@ -168,6 +257,7 @@ QGCView {
qgcView.showDialog(mobileFilePicker, qsTr("Select Fence File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) qgcView.showDialog(mobileFilePicker, qsTr("Select Fence File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else { } else {
geoFenceController.loadFromFilePicker() geoFenceController.loadFromFilePicker()
fitMapViewportToFenceItems()
} }
} }
...@@ -181,6 +271,22 @@ QGCView { ...@@ -181,6 +271,22 @@ QGCView {
} }
} }
} }
function fitViewportToItems() {
fitMapViewportToFenceItems()
}
onLoadComplete: {
_firstFenceLoadComplete = true
switch (_syncDropDownController) {
case geoFenceController:
fitMapViewportToFenceItems()
break
case missionController:
checkFirstLoadComplete()
break
}
}
} }
RallyPointController { RallyPointController {
...@@ -209,6 +315,23 @@ QGCView { ...@@ -209,6 +315,23 @@ QGCView {
qgcView.showDialog(mobileFilePicker, qsTr("Select Rally Point File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) qgcView.showDialog(mobileFilePicker, qsTr("Select Rally Point File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else { } else {
rallyPointController.loadFromFilePicker() rallyPointController.loadFromFilePicker()
fitMapViewportToRallyItems()
}
}
function fitViewportToItems() {
fitMapViewportToRallyItems()
}
onLoadComplete: {
_firstRallyLoadComplete = true
switch (_syncDropDownController) {
case rallyPointController:
fitMapViewportToRallyItems()
break
case missionController:
checkFirstLoadComplete()
break
} }
} }
} }
...@@ -246,7 +369,10 @@ QGCView { ...@@ -246,7 +369,10 @@ QGCView {
QGCMobileFileDialog { QGCMobileFileDialog {
openDialog: true openDialog: true
fileExtension: _syncDropDownController.fileExtension fileExtension: _syncDropDownController.fileExtension
onFilenameReturned: _syncDropDownController.loadFromFile(filename) onFilenameReturned: {
_syncDropDownController.loadFromFile(filename)
_syncDropDownController.fitViewportToItems()
}
} }
} }
...@@ -559,69 +685,31 @@ QGCView { ...@@ -559,69 +685,31 @@ QGCView {
_syncDropDownController = rallyPointController _syncDropDownController = rallyPointController
break break
} }
_syncDropDownController.fitViewportToItems()
} }
} }
RoundButton { QGCRadioButton {
id: planElementMission id: planElementMission
radius: parent._buttonRadius
buttonImage: "/qmlimages/Plan.svg"
lightBorders: _lightWidgetBorders
exclusiveGroup: planElementSelectorGroup exclusiveGroup: planElementSelectorGroup
checked: true
}
QGCLabel {
text: qsTr("Mission") text: qsTr("Mission")
color: mapPal.text checked: true
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
onClicked: planElementMission.checked = true
}
} }
Item { height: 1; width: 1 } Item { height: 1; width: 1 }
RoundButton { QGCRadioButton {
id: planElementGeoFence id: planElementGeoFence
radius: parent._buttonRadius
buttonImage: "/qmlimages/Plan.svg"
lightBorders: _lightWidgetBorders
exclusiveGroup: planElementSelectorGroup exclusiveGroup: planElementSelectorGroup
}
QGCLabel {
text: qsTr("Fence") text: qsTr("Fence")
color: mapPal.text
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
onClicked: planElementGeoFence.checked = true
}
} }
Item { height: 1; width: 1 } Item { height: 1; width: 1 }
RoundButton { QGCRadioButton {
id: planElementRallyPoints id: planElementRallyPoints
radius: parent._buttonRadius
buttonImage: "/qmlimages/Plan.svg"
lightBorders: _lightWidgetBorders
exclusiveGroup: planElementSelectorGroup exclusiveGroup: planElementSelectorGroup
}
QGCLabel {
text: qsTr("Rally") text: qsTr("Rally")
color: mapPal.text
anchors.verticalCenter: parent.verticalCenter
MouseArea {
anchors.fill: parent
onClicked: planElementRallyPoints.checked = true
}
} }
} // Row - Plan Element Selector } // Row - Plan Element Selector
...@@ -872,7 +960,15 @@ QGCView { ...@@ -872,7 +960,15 @@ QGCView {
width: ScreenTools.defaultFontPixelWidth * 10 width: ScreenTools.defaultFontPixelWidth * 10
onClicked: { onClicked: {
centerMapButton.hideDropDown() centerMapButton.hideDropDown()
fitViewportToMissionItems() fitMapViewportToMissionItems()
}
}
QGCButton {
text: qsTr("All items")
width: ScreenTools.defaultFontPixelWidth * 10
onClicked: {
centerMapButton.hideDropDown()
fitMapViewportToAllItems()
} }
} }
QGCButton { QGCButton {
......
...@@ -333,9 +333,9 @@ void GeoFenceController::loadFromVehicle(void) ...@@ -333,9 +333,9 @@ void GeoFenceController::loadFromVehicle(void)
void GeoFenceController::sendToVehicle(void) void GeoFenceController::sendToVehicle(void)
{ {
if (_activeVehicle->parameterManager()->parametersReady() && !syncInProgress()) { if (_activeVehicle->parameterManager()->parametersReady() && !syncInProgress()) {
setDirty(false);
_polygon.setDirty(false);
_activeVehicle->geoFenceManager()->sendToVehicle(_breachReturnPoint, _polygon.coordinateList()); _activeVehicle->geoFenceManager()->sendToVehicle(_breachReturnPoint, _polygon.coordinateList());
_polygon.setDirty(false);
setDirty(false);
} else { } else {
qCWarning(GeoFenceControllerLog) << "GeoFenceController::loadFromVehicle call at wrong time" << _activeVehicle->parameterManager()->parametersReady() << syncInProgress(); qCWarning(GeoFenceControllerLog) << "GeoFenceController::loadFromVehicle call at wrong time" << _activeVehicle->parameterManager()->parametersReady() << syncInProgress();
} }
...@@ -433,6 +433,7 @@ void GeoFenceController::_loadComplete(const QGeoCoordinate& breachReturn, const ...@@ -433,6 +433,7 @@ void GeoFenceController::_loadComplete(const QGeoCoordinate& breachReturn, const
_setReturnPointFromManager(breachReturn); _setReturnPointFromManager(breachReturn);
_setPolygonFromManager(polygon); _setPolygonFromManager(polygon);
setDirty(false); setDirty(false);
emit loadComplete();
} }
QString GeoFenceController::fileExtension(void) const QString GeoFenceController::fileExtension(void) const
......
...@@ -78,6 +78,7 @@ signals: ...@@ -78,6 +78,7 @@ signals:
void paramsChanged (QVariantList params); void paramsChanged (QVariantList params);
void paramLabelsChanged (QStringList paramLabels); void paramLabelsChanged (QStringList paramLabels);
void editorQmlChanged (QString editorQml); void editorQmlChanged (QString editorQml);
void loadComplete (void);
private slots: private slots:
void _polygonDirtyChanged(bool dirty); void _polygonDirtyChanged(bool dirty);
......
...@@ -34,7 +34,7 @@ void GeoFenceManager::_sendError(ErrorCode_t errorCode, const QString& errorMsg) ...@@ -34,7 +34,7 @@ void GeoFenceManager::_sendError(ErrorCode_t errorCode, const QString& errorMsg)
void GeoFenceManager::loadFromVehicle(void) void GeoFenceManager::loadFromVehicle(void)
{ {
// No geofence support in unknown vehicle // No geofence support in unknown vehicle
loadComplete(QGeoCoordinate(), QList<QGeoCoordinate>()); emit loadComplete(QGeoCoordinate(), QList<QGeoCoordinate>());
} }
void GeoFenceManager::sendToVehicle(const QGeoCoordinate& breachReturn, const QList<QGeoCoordinate>& polygon) void GeoFenceManager::sendToVehicle(const QGeoCoordinate& breachReturn, const QList<QGeoCoordinate>& polygon)
......
...@@ -254,6 +254,7 @@ void RallyPointController::_loadComplete(const QList<QGeoCoordinate> rgPoints) ...@@ -254,6 +254,7 @@ void RallyPointController::_loadComplete(const QList<QGeoCoordinate> rgPoints)
_points.swapObjectList(pointList); _points.swapObjectList(pointList);
setDirty(false); setDirty(false);
_setFirstPointCurrent(); _setFirstPointCurrent();
emit loadComplete();
} }
QString RallyPointController::fileExtension(void) const QString RallyPointController::fileExtension(void) const
......
...@@ -61,6 +61,7 @@ public: ...@@ -61,6 +61,7 @@ public:
signals: signals:
void rallyPointsSupportedChanged(bool rallyPointsSupported); void rallyPointsSupportedChanged(bool rallyPointsSupported);
void currentRallyPointChanged(QObject* rallyPoint); void currentRallyPointChanged(QObject* rallyPoint);
void loadComplete(void);
private slots: private slots:
void _loadComplete(const QList<QGeoCoordinate> rgPoints); void _loadComplete(const QList<QGeoCoordinate> rgPoints);
......
...@@ -34,7 +34,7 @@ void RallyPointManager::_sendError(ErrorCode_t errorCode, const QString& errorMs ...@@ -34,7 +34,7 @@ void RallyPointManager::_sendError(ErrorCode_t errorCode, const QString& errorMs
void RallyPointManager::loadFromVehicle(void) void RallyPointManager::loadFromVehicle(void)
{ {
// No support in generic vehicle // No support in generic vehicle
loadComplete(QList<QGeoCoordinate>()); emit loadComplete(QList<QGeoCoordinate>());
} }
void RallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints) void RallyPointManager::sendToVehicle(const QList<QGeoCoordinate>& rgPoints)
......
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