# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1337797463 -7200 # Node ID 94c362f89ed9c67d13d14a224d34feac09a9de45 # Parent 5c7f25fd25b8e5ab6e7b01616d30c60402085cf2 [FT857] Add Dtcs cross modes support and other tones related features last part of Feature #100
diff -r 5c7f25fd25b8 -r 94c362f89ed9 chirp/ft857.py --- a/chirp/ft857.py mer mag 23 20:19:35 2012 +0200 +++ b/chirp/ft857.py mer mag 23 20:24:23 2012 +0200 @@ -27,6 +27,7 @@ TMODES = { 0x04 : "Tone", 0x05 : "TSQL", + # 0x08 : "DTCS Enc", not supported in UI yet 0x0a : "DTCS", 0xff : "Cross", 0x00 : "", @@ -36,11 +37,12 @@ CROSS_MODES = { 0x01 : "->Tone", 0x02 : "->DTCS", - # 0x04 : "Tone->", not supported bi chirp UI + # 0x04 : "Tone->", not supported in UI yet 0x05 : "Tone->Tone", 0x06 : "Tone->DTCS", 0x08 : "DTCS->", 0x09 : "DTCS->Tone", + 0x0a : "DTCS->DTCS", } CROSS_MODES_REV = dict(zip(CROSS_MODES.values(), CROSS_MODES.keys()))
@@ -188,6 +190,7 @@ rf = ft817.FT817Radio.get_features(self) rf.has_cross = True rf.has_ctone = True + rf.has_rx_dtcs = True rf.valid_tmodes = self.TMODES_REV.keys() rf.valid_cross_modes = self.CROSS_MODES_REV.keys() return rf @@ -209,8 +212,11 @@ mem.rtone = mem.ctone = chirp_common.TONES[_mem.tone] elif mem.tmode == "TSQL": mem.rtone = mem.ctone = chirp_common.TONES[_mem.tone] + elif mem.tmode == "DTCS Enc": # UI does not support it yet but + # this code has alreay been tested + mem.dtcs = mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.dcs] elif mem.tmode == "DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] + mem.dtcs = mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.dcs] elif mem.tmode == "Cross": mem.ctone = chirp_common.TONES[_mem.rxtone] # don't want to fail for this @@ -218,15 +224,8 @@ mem.rtone = chirp_common.TONES[_mem.tone] except IndexError: mem.rtone = chirp_common.TONES[0] - if mem.cross_mode == "DTCS->": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] - elif mem.cross_mode == "Tone->DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.rxdcs] - elif mem.cross_mode == "DTCS->Tone": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] - elif mem.cross_mode == "->DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.rxdcs] - + mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] + mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.rxdcs]
def _set_tmode(self, mem, _mem): if mem.tmode != "Cross": @@ -240,12 +239,16 @@ _mem.tone = _mem.rxtone = chirp_common.TONES.index(mem.rtone) elif mem.tmode == "TSQL": _mem.tone = _mem.rxtone = chirp_common.TONES.index(mem.ctone) + elif mem.tmode == "DTCS Enc": # UI does not support it yet but + # this code has alreay been tested + _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) elif mem.tmode == "DTCS": - _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.rx_dtcs) elif mem.tmode == "Cross": _mem.tone = chirp_common.TONES.index(mem.rtone) _mem.rxtone = chirp_common.TONES.index(mem.ctone) - _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.rx_dtcs) # have to put this bit to 0 otherwise we get strange display in tone # frequency (menu 83). See bug #88 and #163 _mem.unknown_toneflag = 0