Last change
on this file since 31 was 31, checked in by sgosseli, 12 years ago |
Huge commit: use the new includes style in all the files, add the license header in all the headers, and in some cpp.
|
File size:
799 bytes
|
Line | |
---|
1 | /**
|
---|
2 | *
|
---|
3 | * Distributed under the UTC Heudiascy Pacpus License, Version 1.0.
|
---|
4 | * Copyright (c) UTC Heudiasyc 2010 - 2013. All rights reserved.
|
---|
5 | *
|
---|
6 | * See the LICENSE file for more information or a copy at:
|
---|
7 | * http://www.hds.utc.fr/~kurdejma/LICENSE_1_0.txt
|
---|
8 | *
|
---|
9 | */
|
---|
10 |
|
---|
11 | // Includes, pacpus.
|
---|
12 | #include <PacpusTools/PeriodicWorker.h>
|
---|
13 |
|
---|
14 | // Includes, qt.
|
---|
15 | #include <QTimer>
|
---|
16 |
|
---|
17 | using namespace pacpus;
|
---|
18 |
|
---|
19 | PeriodicWorker::PeriodicWorker()
|
---|
20 | : AsyncWorkerBase()
|
---|
21 | , mHeartbeat(NULL)
|
---|
22 | {
|
---|
23 | mHeartbeat = new QTimer(this);
|
---|
24 | }
|
---|
25 |
|
---|
26 | PeriodicWorker::~PeriodicWorker()
|
---|
27 | {
|
---|
28 | }
|
---|
29 |
|
---|
30 | void
|
---|
31 | PeriodicWorker::startWork(int msec)
|
---|
32 | {
|
---|
33 | mHeartbeat->start(msec);
|
---|
34 | connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
35 |
|
---|
36 | this->start();
|
---|
37 | }
|
---|
38 |
|
---|
39 | void
|
---|
40 | PeriodicWorker::stopWork()
|
---|
41 | {
|
---|
42 | disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.