From: Joel Holdsworth Date: Fri, 28 Dec 2012 09:51:12 +0000 (+0000) Subject: Added empty HwCap dialog X-Git-Tag: pulseview-0.1.0~184 X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=cdb50f67d6fd1c54d51d0fd497c21aa6b9bfa887 Added empty HwCap dialog --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b1208d64..189e778a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ set(pulseview_SOURCES pv/data/signaldata.cpp pv/data/snapshot.cpp pv/dialogs/about.cpp + pv/dialogs/hwcap.cpp pv/prop/binding/hwcap.cpp pv/view/analogsignal.cpp pv/view/cursor.cpp diff --git a/pv/dialogs/hwcap.cpp b/pv/dialogs/hwcap.cpp new file mode 100644 index 00000000..d6481ab5 --- /dev/null +++ b/pv/dialogs/hwcap.cpp @@ -0,0 +1,33 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "hwcap.h" + +namespace pv { +namespace dialogs { + +HwCap::HwCap(QWidget *parent, struct sr_dev_inst *sdi) : + QDialog(parent), + _hw_cap_binding(sdi) +{ +} + +} // namespace dialogs +} // namespace pv diff --git a/pv/dialogs/hwcap.h b/pv/dialogs/hwcap.h new file mode 100644 index 00000000..7b826fee --- /dev/null +++ b/pv/dialogs/hwcap.h @@ -0,0 +1,43 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_HWCAP_H +#define PULSEVIEW_PV_HWCAP_H + +#include + +#include + +namespace pv { +namespace dialogs { + +class HwCap : public QDialog +{ +public: + HwCap(QWidget *parent, struct sr_dev_inst *sdi); + +private: + pv::prop::binding::HwCap _hw_cap_binding; +}; + +} // namespace dialogs +} // namespace pv + +#endif // PULSEVIEW_PV_HWCAP_H diff --git a/pv/samplingbar.cpp b/pv/samplingbar.cpp index 5f9e4371..468c1c53 100644 --- a/pv/samplingbar.cpp +++ b/pv/samplingbar.cpp @@ -30,6 +30,8 @@ extern "C" { #include "samplingbar.h" +#include + namespace pv { const uint64_t SamplingBar::RecordLengths[11] = { @@ -49,13 +51,17 @@ const uint64_t SamplingBar::RecordLengths[11] = { SamplingBar::SamplingBar(QWidget *parent) : QToolBar("Sampling Bar", parent), _device_selector(this), + _configure_button(this), _record_length_selector(this), _sample_rate_list(this), _run_stop_button(this) { - connect(&_run_stop_button, SIGNAL(clicked()), this, SIGNAL(run_stop())); + connect(&_run_stop_button, SIGNAL(clicked()), + this, SIGNAL(run_stop())); connect(&_device_selector, SIGNAL(currentIndexChanged (int)), this, SLOT(on_device_selected())); + connect(&_configure_button, SIGNAL(clicked()), + this, SLOT(configure())); _sample_rate_value.setDecimals(0); _sample_rate_value.setSuffix("Hz"); @@ -70,7 +76,10 @@ SamplingBar::SamplingBar(QWidget *parent) : set_sampling(false); + _configure_button.setIcon(QIcon::fromTheme("configure")); + addWidget(&_device_selector); + addWidget(&_configure_button); addWidget(&_record_length_selector); _sample_rate_list_action = addWidget(&_sample_rate_list); _sample_rate_value_action = addWidget(&_sample_rate_value); @@ -194,4 +203,13 @@ void SamplingBar::on_device_selected() update_sample_rate_selector(); } +void SamplingBar::configure() +{ + sr_dev_inst *const sdi = get_selected_device(); + assert(sdi); + + pv::dialogs::HwCap dlg(this, sdi); + dlg.exec(); +} + } // namespace pv diff --git a/pv/samplingbar.h b/pv/samplingbar.h index 8c6511a8..a9ceb6bd 100644 --- a/pv/samplingbar.h +++ b/pv/samplingbar.h @@ -57,9 +57,11 @@ private: private slots: void on_device_selected(); + void configure(); private: QComboBox _device_selector; + QToolButton _configure_button; QComboBox _record_length_selector;