Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5c239cd9
Commit
5c239cd9
authored
May 28, 2010
by
pixhawk
Browse files
Working on Qt watchdog control
parent
b13a2a4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ui/watchdog/WatchdogControl.cc
View file @
5c239cd9
...
...
@@ -9,6 +9,7 @@
WatchdogControl
::
WatchdogControl
(
QWidget
*
parent
)
:
QWidget
(
parent
),
mav
(
NULL
),
updateInterval
(
2000000
),
ui
(
new
Ui
::
WatchdogControl
)
{
ui
->
setupUi
(
this
);
...
...
@@ -43,14 +44,20 @@ void WatchdogControl::setUAS(UASInterface* uas)
void
WatchdogControl
::
updateWatchdog
(
int
systemId
,
int
watchdogId
,
unsigned
int
processCount
)
{
// request the watchdog with the given ID
// Get the watchdog and request the info for it
WatchdogInfo
&
watchdog
=
this
->
getWatchdog
(
systemId
,
watchdogId
);
// if the proces count doesn't match, the watchdog is either new or has changed - create a new vector with new (and empty) ProcessInfo structs.
if
(
watchdog
.
processes_
.
size
()
!=
processCount
)
{
watchdog
.
processes_
=
std
::
vector
<
ProcessInfo
>
(
processCount
);
// Create new UI widget
//WatchdogView* view = new Watch
}
// start the timeout timer
//watchdog.timeoutTimer_.reset();
qDebug
()
<<
"WATCHDOG RECEIVED"
;
//qDebug() << "<-- received mavlink_watchdog_heartbeat_t " << msg->sysid << " / " << payload.watchdog_id << " / " << payload.process_count << std::endl;
}
...
...
src/ui/watchdog/WatchdogControl.h
View file @
5c239cd9
...
...
@@ -67,6 +67,7 @@ public:
uint16_t
crashes_
;
///< The number of crashes
int32_t
pid_
;
///< The PID of the process
//quint64_t requestTimeout;
// Timer requestTimer_; ///< Internal timer, used to repeat status and info requests after some time (in case of packet loss)
// Timer updateTimer_; ///< Internal timer, used to measure the time since the last update (used only for graphics)
};
...
...
@@ -92,6 +93,7 @@ public:
ProcessInfo
&
getProcess
(
uint16_t
index
);
std
::
vector
<
ProcessInfo
>
processes_
;
///< A vector containing all processes running on this watchdog
uint64_t
timeout
;
QTimer
*
timeoutTimer_
;
///< Internal timer, used to measure the time since the last heartbeat message
};
...
...
@@ -116,6 +118,7 @@ protected:
UASInterface
*
mav
;
QVBoxLayout
*
listLayout
;
uint64_t
updateInterval
;
private:
Ui
::
WatchdogControl
*
ui
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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