bindings: Add Channel::get_index() method.
This commit is contained in:
parent
f36ca8893d
commit
06bd935e16
|
@ -482,6 +482,11 @@ void Channel::set_enabled(bool value)
|
||||||
check(sr_dev_channel_enable(parent->structure, structure->index, value));
|
check(sr_dev_channel_enable(parent->structure, structure->index, value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int Channel::get_index()
|
||||||
|
{
|
||||||
|
return structure->index;
|
||||||
|
}
|
||||||
|
|
||||||
ChannelGroup::ChannelGroup(Device *device,
|
ChannelGroup::ChannelGroup(Device *device,
|
||||||
struct sr_channel_group *structure) :
|
struct sr_channel_group *structure) :
|
||||||
StructureWrapper<Device, struct sr_channel_group>(structure),
|
StructureWrapper<Device, struct sr_channel_group>(structure),
|
||||||
|
|
|
@ -340,6 +340,8 @@ public:
|
||||||
bool get_enabled();
|
bool get_enabled();
|
||||||
/** Set the enabled status of this channel. */
|
/** Set the enabled status of this channel. */
|
||||||
void set_enabled(bool value);
|
void set_enabled(bool value);
|
||||||
|
/** Get the index number of this channel. */
|
||||||
|
unsigned int get_index();
|
||||||
protected:
|
protected:
|
||||||
Channel(struct sr_channel *structure);
|
Channel(struct sr_channel *structure);
|
||||||
~Channel();
|
~Channel();
|
||||||
|
|
|
@ -200,6 +200,7 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
|
||||||
%attributestring(sigrok::Channel, std::string, name, get_name, set_name);
|
%attributestring(sigrok::Channel, std::string, name, get_name, set_name);
|
||||||
%attribute(sigrok::Channel, bool, enabled, get_enabled, set_enabled);
|
%attribute(sigrok::Channel, bool, enabled, get_enabled, set_enabled);
|
||||||
%attribute(sigrok::Channel, const sigrok::ChannelType *, type, get_type);
|
%attribute(sigrok::Channel, const sigrok::ChannelType *, type, get_type);
|
||||||
|
%attribute(sigrok::Channel, unsigned int, index, get_index);
|
||||||
|
|
||||||
%attributestring(sigrok::ChannelGroup, std::string, name, get_name);
|
%attributestring(sigrok::ChannelGroup, std::string, name, get_name);
|
||||||
%attributeval(sigrok::ChannelGroup,
|
%attributeval(sigrok::ChannelGroup,
|
||||||
|
|
Loading…
Reference in New Issue