]> sigrok.org Git - pulseview.git/blame - pv/popups/channels.hpp
MainWindow: Make session naming consistent
[pulseview.git] / pv / popups / channels.hpp
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
7a01bd36
JH
21#ifndef PULSEVIEW_PV_POPUPS_CHANNELS_HPP
22#define PULSEVIEW_PV_POPUPS_CHANNELS_HPP
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
2acdb232 33#include <pv/widgets/popup.hpp>
cdb50f67 34
488f068c
JH
35class QCheckBox;
36class QGridLayout;
37
e8d00928
ML
38namespace sigrok {
39 class ChannelGroup;
40}
41
cdb50f67 42namespace pv {
aca00b1e 43
2b81ae46 44class Session;
aca00b1e 45
488f068c 46namespace binding {
3cc9ad7b 47class Device;
488f068c 48}
488f068c 49
bf0edd2b
SA
50namespace data {
51class SignalBase;
52}
53
488f068c
JH
54namespace view {
55class Signal;
56}
57
51d4a9ab 58namespace popups {
cdb50f67 59
6ac6242b 60class Channels : public pv::widgets::Popup
cdb50f67 61{
ed773982
JH
62 Q_OBJECT
63
cdb50f67 64public:
520362f8 65 Channels(Session &session, QWidget *parent);
f23cd1e5 66
cdb50f67 67private:
6ac6242b 68 void set_all_channels(bool set);
ed773982 69
e8d00928 70 void populate_group(std::shared_ptr<sigrok::ChannelGroup> group,
bf0edd2b 71 const std::vector< std::shared_ptr<pv::data::SignalBase> > sigs);
488f068c 72
2445160a 73 QGridLayout* create_channel_group_grid(
bf0edd2b 74 const std::vector< std::shared_ptr<pv::data::SignalBase> > sigs);
488f068c 75
b7b659aa 76private:
d9ea9628 77 void showEvent(QShowEvent *event);
b7b659aa 78
e9213170 79private Q_SLOTS:
6ac6242b 80 void on_channel_checked(QWidget *widget);
51d4a9ab 81
6ac6242b
ML
82 void enable_all_channels();
83 void disable_all_channels();
ed773982 84
0740907f 85private:
2b81ae46 86 pv::Session &session_;
0740907f 87
8dbbc7f0 88 QFormLayout layout_;
0740907f 89
8dbbc7f0 90 bool updating_channels_;
b7b659aa 91
3cc9ad7b 92 std::vector< std::shared_ptr<pv::binding::Device> >
8dbbc7f0 93 group_bindings_;
bf0edd2b 94 std::map< QCheckBox*, std::shared_ptr<pv::data::SignalBase> >
8dbbc7f0 95 check_box_signal_map_;
488f068c 96
8dbbc7f0
JH
97 QHBoxLayout buttons_bar_;
98 QPushButton enable_all_channels_;
99 QPushButton disable_all_channels_;
488f068c 100
8dbbc7f0 101 QSignalMapper check_box_mapper_;
cdb50f67
JH
102};
103
51d4a9ab
JH
104} // popups
105} // pv
cdb50f67 106
7a01bd36 107#endif // PULSEVIEW_PV_POPUPS_CHANNELS_HPP