]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/connect.hpp
Connect dialog: Add support for connecting to raw-tcp devices
[pulseview.git] / pv / dialogs / connect.hpp
index cc477631571eae3b97dc31f3b25a627bbab18ccc..0cb50fbff060edd6bcb6c4c5e554a19ca18fb0fd 100644 (file)
 #include <QDialog>
 #include <QDialogButtonBox>
 #include <QFormLayout>
+#include <QHBoxLayout>
 #include <QLineEdit>
+#include <QSpinBox>
 #include <QListWidget>
 #include <QPushButton>
 #include <QVBoxLayout>
 
 namespace sigrok {
 class Driver;
+}
+
+namespace pv {
+namespace devices {
 class HardwareDevice;
 }
+}
 
 Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>);
-Q_DECLARE_METATYPE(std::shared_ptr<sigrok::HardwareDevice>);
+Q_DECLARE_METATYPE(std::shared_ptr<pv::devices::HardwareDevice>);
 
 namespace pv {
 
@@ -53,7 +60,7 @@ class Connect : public QDialog
 public:
        Connect(QWidget *parent, pv::DeviceManager &device_manager);
 
-       std::shared_ptr<sigrok::HardwareDevice> get_selected_device() const;
+       std::shared_ptr<devices::HardwareDevice> get_selected_device() const;
 
 private:
        void populate_drivers();
@@ -63,6 +70,7 @@ private:
        void unset_connection();
 
        void set_serial_connection(std::shared_ptr<sigrok::Driver> driver);
+       void set_tcp_connection(std::shared_ptr<sigrok::Driver> driver);
 
 private Q_SLOTS:
        void device_selected(int index);
@@ -81,6 +89,11 @@ private:
 
        QComboBox serial_devices_;
 
+       QWidget tcp_endpoint_;
+       QHBoxLayout tcp_endpoint_layout_;
+       QLineEdit tcp_host_;
+       QSpinBox tcp_port_;
+
        QPushButton scan_button_;
        QListWidget device_list_;