# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1351799844 -3600 # Node ID 18b37c240b739db341b88a1cd1a4543d8084b6ec # Parent e2e1f0e8fe7480b24981abf470d4d85d314f29e8 [KG-UVD1P KG-UV6] Add support for tx inhibit implements #336
diff --git a/chirp/wouxun.py b/chirp/wouxun.py --- a/chirp/wouxun.py +++ b/chirp/wouxun.py @@ -199,7 +199,7 @@ rf.valid_bands = self.valid_freq rf.valid_characters = "".join(self.CHARSET) rf.valid_name_length = 6 - rf.valid_duplexes = ["", "+", "-", "split"] + rf.valid_duplexes = ["", "+", "-", "split", "off"] rf.has_ctone = True rf.has_rx_dtcs = True rf.has_cross = True @@ -332,6 +332,12 @@ print "Got TX %s (%i) RX %s (%i)" % (txmode, _mem.tx_tone, rxmode, _mem.rx_tone)
+ def _is_txinh(self, _mem): + raw_tx = "" + for i in range(0, 4): + raw_tx += _mem.tx_freq[i].get_raw() + return raw_tx == "\xFF\xFF\xFF\xFF" + def get_memory(self, number): _mem = self._memobj.memory[number - 1] _nam = self._memobj.names[number - 1] @@ -346,12 +352,14 @@ mem.freq = int(_mem.rx_freq) * 10 if _mem.splitdup: mem.duplex = "split" + elif self._is_txinh(_mem): + mem.duplex = "off" elif int(_mem.rx_freq) < int(_mem.tx_freq): mem.duplex = "+" elif int(_mem.rx_freq) > int(_mem.tx_freq): mem.duplex = "-"
- if mem.duplex == "": + if mem.duplex == "" or mem.duplex == "off": mem.offset = 0 elif mem.duplex == "split": mem.offset = int(_mem.tx_freq) * 10 @@ -431,6 +439,9 @@ _mem.rx_freq = int(mem.freq / 10) if mem.duplex == "split": _mem.tx_freq = int(mem.offset / 10) + elif mem.duplex == "off": + for i in range(0, 4): + _mem.tx_freq[i].set_raw("\xFF") elif mem.duplex == "+": _mem.tx_freq = int(mem.freq / 10) + int(mem.offset / 10) elif mem.duplex == "-":