[chirp_devel] [PATCH 0 of 2 ] Some minor fix related to cross dtcs
The present two are supposed to be my last patches on the cross dtcs. It's time for me to close feature #100 :)
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1338197885 -7200 # Node ID 3b5f838c2673c3c055e6ddce0c8c87bbeae2e063 # Parent 8b3f77bdcfa88f78ec5de026f41b71909a610c40 Make import logic behave correctly with new rx_dtcs field needed to follow improvement from Feature #100
diff --git a/chirp/import_logic.py b/chirp/import_logic.py --- a/chirp/import_logic.py +++ b/chirp/import_logic.py @@ -103,6 +103,24 @@ if mem.tmode == "TSQL": mem.ctone = mem.rtone
+def _import_dtcs(dst_radio, srcrf, mem): + dstrf = dst_radio.get_features() + + # Some radios keep separate DTCS codes for tx and rx + # If we're importing to or from radios with differing models, + # do the conversion here. + + if srcrf.has_rx_dtcs and not dstrf.has_rx_dtcs: + # If copying from a radio with separate codes to a radio + # without, and the tmode is DTCS, then use the rx_dtcs value + if mem.tmode == "DTCS": + mem.dtcs = mem.rx_dtcs + elif not srcrf.has_rx_dtcs and dstrf.has_rx_dtcs: + # If copying from a radio without separate codes to a radio + # with it, set the dest rx_dtcs to the src dtcs + if mem.tmode == "DTCS": + mem.rx_dtcs = mem.dtcs + def import_mem(dst_radio, src_features, src_mem, overrides={}): """Perform import logic to create a destination memory from src_mem that will be compatible with @dst_radio""" @@ -119,6 +137,7 @@ helpers = [_import_name, _import_power, _import_tone, + _import_dtcs, ]
for helper in helpers:
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1338198564 -7200 # Node ID d66b50e0df7dcfb834fcb85759dcbf1a16e0f9dd # Parent 3b5f838c2673c3c055e6ddce0c8c87bbeae2e063 Make UI hide the correct field if has_rx_dtcs needed to follow improvement from Feature #100
diff --git a/chirpui/memedit.py b/chirpui/memedit.py --- a/chirpui/memedit.py +++ b/chirpui/memedit.py @@ -219,8 +219,10 @@ self.col(_("DTCS Rx Code")), self.col(_("DTCS Pol"))] elif tmode == "DTCS": + if self._features.has_rx_dtcs: + hide += [self.col(_("DTCS Code"))] + hide += [self.col(_("Tone")), - self.col(_("DTCS Rx Code")), self.col(_("ToneSql"))] elif tmode == "" or tmode == "(None)": hide += [self.col(_("Tone")),
participants (2)
-
Dan Smith
-
Marco Filippi IZ3GME