source: pacpusframework/trunk/src/PacpusSensor/src/ui/pacpusmainwindow.h@ 91

Last change on this file since 91 was 91, checked in by DHERBOMEZ Gérald, 11 years ago

Improvement of the build system to avoid some workarounds

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1// %pacpus:license{
2// This file is part of the PACPUS framework distributed under the
3// CECILL-C License, Version 1.0.
4// %pacpus:license}
5/// @author Gerald Dherbomez <firstname.surname@utc.fr>
6/// @date June, 2006
7/// @version $Id: pacpusmainwindow.h 91 2013-05-19 10:32:48Z gdherbom $
8/// @copyright Copyright (c) UTC/CNRS Heudiasyc 2006 - 2013. All rights reserved.
9/// @brief Brief description.
10///
11/// Detailed description.
12
13#ifndef PACPUSMAINWINDOW_H
14#define PACPUSMAINWINDOW_H
15
16#include <qcheckbox.h>
17#include <qdialog.h>
18#include <qtimer.h>
19
20#include <Pacpus/kernel/ComponentManager.h>
21#include <Pacpus/kernel/XmlConfigFile.h>
22#include "ui_pacpusmainwindow.h"
23
24class QGroupBox;
25class QVBoxLayout;
26
27namespace pacpus {
28
29/// Overloaded class of the QCheckBox in order to get the text
30/// of the button when it is clicked.
31class ComponentCheckBox
32 : public QCheckBox
33{
34 Q_OBJECT
35
36public:
37 /// @todo Documentation
38 ComponentCheckBox(const QString & text, QWidget * parent, const char * /*name*/ = 0 )
39 : QCheckBox(text, parent)
40 {
41 connect(this, SIGNAL(toggled(bool)),
42 SLOT(change(bool)));
43 }
44
45 /// @todo Documentation
46 ~ComponentCheckBox()
47 {
48 }
49
50public Q_SLOTS:
51 /// @todo Documentation
52 void change(bool state)
53 {
54 if (state) {
55 Q_EMIT activate(text());
56 } else {
57 Q_EMIT deactivate(text());
58 }
59 }
60
61Q_SIGNALS:
62 /// @todo Documentation
63 void activate(QString);
64 /// @todo Documentation
65 void deactivate(QString);
66};
67
68////////////////////////////////////////////////////////////////////////////////
69/// @todo Documentation
70class PacpusMainWindow
71 : public QDialog
72 , public Ui::PacpusMainWindow
73{
74 Q_OBJECT
75
76public:
77 /// Constructor
78 PacpusMainWindow(QWidget * parent = 0);
79 /// Destructor
80 ~PacpusMainWindow();
81
82public Q_SLOTS:
83 /// slot
84 /// Starts all the components and checks all the checkbox
85 void startAcquisition();
86 /// slot
87 /// called when a checkbox is checked
88 /// start the corresponding component
89 /// start the monitoring loop if not running
90 void startComponent(QString component);
91
92 /// slot
93 /// Stops all the components and unchecks all the checkbox
94 void stopAcquisition();
95 /// slot
96 /// called when a checkbox is unchecked
97 /// stop the corresponding component
98 /// eventually stop the monitoring loop if any other component is active
99 void stopComponent(QString component);
100
101 /// @todo Documentation
102 void monitoring();
103
104private:
105 ComponentManager * componentManager_;
106
107 QVBoxLayout * layoutBox_;
108 QGroupBox * componentContainer_;
109 QButtonGroup * componentGroup_;
110
111 QTimer monitoringTimer_;
112
113 bool continue_;
114 unsigned short nbActiveComponent_;
115};
116
117} // namespace pacpus
118
119#endif // PACPUSMAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.