Last change
on this file was 162, checked in by Marek Kurdej, 11 years ago |
Update: merged changes from trunk.
|
-
Property svn:executable
set to
*
|
File size:
769 bytes
|
Line | |
---|
1 | // %pacpus:license{
|
---|
2 | // This file is part of the PACPUS framework distributed under the
|
---|
3 | // CECILL-C License, Version 1.0.
|
---|
4 | /// @author Samuel Gosselin <firstname.surname@utc.fr>
|
---|
5 | /// @date December, 2012
|
---|
6 | // %pacpus:license}
|
---|
7 |
|
---|
8 | #include <Pacpus/PacpusTools/PeriodicWorker.h>
|
---|
9 |
|
---|
10 | #include <QTimer>
|
---|
11 |
|
---|
12 | using namespace pacpus;
|
---|
13 |
|
---|
14 | PeriodicWorker::PeriodicWorker()
|
---|
15 | : AsyncWorkerBase()
|
---|
16 | , mHeartbeat(NULL)
|
---|
17 | {
|
---|
18 | mHeartbeat = new QTimer(this);
|
---|
19 | }
|
---|
20 |
|
---|
21 | PeriodicWorker::~PeriodicWorker()
|
---|
22 | {
|
---|
23 | }
|
---|
24 |
|
---|
25 | void
|
---|
26 | PeriodicWorker::startWork(int msec)
|
---|
27 | {
|
---|
28 | mHeartbeat->start(msec);
|
---|
29 | connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
30 |
|
---|
31 | this->start();
|
---|
32 | }
|
---|
33 |
|
---|
34 | void
|
---|
35 | PeriodicWorker::stopWork()
|
---|
36 | {
|
---|
37 | disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.