Last change
on this file since 73 was 73, checked in by Marek Kurdej, 12 years ago |
Minor: line-endings.
|
-
Property svn:keywords
set to
Id
|
File size:
641 bytes
|
Line | |
---|
1 | // This file is part of the PACPUS framework distributed under the
|
---|
2 | // CECILL-C License, Version 1.0.
|
---|
3 |
|
---|
4 | #include <Pacpus/PacpusTools/PeriodicWorker.h>
|
---|
5 |
|
---|
6 | #include <QTimer>
|
---|
7 |
|
---|
8 | using namespace pacpus;
|
---|
9 |
|
---|
10 | PeriodicWorker::PeriodicWorker()
|
---|
11 | : AsyncWorkerBase()
|
---|
12 | , mHeartbeat(NULL)
|
---|
13 | {
|
---|
14 | mHeartbeat = new QTimer(this);
|
---|
15 | }
|
---|
16 |
|
---|
17 | PeriodicWorker::~PeriodicWorker()
|
---|
18 | {
|
---|
19 | }
|
---|
20 |
|
---|
21 | void
|
---|
22 | PeriodicWorker::startWork(int msec)
|
---|
23 | {
|
---|
24 | mHeartbeat->start(msec);
|
---|
25 | connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
26 |
|
---|
27 | this->start();
|
---|
28 | }
|
---|
29 |
|
---|
30 | void
|
---|
31 | PeriodicWorker::stopWork()
|
---|
32 | {
|
---|
33 | disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.