4 #include "configobject.hh"
19 explicit RadioID(QObject *parent=
nullptr);
33 Q_CLASSINFO(
"IdPrefix",
"id")
92 Q_CLASSINFO(
"IdPrefix",
"dtmf")
110 const QString &
number()
const;
147 virtual int addId(
const QString &name, uint32_t
id);
149 virtual bool delId(uint32_t
id);
Parse context for config objects.
Definition: configobject.hh:48
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
List class for config objects.
Definition: configobject.hh:341
Base class of all labeled and named objects.
Definition: configobject.hh:199
QString name
The name of the object.
Definition: configobject.hh:203
Represents a DMR radio ID within the abstract config.
Definition: radioid.hh:31
unsigned number
The number of the radio ID.
Definition: radioid.hh:36
bool link(const YAML::Node &node, const ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack())
Links the given object to the rest of the codeplug using the given context.
Definition: radioid.cc:88
ConfigItem * clone() const
Clones this item.
Definition: radioid.cc:38
void setNumber(uint32_t number)
Sets the DMR ID.
Definition: radioid.cc:53
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: radioid.cc:61
DMRRadioID(QObject *parent=nullptr)
Default constructor.
Definition: radioid.cc:25
bool parse(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition: radioid.cc:74
uint32_t _number
Holds the DMR ID.
Definition: radioid.hh:61
Represents a DTMF radio ID as used for PTT-ID on analog channels.
Definition: radioid.hh:90
ConfigItem * clone() const
Clones this item.
Definition: radioid.cc:137
QString _number
Holds the DTMF number of the radio ID.
Definition: radioid.hh:116
DTMFRadioID(QObject *parent=nullptr)
Default constructor.
Definition: radioid.cc:124
QString number
The DTMF number of the radio ID.
Definition: radioid.hh:95
void setNumber(const QString &number)
Sets the DTMF number of the radio ID.
Definition: radioid.cc:151
A singleton radio ID representing the default DMR radio ID within the abstract config.
Definition: radioid.hh:68
DefaultRadioID(QObject *parent=nullptr)
Constructor.
Definition: radioid.cc:107
static DefaultRadioID * get()
Factory method returning the singleton instance.
Definition: radioid.cc:114
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Represents the list of configured DMR IDs (radio IDs) within the abstract config.
Definition: radioid.hh:126
DMRRadioID * defaultId() const
Returns the current default ID for the radio.
Definition: radioid.cc:183
void clear()
Clears the list.
Definition: radioid.cc:170
virtual int addId(const QString &name, uint32_t id)
Adds the given DMR ID.
Definition: radioid.cc:214
void onDefaultIdDeleted()
Gets call whenever the default DMR ID gets deleted.
Definition: radioid.cc:270
DMRRadioID * _default
Holds a weak reference to the default DMR radio ID.
Definition: radioid.hh:160
RadioIDList(QObject *parent=nullptr)
Constructor.
Definition: radioid.cc:163
bool setDefaultId(int idx)
Sets the default DMR ID.
Definition: radioid.cc:219
int add(ConfigObject *obj, int row=-1)
Adds an element to the list.
Definition: radioid.cc:197
ConfigItem * allocateChild(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack())
Allocates a member objects for the given YAML node.
Definition: radioid.cc:246
virtual bool delId(uint32_t id)
Deletes and removes the given DMR ID.
Definition: radioid.cc:240
DMRRadioID * find(uint32_t id) const
Searches the DMR ID object associated with the given DMR ID.
Definition: radioid.cc:188
DMRRadioID * getId(int idx) const
Returns the radio ID at the given index.
Definition: radioid.cc:176
Abstract base class for all radio IDs.
Definition: radioid.hh:13
RadioID(QObject *parent=nullptr)
Hidden default constructor.
Definition: radioid.cc:9