Skip to content

Commit

Permalink
Merge branch 'master' into i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
hmatuschek committed Jan 3, 2025
2 parents 613df64 + 36f9260 commit 624e91d
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 115 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0.0)
project(qdmr VERSION 0.12.0)
project(qdmr VERSION 0.12.1)

set(RELEASE_SUFFIX "")

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ A more [detailed list](https://dm3mat.darc.de/qdmr/#dev) is also available.
## Questions?

* If you find any bugs or have suggestions to improve qdmr, consider [opening an issue](https://github.com/hmatuschek/qdmr/issues/new) or participate in one of the [discussions](https://github.com/hmatuschek/qdmr/discussions).
* If you want to help translating qdmr in your language, checkout [qdmr's weblate project](https://translate.codeberg.org/projects/qdmr/graphical-user-interface/).
* There is also a *Matrix* chat at [#qdmr:darc.de](https://matrix.to/#/#qdmr:darc.de).
* You can also follow me at [mastodon](https://mastodon.radio/@dm3mat), where I usually announce new releases.

Expand All @@ -46,13 +47,15 @@ tools, that make your day-to-day useage of *qdmr* easier, by providing features,
qdmr or dmrconf.

* **[dmrfill](https://github.com/jancona/dmrfill)** -- Automatically extemds a qdmr YAML file with repeaters from a selected region. Get them all with one single command.

* **[anytone-emu](https://github.com/dmr-tools/anytone-emu)** -- A tool for emulating radios, reverse engineering and documenting codeplugs. Also generates some [codeplug documentation](https://dmr-tools.github.io/codeplugs/).


## Releases
<a href="https://repology.org/project/qdmr/versions">
<img src="https://repology.org/badge/vertical-allrepos/qdmr.svg" alt="Packaging status" align="right">
</a>

* **[Version 0.12.1](https://github.com/hmatuschek/qdmr/releases/tag/v0.12.1)** -- Updated support for OpenGD77.
* **[Version 0.12.0](https://github.com/hmatuschek/qdmr/releases/tag/v0.12.0)** -- Added support BTech DR-1801UV (A6, still unstable) and Radioddity GD-73.
* **[Version 0.11.3](https://github.com/hmatuschek/qdmr/releases/tag/v0.11.3)** -- Added proper support for BTech DMR-6X2UV, device specific settings for AnyTone devices, some bugfixes.
* **[Version 0.10.4](https://github.com/hmatuschek/qdmr/releases/tag/v0.10.4)** -- Added support for BTech DM1701, some bugfixes.
Expand Down
8 changes: 0 additions & 8 deletions doc/manual/codeplug/opengd77/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@
firmware.
</para>

<note>
<para>
The OpenGD77 codeplug is a specialization of the GD77 codeplug. Consequently
all extensions described in <xref linkend="extRadioddity"/> are also applicable to the OpenGD77
codeplug.
</para>
</note>

<xi:include href="channel.xml"/>
<xi:include href="contact.xml"/>

Expand Down
6 changes: 3 additions & 3 deletions doc/manual/manual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@

<xi:include href="meta/authors.xml"/>

<date>August 15th, 2023</date>
<date>January 2nd, 2025</date>

<copyright>
<year>2022-2024</year>
<year>2022-2025</year>
<holder>Hannes Matuschek</holder>
</copyright>

<releaseinfo>
<para>
This document covers <application>qdmr</application> version 0.12.0.
This document covers <application>qdmr</application> version 0.12.1.
</para>
</releaseinfo>

Expand Down
77 changes: 59 additions & 18 deletions lib/opengd77base_codeplug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,30 @@ OpenGD77BaseCodeplug::ChannelElement::~ChannelElement() {
void
OpenGD77BaseCodeplug::ChannelElement::clear() {
setName("");
setRXFrequency(0);
setTXFrequency(0);
setRXFrequency(Frequency());
setTXFrequency(Frequency());
setMode(MODE_ANALOG);
setPower(Channel::Power::High);
clearFixedPosition();
setRXTone(SelectiveCall());
setTXTone(SelectiveCall());
setColorCode(0);
setGroupListIndex(0);
enableSimplex(false);
enablePowerSave(false);
enableBeep(false);
clearDMRId();

setGroupListIndex(0);
setColorCode(0);
clearAPRSIndex();
clearTXContact();
setAliasTimeSlot1(OpenGD77ChannelExtension::TalkerAlias::None);
setAliasTimeSlot2(OpenGD77ChannelExtension::TalkerAlias::None);
setTimeSlot(DMRChannel::TimeSlot::TS1);
setBandwidth(FMChannel::Bandwidth::Narrow);
enableRXOnly(false);
enableSkipScan(false);
enableSkipZoneScan(false);
enableVOX(false);
setSquelch(SquelchMode::Global, 0);
}


Expand All @@ -105,25 +120,25 @@ OpenGD77BaseCodeplug::ChannelElement::setName(const QString &n) {
}


uint32_t
Frequency
OpenGD77BaseCodeplug::ChannelElement::rxFrequency() const {
return getBCD8_le(Offset::rxFrequency())*10;
return Frequency::fromHz(((unsigned long long)getBCD8_le(Offset::rxFrequency()))*10);
}

void
OpenGD77BaseCodeplug::ChannelElement::setRXFrequency(uint32_t freq) {
setBCD8_le(Offset::rxFrequency(), freq/10);
OpenGD77BaseCodeplug::ChannelElement::setRXFrequency(const Frequency &freq) {
setBCD8_le(Offset::rxFrequency(), freq.inHz()/10);
}


uint32_t
Frequency
OpenGD77BaseCodeplug::ChannelElement::txFrequency() const {
return getBCD8_le(Offset::txFrequency())*10;
return Frequency::fromHz(((unsigned long long)getBCD8_le(Offset::txFrequency()))*10);
}

void
OpenGD77BaseCodeplug::ChannelElement::setTXFrequency(uint32_t freq) {
setBCD8_le(Offset::txFrequency(), freq/10);
OpenGD77BaseCodeplug::ChannelElement::setTXFrequency(const Frequency &freq) {
setBCD8_le(Offset::txFrequency(), freq.inHz()/10);
}


Expand Down Expand Up @@ -351,6 +366,27 @@ OpenGD77BaseCodeplug::ChannelElement::clearAPRSIndex() {
}


bool
OpenGD77BaseCodeplug::ChannelElement::hasTXContact() const {
return 0 != getUInt16_le(Offset::txContact());
}

unsigned int
OpenGD77BaseCodeplug::ChannelElement::txContactIndex() const {
return getUInt16_le(Offset::txContact()) - 1;
}

void
OpenGD77BaseCodeplug::ChannelElement::setTXContactIndex(unsigned int index) {
setUInt16_le(Offset::txContact(), index+1);
}

void
OpenGD77BaseCodeplug::ChannelElement::clearTXContact() {
setUInt16_le(Offset::txContact(), 0);
}


OpenGD77ChannelExtension::TalkerAlias
OpenGD77BaseCodeplug::ChannelElement::aliasTimeSlot1() const {
switch ((Alias) getUInt2(Offset::aliasTimeSlot1())) {
Expand Down Expand Up @@ -500,11 +536,11 @@ OpenGD77BaseCodeplug::ChannelElement::decode(Codeplug::Context &ctx, const Error

// Apply common settings
ch->setName(name());
ch->setRXFrequency(Frequency::fromHz(rxFrequency()));
ch->setRXFrequency(rxFrequency());
if (isSimplex())
ch->setTXFrequency(Frequency::fromHz(rxFrequency()));
ch->setTXFrequency(rxFrequency());
else
ch->setTXFrequency(Frequency::fromHz(txFrequency()));
ch->setTXFrequency(txFrequency());
if (globalPower())
ch->setDefaultPower();
else
Expand Down Expand Up @@ -539,6 +575,8 @@ OpenGD77BaseCodeplug::ChannelElement::link(Channel *c, Context &ctx, const Error
DMRChannel *dc = c->as<DMRChannel>();
if (hasGroupList() && ctx.has<RXGroupList>(groupListIndex()))
dc->setGroupListObj(ctx.get<RXGroupList>(groupListIndex()));
if (hasTXContact() && ctx.has<DMRContact>(txContactIndex()))
dc->setTXContactObj(ctx.get<DMRContact>(txContactIndex()));
if (hasDMRId()) {
auto id = ctx.config()->radioIDs()->find(dmrId());
if (nullptr == id) {
Expand Down Expand Up @@ -568,8 +606,8 @@ OpenGD77BaseCodeplug::ChannelElement::encode(const Channel *c, Context &ctx, con

setName(c->name());

setRXFrequency(c->rxFrequency().inHz());
setTXFrequency(c->txFrequency().inHz());
setRXFrequency(c->rxFrequency());
setTXFrequency(c->txFrequency());
enableSimplex(false);

clearPower();
Expand Down Expand Up @@ -597,8 +635,11 @@ OpenGD77BaseCodeplug::ChannelElement::encode(const Channel *c, Context &ctx, con
setMode(MODE_DIGITAL);
setTimeSlot(dc->timeSlot());
setColorCode(dc->colorCode());
// OpenGD77 does not allow for both TX contact and group list, select one, prefer group list
if (dc->groupListObj())
setGroupListIndex(ctx.index(dc->groupListObj()));
else if (dc->txContactObj())
setTXContactIndex(ctx.index(dc->txContactObj()));
if (dc->radioIdObj() != ctx.config()->settings()->defaultId())
setDMRId(dc->radioIdObj()->number());
} else {
Expand Down
20 changes: 15 additions & 5 deletions lib/opengd77base_codeplug.hh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ public:
virtual void setName(const QString &n);

/** Returns the RX frequency of the channel. */
virtual uint32_t rxFrequency() const;
virtual Frequency rxFrequency() const;
/** Sets the RX frequency of the channel. */
virtual void setRXFrequency(uint32_t freq);
virtual void setRXFrequency(const Frequency &freq);
/** Returns the TX frequency of the channel. */
virtual uint32_t txFrequency() const;
virtual Frequency txFrequency() const;
/** Sets the TX frequency of the channel. */
virtual void setTXFrequency(uint32_t freq);
virtual void setTXFrequency(const Frequency &freq);

/** Returns the channel mode. */
virtual Mode mode() const;
Expand Down Expand Up @@ -161,6 +161,15 @@ public:
/** Resets the APRS system index. */
virtual void clearAPRSIndex();

/** Returns @c true, if the TX contact is set. */
virtual bool hasTXContact() const;
/** Returns the TX contact index. */
virtual unsigned int txContactIndex() const;
/** Sets the TX contact index. */
virtual void setTXContactIndex(unsigned int index);
/** Clears the TX contact index. */
virtual void clearTXContact();

/** Returns the alias transmitted on time slot 1. */
virtual OpenGD77ChannelExtension::TalkerAlias aliasTimeSlot1() const;
/** Sets the alias transmitted on time slot 1. */
Expand Down Expand Up @@ -237,7 +246,7 @@ public:
static constexpr unsigned int rxTone() { return 0x0020; }
static constexpr unsigned int txTone() { return 0x0022; }
static constexpr unsigned int longitude2() { return 0x0024; }
static constexpr Bit simplex() { return {0x0026, 3}; }
static constexpr Bit simplex() { return {0x0026, 2}; }
static constexpr Bit useFixedLocation() { return {0x0026, 3}; }
static constexpr Bit disablePowerSave() { return {0x0026, 5}; }
static constexpr Bit disableBeep() { return {0x0026, 6}; }
Expand All @@ -246,6 +255,7 @@ public:
static constexpr unsigned int groupList() { return 0x002b; }
static constexpr unsigned int colorCode() { return 0x002c; }
static constexpr unsigned int aprsIndex() { return 0x002d; }
static constexpr unsigned int txContact() { return 0x002e; }
static constexpr Bit aliasTimeSlot2() { return { 0x030, 2}; }
static constexpr Bit aliasTimeSlot1() { return { 0x030, 0}; }
static constexpr Bit timeSlot() { return {0x0031, 6}; }
Expand Down
78 changes: 0 additions & 78 deletions snapcraft.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ SET(qdmr_UI_FORMS dmrcontactdialog.ui dtmfcontactdialog.ui rxgrouplistdialog.ui
configmergedialog.ui satellitedatabasedialog.ui satelliteselectiondialog.ui
mainwindow.ui)

set(qdmr_TS_FILES ../i18n/de.ts ../i18n/en_US.ts)
set(qdmr_TS_FILES ../i18n/de.ts ../i18n/en_US.ts ../i18n/sv.ts ../i18n/it.ts ../i18n/nl.ts
../i18n/pl.ts ../i18n/fr.ts)
qt5_wrap_cpp(qdmr_MOC_SOURCES ${qdmr_MOC_HEADERS})
qt5_wrap_ui(qdmr_UI_SOURCES ${qdmr_UI_FORMS})

Expand Down

0 comments on commit 624e91d

Please sign in to comment.