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
174f9253
Commit
174f9253
authored
Nov 17, 2010
by
Mariano Lizarraga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getting ready to send a packet to the HIL Sim
parent
a3c9c11f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
slugshilsim.cc
src/ui/slugshilsim.cc
+19
-5
slugshilsim.h
src/ui/slugshilsim.h
+6
-0
No files found.
src/ui/slugshilsim.cc
View file @
174f9253
...
...
@@ -41,7 +41,10 @@ SlugsHilSim::SlugsHilSim(QWidget *parent) :
rxSocket
=
new
QUdpSocket
(
this
);
txSocket
=
new
QUdpSocket
(
this
);
hilLink
=
NULL
;
connect
(
LinkManager
::
instance
(),
SIGNAL
(
newLink
(
LinkInterface
*
)),
this
,
SLOT
(
addToCombo
(
LinkInterface
*
)));
connect
(
ui
->
cb_mavlinkLinks
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
linkSelected
(
int
)));
connect
(
ui
->
bt_startHil
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
putInHilMode
()));
connect
(
rxSocket
,
SIGNAL
(
readyRead
()),
this
,
SLOT
(
readDatagram
()));
...
...
@@ -71,6 +74,11 @@ void SlugsHilSim::addToCombo(LinkInterface* theLink){
ui
->
cb_mavlinkLinks
->
addItem
(
theLink
->
getName
());
linksAvailable
.
insert
(
ui
->
cb_mavlinkLinks
->
count
(),
theLink
);
if
(
hilLink
==
NULL
){
hilLink
=
theLink
;
}
}
void
SlugsHilSim
::
putInHilMode
(
void
){
...
...
@@ -86,8 +94,7 @@ void SlugsHilSim::putInHilMode(void){
msgBox
.
setStandardButtons
(
QMessageBox
::
Yes
|
QMessageBox
::
No
);
msgBox
.
setDefaultButton
(
QMessageBox
::
No
);
if
(
msgBox
.
exec
()
==
QMessageBox
::
Yes
)
{
if
(
msgBox
.
exec
()
==
QMessageBox
::
Yes
)
{
rxSocket
->
disconnectFromHost
();
rxSocket
->
bind
(
QHostAddress
::
Any
,
ui
->
ed_rxPort
->
text
().
toInt
());
//txSocket->bind(QHostAddress::Broadcast, ui->ed_txPort->text().toInt());
...
...
@@ -99,7 +106,6 @@ void SlugsHilSim::putInHilMode(void){
ui
->
bt_startHil
->
setText
(
buttonCaption
);
}
else
{
ui
->
bt_startHil
->
setChecked
(
false
);
}
...
...
@@ -170,9 +176,13 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){
tmpGpsRaw
.
fix_type
=
datagram
->
at
(
i
++
);
tmpGpsTime
.
visSat
=
datagram
->
at
(
i
++
);
mavlink_msg_gps_date_time_pack
()
mavlink_msg_gps_date_time_encode
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
&
tmpGpsTime
);
activeUas
->
sendMessage
(
hilLink
,
&
msg
);
memset
(
&
msg
,
0
,
sizeof
(
mavlink_message_t
));
activeUas
->
sendMessage
();
mavlink_msg_gps_raw_encode
(
MG
::
SYSTEM
::
ID
,
MG
::
SYSTEM
::
COMPID
,
&
msg
,
&
tmpGpsRaw
);
activeUas
->
sendMessage
(
hilLink
,
&
msg
);
// TODO: this is legacy of old HIL datagram. Need to remove from Simulink model
i
++
;
...
...
@@ -201,3 +211,7 @@ uint16_t SlugsHilSim::getUint16FromDatagram (const QByteArray* datagram, unsigne
return
tmpU2C
.
uiData
;
}
void
SlugsHilSim
::
linkSelected
(
int
cbIndex
){
//hilLink = linksAvailable
}
src/ui/slugshilsim.h
View file @
174f9253
...
...
@@ -98,6 +98,12 @@ public slots:
*/
void
activeUasSet
(
UASInterface
*
uas
);
/**
* @brief Called when the Link combobox selects a new link.
*
* @param uas The new index of the selected link
*/
void
linkSelected
(
int
cbIndex
);
private:
...
...
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