Renamed pv::binding::DeviceOptions and DecoderOptions to Device and Decoder

This commit is contained in:
Joel Holdsworth 2015-01-17 21:58:20 +00:00 committed by Uwe Hermann
parent 61703a0124
commit 3cc9ad7b86
12 changed files with 43 additions and 43 deletions

View File

@ -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

View File

@ -20,7 +20,7 @@
#include <libsigrokdecode/libsigrokdecode.h>
#include "decoderoptions.hpp"
#include "decoder.hpp"
#include <boost/none_t.hpp>
@ -48,7 +48,7 @@ using pv::prop::String;
namespace pv {
namespace binding {
DecoderOptions::DecoderOptions(
Decoder::Decoder(
shared_ptr<pv::data::DecoderStack> decoder_stack,
shared_ptr<data::decode::Decoder> decoder) :
decoder_stack_(decoder_stack),
@ -91,7 +91,7 @@ DecoderOptions::DecoderOptions(
}
}
shared_ptr<Property> DecoderOptions::bind_enum(
shared_ptr<Property> Decoder::bind_enum(
const QString &name, const srd_decoder_option *option,
Property::Getter getter, Property::Setter setter)
{
@ -104,7 +104,7 @@ shared_ptr<Property> DecoderOptions::bind_enum(
return shared_ptr<Property>(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());

View File

@ -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<pv::data::DecoderStack> decoder_stack,
Decoder(std::shared_ptr<pv::data::DecoderStack> decoder_stack,
std::shared_ptr<pv::data::decode::Decoder> decoder);
private:
@ -61,4 +61,4 @@ private:
} // binding
} // pv
#endif // PULSEVIEW_PV_BINDING_DECODEROPTIONS_H
#endif // PULSEVIEW_PV_BINDING_DECODER_H

View File

@ -22,7 +22,7 @@
#include <QDebug>
#include "deviceoptions.hpp"
#include "device.hpp"
#include <pv/prop/bool.hpp>
#include <pv/prop/double.hpp>
@ -53,7 +53,7 @@ using pv::prop::Property;
namespace pv {
namespace binding {
DeviceOptions::DeviceOptions(shared_ptr<sigrok::Configurable> configurable) :
Device::Device(shared_ptr<sigrok::Configurable> configurable) :
configurable_(configurable)
{
assert(configurable);
@ -132,7 +132,7 @@ DeviceOptions::DeviceOptions(shared_ptr<sigrok::Configurable> 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<QString (Glib::VariantBase)> 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<int64_t, int64_t> > 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);

View File

@ -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 <boost/optional.hpp>
@ -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<sigrok::Configurable> configurable);
Device(std::shared_ptr<sigrok::Configurable> 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

View File

@ -27,7 +27,7 @@
#include "channels.hpp"
#include <pv/binding/deviceoptions.hpp>
#include <pv/binding/device.hpp>
#include <pv/session.hpp>
#include <pv/view/signal.hpp>
@ -151,14 +151,14 @@ void Channels::set_all_channels(bool set)
void Channels::populate_group(shared_ptr<ChannelGroup> group,
const vector< shared_ptr<pv::view::Signal> > 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<DeviceOptions> binding;
shared_ptr<Device> binding;
if (group)
binding = shared_ptr<DeviceOptions>(new DeviceOptions(group));
binding = shared_ptr<Device>(new Device(group));
// Create a title if the group is going to have any content
if ((!sigs.empty() || (binding && !binding->properties().empty())) &&

View File

@ -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<pv::binding::DeviceOptions> >
std::vector< std::shared_ptr<pv::binding::Device> >
group_bindings_;
std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
check_box_signal_map_;

View File

@ -45,7 +45,7 @@ DeviceOptions::DeviceOptions(shared_ptr<Device> device, QWidget *parent) :
layout_.addWidget(binding_.get_property_form(this, true));
}
pv::binding::DeviceOptions& DeviceOptions::binding()
pv::binding::Device& DeviceOptions::binding()
{
return binding_;
}

View File

@ -24,7 +24,7 @@
#include <QGroupBox>
#include <QVBoxLayout>
#include <pv/binding/deviceoptions.hpp>
#include <pv/binding/device.hpp>
#include <pv/widgets/popup.hpp>
namespace sigrok {
@ -42,14 +42,14 @@ public:
DeviceOptions(std::shared_ptr<sigrok::Device> device,
QWidget *parent);
pv::binding::DeviceOptions& binding();
pv::binding::Device& binding();
private:
std::shared_ptr<sigrok::Device> device_;
QVBoxLayout layout_;
pv::binding::DeviceOptions binding_;
pv::binding::Device binding_;
};
} // namespace popups

View File

@ -687,8 +687,8 @@ void DecodeTrace::create_decoder_form(int index,
}
// Add the options
shared_ptr<binding::DecoderOptions> binding(
new binding::DecoderOptions(decoder_stack_, dec));
shared_ptr<binding::Decoder> binding(
new binding::Decoder(decoder_stack_, dec));
binding->add_properties_to_form(decoder_form, true);
bindings_.push_back(binding);

View File

@ -29,7 +29,7 @@
#include <QSignalMapper>
#include <pv/binding/decoderoptions.hpp>
#include <pv/binding/decoder.hpp>
#include <pv/data/decode/row.hpp>
struct srd_channel;
@ -191,7 +191,7 @@ private:
uint64_t decode_start_, decode_end_;
std::list< std::shared_ptr<pv::binding::DecoderOptions> >
std::list< std::shared_ptr<pv::binding::Decoder> >
bindings_;
std::list<ChannelSelector> channel_selectors_;

View File

@ -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