5 #include <QAbstractTableModel>
7 #include "configobject.hh"
8 #include "configreference.hh"
9 #include "signaling.hh"
11 #include "opengd77_extension.hh"
12 #include "tyt_extensions.hh"
13 #include "opengd77_extension.hh"
14 #include "anytone_extension.hh"
15 #include "commercial_extension.hh"
50 Q_PROPERTY(
unsigned vox READ
vox WRITE
setVOX SCRIPTABLE
false)
57 Q_CLASSINFO(
"IdPrefix",
"ch")
73 explicit Channel(QObject *parent=
nullptr);
122 unsigned vox()
const;
124 void setVOX(
unsigned level);
244 explicit FMChannel(QObject *parent=
nullptr);
Base class for all analog channels.
Definition: channel.hh:190
AnalogChannel(QObject *parent=nullptr)
Hidden constructor.
Definition: channel.cc:324
Implements the settings extension for DMR channels on AnyTone devices.
Definition: anytone_extension.hh:203
Implements the settings extension for FM channels on AnyTone devices.
Definition: anytone_extension.hh:123
Container class holding all channels (analog and digital) for a specific configuration (Config).
Definition: channel.hh:544
ChannelList(QObject *parent=nullptr)
Constructs an empty channel list.
Definition: channel.cc:959
FMChannel * findFMChannelByTxFreq(double freq) const
Finds an analog channel with the given frequency.
Definition: channel.cc:1001
int add(ConfigObject *obj, int row=-1)
Adds an element to the list.
Definition: channel.cc:966
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:1012
Channel * channel(int idx) const
Gets the channel at the specified index.
Definition: channel.cc:975
DMRChannel * findDMRChannel(double rx, double tx, DMRChannel::TimeSlot ts, unsigned cc) const
Finds a digital channel with the given frequencies, time slot and color code.
Definition: channel.cc:982
The base class of all channels (analog and digital) of a codeplug configuration.
Definition: channel.hh:34
ScanList * scanList() const
Returns the default scan list for the channel.
Definition: channel.cc:195
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:307
void setDefaultTimeout()
Sets the timeout to the global default timeout.
Definition: channel.cc:139
unsigned _txTimeOut
Transmit timeout in seconds.
Definition: channel.hh:172
bool defaultTimeout() const
Returns true if the transmit timeout is specified by the global default value.
Definition: channel.cc:121
ScanListReference * scanListRef
The scan list.
Definition: channel.hh:48
TyTChannelExtension * tyt
The TyT channel extension.
Definition: channel.hh:54
bool _defaultPower
If true, the channel uses the global power setting.
Definition: channel.hh:168
double rxFrequency
The receive frequency of the channel.
Definition: channel.hh:38
bool setTimeout(unsigned dur)
(Re-)Sets the TX timeout (TOT) in seconds.
Definition: channel.cc:133
void setPower(Power power)
(Re-)Sets the power setting of the channel, overrides default power.
Definition: channel.cc:110
unsigned _vox
Holds the VOX level.
Definition: channel.hh:176
Power power
The transmit power.
Definition: channel.hh:42
bool setTXFrequency(double freq)
(Re-)Sets the TX frequency of the channel in MHz.
Definition: channel.cc:95
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition: channel.hh:61
@ Low
Low power setting (e.g., 1W).
@ Mid
Medium power setting (e.g., 2W, if available)
@ High
High power setting (e.g, 5W).
@ Max
Highest power setting (e.g. > 5W, if available).
@ Min
Lowest power setting (e.g., <1W, if available).
ScanListReference * scanListRef()
Returns the reference to the scan list.
TyTChannelExtension * tytChannelExtension() const
Returns the channel extension for TyT devices.
Definition: channel.cc:226
void setTyTChannelExtension(TyTChannelExtension *ext)
Sets the TyT channel extension.
Definition: channel.cc:230
void clear()
Clears the config object.
Definition: channel.cc:63
bool voxDisabled() const
Returns true if the VOX is disabled.
Definition: channel.cc:159
bool populate(YAML::Node &node, const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: channel.cc:243
TyTChannelExtension * _tytChannelExtension
Owns the TyT channel extension object.
Definition: channel.hh:182
OpenGD77ChannelExtension * _openGD77ChannelExtension
Owns the OpenGD77 channel extension object.
Definition: channel.hh:180
void setDefaultPower()
Sets the channel to use the default power setting.
Definition: channel.cc:116
unsigned vox
The VOX setting.
Definition: channel.hh:50
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition: channel.cc:47
void disableTimeout()
Disables the transmit timeout.
Definition: channel.cc:143
double _txFreq
The TX frequency in MHz.
Definition: channel.hh:166
double txFrequency
The transmit frequency of the channel.
Definition: channel.hh:40
bool _rxOnly
RX only flag.
Definition: channel.hh:174
bool rxOnly
If true, the channel is receive only.
Definition: channel.hh:46
bool timeoutDisabled() const
Returns true if the transmit timeout is disabled.
Definition: channel.cc:125
Channel(QObject *parent=nullptr)
Hidden constructor.
Definition: channel.cc:26
bool setRXOnly(bool enable)
Set, whether the channel is RX only.
Definition: channel.cc:152
bool defaultVOX() const
Returns true if the VOX is specified by the global default value.
Definition: channel.cc:163
bool defaultPower() const
Returns true if the channel uses the global default power setting.
Definition: channel.cc:102
double _rxFreq
The RX frequency in MHz.
Definition: channel.hh:164
OpenGD77ChannelExtension * openGD77ChannelExtension() const
Returns the channel extension for the OpenGD77 firmware.
Definition: channel.cc:209
unsigned timeout
The transmit timeout in seconds.
Definition: channel.hh:44
bool setRXFrequency(double freq)
(Re-)Sets the RX frequency of the channel in MHz.
Definition: channel.cc:84
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:273
void disableVOX()
Disables the VOX.
Definition: channel.cc:180
void onReferenceModified()
Gets called whenever a referenced object is changed or deleted.
Definition: channel.cc:204
void setOpenGD77ChannelExtension(OpenGD77ChannelExtension *ext)
Sets the OpenGD77 channel extension.
Definition: channel.cc:213
bool setScanList(ScanList *list)
(Re-) Sets the default scan list for the channel.
Definition: channel.cc:199
void setVOXDefault()
Sets the VOX level to the default value.
Definition: channel.cc:176
ScanListReference _scanlist
Default scan list of the channel.
Definition: channel.hh:178
void setVOX(unsigned level)
Sets the VOX level [0-10].
Definition: channel.cc:171
OpenGD77ChannelExtension * openGD77
The OpenGD77 channel extension.
Definition: channel.hh:52
Power _power
The transmit power setting.
Definition: channel.hh:170
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:48
Base class for all configuration objects (channels, zones, contacts, etc).
Definition: configobject.hh:40
List class for config objects.
Definition: configobject.hh:341
Base class of all labeled and named objects.
Definition: configobject.hh:199
The config class, representing the codeplug configuration.
Definition: config.hh:69
Extension to the DigitalChannel class to implement an DMR channel.
Definition: channel.hh:350
ConfigItem * clone() const
Clones this item.
Definition: channel.cc:678
CommercialChannelExtension * commercial
The commercial channel extension.
Definition: channel.hh:371
void setAnytoneChannelExtension(AnytoneDMRChannelExtension *ext)
Sets the AnyTone DMR channel extension.
Definition: channel.cc:899
void setRadioId(DMRRadioIDReference *ref)
Sets the reference to the radio ID.
Definition: channel.cc:857
DMRRadioID * radioIdObj() const
Returns the radio ID associated with this channel.
Definition: channel.cc:865
bool setTXContactObj(DMRContact *c)
(Re-) Sets the default TX contact for this channel.
Definition: channel.cc:778
TimeSlot
Possible timeslots for digital channels.
Definition: channel.hh:385
void setAdmit(Admit admit)
(Re-)Sets the admit criterion for the channel.
Definition: channel.cc:692
bool setTimeSlot(TimeSlot ts)
(Re-)Sets the time slot for the channel.
Definition: channel.cc:717
GroupListReference * groupList()
Returns a reference to the group list.
void setRoaming(RoamingZoneReference *ref)
Sets the reference to the roaming zone.
Definition: channel.cc:827
RoamingZone * roamingZone() const
Returns the roaming zone associated with this channel or nullptr if not set.
Definition: channel.cc:835
RXGroupList * groupListObj() const
Returns the RX group list for the channel.
Definition: channel.cc:742
TimeSlot timeSlot
The time slot of the channel.
Definition: channel.hh:358
bool setAPRSObj(PositioningSystem *sys)
Associates the GPS System with this channel.
Definition: channel.cc:809
bool setColorCode(unsigned cc)
(Re-)Sets the color code for the channel.
Definition: channel.cc:702
unsigned _colorCode
The channel color code.
Definition: channel.hh:488
AnytoneDMRChannelExtension * _anytoneExtension
Owns the AnyTone DMR channel extension.
Definition: channel.hh:505
GroupListReference * groupList
The rx group list.
Definition: channel.hh:362
Admit
Possible admit criteria of digital channels.
Definition: channel.hh:377
@ Always
No admit criteria, allows one to transmit any time.
@ Free
Transmit only if channel is free.
@ ColorCode
Transmit only if channel is free and matches given color code.
void setCommercialExtension(CommercialChannelExtension *ext)
Sets the commercial channel extension.
Definition: channel.cc:882
DMRContactReference * contact
The tx contact.
Definition: channel.hh:364
PositioningSystemReference * aprs()
Returns a reference to the positioning system.
AnytoneDMRChannelExtension * anytoneChannelExtension() const
Returns the DMR channel extension for AnyTone devices.
Definition: channel.cc:895
DMRRadioIDReference _radioId
Radio ID to use on this channel.
Definition: channel.hh:500
RoamingZoneReference * roaming()
Returns a reference to the roaming zone.
Admit _admit
The admit criterion.
Definition: channel.hh:486
void setAPRS(PositioningSystemReference *ref)
Sets the reference to the positioning system.
Definition: channel.cc:796
bool setRadioIdObj(DMRRadioID *id)
Associates the given radio ID with this channel.
Definition: channel.cc:870
PositioningSystemReference _posSystem
The GPS system.
Definition: channel.hh:496
void setGroupList(GroupListReference *ref)
Sets the reference to the group list.
Definition: channel.cc:734
DMRRadioIDReference * radioId
The radio ID.
Definition: channel.hh:360
unsigned colorCode
The color code of the channel.
Definition: channel.hh:356
CommercialChannelExtension * commercialExtension() const
Returns the extension for commercial features.
Definition: channel.cc:878
void clear()
Clears the config object.
Definition: channel.cc:664
Admit admit
The admit criterion of the channel.
Definition: channel.hh:354
TimeSlot _timeSlot
The time slot for the channel.
Definition: channel.hh:490
GroupListReference _rxGroup
The RX group list for this channel.
Definition: channel.hh:492
RoamingZoneReference * roaming
The roaming zone.
Definition: channel.hh:368
DMRRadioIDReference * radioId()
Returns the reference to the radio ID.
CommercialChannelExtension * _commercialExtension
Owns the commercial channel extension.
Definition: channel.hh:503
bool setRoamingZone(RoamingZone *zone)
Associates the given roaming zone with this channel.
Definition: channel.cc:840
PositioningSystem * aprsObj() const
Returns the GPS system associated with this channel or nullptr if not set.
Definition: channel.cc:804
DMRContactReference _txContact
The default TX contact.
Definition: channel.hh:494
bool setGroupListObj(RXGroupList *rxg)
(Re-)Sets the RX group list for the channel.
Definition: channel.cc:747
DMRContact * txContactObj() const
Returns the default TX contact to call on this channel.
Definition: channel.cc:773
DMRChannel(QObject *parent=nullptr)
Constructs a new empty digital (DMR) channel.
Definition: channel.cc:620
RoamingZoneReference _roaming
Roaming zone for the channel.
Definition: channel.hh:498
void setContact(DMRContactReference *ref)
Sets the reference to the transmit contact.
Definition: channel.cc:765
PositioningSystemReference * aprs
The positioning system.
Definition: channel.hh:366
DMRContactReference * contact()
Returns a reference to the transmit contact.
AnytoneDMRChannelExtension * anytone
The AnyTone DMR channel extension.
Definition: channel.hh:373
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: channel.cc:912
Implements a reference to a radio ID.
Definition: configreference.hh:251
Represents a DMR radio ID within the abstract config.
Definition: radioid.hh:31
Base class of all digital channels.
Definition: channel.hh:331
DigitalChannel(QObject *parent=nullptr)
Hidden constructor.
Definition: channel.cc:604
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition: errorstack.hh:41
Extension to the AnalogChannel class to implement an analog FM channel.
Definition: channel.hh:210
Bandwidth bandwidth
The band width of the channel.
Definition: channel.hh:218
APRSSystem * aprsSystem() const
Returns the APRS system used for this channel or nullptr if disabled.
Definition: channel.cc:481
AnytoneFMChannelExtension * anytoneChannelExtension() const
Returns the FM channel extension for AnyTone devices.
Definition: channel.cc:490
void setSquelchDefault()
Sets the squelch to the global default value.
Definition: channel.cc:426
AnytoneFMChannelExtension * anytone
The AnyTone FM channel extension.
Definition: channel.hh:223
bool setBandwidth(Bandwidth bw)
(Re-)Sets the bandwidth of the analog channel.
Definition: channel.cc:457
unsigned _squelch
Holds the squelch level [0,10].
Definition: channel.hh:312
Admit _admit
Holds the admit criterion.
Definition: channel.hh:310
bool defaultSquelch() const
Returns true if the global default squelch level is used.
Definition: channel.cc:404
Admit admit
The admit criterion of the channel.
Definition: channel.hh:214
unsigned squelch
The squelch level of the channel [1-10].
Definition: channel.hh:216
Bandwidth _bw
The channel bandwidth.
Definition: channel.hh:318
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition: channel.cc:360
Admit
Admit criteria of analog channel.
Definition: channel.hh:228
@ Free
Allow when channel free.
@ Tone
Allow when admit tone is present.
void setAdmit(Admit admit)
(Re-)Sets the admit criterion for the analog channel.
Definition: channel.cc:398
ConfigItem * clone() const
Clones this item.
Definition: channel.cc:372
bool squelchDisabled() const
Returns true if the squelch is disabled.
Definition: channel.cc:408
FMChannel(QObject *parent=nullptr)
Constructs a new empty analog channel.
Definition: channel.cc:341
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:557
YAML::Node serialize(const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: channel.cc:507
void disableSquelch()
Disables the quelch.
Definition: channel.cc:422
bool setSquelch(unsigned squelch)
(Re-)Sets the squelch level [0,10].
Definition: channel.cc:416
bool populate(YAML::Node &node, const Context &context, const ErrorStack &err=ErrorStack())
Recursively serializes the configuration to YAML nodes.
Definition: channel.cc:518
Signaling::Code _txTone
The TX CTCSS tone.
Definition: channel.hh:316
Signaling::Code _rxTone
The RX CTCSS tone.
Definition: channel.hh:314
APRSSystemReference _aprsSystem
A reference to the APRS system used on the channel or nullptr if disabled.
Definition: channel.hh:320
AnytoneFMChannelExtension * _anytoneExtension
Owns the AnyTone FM channel extension.
Definition: channel.hh:323
Bandwidth
Possible bandwidth of an analog channel.
Definition: channel.hh:236
bool setRXTone(Signaling::Code code)
(Re-)Sets the CTCSS/DCS RX tone, SIGNALING_NONE disables the RX tone.
Definition: channel.cc:435
Signaling::Code rxTone() const
Returns the CTCSS/DCS RX tone, SIGNALING_NONE means disabled.
Definition: channel.cc:431
APRSSystemReference * aprs()
Returns the reference to the APRS system.
bool setTXTone(Signaling::Code code)
(Re-)Sets the CTCSS/DCS TX tone, SIGNALING_NONE disables the TX tone.
Definition: channel.cc:446
void clear()
Clears the config object.
Definition: channel.cc:382
void setAPRS(APRSSystemReference *ref)
Sets the APRS system reference.
Definition: channel.cc:474
void setAnytoneChannelExtension(AnytoneFMChannelExtension *ext)
Sets the AnyTone FM channel extension.
Definition: channel.cc:494
void setAPRSSystem(APRSSystem *sys)
Sets the APRS system.
Definition: channel.cc:485
Signaling::Code txTone() const
Returns the CTCSS/DCS TX tone, SIGNALING_NONE means disabled.
Definition: channel.cc:442
APRSSystemReference * aprs
The APRS system.
Definition: channel.hh:220
Implements a reference to a group list.
Definition: configreference.hh:262
Implements the channel extensions for the OpenGD77 radios.
Definition: opengd77_extension.hh:15
Implements a reference to a positioning system.
Definition: configreference.hh:214
Base class of the positioning systems, that is APRS and DMR position reporting system.
Definition: gpssystem.hh:17
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
Internal singleton class representing the "currently selected" channel.
Definition: channel.hh:512
static SelectedChannel * _instance
Holds the channel singleton instance.
Definition: channel.hh:532
virtual ~SelectedChannel()
Destructor.
Definition: channel.cc:934
ConfigItem * clone() const
Clones this item.
Definition: channel.cc:944
bool copy(const ConfigItem &other)
Copies the given item into this one.
Definition: channel.cc:939
static SelectedChannel * get()
Constructs/gets the singleton instance.
Definition: channel.cc:949
SelectedChannel()
Constructs the "selected" channel.
Definition: channel.cc:928
Represents the TyT channel extension.
Definition: tyt_extensions.hh:13
Code
This huge enum lists all possible RX/TX tones that can be associated with analog channels.
Definition: signaling.hh:14