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
0846707b
Commit
0846707b
authored
Jun 19, 2011
by
pixhawk
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:pixhawk/qgroundcontrol into opmapcontrol
parents
5aab6ca2
5f82c714
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
792 additions
and
723 deletions
+792
-723
splash.png
images/splash.png
+0
-0
UAS.cc
src/uas/UAS.cc
+767
-714
UAS.h
src/uas/UAS.h
+3
-2
HUD.cc
src/ui/HUD.cc
+18
-7
HUD.h
src/ui/HUD.h
+4
-0
No files found.
images/splash.png
View replaced file @
5aab6ca2
View file @
0846707b
27.8 KB
|
W:
|
H:
25.5 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/uas/UAS.cc
View file @
0846707b
This diff is collapsed.
Click to expand it.
src/uas/UAS.h
View file @
0846707b
...
...
@@ -187,7 +187,8 @@ protected: //COMMENTS FOR TEST UNIT
int
imagePackets
;
///< Number of data packets being sent for this image
int
imagePacketsArrived
;
///< Number of data packets recieved
int
imagePayload
;
///< Payload size per transmitted packet (bytes). Standard is 254, and decreases when image resolution increases.
int
imageQuality
;
///< JPEG-Quality of the transmitted image (percentage)
int
imageQuality
;
///< Quality of the transmitted image (percentage)
int
imageType
;
///< Type of the transmitted image (BMP, PNG, JPEG, RAW 8 bit, RAW 32 bit)
QByteArray
imageRecBuffer
;
///< Buffer for the incoming bytestream
QImage
image
;
///< Image data of last completely transmitted image
quint64
imageStart
;
...
...
@@ -226,7 +227,7 @@ public:
}
int
getSystemType
();
QImage
getImage
();
void
requestImage
();
// ?
void
requestImage
();
int
getAutopilotType
()
{
return
autopilot
;
}
...
...
src/ui/HUD.cc
View file @
0846707b
...
...
@@ -75,6 +75,7 @@ inline bool isinf(T value)
*/
HUD
::
HUD
(
int
width
,
int
height
,
QWidget
*
parent
)
:
QGLWidget
(
QGLFormat
(
QGL
::
SampleBuffers
),
parent
),
u
(
NULL
),
uas
(
NULL
),
yawInt
(
0.0
f
),
mode
(
tr
(
"UNKNOWN MODE"
)),
...
...
@@ -136,7 +137,8 @@ HUD::HUD(int width, int height, QWidget* parent)
hudInstrumentsEnabled
(
true
),
videoEnabled
(
false
),
xImageFactor
(
1.0
),
yImageFactor
(
1.0
)
yImageFactor
(
1.0
),
imageRequested
(
false
)
{
// Set auto fill to false
setAutoFillBackground
(
false
);
...
...
@@ -158,11 +160,10 @@ HUD::HUD(int width, int height, QWidget* parent)
//qDebug() << __FILE__ << __LINE__ << "template image:" << imagePath;
//fill = QImage(imagePath);
//
glImage = QGLWidget::convertToGLFormat(fill);
glImage
=
QGLWidget
::
convertToGLFormat
(
fill
);
// Refresh timer
refreshTimer
->
setInterval
(
updateInterval
);
//connect(refreshTimer, SIGNAL(timeout()), this, SLOT(update()));
connect
(
refreshTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
paintHUD
()));
// Resize to correct size and fill with image
...
...
@@ -282,6 +283,7 @@ void HUD::setActiveUAS(UASInterface* uas)
UAS
*
u
=
dynamic_cast
<
UAS
*>
(
this
->
uas
);
if
(
u
)
{
disconnect
(
u
,
SIGNAL
(
imageStarted
(
quint64
)),
this
,
SLOT
(
startImage
(
quint64
)));
disconnect
(
u
,
SIGNAL
(
imageReady
(
UASInterface
*
)),
this
,
SLOT
(
copyImage
()));
}
}
...
...
@@ -303,10 +305,12 @@ void HUD::setActiveUAS(UASInterface* uas)
UAS
*
u
=
dynamic_cast
<
UAS
*>
(
uas
);
if
(
u
)
{
connect
(
u
,
SIGNAL
(
imageStarted
(
quint64
)),
this
,
SLOT
(
startImage
(
quint64
)));
connect
(
u
,
SIGNAL
(
imageReady
(
UASInterface
*
)),
this
,
SLOT
(
copyImage
()));
}
// Set new UAS
this
->
uas
=
uas
;
this
->
u
=
dynamic_cast
<
UAS
*>
(
this
->
uas
);
}
}
...
...
@@ -666,9 +670,6 @@ void HUD::paintHUD()
qDebug
()
<<
__FILE__
<<
__LINE__
<<
"template image:"
<<
nextOfflineImage
;
QImage
fill
=
QImage
(
nextOfflineImage
);
xImageFactor
=
width
()
/
(
float
)
fill
.
width
();
yImageFactor
=
height
()
/
(
float
)
fill
.
height
();
glImage
=
QGLWidget
::
convertToGLFormat
(
fill
);
// Reset to save load efforts
...
...
@@ -677,9 +678,13 @@ void HUD::paintHUD()
glRasterPos2i
(
0
,
0
);
glPixelZoom
(
xImageFactor
,
yImageFactor
);
xImageFactor
=
width
()
/
(
float
)
glImage
.
width
();
yImageFactor
=
height
()
/
(
float
)
glImage
.
height
();
float
imageFactor
=
qMin
(
xImageFactor
,
yImageFactor
);
glPixelZoom
(
imageFactor
,
imageFactor
);
// Resize to correct size and fill with image
glDrawPixels
(
glImage
.
width
(),
glImage
.
height
(),
GL_RGBA
,
GL_UNSIGNED_BYTE
,
glImage
.
bits
());
//qDebug() << "DRAWING GL IMAGE";
}
else
{
// Blue / brown background
paintCenterBackground
(
roll
,
pitch
,
yawTrans
);
...
...
@@ -1623,3 +1628,9 @@ void HUD::setPixels(int imgid, const unsigned char* imageData, int length, int s
// }
}
}
void
HUD
::
copyImage
()
{
qDebug
()
<<
"HUD::copyImage()"
;
this
->
glImage
=
QGLWidget
::
convertToGLFormat
(
this
->
u
->
getImage
());
}
src/ui/HUD.h
View file @
0846707b
...
...
@@ -88,6 +88,8 @@ public slots:
void
enableHUDInstruments
(
bool
enabled
);
/** @brief Enable Video */
void
enableVideo
(
bool
enabled
);
/** @brief Copy an image from the current active UAS */
void
copyImage
();
protected
slots
:
...
...
@@ -216,6 +218,8 @@ protected:
QAction
*
selectOfflineDirectoryAction
;
QAction
*
selectVideoChannelAction
;
void
paintEvent
(
QPaintEvent
*
event
);
bool
imageRequested
;
UAS
*
u
;
};
...
...
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