[chirp_devel] [PATCH] [UV-5X3] Add remaining DTMF Decode settings
Jim Unroe
Fri Nov 11 15:07:42 PST 2016
# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1478905113 18000
# Node ID 1b62ad89d453ee26555704d9fe75767866adb48a
# Parent c386ef4dc431e5065266de2b163260e6f5637b27
[UV-5X3] Add remaining DTMF Decode settings
This patch adds the following settings to the BTech UV-5X3:
- Group Code
- Space Code
related to #3931
diff -r c386ef4dc431 -r 1b62ad89d453 chirp/drivers/uv5x3.py
--- a/chirp/drivers/uv5x3.py Tue Nov 01 18:42:18 2016 -0700
+++ b/chirp/drivers/uv5x3.py Fri Nov 11 17:58:33 2016 -0500
@@ -71,6 +71,8 @@
LIST_TXPOWER = ["High", "Low"]
LIST_VOICE = ["Off", "English", "Chinese"]
LIST_WORKMODE = ["Frequency", "Channel"]
+LIST_DTMF_SPECIAL_DIGITS = [ "*", "#", "A", "B", "C", "D"]
+LIST_DTMF_SPECIAL_VALUES = [ 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00]
def model_match(cls, data):
"""Match the opened/downloaded image to the correct version"""
@@ -1119,6 +1121,27 @@
rs.set_apply_callback(apply_code, self._memobj.ani)
dtmfd.append(rs)
+ def apply_dmtf_listvalue(setting, obj):
+ LOG.debug("Setting value: "+ str(setting.value) + " from list")
+ val = str(setting.value)
+ index = LIST_DTMF_SPECIAL_DIGITS.index(val)
+ val = LIST_DTMF_SPECIAL_VALUES[index]
+ obj.set_value(val)
+
+ idx = LIST_DTMF_SPECIAL_VALUES.index(_mem.ani.groupcode)
+ rs = RadioSetting("ani.groupcode", "Group Code",
+ RadioSettingValueList(LIST_DTMF_SPECIAL_DIGITS,
+ LIST_DTMF_SPECIAL_DIGITS[idx]))
+ rs.set_apply_callback(apply_dmtf_listvalue, _mem.ani.groupcode)
+ dtmfd.append(rs)
+
+ idx = LIST_DTMF_SPECIAL_VALUES.index(_mem.ani.spacecode)
+ rs = RadioSetting("ani.spacecode", "Space Code",
+ RadioSettingValueList(LIST_DTMF_SPECIAL_DIGITS,
+ LIST_DTMF_SPECIAL_DIGITS[idx]))
+ rs.set_apply_callback(apply_dmtf_listvalue, _mem.ani.spacecode)
+ dtmfd.append(rs)
+
if _mem.ani.resettime > 0x9F:
val = 0x4F
else:
More information about the chirp_devel
mailing list