1#ifndef UV390_CODEPLUG_HH
2#define UV390_CODEPLUG_HH
4#include "dm1701_codeplug.hh"
95 virtual unsigned squelch()
const;
130 static constexpr Bit
turnOffFreq() {
return {0x0005, 6}; }
131 static constexpr unsigned int squelch() {
return 0x000f; }
132 static constexpr Bit
power() {
return {0x001e, 0}; }
135 static constexpr Bit
dcdmLeader() {
return {0x001f, 4}; }
156 QString
name()
const;
157 void setName(
const QString &txt);
188 LAST_CALL_AND_HAND_CH = 1,
190 DESIGNED_AND_HAND_CH = 3,
304 virtual bool txMode()
const;
393 struct Limit:
public Element::Limit {
395 static constexpr unsigned int channels() {
return 3000; }
402 static constexpr unsigned int messages() {
return 0x002180; }
403 static constexpr unsigned int channels() {
return 0x110000; }
The base class of all channels (analog and digital) of a codeplug configuration.
Definition channel.hh:34
Power
Specifies the prefix for every ID assigned to every channel during serialization.
Definition channel.hh:61
Base class for all codeplug contexts.
Definition codeplug.hh:291
Represents the abstract base class of all codeplug elements.
Definition codeplug.hh:65
Certain flags passed to CodePlug::encode to control the transfer and encoding of the codeplug.
Definition codeplug.hh:24
The config class, representing the codeplug configuration.
Definition config.hh:70
uint32_t size() const
Returns the total size of the DFU file.
Definition dfufile.cc:52
Extends the common TyTCodeplug::GeneralSettingsElement to implement the DM-1701 specific settings.
Definition dm1701_codeplug.hh:121
Extended zone data for the DM-1701.
Definition dm1701_codeplug.hh:228
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
InCallCriterion
Possible in-call criterions.
Definition tyt_extensions.hh:76
KillTone
Possible kill-tone settings.
Definition tyt_extensions.hh:70
Represents a single channel (analog or digital) within the TyT codeplug.
Definition tyt_codeplug.hh:35
static constexpr unsigned int size()
Returns the size of the element.
Definition tyt_codeplug.hh:81
PrivacyType
Possible privacy types.
Definition tyt_codeplug.hh:51
Base class of all TyT codeplugs.
Definition tyt_codeplug.hh:26
Represents the boot-time settings (selected zone and channels) within the UV390 code-plug.
Definition uv390_codeplug.hh:239
virtual void setChannelIndexB(unsigned idx)
Sets the channel index (within zone) for VFO B.
Definition uv390_codeplug.cc:469
virtual unsigned channelIndexA() const
Returns the channel index (within zone) for VFO A.
Definition uv390_codeplug.cc:456
virtual void setChannelIndexA(unsigned idx)
Sets the channel index (within zone) for VFO A.
Definition uv390_codeplug.cc:460
void clear()
Abstract method to reset the element within the codeplug.
Definition uv390_codeplug.cc:434
virtual ~BootSettingsElement()
Destructor.
Definition uv390_codeplug.cc:429
virtual unsigned channelIndexB() const
Returns the channel index (within zone) for VFO B.
Definition uv390_codeplug.cc:465
virtual unsigned zoneIndex() const
Returns the boot zone index.
Definition uv390_codeplug.cc:447
virtual void setZoneIndex(unsigned idx)
Sets the boot zone index.
Definition uv390_codeplug.cc:451
Extends the TyTCodeplug::ChannelElement for the TyT MD-UV390 and Retevis RT3S.
Definition uv390_codeplug.hh:60
virtual TyTChannelExtension::InCallCriterion inCallCriteria() const
Returns the in-call criterion for this channel.
Definition uv390_codeplug.cc:104
virtual void enableAllowInterrupt(bool enable)
Enables/disables interruption for this channel.
Definition uv390_codeplug.cc:161
virtual void setSquelch(unsigned value)
Sets the squelch level [0-10].
Definition uv390_codeplug.cc:125
virtual TyTChannelExtension::KillTone turnOffFreq() const
Returns the remote turn-off/kill frequency for this channel.
Definition uv390_codeplug.cc:112
virtual void setTurnOffFreq(TyTChannelExtension::KillTone freq)
Sets the remote turn-off/kill frequency for this channel.
Definition uv390_codeplug.cc:116
virtual void enablePrivacySwitch(bool enable)
Enables/disables the privacy switch.
Definition uv390_codeplug.cc:93
virtual bool dcdmLeader() const
Returns true if the radio acts as the leader for this DCDM channel.
Definition uv390_codeplug.cc:175
void enableTalkaround(bool enable)
Enables/disables talkaround for this channel.
Definition uv390_codeplug.cc:84
virtual void fromChannelObj(const Channel *c, Context &ctx)
Initializes this codeplug channel from the given generic configuration.
Definition uv390_codeplug.cc:220
bool talkaround() const
Returns true if the channel has talkaround enabled.
Definition uv390_codeplug.cc:80
virtual void enableDualCapacityDirectMode(bool enable)
Enables/disables dual-capacity direct mode for this channel.
Definition uv390_codeplug.cc:170
virtual Channel * toChannelObj(const ErrorStack &err=ErrorStack()) const
Constructs a generic Channel object from the codeplug channel.
Definition uv390_codeplug.cc:185
virtual void enableDCDMLeader(bool enable)
Enables/disables this radio to be the leader for this DCDM channel.
Definition uv390_codeplug.cc:179
virtual Channel::Power power() const
Returns the power of this channel.
Definition uv390_codeplug.cc:131
virtual void setPower(Channel::Power pwr)
Sets the power of this channel.
Definition uv390_codeplug.cc:141
void clear()
Clears/resets the channel and therefore disables it.
Definition uv390_codeplug.cc:64
virtual bool allowInterrupt() const
Returns true if the channel allows interruption enabled.
Definition uv390_codeplug.cc:157
virtual bool dualCapacityDirectMode() const
Returns true if the channel has dual-capacity direct mode enabled.
Definition uv390_codeplug.cc:166
virtual bool privacySwitch() const
Returns true, if the privacy switch is enabled.
Definition uv390_codeplug.cc:89
virtual void setInCallCriteria(TyTChannelExtension::InCallCriterion crit)
Sets the in-call criterion for this channel.
Definition uv390_codeplug.cc:108
void setPrivacyType(PrivacyType type) override
Overrides TyT basic implementation to enable privacy switch, whenever encryption is enabled for this ...
Definition uv390_codeplug.cc:98
virtual unsigned squelch() const
Returns the squelch level [0-10].
Definition uv390_codeplug.cc:121
Extends the common TyTCodeplug::GeneralSettings to implement the MD-UV390 specific settings.
Definition uv390_codeplug.hh:174
virtual void setMICLevel(unsigned val)
Sets the microphone gain.
Definition uv390_codeplug.cc:380
virtual bool keypadTones() const
Returns true, if keypad tones are enabled.
Definition uv390_codeplug.cc:349
virtual void enableEditRadioID(bool enable)
Enable/disable radio ID editing.
Definition uv390_codeplug.cc:389
virtual bool fromConfig(const Config *config)
Encodes the general settings.
Definition uv390_codeplug.cc:394
virtual void enableKeypadTones(bool enable)
Enables/disables the keypad tones.
Definition uv390_codeplug.cc:353
TransmitMode
Defines all possible transmit modes.
Definition uv390_codeplug.hh:186
virtual unsigned micLevel() const
Returns the microphone gain.
Definition uv390_codeplug.cc:376
virtual void setAdditionalDMRId(unsigned n, uint32_t id)
Sets the n-th DMR id.
Definition uv390_codeplug.cc:371
virtual bool editRadioID() const
If true, radio ID editing is enabled.
Definition uv390_codeplug.cc:385
virtual void enableChannelVoiceAnnounce(bool enable)
Enables/disables the speech synthesis.
Definition uv390_codeplug.cc:344
virtual uint32_t additionalDMRId(unsigned n) const
Returns the n-th DMR id.
Definition uv390_codeplug.cc:367
virtual bool channelVoiceAnnounce() const
Returns true, if the speech synthesis is enabled.
Definition uv390_codeplug.cc:340
void clear()
Abstract method to reset the element within the codeplug.
Definition uv390_codeplug.cc:306
virtual bool updateConfig(Config *config)
Updates config from general settings.
Definition uv390_codeplug.cc:405
virtual void enablePublicZone(bool enable)
Enables/disables public zone.
Definition uv390_codeplug.cc:362
virtual TransmitMode transmitMode() const
Returns the transmit mode.
Definition uv390_codeplug.cc:331
virtual bool publicZone() const
Returns true, if public zone is enabled.
Definition uv390_codeplug.cc:358
virtual void setTransmitMode(TransmitMode mode)
Sets the transmit mode.
Definition uv390_codeplug.cc:335
Implements a VFO channel for TyT radios.
Definition uv390_codeplug.hh:145
virtual void setStepSize(unsigned ss_hz)
Sets the step-size for the VFO channel in Hz.
Definition uv390_codeplug.cc:283
virtual ~VFOChannelElement()
Destructor.
Definition uv390_codeplug.cc:264
QString name() const
Returns the name of this channel.
Definition uv390_codeplug.cc:269
void setName(const QString &txt)
Sets the name of this channel.
Definition uv390_codeplug.cc:273
virtual unsigned stepSize() const
Returns the step-size for the VFO channel.
Definition uv390_codeplug.cc:279
Device specific implementation of the codeplug for the TyT MD-UV390.
Definition uv390_codeplug.hh:51
void clearMenuSettings()
Clears the menu settings in the codeplug.
Definition uv390_codeplug.cc:1026
void clearTextMessages()
Clears all text messages in the codeplug.
Definition uv390_codeplug.cc:1032
bool createChannels(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a channel to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:686
bool createScanLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a scan list to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:887
bool decodePrivacyKeys(Config *config, Context &ctx, const ErrorStack &err)
Decodes the encryption keys.
Definition uv390_codeplug.cc:1007
void clearTimestamp()
Clears the time-stamp in the codeplug.
Definition uv390_codeplug.cc:636
bool linkZones(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added zones within the configuration.
Definition uv390_codeplug.cc:796
void clearScanLists()
Clears all scan lists in the codeplug.
Definition uv390_codeplug.cc:866
bool encodePositioningSystems(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all DMR positioning systems in the configuration into the codeplug.
Definition uv390_codeplug.cc:925
bool createZones(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a zone to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:779
bool createContacts(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a digital contact to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:737
void clear()
Clears and resets the complete codeplug to some default values.
Definition uv390_codeplug.cc:628
bool decodeButtonSetttings(Config *config, const ErrorStack &err=ErrorStack())
Decodes the button settings.
Definition uv390_codeplug.cc:985
bool linkScanLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added scan lists within the configuration.
Definition uv390_codeplug.cc:903
void clearGeneralSettings()
Clears the general settings in the codeplug.
Definition uv390_codeplug.cc:648
void clearGroupLists()
Clears all RX group lists in the codeplug.
Definition uv390_codeplug.cc:817
void clearPrivacyKeys()
Clears all encryption keys in the codeplug.
Definition uv390_codeplug.cc:992
bool encodePrivacyKeys(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err)
Encodes the encryption keys.
Definition uv390_codeplug.cc:997
bool encodeTextMessages(Context &ctx, const Flags &flags, const ErrorStack &err)
Encodes text messages.
Definition uv390_codeplug.cc:1037
bool linkChannels(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added channels within the configuration.
Definition uv390_codeplug.cc:702
bool createGroupLists(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a RX group list to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:836
bool encodeContacts(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all digital contacts in the configuration into the codeplug.
Definition uv390_codeplug.cc:723
void clearChannels()
Clears all channels in the codeplug.
Definition uv390_codeplug.cc:665
virtual void clearBootSettings()
Resets the boot setting, e.g.
Definition uv390_codeplug.cc:1021
bool encodeScanLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all scan lists in the configuration into the codeplug.
Definition uv390_codeplug.cc:873
void clearPositioningSystems()
Clears all positioning systems in the codeplug.
Definition uv390_codeplug.cc:918
bool encodeGroupLists(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all group lists in the configuration into the codeplug.
Definition uv390_codeplug.cc:823
virtual ~UV390Codeplug()
Destructor.
Definition uv390_codeplug.cc:623
DM1701Codeplug::ZoneExtElement ZoneExtElement
Reuse zone extension from DM1701.
Definition uv390_codeplug.hh:166
virtual void clearVFOSettings()
Clears the VFO A & B.
Definition uv390_codeplug.cc:1055
bool encodeZones(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all zones in the configuration into the codeplug.
Definition uv390_codeplug.cc:762
void clearEmergencySystems()
Clears all emergency systems in the codeplug.
Definition uv390_codeplug.cc:1048
bool createPositioningSystems(Config *config, Context &ctx, const ErrorStack &err=ErrorStack())
Adds a GPS positioning system to the configuration for each one in the codeplug.
Definition uv390_codeplug.cc:941
bool decodeTextMessages(Context &ctx, const ErrorStack &err)
Decodes text messages.
Definition uv390_codeplug.cc:1042
bool decodeGeneralSettings(Config *config, const ErrorStack &err=ErrorStack())
Updates the given configuration from the general settings.
Definition uv390_codeplug.cc:659
bool encodeTimestamp()
Sets the time-stamp.
Definition uv390_codeplug.cc:641
bool encodeChannels(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes all channels in the configuration into the codeplug.
Definition uv390_codeplug.cc:672
void clearZones()
Clears all zones in the codeplug.
Definition uv390_codeplug.cc:753
bool encodeGeneralSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Updates the general settings from the given configuration.
Definition uv390_codeplug.cc:653
bool linkGroupLists(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added RX group lists within the configuration.
Definition uv390_codeplug.cc:852
bool linkPositioningSystems(Context &ctx, const ErrorStack &err=ErrorStack())
Links all added positioning systems within the configuration.
Definition uv390_codeplug.cc:958
bool encodeButtonSettings(Config *config, const Flags &flags, Context &ctx, const ErrorStack &err=ErrorStack())
Encodes the button settings.
Definition uv390_codeplug.cc:978
void clearButtonSettings()
Clears the button settings in the codeplug.
Definition uv390_codeplug.cc:973
void clearContacts()
Clears all contacts in the codeplug.
Definition uv390_codeplug.cc:716
Some internal offsets within the element.
Definition tyt_codeplug.hh:270
Some internal offsets.
Definition uv390_codeplug.hh:126
Some limits for the codeplug.
Definition uv390_codeplug.hh:393
static constexpr unsigned int channels()
Number of channels.
Definition uv390_codeplug.hh:395
Some internal offsets within the codeplug.
Definition uv390_codeplug.hh:400