[chirp_devel] [PATCH 0 of 2] Add has_nostep_tuning feature flag
The following two patches should resolve Marco's issue with setting fine-tuned frequencies (such as pretty much everything on HF)
# HG changeset patch # User Dan Smith dsmith@danplanet.com # Date 1326846306 28800 # Node ID b51a59425d8352815637e5187cb9ea194441534f # Parent 4b90cf6547c80734eb838217da99c271c2aa2f12 Add "has_nostep_tuning" flag to RadioFeatures. This flag means that the destination radio does not require a tuning step matching the frequency of a given set_memory() operation. The radio may also use this flag to push step validation down into the driver layer instead of letting the UI make the determination.
diff -r 4b90cf6547c8 -r b51a59425d83 chirp/chirp_common.py --- a/chirp/chirp_common.py Mon Jan 16 12:01:26 2012 -0800 +++ b/chirp/chirp_common.py Tue Jan 17 16:25:06 2012 -0800 @@ -534,6 +534,7 @@ "has_ctone" : BOOLEAN, "has_cross" : BOOLEAN, "has_infinite_number" : BOOLEAN, + "has_nostep_tuning" : BOOLEAN,
# Attributes "valid_modes" : [], @@ -621,6 +622,9 @@ self.init("has_infinite_number", False, "Indicates that the radio is not constrained in the " + "number of memories that it can store") + self.init("has_nostep_tuning", False, + "Indicates that the radio does not require a valid " + + "tuning step to store a frequency")
self.init("valid_modes", list(MODES), "Supported emission (or receive) modes") @@ -784,7 +788,7 @@ msg = ValidationWarning("Power level %s not supported" % mem.power) msgs.append(msg)
- if rf.valid_tuning_steps: + if rf.valid_tuning_steps and not rf.has_nostep_tuning: try: step = required_step(mem.freq) if step not in rf.valid_tuning_steps: diff -r 4b90cf6547c8 -r b51a59425d83 chirpui/memedit.py --- a/chirpui/memedit.py Mon Jan 16 12:01:26 2012 -0800 +++ b/chirpui/memedit.py Tue Jan 17 16:25:06 2012 -0800 @@ -190,7 +190,13 @@ print e new = None
- set_ts(chirp_common.required_step(new)) + features = self.rthread.radio.get_features() + + try: + set_ts(chirp_common.required_step(new)) + except errors.InvalidDataError, e: + if not features.has_nostep_tuning: + raise e
if new and self._config.get_bool("autorpt") and new != prev: band = int(new / 100000000)
# HG changeset patch # User Dan Smith dsmith@danplanet.com # Date 1326846449 28800 # Node ID bd119ddce0461ca436376f49932c45de8ee7996b # Parent b51a59425d8352815637e5187cb9ea194441534f Make the FT-817 driver declare the has_nostep_tuning feature. This prevents the UI from stopping a user from setting a frequency that doesn't match one of the declared tuning steps (such as 146.000001).
diff -r b51a59425d83 -r bd119ddce046 chirp/ft817.py --- a/chirp/ft817.py Tue Jan 17 16:25:06 2012 -0800 +++ b/chirp/ft817.py Tue Jan 17 16:27:29 2012 -0800 @@ -190,6 +190,7 @@ rf = chirp_common.RadioFeatures() rf.has_bank = False rf.has_dtcs_polarity = False + rf.has_nostep_tuning = True rf.valid_modes = list(set(MODES)) rf.valid_tmodes = list(TMODES) rf.valid_duplexes = list(DUPLEX)
participants (1)
-
Dan Smith