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

Container class holding all channels (analog and digital) for a specific configuration (Config). More...

#include <channel.hh>

Inheritance diagram for ChannelList:

Signals

void modified ()
 Gets emitted once the table has been changed.
 

Public Member Functions

 ChannelList (QObject *parent=nullptr)
 Constructs an empty channel list.
 
int count () const
 Returns the number of channels in this list.
 
void clear ()
 Clears the list.
 
int indexOf (Channel *channel) const
 Returns the index of the channel.
 
Channelchannel (int idx) const
 Gets the channel at the specified index.
 
DigitalChannelfindDigitalChannel (double rx, double tx, DigitalChannel::TimeSlot ts, uint cc) const
 Finds a digial channel with the given frequencies, time slot and color code. More...
 
AnalogChannelfindAnalogChannelByTxFreq (double freq) const
 Finds an analog channel with the given frequeny.
 
int addChannel (Channel *channel, int row=-1)
 Adds a channel to the list at the specified row. More...
 
bool remChannel (Channel *channel)
 Removes the given channel from the list.
 
bool remChannel (int idx)
 Removes the channel at the given index from the list.
 
bool moveUp (int idx)
 Moves the channel at index idx one step up.
 
bool moveDown (int idx)
 Moves the channel at index idx one step up.
 
int rowCount (const QModelIndex &index) const
 Implements QAbstractTableModel, returns number of rows.
 
int columnCount (const QModelIndex &index) const
 Implements QAbstractTableModel, returns number of colums.
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
 Implements QAbstractTableModel, returns data at cell.
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
 Implements QAbstractTableModel, returns header at section.
 

Protected Slots

void onChannelDeleted (QObject *obj)
 Internal callback on deleted channels.
 
void onChannelEdited ()
 Internal callback on modified channels.
 

Protected Attributes

QVector< Channel * > _channels
 Just the vector of channels.
 

Detailed Description

Container class holding all channels (analog and digital) for a specific configuration (Config).

This class also implements the QAbstractTableModel and can therefore be displayed using a default QTableView instance.

Member Function Documentation

◆ addChannel()

int ChannelList::addChannel ( Channel channel,
int  row = -1 
)

Adds a channel to the list at the specified row.

If row<0 the channel gets appendet to the list.

◆ findDigitalChannel()

DigitalChannel * ChannelList::findDigitalChannel ( double  rx,
double  tx,
DigitalChannel::TimeSlot  ts,
uint  cc 
) const

Finds a digial channel with the given frequencies, time slot and color code.

Bug:
I should certainly change the frequency handling to integer values!

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