]>
Commit | Line | Data |
---|---|---|
9663c82b JH |
1 | /* |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2012-2013 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_CONNECT_HPP |
22 | #define PULSEVIEW_PV_CONNECT_HPP | |
9663c82b | 23 | |
f9abf97e | 24 | #include <memory> |
19adbc2c | 25 | |
1ebe875c | 26 | #include <QCheckBox> |
9663c82b JH |
27 | #include <QComboBox> |
28 | #include <QDialog> | |
29 | #include <QDialogButtonBox> | |
30 | #include <QFormLayout> | |
26f209b7 | 31 | #include <QHBoxLayout> |
9663c82b | 32 | #include <QLineEdit> |
26f209b7 | 33 | #include <QSpinBox> |
c9de8b32 JH |
34 | #include <QListWidget> |
35 | #include <QPushButton> | |
9663c82b JH |
36 | #include <QVBoxLayout> |
37 | ||
e8d00928 | 38 | namespace sigrok { |
9894618a | 39 | class Driver; |
da30ecb7 JH |
40 | } |
41 | ||
42 | namespace pv { | |
43 | namespace devices { | |
9894618a | 44 | class HardwareDevice; |
e8d00928 | 45 | } |
da30ecb7 | 46 | } |
e8d00928 ML |
47 | |
48 | Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>); | |
da30ecb7 | 49 | Q_DECLARE_METATYPE(std::shared_ptr<pv::devices::HardwareDevice>); |
c9de8b32 | 50 | |
9663c82b | 51 | namespace pv { |
107ca6d3 JH |
52 | |
53 | class DeviceManager; | |
94574501 | 54 | |
9663c82b JH |
55 | namespace dialogs { |
56 | ||
57 | class Connect : public QDialog | |
58 | { | |
59 | Q_OBJECT | |
60 | ||
61 | public: | |
107ca6d3 | 62 | Connect(QWidget *parent, pv::DeviceManager &device_manager); |
9663c82b | 63 | |
da30ecb7 | 64 | std::shared_ptr<devices::HardwareDevice> get_selected_device() const; |
5eb0fa13 | 65 | |
9663c82b JH |
66 | private: |
67 | void populate_drivers(); | |
68 | ||
34750abe AJ |
69 | void populate_serials(std::shared_ptr<sigrok::Driver> driver); |
70 | ||
c9de8b32 JH |
71 | void unset_connection(); |
72 | ||
e9213170 | 73 | private Q_SLOTS: |
1ebe875c SA |
74 | void driver_selected(int index); |
75 | ||
76 | void serial_toggled(bool checked); | |
77 | void tcp_toggled(bool checked); | |
9663c82b | 78 | |
c9de8b32 | 79 | void scan_pressed(); |
9663c82b | 80 | |
9663c82b | 81 | private: |
8dbbc7f0 | 82 | pv::DeviceManager &device_manager_; |
107ca6d3 | 83 | |
8dbbc7f0 | 84 | QVBoxLayout layout_; |
9663c82b | 85 | |
8dbbc7f0 JH |
86 | QWidget form_; |
87 | QFormLayout form_layout_; | |
9663c82b | 88 | |
8dbbc7f0 | 89 | QComboBox drivers_; |
9663c82b | 90 | |
34750abe | 91 | QComboBox serial_devices_; |
9663c82b | 92 | |
1ebe875c SA |
93 | QWidget *tcp_config_; |
94 | QLineEdit *tcp_host_; | |
95 | QSpinBox *tcp_port_; | |
96 | QCheckBox *tcp_use_vxi_; | |
26f209b7 | 97 | |
8dbbc7f0 JH |
98 | QPushButton scan_button_; |
99 | QListWidget device_list_; | |
c9de8b32 | 100 | |
8dbbc7f0 | 101 | QDialogButtonBox button_box_; |
9663c82b JH |
102 | }; |
103 | ||
104 | } // namespace dialogs | |
105 | } // namespace pv | |
106 | ||
7a01bd36 | 107 | #endif // PULSEVIEW_PV_CONNECT_HPP |