]>
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 | |
bfc9f61e | 24 | #include <map> |
f9abf97e | 25 | #include <memory> |
488f068c JH |
26 | #include <vector> |
27 | ||
28 | #include <QFormLayout> | |
65cbcf46 JH |
29 | #include <QHBoxLayout> |
30 | #include <QPushButton> | |
bfc9f61e | 31 | #include <QSignalMapper> |
cdb50f67 | 32 | |
51d4a9ab | 33 | #include <pv/widgets/popup.h> |
cdb50f67 | 34 | |
2445160a | 35 | struct sr_channel_group; |
bfc9f61e | 36 | |
488f068c JH |
37 | class QCheckBox; |
38 | class QGridLayout; | |
39 | ||
cdb50f67 | 40 | namespace pv { |
aca00b1e JH |
41 | |
42 | class SigSession; | |
43 | ||
488f068c JH |
44 | namespace prop { |
45 | namespace binding { | |
46 | class DeviceOptions; | |
47 | } | |
48 | } | |
49 | ||
50 | namespace view { | |
51 | class Signal; | |
52 | } | |
53 | ||
51d4a9ab | 54 | namespace popups { |
cdb50f67 | 55 | |
51d4a9ab | 56 | class Probes : public pv::widgets::Popup |
cdb50f67 | 57 | { |
ed773982 JH |
58 | Q_OBJECT |
59 | ||
cdb50f67 | 60 | public: |
aca00b1e | 61 | Probes(SigSession &_session, QWidget *parent); |
f23cd1e5 | 62 | |
cdb50f67 | 63 | private: |
ed773982 JH |
64 | void set_all_probes(bool set); |
65 | ||
2445160a | 66 | void populate_group(const sr_channel_group *group, |
f9abf97e | 67 | const std::vector< std::shared_ptr<pv::view::Signal> > sigs); |
488f068c | 68 | |
2445160a | 69 | QGridLayout* create_channel_group_grid( |
f9abf97e | 70 | const std::vector< std::shared_ptr<pv::view::Signal> > sigs); |
488f068c | 71 | |
b7b659aa JH |
72 | private: |
73 | void showEvent(QShowEvent *e); | |
74 | ||
ed773982 | 75 | private slots: |
488f068c | 76 | void on_probe_checked(QWidget *widget); |
51d4a9ab | 77 | |
ed773982 JH |
78 | void enable_all_probes(); |
79 | void disable_all_probes(); | |
80 | ||
0740907f | 81 | private: |
aca00b1e | 82 | pv::SigSession &_session; |
0740907f | 83 | |
488f068c | 84 | QFormLayout _layout; |
0740907f | 85 | |
b7b659aa JH |
86 | bool _updating_probes; |
87 | ||
f9abf97e | 88 | std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> > |
488f068c | 89 | _group_bindings; |
f9abf97e | 90 | std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> > |
488f068c JH |
91 | _check_box_signal_map; |
92 | ||
65cbcf46 JH |
93 | QHBoxLayout _buttons_bar; |
94 | QPushButton _enable_all_probes; | |
95 | QPushButton _disable_all_probes; | |
488f068c JH |
96 | |
97 | QSignalMapper _check_box_mapper; | |
cdb50f67 JH |
98 | }; |
99 | ||
51d4a9ab JH |
100 | } // popups |
101 | } // pv | |
cdb50f67 | 102 | |
51d4a9ab | 103 | #endif // PULSEVIEW_PV_POPUPS_PROBES_H |