libdrmconf 0.12.1
A library to program DMR radios.
Loading...
Searching...
No Matches
CSVReader Class Reference

Implements the text-file codeplug reader. More...

#include <csvreader.hh>

Inheritance diagram for CSVReader:
Collaboration diagram for CSVReader:

Public Member Functions

virtual bool handleRadioId (const QList< qint64 > &ids, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the DMR IDs has been parsed.
 
virtual bool handleRadioName (const QString &name, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the radio name has been parsed.
 
virtual bool handleIntroLine1 (const QString &text, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the first intro line has been parsed.
 
virtual bool handleIntroLine2 (const QString &text, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the second intro line has been parsed.
 
virtual bool handleMicLevel (unsigned level, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the MIC level has been parsed.
 
virtual bool handleSpeech (bool speech, qint64 line, qint64 column, QString &errorMessage)
 Gets called once the Speech flag has been parsed.
 
virtual bool handleDTMFContact (qint64 idx, const QString &name, const QString &num, bool rxTone, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a DTMF contact has been parsed.
 
virtual bool handleDigitalContact (qint64 idx, const QString &name, DMRContact::Type type, qint64 id, bool rxTone, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a digital contact has been parsed.
 
virtual bool handleGroupList (qint64 idx, const QString &name, const QList< qint64 > &contacts, qint64 line, qint64 column, QString &errorMessage)
 Gets called once an RX group list has been parsed.
 
virtual bool handleDigitalChannel (qint64 idx, const QString &name, double rx, double tx, Channel::Power power, qint64 scan, qint64 tot, bool ro, DMRChannel::Admit admit, qint64 color, DMRChannel::TimeSlot slot, qint64 gl, qint64 contact, qint64 gps, qint64 roam, qint64 radioID, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a digital channel has been parsed.
 
virtual bool handleAnalogChannel (qint64 idx, const QString &name, double rx, double tx, Channel::Power power, qint64 scan, qint64 aprs, qint64 tot, bool ro, FMChannel::Admit admit, qint64 squelch, const SelectiveCall &rxTone, const SelectiveCall &txTone, FMChannel::Bandwidth bw, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a analog channel has been parsed.
 
virtual bool handleZone (qint64 idx, const QString &name, bool a, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a zone list has been parsed.
 
virtual bool handleGPSSystem (qint64 idx, const QString &name, qint64 contactIdx, qint64 period, qint64 revertChannelIdx, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a GPS system has been parsed.
 
virtual bool handleAPRSSystem (qint64 idx, const QString &name, qint64 channelIdx, qint64 period, const QString &src, unsigned srcSSID, const QString &dest, unsigned destSSID, const QString &path, const QString &icon, const QString &message, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a APRS system has been parsed.
 
virtual bool handleScanList (qint64 idx, const QString &name, qint64 pch1, qint64 pch2, qint64 txch, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a scan list has been parsed.
 
virtual bool handleRoamingZone (qint64 idx, const QString &name, const QList< qint64 > &channels, qint64 line, qint64 column, QString &errorMessage)
 Gets called once a roaming zone list has been parsed.
 
- Public Member Functions inherited from CSVHandler
virtual ~CSVHandler ()
 Destructor.
 

Static Public Member Functions

static bool read (Config *config, QTextStream &stream, QString &errorMessage)
 Reads a config file from stream and stores the read configuration into config.
 

Protected Member Functions

 CSVReader (Config *config, QObject *parent=nullptr)
 Hidden constructor.
 
- Protected Member Functions inherited from CSVHandler
 CSVHandler (QObject *parent=nullptr)
 Hidden constructor.
 

Protected Attributes

bool _link
 If true, the reader is in "link" mode.
 
Config_config
 The configuration to read.
 
QMap< int, Channel * > _channels
 Index <-> Channel map.
 
QMap< int, DMRContact * > _digital_contacts
 Index <-> Digital contact map.
 
QMap< int, RXGroupList * > _rxgroups
 Index <-> RX group list map.
 
QMap< int, Zone * > _zones
 Index <-> Zone map.
 
QMap< int, PositioningSystem * > _posSystems
 Index <-> GPS System map.
 
QMap< int, ScanList * > _scanlists
 Index <-> Scan list map.
 
QMap< int, RoamingZone * > _roamingZones
 Index <-> RoamingZone map.
 
QMap< int, DMRRadioID * > _radioIDs
 Index <-> radio ID map.
 

Detailed Description

Implements the text-file codeplug reader.

Constructor & Destructor Documentation

◆ CSVReader()

CSVReader::CSVReader ( Config * config,
QObject * parent = nullptr )
protected

Hidden constructor.

Consider using the static read method.

Member Function Documentation

◆ handleAnalogChannel()

bool CSVReader::handleAnalogChannel ( qint64 idx,
const QString & name,
double rx,
double tx,
Channel::Power power,
qint64 scan,
qint64 aprs,
qint64 tot,
bool ro,
FMChannel::Admit admit,
qint64 squelch,
const SelectiveCall & rxTone,
const SelectiveCall & txTone,
FMChannel::Bandwidth bw,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a analog channel has been parsed.

Reimplemented from CSVHandler.

◆ handleAPRSSystem()

bool CSVReader::handleAPRSSystem ( qint64 idx,
const QString & name,
qint64 channelIdx,
qint64 period,
const QString & src,
unsigned srcSSID,
const QString & dest,
unsigned destSSID,
const QString & path,
const QString & icon,
const QString & message,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a APRS system has been parsed.

Reimplemented from CSVHandler.

◆ handleDigitalChannel()

bool CSVReader::handleDigitalChannel ( qint64 idx,
const QString & name,
double rx,
double tx,
Channel::Power power,
qint64 scan,
qint64 tot,
bool ro,
DMRChannel::Admit admit,
qint64 color,
DMRChannel::TimeSlot slot,
qint64 gl,
qint64 contact,
qint64 gps,
qint64 roam,
qint64 radioID,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a digital channel has been parsed.

Reimplemented from CSVHandler.

◆ handleDigitalContact()

bool CSVReader::handleDigitalContact ( qint64 idx,
const QString & name,
DMRContact::Type type,
qint64 id,
bool rxTone,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a digital contact has been parsed.

Reimplemented from CSVHandler.

◆ handleDTMFContact()

bool CSVReader::handleDTMFContact ( qint64 idx,
const QString & name,
const QString & num,
bool rxTone,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a DTMF contact has been parsed.

Reimplemented from CSVHandler.

◆ handleGPSSystem()

bool CSVReader::handleGPSSystem ( qint64 idx,
const QString & name,
qint64 contactIdx,
qint64 period,
qint64 revertChannelIdx,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a GPS system has been parsed.

Reimplemented from CSVHandler.

◆ handleGroupList()

bool CSVReader::handleGroupList ( qint64 idx,
const QString & name,
const QList< qint64 > & contacts,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once an RX group list has been parsed.

Reimplemented from CSVHandler.

◆ handleIntroLine1()

bool CSVReader::handleIntroLine1 ( const QString & text,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the first intro line has been parsed.

Reimplemented from CSVHandler.

◆ handleIntroLine2()

bool CSVReader::handleIntroLine2 ( const QString & text,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the second intro line has been parsed.

Reimplemented from CSVHandler.

◆ handleMicLevel()

bool CSVReader::handleMicLevel ( unsigned level,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the MIC level has been parsed.

Reimplemented from CSVHandler.

◆ handleRadioId()

bool CSVReader::handleRadioId ( const QList< qint64 > & ids,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the DMR IDs has been parsed.

Reimplemented from CSVHandler.

◆ handleRadioName()

bool CSVReader::handleRadioName ( const QString & name,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the radio name has been parsed.

Reimplemented from CSVHandler.

◆ handleRoamingZone()

bool CSVReader::handleRoamingZone ( qint64 idx,
const QString & name,
const QList< qint64 > & channels,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a roaming zone list has been parsed.

Reimplemented from CSVHandler.

◆ handleScanList()

bool CSVReader::handleScanList ( qint64 idx,
const QString & name,
qint64 pch1,
qint64 pch2,
qint64 txch,
const QList< qint64 > & channels,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a scan list has been parsed.

Reimplemented from CSVHandler.

◆ handleSpeech()

bool CSVReader::handleSpeech ( bool speech,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once the Speech flag has been parsed.

Reimplemented from CSVHandler.

◆ handleZone()

bool CSVReader::handleZone ( qint64 idx,
const QString & name,
bool a,
const QList< qint64 > & channels,
qint64 line,
qint64 column,
QString & errorMessage )
virtual

Gets called once a zone list has been parsed.

Reimplemented from CSVHandler.

◆ read()

bool CSVReader::read ( Config * config,
QTextStream & stream,
QString & errorMessage )
static

Reads a config file from stream and stores the read configuration into config.

Returns
true on success.

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