]> sigrok.org Git - pulseview.git/blame - pv/popups/channels.h
Use libsigrok C++ bindings (patch version 7).
[pulseview.git] / pv / popups / channels.h
CommitLineData
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
6ac6242b
ML
21#ifndef PULSEVIEW_PV_POPUPS_CHANNELS_H
22#define PULSEVIEW_PV_POPUPS_CHANNELS_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
488f068c
JH
35class QCheckBox;
36class QGridLayout;
37
e8d00928
ML
38namespace sigrok {
39 class ChannelGroup;
40}
41
cdb50f67 42namespace pv {
aca00b1e
JH
43
44class SigSession;
45
488f068c
JH
46namespace prop {
47namespace binding {
48class DeviceOptions;
49}
50}
51
52namespace view {
53class Signal;
54}
55
51d4a9ab 56namespace popups {
cdb50f67 57
6ac6242b 58class Channels : public pv::widgets::Popup
cdb50f67 59{
ed773982
JH
60 Q_OBJECT
61
cdb50f67 62public:
6ac6242b 63 Channels(SigSession &_session, QWidget *parent);
f23cd1e5 64
cdb50f67 65private:
6ac6242b 66 void set_all_channels(bool set);
ed773982 67
e8d00928 68 void populate_group(std::shared_ptr<sigrok::ChannelGroup> group,
f9abf97e 69 const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
488f068c 70
2445160a 71 QGridLayout* create_channel_group_grid(
f9abf97e 72 const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
488f068c 73
b7b659aa
JH
74private:
75 void showEvent(QShowEvent *e);
76
e9213170 77private Q_SLOTS:
6ac6242b 78 void on_channel_checked(QWidget *widget);
51d4a9ab 79
6ac6242b
ML
80 void enable_all_channels();
81 void disable_all_channels();
ed773982 82
0740907f 83private:
aca00b1e 84 pv::SigSession &_session;
0740907f 85
488f068c 86 QFormLayout _layout;
0740907f 87
6ac6242b 88 bool _updating_channels;
b7b659aa 89
f9abf97e 90 std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> >
488f068c 91 _group_bindings;
f9abf97e 92 std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
488f068c
JH
93 _check_box_signal_map;
94
65cbcf46 95 QHBoxLayout _buttons_bar;
6ac6242b
ML
96 QPushButton _enable_all_channels;
97 QPushButton _disable_all_channels;
488f068c
JH
98
99 QSignalMapper _check_box_mapper;
cdb50f67
JH
100};
101
51d4a9ab
JH
102} // popups
103} // pv
cdb50f67 104
6ac6242b 105#endif // PULSEVIEW_PV_POPUPS_CHANNELS_H