From 3cc9ad7b867853315473df611612c562d562ed8a Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Sat, 17 Jan 2015 21:58:20 +0000 Subject: [PATCH] Renamed pv::binding::DeviceOptions and DecoderOptions to Device and Decoder --- CMakeLists.txt | 6 +++--- pv/binding/{decoderoptions.cpp => decoder.cpp} | 10 +++++----- pv/binding/{decoderoptions.hpp => decoder.hpp} | 10 +++++----- pv/binding/{deviceoptions.cpp => device.cpp} | 16 ++++++++-------- pv/binding/{deviceoptions.hpp => device.hpp} | 10 +++++----- pv/popups/channels.cpp | 8 ++++---- pv/popups/channels.hpp | 4 ++-- pv/popups/deviceoptions.cpp | 2 +- pv/popups/deviceoptions.hpp | 6 +++--- pv/view/decodetrace.cpp | 4 ++-- pv/view/decodetrace.hpp | 4 ++-- test/CMakeLists.txt | 6 +++--- 12 files changed, 43 insertions(+), 43 deletions(-) rename pv/binding/{decoderoptions.cpp => decoder.cpp} (94%) rename pv/binding/{decoderoptions.hpp => decoder.hpp} (86%) rename pv/binding/{deviceoptions.cpp => device.cpp} (90%) rename pv/binding/{deviceoptions.hpp => device.hpp} (87%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7785928..6848be50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -147,7 +147,7 @@ set(pulseview_SOURCES pv/storesession.cpp pv/util.cpp pv/binding/binding.cpp - pv/binding/deviceoptions.cpp + pv/binding/device.cpp pv/data/analog.cpp pv/data/analogsegment.cpp pv/data/logic.cpp @@ -203,7 +203,7 @@ set(pulseview_HEADERS pv/mainwindow.hpp pv/session.hpp pv/storesession.hpp - pv/binding/deviceoptions.hpp + pv/binding/device.hpp pv/dialogs/about.hpp pv/dialogs/connect.hpp pv/dialogs/storeprogress.hpp @@ -258,7 +258,7 @@ endif() if(ENABLE_DECODE) list(APPEND pulseview_SOURCES - pv/binding/decoderoptions.cpp + pv/binding/decoder.cpp pv/data/decoderstack.cpp pv/data/decode/annotation.cpp pv/data/decode/decoder.cpp diff --git a/pv/binding/decoderoptions.cpp b/pv/binding/decoder.cpp similarity index 94% rename from pv/binding/decoderoptions.cpp rename to pv/binding/decoder.cpp index fd7d918c..dd571602 100644 --- a/pv/binding/decoderoptions.cpp +++ b/pv/binding/decoder.cpp @@ -20,7 +20,7 @@ #include -#include "decoderoptions.hpp" +#include "decoder.hpp" #include @@ -48,7 +48,7 @@ using pv::prop::String; namespace pv { namespace binding { -DecoderOptions::DecoderOptions( +Decoder::Decoder( shared_ptr decoder_stack, shared_ptr decoder) : decoder_stack_(decoder_stack), @@ -91,7 +91,7 @@ DecoderOptions::DecoderOptions( } } -shared_ptr DecoderOptions::bind_enum( +shared_ptr Decoder::bind_enum( const QString &name, const srd_decoder_option *option, Property::Getter getter, Property::Setter setter) { @@ -104,7 +104,7 @@ shared_ptr DecoderOptions::bind_enum( return shared_ptr(new Enum(name, values, getter, setter)); } -Glib::VariantBase DecoderOptions::getter(const char *id) +Glib::VariantBase Decoder::getter(const char *id) { GVariant *val = NULL; @@ -138,7 +138,7 @@ Glib::VariantBase DecoderOptions::getter(const char *id) return Glib::VariantBase(); } -void DecoderOptions::setter(const char *id, Glib::VariantBase value) +void Decoder::setter(const char *id, Glib::VariantBase value) { assert(decoder_); decoder_->set_option(id, value.gobj()); diff --git a/pv/binding/decoderoptions.hpp b/pv/binding/decoder.hpp similarity index 86% rename from pv/binding/decoderoptions.hpp rename to pv/binding/decoder.hpp index a2f7706d..48e5945b 100644 --- a/pv/binding/decoderoptions.hpp +++ b/pv/binding/decoder.hpp @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_BINDING_DECODEROPTIONS_H -#define PULSEVIEW_PV_BINDING_DECODEROPTIONS_H +#ifndef PULSEVIEW_PV_BINDING_DECODER_H +#define PULSEVIEW_PV_BINDING_DECODER_H #include "binding.hpp" @@ -38,10 +38,10 @@ class Decoder; namespace binding { -class DecoderOptions : public Binding +class Decoder : public Binding { public: - DecoderOptions(std::shared_ptr decoder_stack, + Decoder(std::shared_ptr decoder_stack, std::shared_ptr decoder); private: @@ -61,4 +61,4 @@ private: } // binding } // pv -#endif // PULSEVIEW_PV_BINDING_DECODEROPTIONS_H +#endif // PULSEVIEW_PV_BINDING_DECODER_H diff --git a/pv/binding/deviceoptions.cpp b/pv/binding/device.cpp similarity index 90% rename from pv/binding/deviceoptions.cpp rename to pv/binding/device.cpp index 8609e211..224bc23a 100644 --- a/pv/binding/deviceoptions.cpp +++ b/pv/binding/device.cpp @@ -22,7 +22,7 @@ #include -#include "deviceoptions.hpp" +#include "device.hpp" #include #include @@ -53,7 +53,7 @@ using pv::prop::Property; namespace pv { namespace binding { -DeviceOptions::DeviceOptions(shared_ptr configurable) : +Device::Device(shared_ptr configurable) : configurable_(configurable) { assert(configurable); @@ -132,7 +132,7 @@ DeviceOptions::DeviceOptions(shared_ptr configurable) : } } -void DeviceOptions::bind_bool(const QString &name, +void Device::bind_bool(const QString &name, Property::Getter getter, Property::Setter setter) { assert(configurable_); @@ -140,7 +140,7 @@ void DeviceOptions::bind_bool(const QString &name, name, getter, setter))); } -void DeviceOptions::bind_enum(const QString &name, +void Device::bind_enum(const QString &name, Glib::VariantContainerBase gvar_list, Property::Getter getter, Property::Setter setter, function printer) { @@ -157,7 +157,7 @@ void DeviceOptions::bind_enum(const QString &name, getter, setter))); } -void DeviceOptions::bind_int(const QString &name, QString suffix, +void Device::bind_int(const QString &name, QString suffix, optional< std::pair > range, Property::Getter getter, Property::Setter setter) { @@ -167,21 +167,21 @@ void DeviceOptions::bind_int(const QString &name, QString suffix, getter, setter))); } -QString DeviceOptions::print_timebase(Glib::VariantBase gvar) +QString Device::print_timebase(Glib::VariantBase gvar) { uint64_t p, q; g_variant_get(gvar.gobj(), "(tt)", &p, &q); return QString::fromUtf8(sr_period_string(p * q)); } -QString DeviceOptions::print_vdiv(Glib::VariantBase gvar) +QString Device::print_vdiv(Glib::VariantBase gvar) { uint64_t p, q; g_variant_get(gvar.gobj(), "(tt)", &p, &q); return QString::fromUtf8(sr_voltage_string(p, q)); } -QString DeviceOptions::print_voltage_threshold(Glib::VariantBase gvar) +QString Device::print_voltage_threshold(Glib::VariantBase gvar) { gdouble lo, hi; g_variant_get(gvar.gobj(), "(dd)", &lo, &hi); diff --git a/pv/binding/deviceoptions.hpp b/pv/binding/device.hpp similarity index 87% rename from pv/binding/deviceoptions.hpp rename to pv/binding/device.hpp index 9e913b06..2a4c5163 100644 --- a/pv/binding/deviceoptions.hpp +++ b/pv/binding/device.hpp @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef PULSEVIEW_PV_BINDING_DEVICEOPTIONS_H -#define PULSEVIEW_PV_BINDING_DEVICEOPTIONS_H +#ifndef PULSEVIEW_PV_BINDING_DEVICE_H +#define PULSEVIEW_PV_BINDING_DEVICE_H #include @@ -38,12 +38,12 @@ namespace pv { namespace binding { -class DeviceOptions : public QObject, public Binding +class Device : public QObject, public Binding { Q_OBJECT public: - DeviceOptions(std::shared_ptr configurable); + Device(std::shared_ptr configurable); Q_SIGNALS: void config_changed(); @@ -69,4 +69,4 @@ protected: } // binding } // pv -#endif // PULSEVIEW_PV_BINDING_DEVICEOPTIONS_H +#endif // PULSEVIEW_PV_BINDING_DEVICE_H diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp index c00863b0..61a8aee0 100644 --- a/pv/popups/channels.cpp +++ b/pv/popups/channels.cpp @@ -27,7 +27,7 @@ #include "channels.hpp" -#include +#include #include #include @@ -151,14 +151,14 @@ void Channels::set_all_channels(bool set) void Channels::populate_group(shared_ptr group, const vector< shared_ptr > sigs) { - using pv::binding::DeviceOptions; + using pv::binding::Device; // Only bind options if this is a group. We don't do it for general // options, because these properties are shown in the device config // popup. - shared_ptr binding; + shared_ptr binding; if (group) - binding = shared_ptr(new DeviceOptions(group)); + binding = shared_ptr(new Device(group)); // Create a title if the group is going to have any content if ((!sigs.empty() || (binding && !binding->properties().empty())) && diff --git a/pv/popups/channels.hpp b/pv/popups/channels.hpp index 61dc9e15..a0b0693f 100644 --- a/pv/popups/channels.hpp +++ b/pv/popups/channels.hpp @@ -44,7 +44,7 @@ namespace pv { class Session; namespace binding { -class DeviceOptions; +class Device; } namespace view { @@ -85,7 +85,7 @@ private: bool updating_channels_; - std::vector< std::shared_ptr > + std::vector< std::shared_ptr > group_bindings_; std::map< QCheckBox*, std::shared_ptr > check_box_signal_map_; diff --git a/pv/popups/deviceoptions.cpp b/pv/popups/deviceoptions.cpp index 06c9705f..fe795515 100644 --- a/pv/popups/deviceoptions.cpp +++ b/pv/popups/deviceoptions.cpp @@ -45,7 +45,7 @@ DeviceOptions::DeviceOptions(shared_ptr device, QWidget *parent) : layout_.addWidget(binding_.get_property_form(this, true)); } -pv::binding::DeviceOptions& DeviceOptions::binding() +pv::binding::Device& DeviceOptions::binding() { return binding_; } diff --git a/pv/popups/deviceoptions.hpp b/pv/popups/deviceoptions.hpp index 94ce7afd..f840e83f 100644 --- a/pv/popups/deviceoptions.hpp +++ b/pv/popups/deviceoptions.hpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include namespace sigrok { @@ -42,14 +42,14 @@ public: DeviceOptions(std::shared_ptr device, QWidget *parent); - pv::binding::DeviceOptions& binding(); + pv::binding::Device& binding(); private: std::shared_ptr device_; QVBoxLayout layout_; - pv::binding::DeviceOptions binding_; + pv::binding::Device binding_; }; } // namespace popups diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 91ffebe4..f423b21e 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -687,8 +687,8 @@ void DecodeTrace::create_decoder_form(int index, } // Add the options - shared_ptr binding( - new binding::DecoderOptions(decoder_stack_, dec)); + shared_ptr binding( + new binding::Decoder(decoder_stack_, dec)); binding->add_properties_to_form(decoder_form, true); bindings_.push_back(binding); diff --git a/pv/view/decodetrace.hpp b/pv/view/decodetrace.hpp index 863fb35e..ada01db7 100644 --- a/pv/view/decodetrace.hpp +++ b/pv/view/decodetrace.hpp @@ -29,7 +29,7 @@ #include -#include +#include #include struct srd_channel; @@ -191,7 +191,7 @@ private: uint64_t decode_start_, decode_end_; - std::list< std::shared_ptr > + std::list< std::shared_ptr > bindings_; std::list channel_selectors_; diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 61b9c4d5..98b02999 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -24,7 +24,7 @@ set(pulseview_TEST_SOURCES ${PROJECT_SOURCE_DIR}/pv/storesession.cpp ${PROJECT_SOURCE_DIR}/pv/util.cpp ${PROJECT_SOURCE_DIR}/pv/binding/binding.cpp - ${PROJECT_SOURCE_DIR}/pv/binding/deviceoptions.cpp + ${PROJECT_SOURCE_DIR}/pv/binding/device.cpp ${PROJECT_SOURCE_DIR}/pv/data/analog.cpp ${PROJECT_SOURCE_DIR}/pv/data/analogsegment.cpp ${PROJECT_SOURCE_DIR}/pv/data/logic.cpp @@ -74,7 +74,7 @@ set(pulseview_TEST_SOURCES set(pulseview_TEST_HEADERS ${PROJECT_SOURCE_DIR}/pv/session.hpp ${PROJECT_SOURCE_DIR}/pv/storesession.hpp - ${PROJECT_SOURCE_DIR}/pv/binding/deviceoptions.hpp + ${PROJECT_SOURCE_DIR}/pv/binding/device.hpp ${PROJECT_SOURCE_DIR}/pv/popups/channels.hpp ${PROJECT_SOURCE_DIR}/pv/popups/deviceoptions.hpp ${PROJECT_SOURCE_DIR}/pv/prop/bool.hpp @@ -109,7 +109,7 @@ set(pulseview_TEST_HEADERS if(ENABLE_DECODE) list(APPEND pulseview_TEST_SOURCES - ${PROJECT_SOURCE_DIR}/pv/binding/decoderoptions.cpp + ${PROJECT_SOURCE_DIR}/pv/binding/decoder.cpp ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/annotation.cpp ${PROJECT_SOURCE_DIR}/pv/data/decode/decoder.cpp -- 2.30.2