5#include <QAbstractTableModel>
7#include "configobject.hh"
8#include "configreference.hh"
13#include "channel_extension.hh"
14#include "opengd77_extension.hh"
15#include "tyt_extensions.hh"
16#include "opengd77_extension.hh"
17#include "anytone_extension.hh"
18#include "commercial_extension.hh"
60 Q_CLASSINFO(
"IdPrefix",
"ch")
83 explicit Channel(QObject *parent=
nullptr);
287 Q_INVOKABLE
explicit FMChannel(QObject *parent=
nullptr);
365 Q_INVOKABLE
explicit AMChannel(QObject *parent=
nullptr);
369 void clear()
override;
447 Q_INVOKABLE
explicit DMRChannel(QObject *parent=
nullptr);
void clear() override
Clears the config object.
Definition channel.cc:589
bool copy(const ConfigItem &other) override
Copies the given item into this one.
Definition channel.cc:571
Q_INVOKABLE AMChannel(QObject *parent=nullptr)
Constructs a new empty AM channel.
Definition channel.cc:563
ConfigItem * clone() const override
Clones this item.
Definition channel.cc:579
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack()) override
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition channel.cc:606
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack()) override
Recursively serializes the configuration to YAML nodes.
Definition channel.cc:595
bool squelchDisabled() const
Returns true if the squelch is disabled.
Definition channel.cc:370
Level _squelch
Squelch.
Definition channel.hh:237
Level squelch
Specifies the squelch level for the channel.
Definition channel.hh:210
AnalogChannel(QObject *parent=nullptr)
Hidden constructor.
Definition channel.cc:351
void disableSquelch()
Disables the quelch.
Definition channel.cc:386
bool defaultSquelch() const
Returns true if the global default squelch level is used.
Definition channel.cc:366
void setSquelchDefault()
Sets the squelch to the global default value.
Definition channel.cc:390
bool setSquelch(Level squelch)
(Re-)Sets the squelch level [0,10].
Definition channel.cc:378
Implements the settings extension for DMR channels on AnyTone devices.
Definition anytone_extension.hh:204
Implements the settings extension for FM channels on AnyTone devices.
Definition anytone_extension.hh:133
ChannelList(QObject *parent=nullptr)
Constructs an empty channel list.
Definition channel.cc:930
int add(ConfigObject *obj, int row=-1, bool unique=true)
Adds an element to the list.
Definition channel.cc:937
ConfigItem * allocateChild(const YAML::Node &node, ConfigItem::Context &ctx, const ErrorStack &err=ErrorStack())
Allocates a member objects for the given YAML node.
Definition channel.cc:982
Channel * channel(int idx) const
Gets the channel at the specified index.
Definition channel.cc:946
DMRChannel * findDMRChannel(Frequency rx, Frequency tx, DMRChannel::TimeSlot ts, unsigned cc) const
Finds a digital channel with the given frequencies, time slot and color code.
Definition channel.cc:953
FMChannel * findFMChannelByTxFreq(Frequency freq) const
Finds an analog channel with the given frequency.
Definition channel.cc:971
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:37
ScanList * scanList() const
Returns the default scan list for the channel.
Definition channel.cc:246
bool link(const YAML::Node &node, const Context &ctx, const ErrorStack &err=ErrorStack())
Links the given object to the rest of the codeplug using the given context.
Definition channel.cc:334
void setDefaultTimeout()
Sets the timeout to the global default timeout.
Definition channel.cc:182
Interval timeout
The transmit timeout in seconds.
Definition channel.hh:47
FrequencyOffset offsetFrequency() const
Returns the offset between tx and rx frequency of the channel in Hz.
Definition channel.cc:110
bool defaultTimeout() const
Returns true if the transmit timeout is specified by the global default value.
Definition channel.cc:156
ScanListReference * scanListRef
The scan list.
Definition channel.hh:51
TyTChannelExtension * tyt
The TyT channel extension.
Definition channel.hh:57
bool _defaultPower
If true, the channel uses the global power setting.
Definition channel.hh:182
Frequency _txFreq
The TX frequency in Hz.
Definition channel.hh:180
void setPower(Power power)
(Re-)Sets the power setting of the channel, overrides default power.
Definition channel.cc:137
Power power
The transmit power.
Definition channel.hh:45
OffsetShift offsetShift() const
Returns direction of offset if any.
Definition channel.cc:116
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition channel.hh:64
@ Low
Low power setting (e.g., 1W).
Definition channel.hh:68
@ Mid
Medium power setting (e.g., 2W, if available).
Definition channel.hh:67
@ High
High power setting (e.g, 5W).
Definition channel.hh:66
@ Max
Highest power setting (e.g. > 5W, if available).
Definition channel.hh:65
@ Min
Lowest power setting (e.g., <1W, if available).
Definition channel.hh:69
OffsetShift
Definition channel.hh:73
@ Positive
Positive offset between TX/RX frequencies.
Definition channel.hh:75
@ None
No Offset between TX/RX frequencies.
Definition channel.hh:74
@ Negative
Negative offset between TX/RX frequencies.
Definition channel.hh:76
TyTChannelExtension * tytChannelExtension() const
Returns the channel extension for TyT devices.
Definition channel.cc:277
void setTyTChannelExtension(TyTChannelExtension *ext)
Sets the TyT channel extension.
Definition channel.cc:281
void clear()
Clears the config object.
Definition channel.cc:61
bool voxDisabled() const
Returns true if the VOX is disabled.
Definition channel.cc:208
bool populate(YAML::Node &node, const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition channel.cc:294
TyTChannelExtension * _tytChannelExtension
Owns the TyT channel extension object.
Definition channel.hh:197
OpenGD77ChannelExtension * _openGD77ChannelExtension
Owns the OpenGD77 channel extension object.
Definition channel.hh:195
void setDefaultPower()
Sets the channel to use the default power setting.
Definition channel.cc:146
Interval _txTimeOut
Transmit timeout.
Definition channel.hh:187
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition channel.cc:45
void disableTimeout()
Disables the transmit timeout.
Definition channel.cc:191
bool _rxOnly
RX only flag.
Definition channel.hh:189
bool rxOnly
If true, the channel is receive only.
Definition channel.hh:49
bool timeoutDisabled() const
Returns true if the transmit timeout is disabled.
Definition channel.cc:161
void setVOX(Level level)
Sets the VOX level [0-10].
Definition channel.cc:220
Channel(QObject *parent=nullptr)
Hidden constructor.
Definition channel.cc:18
ScanListReference * scanListRef()
Returns the reference to the scan list.
bool setRXOnly(bool enable)
Set, whether the channel is RX only.
Definition channel.cc:201
bool defaultVOX() const
Returns true if the VOX is specified by the global default value.
Definition channel.cc:212
bool defaultPower() const
Returns true if the channel uses the global default power setting.
Definition channel.cc:127
Frequency rxFrequency
The receive frequency of the channel in Hz.
Definition channel.hh:41
OpenGD77ChannelExtension * openGD77ChannelExtension() const
Returns the channel extension for the OpenGD77 firmware.
Definition channel.cc:260
bool setTXFrequency(Frequency freq)
(Re-)Sets the TX frequency of the channel in Hz.
Definition channel.cc:99
Level vox
The VOX setting.
Definition channel.hh:53
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition channel.cc:310
void disableVOX()
Disables the VOX.
Definition channel.cc:231
void onReferenceModified()
Gets called whenever a referenced object is changed or deleted.
Definition channel.cc:255
Frequency _rxFreq
The RX frequency in Hz.
Definition channel.hh:178
void setOpenGD77ChannelExtension(OpenGD77ChannelExtension *ext)
Sets the OpenGD77 channel extension.
Definition channel.cc:264
bool setScanList(ScanList *list)
(Re-) Sets the default scan list for the channel.
Definition channel.cc:250
bool setTimeout(const Interval &dur)
(Re-)Sets the TX timeout (TOT) in seconds.
Definition channel.cc:171
Level _vox
Holds the VOX level.
Definition channel.hh:191
bool setRXFrequency(Frequency freq)
(Re-)Sets the RX frequency of the channel in Hz.
Definition channel.cc:83
void setVOXDefault()
Sets the VOX level to the default value.
Definition channel.cc:227
ScanListReference _scanlist
Default scan list of the channel.
Definition channel.hh:193
OpenGD77ChannelExtension * openGD77
The OpenGD77 channel extension.
Definition channel.hh:55
Frequency txFrequency
The transmit frequency of the channel in Hz.
Definition channel.hh:43
Power _power
The transmit power setting.
Definition channel.hh:184
Implements the generic extension for all channels configuring commercial features of DMR.
Definition commercial_extension.hh:35
Parse context for config objects.
Definition configobject.hh:43
Base class for all configuration objects (channels, zones, contacts, etc).
Definition configobject.hh:35
ConfigItem(QObject *parent=nullptr)
Hidden constructor.
Definition configobject.cc:158
ConfigObjectList(const QMetaObject &elementTypes=ConfigItem::staticMetaObject, QObject *parent=nullptr)
Hidden constructor.
Definition configobject.cc:1511
Base class of all labeled and named objects.
Definition configobject.hh:192
ConfigObject(QObject *parent=nullptr)
Specifies the prefix for every ID assigned to every object during serialization.
Definition configobject.cc:1141
The config class, representing the codeplug configuration.
Definition config.hh:70
Common DMR channel extended settings.
Definition channel_extension.hh:64
Extension to the DigitalChannel class to implement an DMR channel.
Definition channel.hh:402
DMRChannelExtension * extended
The extended dmr channel settings.
Definition channel.hh:423
ConfigItem * clone() const
Clones this item.
Definition channel.cc:682
CommercialChannelExtension * commercial
The commercial channel extension.
Definition channel.hh:425
void setAnytoneChannelExtension(AnytoneDMRChannelExtension *ext)
Sets the AnyTone DMR channel extension.
Definition channel.cc:870
TimeSlot
Possible timeslots for digital channels.
Definition channel.hh:439
@ TS2
Time/repeater slot 2.
Definition channel.hh:441
@ TS1
Time/repeater slot 1.
Definition channel.hh:440
const GroupListReference * groupListRef() const
Returns a reference to the group list.
Definition channel.cc:728
void setAdmit(Admit admit)
(Re-)Sets the admit criterion for the channel.
Definition channel.cc:696
bool setTimeSlot(TimeSlot ts)
(Re-)Sets the time slot for the channel.
Definition channel.cc:721
const RoamingZoneReference * roamingRef() const
Returns a reference to the roamingRef zone.
Definition channel.cc:797
const DMRContactReference * contactRef() const
Returns a reference to the transmit contactRef.
Definition channel.cc:751
bool setRadioId(DMRRadioID *id)
Associates the given radio ID with this channel.
Definition channel.cc:834
bool setContact(DMRContact *c)
(Re-) Sets the default TX contact for this channel.
Definition channel.cc:766
TimeSlot timeSlot
The time slot of the channel.
Definition channel.hh:410
bool setColorCode(unsigned cc)
(Re-)Sets the color code for the channel.
Definition channel.cc:706
PositioningSystemReference * aprs
The positioning system.
Definition channel.hh:418
unsigned _colorCode
The channel color code.
Definition channel.hh:533
AnytoneDMRChannelExtension * _anytoneExtension
Owns the AnyTone DMR channel extension.
Definition channel.hh:552
Admit
Possible admit criteria of digital channels.
Definition channel.hh:431
@ Always
No admit criteria, allows one to transmit any time.
Definition channel.hh:432
@ Free
Transmit only if channel is free.
Definition channel.hh:433
@ ColorCode
Transmit if channel is free or differs given color code.
Definition channel.hh:434
void setCommercialExtension(CommercialChannelExtension *ext)
Sets the commercial channel extension.
Definition channel.cc:853
AnytoneDMRChannelExtension * anytoneChannelExtension() const
Returns the DMR channel extension for AnyTone devices.
Definition channel.cc:866
DMRRadioIDReference _radioId
Radio ID to use on this channel.
Definition channel.hh:545
Admit _admit
The admit criterion.
Definition channel.hh:531
const DMRRadioIDReference * radioIdRef() const
Returns the reference to the radio ID.
Definition channel.cc:819
PositioningSystemReference _posSystem
The GPS system.
Definition channel.hh:541
DMRChannelExtension * _extended
Owns the extended channel extension.
Definition channel.hh:548
GroupListReference * groupList
The rx group list.
Definition channel.hh:414
RoamingZoneReference * roaming
The roaming zone.
Definition channel.hh:420
DMRContactReference * contact
The tx contact.
Definition channel.hh:416
unsigned colorCode
The color code of the channel.
Definition channel.hh:408
CommercialChannelExtension * commercialExtension() const
Returns the extension for commercial features.
Definition channel.cc:849
void clear()
Clears the config object.
Definition channel.cc:668
Admit admit
The admit criterion of the channel.
Definition channel.hh:406
TimeSlot _timeSlot
The time slot for the channel.
Definition channel.hh:535
GroupListReference _rxGroup
The RX group list for this channel.
Definition channel.hh:537
bool setAPRS(PositionReportingSystem *sys)
Associates the GPS System with this channel.
Definition channel.cc:789
bool setRoaming(RoamingZone *zone)
Associates the given roaming zone with this channel.
Definition channel.cc:812
CommercialChannelExtension * _commercialExtension
Owns the commercial channel extension.
Definition channel.hh:550
const PositioningSystemReference * aprsRef() const
Returns a reference to the positioning system.
Definition channel.cc:774
DMRContactReference _txContact
The default TX contact.
Definition channel.hh:539
Q_INVOKABLE DMRChannel(QObject *parent=nullptr)
Constructs a new empty digital (DMR) channel.
Definition channel.cc:642
RoamingZoneReference _roaming
Roaming zone for the channel.
Definition channel.hh:543
bool setGroupList(RXGroupList *rxg)
(Re-)Sets the RX group list for the channel.
Definition channel.cc:743
DMRRadioIDReference * radioId
The radio ID.
Definition channel.hh:412
AnytoneDMRChannelExtension * anytone
The AnyTone DMR channel extension.
Definition channel.hh:427
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition channel.cc:883
Implements a reference to a radio ID.
Definition configreference.hh:251
Represents a DMR radio ID within the abstract config.
Definition radioid.hh:33
DigitalChannel(QObject *parent=nullptr)
Hidden constructor.
Definition channel.cc:626
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
Common FM channel extended settings.
Definition channel_extension.hh:37
Extension to the AnalogChannel class to implement an analog FM channel.
Definition channel.hh:249
FMChannelExtension * _extended
Owns the extended settings.
Definition channel.hh:346
Bandwidth bandwidth
The band width of the channel.
Definition channel.hh:259
AnytoneFMChannelExtension * anytoneChannelExtension() const
Returns the FM channel extension for AnyTone devices.
Definition channel.cc:515
AnytoneFMChannelExtension * anytone
The AnyTone FM channel extension.
Definition channel.hh:266
bool setBandwidth(Bandwidth bw)
(Re-)Sets the bandwidth of the analog channel.
Definition channel.cc:482
SelectiveCall txTone
The TX tone (CTCSS/DSC).
Definition channel.hh:257
Admit _admit
Holds the admit criterion.
Definition channel.hh:336
Admit admit
The admit criterion of the channel.
Definition channel.hh:253
SelectiveCall rxTone
The RX tone (CTCSS/DSC).
Definition channel.hh:255
Bandwidth _bw
The channel bandwidth.
Definition channel.hh:342
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition channel.cc:412
Admit
Admit criteria of analog channel.
Definition channel.hh:271
@ Always
Allow always.
Definition channel.hh:272
@ Free
Allow when channel free.
Definition channel.hh:273
@ Tone
Allow when free or wrong ctcss/dcs tone is present.
Definition channel.hh:274
void setAdmit(Admit admit)
(Re-)Sets the admit criterion for the analog channel.
Definition channel.cc:450
ConfigItem * clone() const
Clones this item.
Definition channel.cc:424
SelectiveCall _rxTone
The RX CTCSS/DCS setting.
Definition channel.hh:338
const FMAPRSSystemReference * aprsRef() const
Returns the reference to the APRS system.
Definition channel.cc:489
Q_INVOKABLE FMChannel(QObject *parent=nullptr)
Constructs a new empty analog channel.
Definition channel.cc:400
bool setTXTone(SelectiveCall code)
(Re-)Sets the CTCSS/DCS TX tone, SIGNALING_NONE disables the TX tone.
Definition channel.cc:471
bool parse(const YAML::Node &node, Context &ctx, const ErrorStack &err=ErrorStack())
Parses the given YAML node, updates the given object and updates the given context (IDs).
Definition channel.cc:543
SelectiveCall _txTone
The TX CTCSS/DCS setting.
Definition channel.hh:340
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition channel.cc:532
void setAPRS(FMAPRSSystem *sys)
Sets the APRS system.
Definition channel.cc:503
AnytoneFMChannelExtension * _anytoneExtension
Owns the AnyTone FM channel extension.
Definition channel.hh:348
Bandwidth
Possible bandwidth of an analog channel.
Definition channel.hh:279
@ Narrow
Narrow bandwidth (12.5kHz).
Definition channel.hh:280
@ Wide
Wide bandwidth (25kHz).
Definition channel.hh:281
bool setRXTone(SelectiveCall code)
(Re-)Sets the CTCSS/DCS RX tone, SIGNALING_NONE disables the RX tone.
Definition channel.cc:460
FMChannelExtension * extended
Common extended channel settings.
Definition channel.hh:264
void clear()
Clears the config object.
Definition channel.cc:434
FMAPRSSystemReference _aprsSystem
A reference to the APRS system used on the channel or nullptr if disabled.
Definition channel.hh:344
void setAnytoneChannelExtension(AnytoneFMChannelExtension *ext)
Sets the AnyTone FM channel extension.
Definition channel.cc:519
FMAPRSSystemReference * aprs
The APRS system.
Definition channel.hh:261
Implements a reference to a group list.
Definition configreference.hh:262
Represents a time interval.
Definition interval.hh:11
Some simple class implementing a [1-10] level setting.
Definition level.hh:15
Implements the channel extensions for the OpenGD77 radios.
Definition opengd77_extension.hh:17
Base class of the position reporting systems, that is APRS and DMR position reporting system.
Definition gpssystem.hh:17
Implements a reference to a positioning system.
Definition configreference.hh:214
Generic representation of a RX group list.
Definition rxgrouplist.hh:14
Implements a reference to a roaming zone.
Definition configreference.hh:273
Represents a RoamingZone within the abstract device configuration.
Definition roamingzone.hh:15
Implements a reference to a scan list.
Definition configreference.hh:203
Generic representation of a scan list.
Definition scanlist.hh:15
static SelectedChannel * _instance
Holds the channel singleton instance.
Definition channel.hh:580
virtual ~SelectedChannel()
Destructor.
Definition channel.cc:905
ConfigItem * clone() const
Clones this item.
Definition channel.cc:915
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition channel.cc:910
static SelectedChannel * get()
Constructs/gets the singleton instance.
Definition channel.cc:920
SelectedChannel()
Constructs the "selected" channel.
Definition channel.cc:899
Represents the TyT channel extension.
Definition tyt_extensions.hh:15
Helper type to represent frequency differences aka offsets.
Definition frequency.hh:69
Helper type to encode frequencies without any rounding error.
Definition frequency.hh:107
Encodes a selective call.
Definition signaling.hh:13