]>
Commit | Line | Data |
---|---|---|
cdb50f67 JH |
1 | /* |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 2 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * This program is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program; if not, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | */ | |
20 | ||
51d4a9ab JH |
21 | #ifndef PULSEVIEW_PV_POPUPS_PROBES_H |
22 | #define PULSEVIEW_PV_POPUPS_PROBES_H | |
cdb50f67 | 23 | |
488f068c JH |
24 | #include <vector> |
25 | ||
26 | #include <QFormLayout> | |
65cbcf46 JH |
27 | #include <QHBoxLayout> |
28 | #include <QPushButton> | |
cdb50f67 | 29 | |
51d4a9ab | 30 | #include <pv/widgets/popup.h> |
cdb50f67 | 31 | |
488f068c JH |
32 | class QCheckBox; |
33 | class QGridLayout; | |
34 | ||
cdb50f67 | 35 | namespace pv { |
aca00b1e JH |
36 | |
37 | class SigSession; | |
38 | ||
488f068c JH |
39 | namespace prop { |
40 | namespace binding { | |
41 | class DeviceOptions; | |
42 | } | |
43 | } | |
44 | ||
45 | namespace view { | |
46 | class Signal; | |
47 | } | |
48 | ||
51d4a9ab | 49 | namespace popups { |
cdb50f67 | 50 | |
51d4a9ab | 51 | class Probes : public pv::widgets::Popup |
cdb50f67 | 52 | { |
ed773982 JH |
53 | Q_OBJECT |
54 | ||
cdb50f67 | 55 | public: |
aca00b1e | 56 | Probes(SigSession &_session, QWidget *parent); |
f23cd1e5 | 57 | |
cdb50f67 | 58 | private: |
ed773982 JH |
59 | void set_all_probes(bool set); |
60 | ||
488f068c JH |
61 | void populate_group(const sr_probe_group *group, |
62 | const std::vector< boost::shared_ptr<pv::view::Signal> > sigs); | |
63 | ||
64 | QGridLayout* create_probe_group_grid( | |
65 | const std::vector< boost::shared_ptr<pv::view::Signal> > sigs); | |
66 | ||
b7b659aa JH |
67 | private: |
68 | void showEvent(QShowEvent *e); | |
69 | ||
ed773982 | 70 | private slots: |
488f068c | 71 | void on_probe_checked(QWidget *widget); |
51d4a9ab | 72 | |
ed773982 JH |
73 | void enable_all_probes(); |
74 | void disable_all_probes(); | |
75 | ||
0740907f | 76 | private: |
aca00b1e | 77 | pv::SigSession &_session; |
0740907f | 78 | |
488f068c | 79 | QFormLayout _layout; |
0740907f | 80 | |
b7b659aa JH |
81 | bool _updating_probes; |
82 | ||
488f068c JH |
83 | std::vector< boost::shared_ptr<pv::prop::binding::DeviceOptions> > |
84 | _group_bindings; | |
85 | std::map< QCheckBox*, boost::shared_ptr<pv::view::Signal> > | |
86 | _check_box_signal_map; | |
87 | ||
65cbcf46 JH |
88 | QHBoxLayout _buttons_bar; |
89 | QPushButton _enable_all_probes; | |
90 | QPushButton _disable_all_probes; | |
488f068c JH |
91 | |
92 | QSignalMapper _check_box_mapper; | |
cdb50f67 JH |
93 | }; |
94 | ||
51d4a9ab JH |
95 | } // popups |
96 | } // pv | |
cdb50f67 | 97 | |
51d4a9ab | 98 | #endif // PULSEVIEW_PV_POPUPS_PROBES_H |