[chirp_devel] [PATCH] [thd72] Add live driver for Kenwood TH-D72 and disable broken clone driver.
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1331766827 21600 # Node ID 6a44e4de4ec4775744f9d469cb8505e51448a81b # Parent 02e3e9f109445789e64b2f974b203833a9dfbba7 [thd72] Add live driver for Kenwood TH-D72 and disabled broken clone driver.
diff -r 02e3e9f10944 -r 6a44e4de4ec4 chirp/kenwood_live.py --- a/chirp/kenwood_live.py Wed Mar 14 17:04:55 2012 -0600 +++ b/chirp/kenwood_live.py Wed Mar 14 17:13:47 2012 -0600 @@ -544,7 +544,7 @@ rf.valid_modes = D710_MODES rf.valid_duplexes = D710_DUPLEX rf.valid_tuning_steps = D710_STEPS - rf.valid_characters = chirp_common.CHARSET_ALPHANUMERIC + rf.valid_characters = chirp_common.CHARSET_ASCII.replace(',','') rf.valid_name_length = 8 rf.memory_bounds = (0, 999) return rf @@ -612,6 +612,62 @@ return spec
@directory.register +class THD72Radio(TMD710Radio): + MODEL = "TH-D72" + + def _parse_mem_spec(self, spec): + mem = chirp_common.Memory() + + mem.number = int(spec[0]) + mem.freq = int(spec[1]) + mem.tuning_step = D710_STEPS[int(spec[2], 16)] + mem.duplex = D710_DUPLEX[int(spec[3])] + # Reverse + if int(spec[5]): + mem.tmode = "Tone" + elif int(spec[6]): + mem.tmode = "TSQL" + elif int(spec[7]): + mem.tmode = "DTCS" + mem.rtone = chirp_common.TONES[int(spec[9])] + mem.ctone = chirp_common.TONES[int(spec[10])] + mem.dtcs = chirp_common.DTCS_CODES[int(spec[11])] + mem.offset = int(spec[13]) + mem.mode = D710_MODES[int(spec[14])] + # TX Frequency + if int(spec[15]): + mem.duplex = "split" + mem.offset = int(spec[15]) + # Lockout + mem.skip = D710_SKIP[int(spec[17])] # Memory Lockout + + return mem + + def _make_mem_spec(self, mem): + print "Index %i for step %.2f" % (chirp_common.TUNING_STEPS.index(mem.tuning_step), mem.tuning_step) + spec = ( \ + "%010i" % mem.freq, + "%X" % D710_STEPS.index(mem.tuning_step), + "%i" % (0 if mem.duplex == "split" else D710_DUPLEX.index(mem.duplex)), + "0", # Reverse + "%i" % (mem.tmode == "Tone" and 1 or 0), + "%i" % (mem.tmode == "TSQL" and 1 or 0), + "%i" % (mem.tmode == "DTCS" and 1 or 0), + "0", + "%02i" % (chirp_common.TONES.index(mem.rtone)), + "%02i" % (chirp_common.TONES.index(mem.ctone)), + "%03i" % (chirp_common.DTCS_CODES.index(mem.dtcs)), + "0", + "%08i" % (0 if mem.duplex == "split" else mem.offset), # Offset + "%i" % D710_MODES.index(mem.mode), + "%010i" % (mem.offset if mem.duplex == "split" else 0), # TX Frequency + "0", # Unknown + "%i" % D710_SKIP.index(mem.skip), # Memory Lockout + ) + + return spec + +@directory.register class TMV71Radio(TMD710Radio): MODEL = "TM-V71"
diff -r 02e3e9f10944 -r 6a44e4de4ec4 chirp/thd72.py --- a/chirp/thd72.py Wed Mar 14 17:04:55 2012 -0600 +++ b/chirp/thd72.py Wed Mar 14 17:13:47 2012 -0600 @@ -160,7 +160,7 @@ EXCH_W = "W\x00\x00\x00\x00"
-@directory.register +#@directory.register class THD72Radio(chirp_common.CloneModeRadio): BAUD_RATE = 9600 VENDOR = "Kenwood"
participants (1)
-
Tom Hayward