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
036d1bef
Commit
036d1bef
authored
Aug 12, 2010
by
Bryan Godbolt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
successfully connecting to model
parent
20bd17f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
3 deletions
+37
-3
OpalLink.cc
src/comm/OpalLink.cc
+33
-3
OpalLink.h
src/comm/OpalLink.h
+4
-0
No files found.
src/comm/OpalLink.cc
View file @
036d1bef
#include "OpalLink.h"
OpalLink
::
OpalLink
()
OpalLink
::
OpalLink
()
:
connectState
(
false
)
{
// Set unique ID and add link to the list of links
...
...
@@ -26,6 +26,7 @@ void OpalLink::setName(QString name)
}
bool
OpalLink
::
isConnected
()
{
//qDebug() << "OpalLink::isConnected:: connectState: " << connectState;
return
connectState
;
}
...
...
@@ -81,8 +82,28 @@ bool OpalLink::isFullDuplex()
bool
OpalLink
::
connect
()
{
short
modelState
;
OpalConnect
(
101
,
true
,
&
modelState
);
return
true
;
/// \todo allow configuration of instid in window
if
(
OpalConnect
(
101
,
false
,
&
modelState
)
==
EOK
)
{
connectState
=
true
;
}
else
{
connectState
=
false
;
setLastErrorMsg
();
QMessageBox
msgBox
;
msgBox
.
setIcon
(
QMessageBox
::
Critical
);
msgBox
.
setText
(
lastErrorMsg
);
msgBox
.
exec
();
}
emit
connected
(
connectState
);
if
(
connectState
)
{
emit
connected
();
}
return
connectState
;
}
bool
OpalLink
::
disconnect
()
...
...
@@ -90,6 +111,15 @@ bool OpalLink::disconnect()
return
false
;
}
void
OpalLink
::
setLastErrorMsg
()
{
char
buf
[
512
];
unsigned
short
len
;
OpalGetLastErrMsg
(
buf
,
sizeof
(
buf
),
&
len
);
lastErrorMsg
.
clear
();
lastErrorMsg
.
append
(
buf
);
}
qint64
OpalLink
::
bytesAvailable
()
{
return
0
;
...
...
src/comm/OpalLink.h
View file @
036d1bef
...
...
@@ -8,6 +8,8 @@
*/
#include <QMutex>
#include <QDebug>
#include <QMessageBox>
#include "LinkInterface.h"
#include "LinkManager.h"
...
...
@@ -73,6 +75,8 @@ protected:
quint64
connectionStartTime
;
QMutex
statisticsMutex
;
QString
lastErrorMsg
;
void
setLastErrorMsg
();
void
setName
(
QString
name
);
};
...
...
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