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
f8a90520
Commit
f8a90520
authored
Dec 03, 2010
by
tecnosapiens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add SlugsPadCameraWidget
parent
deb6ba86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
13 deletions
+77
-13
qgroundcontrol.pro
qgroundcontrol.pro
+6
-3
MapWidget.cc
src/ui/MapWidget.cc
+3
-1
SlugsVideoCamControl.cpp
src/ui/SlugsVideoCamControl.cpp
+42
-0
SlugsVideoCamControl.h
src/ui/SlugsVideoCamControl.h
+8
-0
SlugsVideoCamControl.ui
src/ui/SlugsVideoCamControl.ui
+9
-8
WaypointList.cc
src/ui/WaypointList.cc
+9
-1
No files found.
qgroundcontrol.pro
View file @
f8a90520
...
@@ -140,7 +140,8 @@ FORMS += src/ui/MainWindow.ui \
...
@@ -140,7 +140,8 @@ FORMS += src/ui/MainWindow.ui \
src
/
ui
/
SlugsDataSensorView
.
ui
\
src
/
ui
/
SlugsDataSensorView
.
ui
\
src
/
ui
/
SlugsHilSim
.
ui
\
src
/
ui
/
SlugsHilSim
.
ui
\
src
/
ui
/
SlugsPIDControl
.
ui
\
src
/
ui
/
SlugsPIDControl
.
ui
\
src
/
ui
/
SlugsVideoCamControl
.
ui
src
/
ui
/
SlugsVideoCamControl
.
ui
\
src
/
ui
/
SlugsPadCameraControl
.
ui
INCLUDEPATH
+=
src
\
INCLUDEPATH
+=
src
\
src
/
ui
\
src
/
ui
\
src
/
ui
/
linechart
\
src
/
ui
/
linechart
\
...
@@ -243,7 +244,8 @@ HEADERS += src/MG.h \
...
@@ -243,7 +244,8 @@ HEADERS += src/MG.h \
src
/
ui
/
SlugsDataSensorView
.
h
\
src
/
ui
/
SlugsDataSensorView
.
h
\
src
/
ui
/
SlugsHilSim
.
h
\
src
/
ui
/
SlugsHilSim
.
h
\
src
/
ui
/
SlugsPIDControl
.
h
\
src
/
ui
/
SlugsPIDControl
.
h
\
src
/
ui
/
SlugsVideoCamControl
.
h
src
/
ui
/
SlugsVideoCamControl
.
h
\
src
/
ui
/
SlugsPadCameraControl
.
h
SOURCES
+=
src
/
main
.
cc
\
SOURCES
+=
src
/
main
.
cc
\
src
/
Core
.
cc
\
src
/
Core
.
cc
\
src
/
uas
/
UASManager
.
cc
\
src
/
uas
/
UASManager
.
cc
\
...
@@ -326,7 +328,8 @@ SOURCES += src/main.cc \
...
@@ -326,7 +328,8 @@ SOURCES += src/main.cc \
src
/
ui
/
SlugsDataSensorView
.
cc
\
src
/
ui
/
SlugsDataSensorView
.
cc
\
src
/
ui
/
SlugsHilSim
.
cc
\
src
/
ui
/
SlugsHilSim
.
cc
\
src
/
ui
/
SlugsPIDControl
.
cpp
\
src
/
ui
/
SlugsPIDControl
.
cpp
\
src
/
ui
/
SlugsVideoCamControl
.
cpp
src
/
ui
/
SlugsVideoCamControl
.
cpp
\
src
/
ui
/
SlugsPadCameraControl
.
cpp
RESOURCES
=
mavground
.
qrc
RESOURCES
=
mavground
.
qrc
...
...
src/ui/MapWidget.cc
View file @
f8a90520
...
@@ -410,6 +410,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
...
@@ -410,6 +410,7 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
// Create waypoint name
// Create waypoint name
QString
str
;
QString
str
;
str
=
QString
(
"%1"
).
arg
(
path
->
numberOfPoints
());
str
=
QString
(
"%1"
).
arg
(
path
->
numberOfPoints
());
// create the WP and set everything in the LineString to display the path
// create the WP and set everything in the LineString to display the path
...
@@ -431,8 +432,9 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
...
@@ -431,8 +432,9 @@ void MapWidget::createWaypointGraphAtMap(const QPointF coordinate)
path
->
addPoint
(
tempPoint
);
path
->
addPoint
(
tempPoint
);
wpIndex
.
insert
(
str
,
tempPoint
);
wpIndex
.
insert
(
str
,
tempPoint
);
qDebug
()
<<
"Funcion createWaypointGraphAtMap WP= "
<<
str
<<
" -> x= "
<<
tempPoint
->
latitude
()
<<
" y= "
<<
tempPoint
->
longitude
();
// Refresh the screen
// Refresh the screen
mc
->
updateRequestNew
();
mc
->
updateRequestNew
();
//// // emit signal mouse was clicked
//// // emit signal mouse was clicked
...
...
src/ui/SlugsVideoCamControl.cpp
View file @
f8a90520
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
#include <QWheelEvent>
#include <QWheelEvent>
#include <QDebug>
#include <QDebug>
#include <qmath.h>
#include <qmath.h>
#include <QPainter>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
SlugsVideoCamControl
::
SlugsVideoCamControl
(
QWidget
*
parent
)
:
SlugsVideoCamControl
::
SlugsVideoCamControl
(
QWidget
*
parent
)
:
...
@@ -20,6 +24,22 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
...
@@ -20,6 +24,22 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
x1
=
0
;
x1
=
0
;
y1
=
0
;
y1
=
0
;
connect
(
ui
->
viewCamBordeatMap_checkBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
changeViewCamBorderAtMapStatus
(
bool
)));
connect
(
ui
->
viewCamBordeatMap_checkBox
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
changeViewCamBorderAtMapStatus
(
bool
)));
tL
=
ui
->
padCamContro_frame
->
frameGeometry
().
topLeft
();
bR
=
ui
->
padCamContro_frame
->
frameGeometry
().
bottomRight
();
//ui->padCamContro_frame->setVisible(true);
// create a layout for camera pad
QGridLayout
*
padCameraLayout
=
new
QGridLayout
(
ui
->
padCamContro_frame
);
padCameraLayout
->
setSpacing
(
2
);
padCameraLayout
->
setMargin
(
0
);
padCameraLayout
->
setAlignment
(
Qt
::
AlignTop
);
ui
->
padCamContro_frame
->
setLayout
(
padCameraLayout
);
// create a camera pad widget
padCamera
=
new
SlugsPadCameraControl
();
padCameraLayout
->
addWidget
(
padCamera
);
...
@@ -326,6 +346,28 @@ QPointF SlugsVideoCamControl::ObtenerMarcacionDistanciaPixel(double lon1, double
...
@@ -326,6 +346,28 @@ QPointF SlugsVideoCamControl::ObtenerMarcacionDistanciaPixel(double lon1, double
}
}
void
SlugsVideoCamControl
::
paintEvent
(
QPaintEvent
*
pe
)
{
Q_UNUSED
(
pe
);
QPainter
painter
(
this
);
painter
.
setPen
(
Qt
::
blue
);
painter
.
setFont
(
QFont
(
"Arial"
,
30
));
// QRectF rectangle(tL.x(), tL.y(), ui->padCamContro_frame->width(), ui->padCamContro_frame->height());
// int startAngle = 30 * 16;
// int spanAngle = 120 * 16;
painter
.
drawLine
(
QPoint
(
tL
.
x
(),
tL
.
y
()),
QPoint
(
bR
.
x
(),
bR
.
y
()));
// painter.drawLine(QPoint());
//painter.drawLines(padLines);
// painter.drawPie(rectangle, startAngle, spanAngle);
//painter.drawText(rect(), Qt::AlignCenter, "Qt");
}
src/ui/SlugsVideoCamControl.h
View file @
f8a90520
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#include <QGraphicsView>
#include <QGraphicsView>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsScene>
#include <QGraphicsScene>
#include "SlugsPadCameraControl.h"
#define DELTA 1000
#define DELTA 1000
...
@@ -36,6 +38,8 @@ protected:
...
@@ -36,6 +38,8 @@ protected:
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
virtual
void
mousePressEvent
(
QMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
//virtual void paintEvent(QPaintEvent *pe);
void
paintEvent
(
QPaintEvent
*
pe
);
private:
private:
...
@@ -44,6 +48,10 @@ private:
...
@@ -44,6 +48,10 @@ private:
int
x1
;
int
x1
;
int
y1
;
int
y1
;
QPoint
tL
;
QPoint
bR
;
SlugsPadCameraControl
*
padCamera
;
};
};
...
...
src/ui/SlugsVideoCamControl.ui
View file @
f8a90520
...
@@ -6,14 +6,14 @@
...
@@ -6,14 +6,14 @@
<rect>
<rect>
<x>
0
</x>
<x>
0
</x>
<y>
0
</y>
<y>
0
</y>
<width>
1
53
</width>
<width>
1
65
</width>
<height>
200
</height>
<height>
191
</height>
</rect>
</rect>
</property>
</property>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
<size>
<size>
<width>
153
</width>
<width>
0
</width>
<height>
176
</height>
<height>
0
</height>
</size>
</size>
</property>
</property>
<property
name=
"mouseTracking"
>
<property
name=
"mouseTracking"
>
...
@@ -27,15 +27,16 @@
...
@@ -27,15 +27,16 @@
<widget
class=
"QFrame"
name=
"padCamContro_frame"
>
<widget
class=
"QFrame"
name=
"padCamContro_frame"
>
<property
name=
"minimumSize"
>
<property
name=
"minimumSize"
>
<size>
<size>
<width>
131
</width>
<width>
0
</width>
<height>
91
</height>
<height>
0
</height>
</size>
</size>
</property>
</property>
<property
name=
"mouseTracking"
>
<property
name=
"mouseTracking"
>
<bool>
tru
e
</bool>
<bool>
fals
e
</bool>
</property>
</property>
<property
name=
"styleSheet"
>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
background-color: rgb(255, 170, 0);
</string>
<string
notr=
"true"
>
background-color: rgba(255, 170, 0,0%);
</string>
</property>
</property>
<property
name=
"frameShape"
>
<property
name=
"frameShape"
>
<enum>
QFrame::WinPanel
</enum>
<enum>
QFrame::WinPanel
</enum>
...
...
src/ui/WaypointList.cc
View file @
f8a90520
...
@@ -480,11 +480,12 @@ void WaypointList::changeEvent(QEvent *e)
...
@@ -480,11 +480,12 @@ void WaypointList::changeEvent(QEvent *e)
void
WaypointList
::
on_clearWPListButton_clicked
()
void
WaypointList
::
on_clearWPListButton_clicked
()
{
{
if
(
uas
)
if
(
uas
)
{
{
if
(
isGlobalWP
)
if
(
isGlobalWP
)
{
{
emit
clearPathclicked
();
emit
clearPathclicked
();
const
QVector
<
Waypoint
*>
&
waypoints
=
uas
->
getWaypointManager
().
getWaypointList
();
const
QVector
<
Waypoint
*>
&
waypoints
=
uas
->
getWaypointManager
().
getWaypointList
();
while
(
!
waypoints
.
isEmpty
())
//for(int i = 0; i <= waypoints.size(); i++)
while
(
!
waypoints
.
isEmpty
())
//for(int i = 0; i <= waypoints.size(); i++)
...
@@ -520,6 +521,13 @@ void WaypointList::on_clearWPListButton_clicked()
...
@@ -520,6 +521,13 @@ void WaypointList::on_clearWPListButton_clicked()
}
}
}
}
else
{
if
(
isGlobalWP
)
{
emit
clearPathclicked
();
}
}
}
}
/** @brief Add a waypoint by mouse click over the map */
/** @brief Add a waypoint by mouse click over the map */
...
...
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