source: pacpusframework/trunk/src/PacpusTools/src/PeriodicWorker.cpp@ 62

Last change on this file since 62 was 62, checked in by Marek Kurdej, 12 years ago

Update: license info.

File size: 607 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
8using namespace pacpus;
9
10PeriodicWorker::PeriodicWorker()
11 : AsyncWorkerBase()
12 , mHeartbeat(NULL)
13{
14 mHeartbeat = new QTimer(this);
15}
16
17PeriodicWorker::~PeriodicWorker()
18{
19}
20
21void
22PeriodicWorker::startWork(int msec)
23{
24 mHeartbeat->start(msec);
25 connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
26
27 this->start();
28}
29
30void
31PeriodicWorker::stopWork()
32{
33 disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
34}
Note: See TracBrowser for help on using the repository browser.