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
ba883c79
Commit
ba883c79
authored
Jun 03, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support blocking zoom on map
parent
ae7cb28a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
6 deletions
+34
-6
QGCMapToolBar.cc
src/ui/map/QGCMapToolBar.cc
+1
-0
QGCMapToolBar.ui
src/ui/map/QGCMapToolBar.ui
+18
-2
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+8
-4
QGCMapWidget.h
src/ui/map/QGCMapWidget.h
+7
-0
No files found.
src/ui/map/QGCMapToolBar.cc
View file @
ba883c79
...
...
@@ -28,6 +28,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map)
connect
(
ui
->
goHomeButton
,
SIGNAL
(
clicked
()),
map
,
SLOT
(
goHome
()));
connect
(
ui
->
lastPosButton
,
SIGNAL
(
clicked
()),
map
,
SLOT
(
loadSettings
()));
connect
(
ui
->
clearTrailsButton
,
SIGNAL
(
clicked
()),
map
,
SLOT
(
deleteTrails
()));
connect
(
ui
->
lockCheckBox
,
SIGNAL
(
clicked
(
bool
)),
map
,
SLOT
(
setZoomBlocked
(
bool
)));
connect
(
map
,
SIGNAL
(
OnTileLoadStart
()),
this
,
SLOT
(
tileLoadStart
()));
connect
(
map
,
SIGNAL
(
OnTileLoadComplete
()),
this
,
SLOT
(
tileLoadEnd
()));
connect
(
map
,
SIGNAL
(
OnTilesStillToLoad
(
int
)),
this
,
SLOT
(
tileLoadProgress
(
int
)));
...
...
src/ui/map/QGCMapToolBar.ui
View file @
ba883c79
...
...
@@ -13,11 +13,20 @@
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"1,1,1,1,1,1,1,5,1,30,1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
stretch=
"1,1,1,1,1,1,
0,
1,5,1,30,1"
>
<property
name=
"spacing"
>
<number>
2
</number>
</property>
<property
name=
"margin"
>
<property
name=
"leftMargin"
>
<number>
4
</number>
</property>
<property
name=
"topMargin"
>
<number>
4
</number>
</property>
<property
name=
"rightMargin"
>
<number>
4
</number>
</property>
<property
name=
"bottomMargin"
>
<number>
4
</number>
</property>
<item>
...
...
@@ -62,6 +71,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"lockCheckBox"
>
<property
name=
"text"
>
<string>
Lock
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"followCheckBox"
>
<property
name=
"text"
>
...
...
src/ui/map/QGCMapWidget.cc
View file @
ba883c79
...
...
@@ -18,6 +18,7 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) :
mapInitialized
(
false
),
mapPositionInitialized
(
false
),
homeAltitude
(
0
),
zoomBlocked
(
false
),
uas
(
NULL
)
{
currWPManager
=
UASManager
::
instance
()
->
getActiveUASWaypointManager
();
...
...
@@ -249,6 +250,13 @@ void QGCMapWidget::hideEvent(QHideEvent* event)
OPMapWidget
::
hideEvent
(
event
);
}
void
QGCMapWidget
::
wheelEvent
(
QWheelEvent
*
event
)
{
if
(
!
zoomBlocked
)
{
OPMapWidget
::
wheelEvent
(
event
);
}
}
/**
* @param changePosition Load also the last position from settings and update the map position.
*/
...
...
@@ -328,14 +336,10 @@ void QGCMapWidget::mouseDoubleClickEvent(QMouseEvent* event)
// Create new waypoint
internals
::
PointLatLng
pos
=
map
->
FromLocalToLatLng
(
event
->
pos
().
x
(),
event
->
pos
().
y
());
Waypoint
*
wp
=
currWPManager
->
createWaypoint
();
// wp->blockSignals(true);
// wp->setFrame(MAV_FRAME_GLOBAL_RELATIVE_ALT);
wp
->
setLatitude
(
pos
.
Lat
());
wp
->
setLongitude
(
pos
.
Lng
());
wp
->
setFrame
((
MAV_FRAME
)
currWPManager
->
getFrameRecommendation
());
wp
->
setAltitude
(
currWPManager
->
getAltitudeRecommendation
());
// wp->blockSignals(false);
// currWPManager->notifyOfChangeEditable(wp);
}
OPMapWidget
::
mouseDoubleClickEvent
(
event
);
...
...
src/ui/map/QGCMapWidget.h
View file @
ba883c79
...
...
@@ -124,6 +124,11 @@ public slots:
}
}
void
setZoomBlocked
(
bool
blocked
)
{
zoomBlocked
=
blocked
;
}
/** @brief Load the settings for this widget from disk */
void
loadSettings
(
bool
changePosition
=
true
);
/** @brief Store the settings for this widget to disk */
...
...
@@ -139,6 +144,7 @@ protected:
/** @brief Initialize */
void
showEvent
(
QShowEvent
*
event
);
void
hideEvent
(
QHideEvent
*
event
);
void
wheelEvent
(
QWheelEvent
*
event
);
void
mousePressEvent
(
QMouseEvent
*
event
);
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
void
mouseDoubleClickEvent
(
QMouseEvent
*
event
);
...
...
@@ -172,6 +178,7 @@ protected:
QPoint
mousePressPos
;
///< Mouse position when the button is released.
QPoint
contextMousePressPos
;
///< Mouse position when context menu activated.
int
defaultGuidedAlt
;
///< Default altitude for guided mode
bool
zoomBlocked
;
///< Wether zooming is blocked
UASInterface
*
uas
;
///< Currently selected UAS.
};
...
...
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