LibDMRConf  0.5.0
A library to program DMR radios.
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
Channel Class Reference

The base class of all channels (analog and digital) of a codeplug configuration. More...

#include <channel.hh>

Inheritance diagram for Channel:
AnalogChannel DigitalChannel SelectedChannel

Public Types

enum  Power {
  MaxPower, HighPower, MidPower, LowPower,
  MinPower
}
 Possible power settings. More...
 

Signals

void modified ()
 Is emitted if the channel gets modified.
 

Public Member Functions

template<class T >
bool is () const
 Returns true if the channel is of type T. More...
 
template<class T >
T * as ()
 Dynamic cast of channels. More...
 
template<class T >
const T * as () const
 Dynamic cast of channels. More...
 
const QString & name () const
 Returns the name of the channel.
 
bool setName (const QString &name)
 (Re-)Sets the name of the channel.
 
double rxFrequency () const
 Returns the RX frequency of the channel in MHz.
 
bool setRXFrequency (double freq)
 (Re-)Sets the RX frequency of the channel in MHz.
 
double txFrequency () const
 Returns the TX frequency of the channel in MHz.
 
bool setTXFrequency (double freq)
 (Re-)Sets the TX frequency of the channel in MHz.
 
Power power () const
 Returns the power setting of the channel.
 
void setPower (Power power)
 (Re-)Sets the power setting of the channel.
 
uint txTimeout () const
 Returns the TX timeout (TOT) in seconds.
 
bool setTimeout (uint dur)
 (Re-)Sets the TX timeout (TOT) in seconds.
 
bool rxOnly () const
 Returns true, if the channel is RX only.
 
bool setRXOnly (bool enable)
 Set, whether the channel is RX only.
 
ScanListscanList () const
 Returns the default scan list for the channel.
 
bool setScanList (ScanList *list)
 (Re-) Sets the default scan list for the channel.
 

Protected Slots

void onScanListDeleted (QObject *obj)
 Internal hander for deleted scan lists.
 

Protected Member Functions

 Channel (const QString &name, double rx, double tx, Power power, uint txTimeout, bool rxOnly, ScanList *scanlist, QObject *parent=nullptr)
 Hidden constructor. More...
 

Protected Attributes

QString _name
 The channel name.
 
double _rxFreq
 The RX frequency in MHz.
 
double _txFreq
 The TX frequency in MHz.
 
Power _power
 The transmit power setting.
 
uint _txTimeOut
 Transmit timeout in seconds.
 
bool _rxOnly
 RX only flag.
 
ScanList_scanlist
 Default scan list of the channel.
 

Detailed Description

The base class of all channels (analog and digital) of a codeplug configuration.

This class holds the common configuration of AnalogChannel and DigitalChannel, that is the name, RX and TX frequencies, output power, TOT and default scanlist properties.

Member Enumeration Documentation

◆ Power

Possible power settings.

Enumerator
MaxPower 

Highest power setting (e.g. > 5W, if available).

HighPower 

High power setting (e.g, 5W).

MidPower 

Medium power setting (e.g., 2W, if avaliable)

LowPower 

Low power setting (e.g., 1W).

MinPower 

Lowest power setting (e.g., <1W, if available).

Constructor & Destructor Documentation

◆ Channel()

Channel::Channel ( const QString &  name,
double  rx,
double  tx,
Power  power,
uint  txTimeout,
bool  rxOnly,
ScanList scanlist,
QObject *  parent = nullptr 
)
protected

Hidden constructor.

Constructs a new base channel.

Parameters
nameSpecifies the name of the channel.
rxSepcifies the RX freqeuncy in MHz.
txSpecifies the TX frequency in MHz.
powerSpecifies the power setting for the channel.
txTimeoutSpecifies the transmit timeout in seconds (TOT).
rxOnlySpecifies whether the channel is RX only.
scanlistSpecifies the default scanlist for the channel.
parentSpecified the QObject parent object.

Member Function Documentation

◆ as() [1/2]

template<class T >
T* Channel::as ( )
inline

Dynamic cast of channels.

For example channel->as<AnalogChannel>().

◆ as() [2/2]

template<class T >
const T* Channel::as ( ) const
inline

Dynamic cast of channels.

For example channel->as<AnalogChannel>().

◆ is()

template<class T >
bool Channel::is ( ) const
inline

Returns true if the channel is of type T.

This can be used to text wheter this channel is actuially an analog or digital channel: channel->is<AnalogChannel>().


The documentation for this class was generated from the following files: