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

Last change on this file since 32 was 32, checked in by sgosseli, 12 years ago

Same modification.

File size: 2.0 KB
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#ifndef PACPUSMAINWINDOW_H
12#define PACPUSMAINWINDOW_H
13
14#include <qcheckbox.h>
15#include <qdialog.h>
16#include <qtimer.h>
17
18#include <Pacpus/kernel/ComponentManager.h>
19#include <Pacpus/kernel/XmlConfigFile.h>
20#include "ui_pacpusmainwindow.h"
21
22class QGroupBox;
23class QVBoxLayout;
24
25namespace pacpus {
26
27/// Overloaded class of the QCheckBox in order to get the text
28/// of the button when it is clicked.
29class ComponentCheckBox
30 : public QCheckBox
31{
32 Q_OBJECT
33
34public:
35 ComponentCheckBox(const QString & text, QWidget * parent, const char * /*name*/ = 0 )
36 : QCheckBox(text, parent)
37 {
38 connect(this, SIGNAL(toggled(bool)),
39 SLOT(change(bool)));
40 }
41
42 ~ComponentCheckBox()
43 {
44 }
45
46public Q_SLOTS:
47 void change(bool state)
48 {
49 if (state) {
50 Q_EMIT activate(text());
51 } else {
52 Q_EMIT deactivate(text());
53 }
54 }
55
56Q_SIGNALS:
57 void activate(QString);
58 void deactivate(QString);
59};
60
61////////////////////////////////////////////////////////////////////////////////
62class PacpusMainWindow
63 : public QDialog
64 , public Ui::PacpusMainWindow
65{
66 Q_OBJECT
67
68public:
69 PacpusMainWindow(QWidget * parent = 0);
70 ~PacpusMainWindow();
71
72public Q_SLOTS:
73 void startAcquisition();
74 void startComponent(QString component);
75
76 void stopAcquisition();
77 void stopComponent(QString component);
78
79 void monitoring();
80
81private:
82 ComponentManager * componentManager_;
83
84 QVBoxLayout * layoutBox_;
85 QGroupBox * componentContainer_;
86 QButtonGroup * componentGroup_;
87
88 QTimer monitoringTimer_;
89
90 bool continue_;
91 unsigned short nbActiveComponent_;
92};
93
94} // namespace pacpus
95
96#endif // PACPUSMAINWINDOW_H
Note: See TracBrowser for help on using the repository browser.