[chirp_devel] [PATCH 3 of 4] [KG-UVD1P] Add support for DTCS->DTCS tone cross mode
Marco Filippi IZ3GME
Sat May 26 02:21:59 PDT 2012
# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1338021815 -7200
# Node ID 29fa7ff1a8d8deac2cfa50811e71b808614bd997
# Parent d4c1e515ca427694cac2b1eba401bcd8f1e9f897
[KG-UVD1P] Add support for DTCS->DTCS tone cross mode
side effect of UI improvement from Feature #100
diff -r d4c1e515ca42 -r 29fa7ff1a8d8 chirp/wouxun.py
--- a/chirp/wouxun.py mer mag 23 20:24:23 2012 +0200
+++ b/chirp/wouxun.py sab mag 26 10:43:35 2012 +0200
@@ -188,6 +188,15 @@
def get_features(self):
rf = chirp_common.RadioFeatures()
rf.valid_tmodes = ["", "Tone", "TSQL", "DTCS", "Cross"]
+ rf.valid_cross_modes = [
+ "Tone->Tone",
+ "Tone->DTCS",
+ "DTCS->Tone",
+ "DTCS->",
+ "->Tone",
+ "->DTCS",
+ "DTCS->DTCS",
+ ]
rf.valid_modes = ["FM", "NFM"]
rf.valid_power_levels = POWER_LEVELS
rf.valid_bands = [(136000000, 174000000), (216000000, 520000000)]
@@ -195,6 +204,7 @@
rf.valid_name_length = 6
rf.valid_duplexes = ["", "+", "-", "split"]
rf.has_ctone = True
+ rf.has_rx_dtcs = True
rf.has_cross = True
rf.has_tuning_step = False
rf.has_bank = False
@@ -223,7 +233,7 @@
if _mem.rx_tone != 0xFFFF and _mem.rx_tone > 0x2800:
rcode, rpol = _get_dcs(_mem.rx_tone)
- mem.dtcs = rcode
+ mem.rx_dtcs = rcode
rxmode = "DTCS"
elif _mem.rx_tone != 0xFFFF:
mem.ctone = _mem.rx_tone / 10.0
@@ -235,7 +245,7 @@
mem.tmode = "Tone"
elif txmode == rxmode and txmode == "Tone" and mem.rtone == mem.ctone:
mem.tmode = "TSQL"
- elif txmode == rxmode and txmode == "DTCS":
+ elif txmode == rxmode and txmode == "DTCS" and mem.dtcs == mem.rx_dtcs:
mem.tmode = "DTCS"
elif rxmode or txmode:
mem.tmode = "Cross"
@@ -307,7 +317,8 @@
if tx_mode == "DTCS":
- _mem.tx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[0])
+ _mem.tx_tone = mem.tmode != "DTCS" and \
+ _set_dcs(mem.dtcs, mem.dtcs_polarity[0]) or _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[0])
elif tx_mode:
_mem.tx_tone = tx_mode == "Tone" and \
int(mem.rtone * 10) or int(mem.ctone * 10)
@@ -315,7 +326,7 @@
_mem.tx_tone = 0xFFFF
if rx_mode == "DTCS":
- _mem.rx_tone = _set_dcs(mem.dtcs, mem.dtcs_polarity[1])
+ _mem.rx_tone = _set_dcs(mem.rx_dtcs, mem.dtcs_polarity[1])
elif rx_mode:
_mem.rx_tone = int(mem.ctone * 10)
else:
More information about the chirp_devel
mailing list