diff --git a/chirp/chirp_common.py b/chirp/chirp_common.py index a5b93f97..53d77a6b 100644 --- a/chirp/chirp_common.py +++ b/chirp/chirp_common.py @@ -1783,9 +1783,12 @@ def required_step(freq, allowed=None): } # Try the above "standard" steps first in order + required_step = None for step, validate in steps.items(): if step in allowed and validate(freq): return step + elif validate(freq) and required_step is None: + required_step = step # Try any additional steps in the allowed list for step in allowed: @@ -1797,8 +1800,14 @@ def required_step(freq, allowed=None): step, format_freq(freq))) return step - raise errors.InvalidDataError("Unable to find a supported " + - "tuning step for %s" % format_freq(freq)) + if required_step is not None: + raise errors.InvalidDataError(( + 'Frequency %s requires step %.2f, ' + 'which is not supported') % ( + format_freq(freq), required_step)) + else: + raise errors.InvalidDataError("Unable to find a supported " + + "tuning step for %s" % format_freq(freq)) def fix_rounded_step(freq): diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index fbe5b555..6b9cf214 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -344,7 +344,7 @@ MODES = ["FM", "AM", "NFM"] -STEPS = [0, 5, 6.25, 10, 12.5, 15, 20, 25, 50, 100] # 0 = auto +STEPS = [5, 6.25, 0, 10, 12.5, 15, 20, 25, 50, 100] # 0 = auto? RFSQUELCH = ["OFF", "S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8"] SKIPS = ["", "S", "P"] diff --git a/chirp/drivers/icv80.py b/chirp/drivers/icv80.py index aa3e69cf..1564a9ea 100644 --- a/chirp/drivers/icv80.py +++ b/chirp/drivers/icv80.py @@ -170,7 +170,7 @@ def get_features(self): rf.memory_bounds = (0, 199) rf.valid_modes = MODES rf.valid_tmodes = TMODES - rf.valid_duplexes = DUPLEXES + rf.valid_duplexes = DUPLEXES + ['off'] rf.valid_tuning_steps = TUNING_STEPS rf.valid_power_levels = POWER_LEVELS rf.valid_skips = SKIPS @@ -410,7 +410,10 @@ def _get_memory(self, number, extd_number=None): if mem.extd_number == "": mem.name = str(_mem.name).rstrip() mem.skip = (_skip & bit) and "S" or "" - mem.duplex = DUPLEXES[_mem.duplex] + if _mem.tx_inhibit: + mem.duplex = 'off' + else: + mem.duplex = DUPLEXES[_mem.duplex] mem.power = POWER_LEVELS[_mem.power] mem.tuning_step = TUNING_STEPS[_mem.tuning_step] mem.mode = MODES[_mem.mode] @@ -427,13 +430,6 @@ def _get_memory(self, number, extd_number=None): rev.set_doc("Reverse duplex") mem.extra.append(rev) - # Tx inhibit - tx_inhibit = RadioSetting("tx_inhibit", "TX inhibit", - RadioSettingValueBoolean( - bool(not _mem.tx_inhibit))) - tx_inhibit.set_doc("TX inhibit") - mem.extra.append(tx_inhibit) - return mem def get_memory(self, number): @@ -497,7 +493,10 @@ def set_memory(self, mem): _mem.freq = mem.freq // mult _mem.offset = int(mem.offset) // mult _mem.name = str(mem.name).ljust(5) - _mem.duplex = DUPLEXES.index(mem.duplex) + try: + _mem.duplex = DUPLEXES.index(mem.duplex) + except ValueError: + _mem.duplex = 0 power = mem.power or POWER_LEVELS[0] _mem.power = POWER_LEVELS.index(power) _mem.tuning_step = TUNING_STEPS.index(mem.tuning_step) @@ -507,6 +506,7 @@ def set_memory(self, mem): _mem.ctone = chirp_common.TONES.index(mem.ctone) _mem.dtcs = chirp_common.DTCS_CODES.index(mem.dtcs) _mem.dtcs_polarity = DTCS_POLARITY.index(mem.dtcs_polarity) + _mem.tx_inhibit = mem.duplex == 'off' # Set used _unused &= ~bit @@ -519,7 +519,6 @@ def set_memory(self, mem): _skip &= ~bit if mem.extra: - _mem.tx_inhibit = not mem.extra['tx_inhibit'].value _mem.reverse_duplex = mem.extra['reverse_duplex'].value def get_raw_memory(self, number):