[chirp_devel] [PATCH] [uv5r]Move DTMF Sidetone and ANI settings to DTMF Settings tab
# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1361063632 18000 # Node ID 10757edf3e4489cf70c50f55600c68dad2acc155 # Parent c5611d10c1728ad5f9e3aa7860230e274bc02188 [uv5r]Move DTMF Sidetone and ANI settings to DTMF Settings tab use PTT-ID type code for ANI to allow 0 - 5 digit codes #583
diff -r c5611d10c172 -r 10757edf3e44 chirp/uv5r.py --- a/chirp/uv5r.py Sat Feb 16 16:29:16 2013 -0500 +++ b/chirp/uv5r.py Sat Feb 16 20:13:52 2013 -0500 @@ -695,11 +695,6 @@ RadioSettingValueInteger(0, 9, _settings.squelch)) basic.append(rs)
- rs = RadioSetting("dtmfst", "DTMF Sidetone", - RadioSettingValueList(DTMFST_LIST, - DTMFST_LIST[_settings.dtmfst])) - advanced.append(rs) - rs = RadioSetting("save", "Battery Saver", RadioSettingValueInteger(0, 4, _settings.save)) basic.append(rs) @@ -791,19 +786,6 @@ RadioSettingValueBoolean(_settings.roger)) basic.append(rs)
- try: - _ani = self._memobj.ani.code - rs = RadioSetting("ani.code", "ANI Code", - RadioSettingValueInteger(0, 9, _ani[0]), - RadioSettingValueInteger(0, 9, _ani[1]), - RadioSettingValueInteger(0, 9, _ani[2]), - RadioSettingValueInteger(0, 9, _ani[3]), - RadioSettingValueInteger(0, 9, _ani[4])) - advanced.append(rs) - except Exception: - print ("Your ANI code is not five digits, which is not currently" - " supported in CHIRP.") - rs = RadioSetting("ste", "Squelch Tail Eliminate (HT to HT)", RadioSettingValueBoolean(_settings.ste)) advanced.append(rs) @@ -1008,6 +990,27 @@ rs.set_apply_callback(apply_code, self._memobj.pttid[i]) dtmf.append(rs)
+ _codeobj = self._memobj.ani.code + _code = "".join(["%x" % x for x in _codeobj if int(x) != 0xFF]) + val = RadioSettingValueString(0, 5, _code, False) + val.set_charset("0123456789") + rs = RadioSetting("ani.code", "ANI Code", val) + def apply_code(setting, obj): + code = [] + for j in range(0, 5): + try: + code.append(int(str(setting.value)[j])) + except IndexError: + code.append(0xFF) + obj.code = code + rs.set_apply_callback(apply_code, self._memobj.ani) + dtmf.append(rs) + + rs = RadioSetting("dtmfst", "DTMF Sidetone", + RadioSettingValueList(DTMFST_LIST, + DTMFST_LIST[_settings.dtmfst])) + dtmf.append(rs) + return group
def get_settings(self):
participants (1)
-
Jim Unroe