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

Last change on this file since 36 was 36, checked in by DHERBOMEZ Gérald, 12 years ago
  • modif de chemins d'include non trouvés sur ma machine
  • modif entetes de fichiers, utiliser ce template :

/

*

  • This file is part of the PACPUS framework distributed under the
  • CECILL-C License, Version 1.0. *
  • @author Prenom Nom <Mail>
  • @date Month, Year
  • @version $Id$
  • @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
  • @brief Brief description of file... *
  • Detailed description of file...
  • */
File size: 895 bytes
Line 
1/**
2 *
3 * This file is part of the PACPUS framework distributed under the
4 * CECILL-C License, Version 1.0.
5 *
6 * @author Samuel Gosselin
7 * @date December, 2012
8 * @version $Id$
9 * @copyright Copyright (c) UTC/CNRS Heudiasyc 2005 - 2013. All rights reserved.
10 * @brief Periodic worker base class
11 *
12 * Detailed description of file...
13 *
14 */
15
16
17// Includes, pacpus.
18#include <Pacpus/PacpusTools/PeriodicWorker.h>
19
20// Includes, qt.
21#include <QTimer>
22
23using namespace pacpus;
24
25PeriodicWorker::PeriodicWorker()
26 : AsyncWorkerBase()
27 , mHeartbeat(NULL)
28{
29 mHeartbeat = new QTimer(this);
30}
31
32PeriodicWorker::~PeriodicWorker()
33{
34}
35
36void
37PeriodicWorker::startWork(int msec)
38{
39 mHeartbeat->start(msec);
40 connect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
41
42 this->start();
43}
44
45void
46PeriodicWorker::stopWork()
47{
48 disconnect(mHeartbeat, SIGNAL(timeout()), this, SLOT(doWork()));
49}
Note: See TracBrowser for help on using the repository browser.