tcp_port_->setRange(1, 65535);
tcp_port_->setValue(5555);
tcp_config_layout->addWidget(tcp_port_);
- tcp_use_vxi_ = new QCheckBox();
- tcp_use_vxi_->setText(tr("Use VXI"));
+
tcp_config_layout->addSpacing(30);
- tcp_config_layout->addWidget(tcp_use_vxi_);
+ tcp_config_layout->addWidget(new QLabel(tr("Protocol:")));
+ tcp_protocol_ = new QComboBox();
+ tcp_protocol_->addItem("Raw TCP", QVariant("tcp-raw/%1/%2"));
+ tcp_protocol_->addItem("VXI", QVariant("vxi/%1/%2"));
+ tcp_config_layout->addWidget(tcp_protocol_);
tcp_config_layout->setContentsMargins(0, 0, 0, 0);
tcp_config_->setEnabled(false);
QString host = tcp_host_->text();
QString port = tcp_port_->text();
if (!host.isEmpty()) {
- QString conn;
- if (tcp_use_vxi_->isChecked())
- conn = QString("vxi/%1/%2").arg(host, port);
- else
- conn = QString("tcp-raw/%1/%2").arg(host, port);
+ QString conn =
+ tcp_protocol_->itemData(tcp_protocol_->currentIndex()).toString();
+
+ conn = conn.arg(host, port);
drvopts[ConfigKey::CONN] = Variant<ustring>::create(
conn.toUtf8().constData());