[chirp_devel] [PATCH] [uv-b5] fix for proper display of STEP setting value
# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1382190575 14400 # Node ID c9ba0051b895692503d39b3f4b8db152ac6a1488 # Parent f326c0deb8f31d855f0d933bbbf4b50fd3a03352 [uv-b5] fix for proper display of STEP setting value update memory structure to define 'step' add Step setting to allow user to edit the STEP value fix for Bug #1179
diff -r f326c0deb8f3 -r c9ba0051b895 chirp/uvb5.py --- a/chirp/uvb5.py Fri Oct 18 14:36:59 2013 -0500 +++ b/chirp/uvb5.py Sat Oct 19 09:49:35 2013 -0400 @@ -38,7 +38,8 @@ highpower:1, revfreq:1, duplex:2; - u8 unknown[4]; + u8 step; + u8 unknown[3]; };
#seekto 0x0000; @@ -372,6 +373,16 @@ RadioSettingValueBoolean(_mem.compander)) mem.extra.append(rs)
+ options = ["5.00K", "6.25K", "10.00K", "12.50K", "20.00K", "25.00K"] + if _mem.step != 0xFF: + val1 = _mem.step + else: + val1 = 0 + rs = RadioSetting("step", "Steps", + RadioSettingValueList(options, + options[val1])) + mem.extra.append(rs) + return mem
def set_memory(self, mem):
options = ["5.00K", "6.25K", "10.00K", "12.50K", "20.00K", "25.00K"]
if _mem.step != 0xFF:
val1 = _mem.step
else:
val1 = 0
rs = RadioSetting("step", "Steps",
RadioSettingValueList(options,
options[val1]))
mem.extra.append(rs)
Hmm, this is exposing step as a feature for the channel, but I think it should expose it properly in mem.tuning_step like the rest of them. We keep the mem.features as a grab-bag of non-standard things that chirp doesn't really support natively (like, voice scrambler, etc). But, we have a field for tuning_step.
So, I think you need to expose a set of valid_tuning_steps in get_features() and populate mem.tuning_step with something from that list. It should be mostly like what you've got here, although (very roughly):
VALID_STEPS = [5.0, 6.25, 10.0, 12.5, 20.0, 25.0]
def get_features(self): ... rf.valid_tuning_steps = VALID_STEPS rf.has_tuning_step = True
def get_memory(self, number): ... mem.tuning_step = VALID_STEPS[_mem.step]
This will make it show up in the spreadsheet view like the other radios.
Make sense?
Thanks Jim!
Dan,
VALID_STEPS = [5.0, 6.25, 10.0, 12.5, 20.0, 25.0]
def get_features(self): ... rf.valid_tuning_steps = VALID_STEPS rf.has_tuning_step = True
I pretty much have this working except for one thing. The drop-down list of steps available appears to be the common list of steps built into CHIRP:
TUNING_STEPS = [ 5.0, 6.25, 10.0, 12.5, 15.0, 20.0, 25.0, 30.0, 50.0, 100.0, 125.0, 200.0, # Need to fix drivers using this list as an index! 9.0, 1.0, 2.5, ]
I tried the only other driver that has "rf.has_tuning_step = True" and it does the same thing. Is this a CHIRP bug or am I doing something wrong?
I suppose I could leave it "rf.has_tuning_step = False" since the user has no real need to use tuning steps on the UV-B5 when programming with CHIRP. But I'll wait to see what you have to say about it.
Jim
I meant to attach this but I forgot when my internet went out...
On Sun, Oct 20, 2013 at 4:18 PM, Jim Unroe rock.unroe@gmail.com wrote:
Dan,
VALID_STEPS = [5.0, 6.25, 10.0, 12.5, 20.0, 25.0]
def get_features(self): ... rf.valid_tuning_steps = VALID_STEPS rf.has_tuning_step = True
I pretty much have this working except for one thing. The drop-down list of steps available appears to be the common list of steps built into CHIRP:
TUNING_STEPS = [ 5.0, 6.25, 10.0, 12.5, 15.0, 20.0, 25.0, 30.0, 50.0, 100.0, 125.0, 200.0, # Need to fix drivers using this list as an index! 9.0, 1.0, 2.5, ]
I tried the only other driver that has "rf.has_tuning_step = True" and it does the same thing. Is this a CHIRP bug or am I doing something wrong?
I suppose I could leave it "rf.has_tuning_step = False" since the user has no real need to use tuning steps on the UV-B5 when programming with CHIRP. But I'll wait to see what you have to say about it.
Jim
I tried the only other driver that has "rf.has_tuning_step = True" and it does the same thing. Is this a CHIRP bug or am I doing something wrong?
I suppose I could leave it "rf.has_tuning_step = False" since the user has no real need to use tuning steps on the UV-B5 when programming with CHIRP. But I'll wait to see what you have to say about it.
I think this is one of the lists we've not yet converted to use the radio-supplied one. If they choose one that the radio does not support, it will warn them. Just go ahead and set the flag and the list as you would expect and then it will be right when that gets fixed.
participants (2)
-
Dan Smith
-
Jim Unroe