libdrmconf
0.10.4
A library to program DMR radios.
|
Helper class to assemble radio config from binary codeplugs that use index-tables and bitmaps to specify which elements of the codeplug are valid. More...
#include <codeplugcontext.hh>
Public Member Functions | |
CodeplugContext (Config *config) | |
Wraps the given device config. | |
Config * | config () const |
Returns the wrapped config. | |
bool | hasRadioId (int index) const |
Returns true if the radio DMR ID of given index is set. | |
bool | setDefaultRadioId (uint32_t id, int index) |
Stores the given ID at the specified index as the default radio ID. | |
bool | addRadioId (uint32_t id, int index, const QString &name="") |
Adds the given radio ID at the given index to the list. | |
DMRRadioID * | getRadioId (int idx) const |
Maps the given index to the associated radio ID. | |
bool | hasChannel (int index) const |
Returns true , if the given channel index has been defined before. | |
bool | addChannel (Channel *ch, int index) |
Adds a channel to the config and maps the given index to that channel. | |
Channel * | getChannel (int index) const |
Gets a channel for the specified index or nullptr if not defined. | |
bool | hasDigitalContact (int index) const |
Returns true , if the given digital contact index has been defined before. | |
bool | addDigitalContact (DMRContact *con, int index) |
Adds a digital contact to the config and maps the given index to that contact. | |
DMRContact * | getDigitalContact (int index) const |
Gets a digital contact for the specified index or nullptr if not defined. | |
bool | hasAnalogContact (int index) const |
Returns true , if the given analog contact index has been defined before. | |
bool | addAnalogContact (DTMFContact *con, int index) |
Adds a analog contact to the config and maps the given index to that contact. | |
DTMFContact * | getAnalogContact (int index) const |
Gets a analog contact for the specified index or nullptr if not defined. | |
bool | hasGroupList (int index) const |
Returns true , if the given RX group list index has been defined before. | |
bool | addGroupList (RXGroupList *grp, int index) |
Adds a RX group list to the config and maps the given index to that group list. | |
RXGroupList * | getGroupList (int index) const |
Gets a RX group list for the specified index or nullptr if not defined. | |
bool | hasScanList (int index) const |
Returns true , if the given scan list index has been defined before. | |
bool | addScanList (ScanList *lst, int index) |
Adds a scan list to the config and maps the given index to that scan list. | |
ScanList * | getScanList (int index) const |
Gets a scan list for the specified index or nullptr if not defined. | |
bool | hasGPSSystem (int index) const |
Returns true , if the given GPS system index has been defined before. | |
bool | addGPSSystem (GPSSystem *sys, int index) |
Adds a GPS system to the config and maps the given index to that GPS system. | |
GPSSystem * | getGPSSystem (int index) const |
Gets a GPS system for the specified index or nullptr if not defined. | |
bool | hasAPRSSystem (int index) const |
Returns true , if the given APRS system index has been defined before. | |
bool | addAPRSSystem (APRSSystem *sys, int index) |
Adds an APRS system to the config and maps the given index to that APRS system. | |
APRSSystem * | getAPRSSystem (int index) const |
Gets an APRS system for the specified index or nullptr if not defined. | |
bool | hasRoamingZone (int index) const |
Returns true if the given roaming zone index is defined. | |
bool | addRoamingZone (RoamingZone *zone, int index) |
Associates the given roaming zone with the given index. | |
RoamingZone * | getRoamingZone (int index) const |
Returns the roaming zone associated with the given index. | |
bool | hasRoamingChannel (int index) const |
Returns true if a roaming channel is defined for the given index. | |
bool | addRoamingChannel (DMRChannel *ch, int index) |
Associates the given digital channel as the roaming channel with the given index. | |
DMRChannel * | getRoamingChannel (int index) const |
Returns the roaming channel associated with the given index. | |
Protected Attributes | |
Config * | _config |
The wrapped radio config (aka abstract code-plug). | |
QHash< int, int > | _radioIDTable |
Maps a code-plug radio ID index to the radio ID index within the wrapped radio config. | |
QHash< int, int > | _channelTable |
Maps a code-plug channel index to the channel index within the wrapped radio config. | |
QHash< int, int > | _digitalContactTable |
Maps a code-plug digital-contact index to the contact index within the wrapped radio config. | |
QHash< int, int > | _analogContactTable |
Maps a code-plug analog-contact index to the contact index within the wrapped radio config. | |
QHash< int, int > | _groupListTable |
Maps a code-plug RX group-list index to the group-list index within the wrapped radio config. | |
QHash< int, int > | _scanListTable |
Maps a code-plug scan-list index to the scan-list index within the wrapped radio config. | |
QHash< int, int > | _gpsSystemTable |
Maps a code-plug GPS system index to the GPS system index within the wrapped radio config. | |
QHash< int, int > | _aprsSystemTable |
Maps a code-plug APRS system index to the APRS system index within the wrapped radio config. | |
QHash< int, int > | _roamingZoneTable |
Maps a code-plug roaming zone index to the roaming zone index within the wrapped radio config. | |
QHash< int, int > | _roamingChannelTable |
Maps a code-plug roaming channel index to a digital channel index within the wrapped radio config. | |
Helper class to assemble radio config from binary codeplugs that use index-tables and bitmaps to specify which elements of the codeplug are valid.
This may lead to sparse specification of channels etc. Hence an codeplug index to config object mapping is needed. This class provides this mapping.
CodePlug::Context
. This class will be phased out and replaced with the new one.