Les,<br><br>OK. Let me try to say it another way<br><br>My STEP_LIST is a sequence of the available steps: 2.5, 5.0, 6.25, 10.0 etc.<br><br>The structure vfoa.step that I am reading from and writing to corresponds to 0x00, 0x10, 0x20, 0x30 etc.<br>
<br>So I'm thinking that somehow I read the value, divide by 16 and then display it in the settings tab.<br>Then if the user changes the setting, it get multiplied by 16 and get written back.<br><br>Do I make sense?<br>
<br>Jim<br><br><br><div class="gmail_quote">On Sun, Jan 13, 2013 at 6:04 PM, Les Niles <span dir="ltr"><<a href="mailto:les@2pi.org" target="_blank">les@2pi.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">If STEP_LIST is a sequence of the radio memory values 0x0, 0x10, 0x20, etc., then<div><span style="white-space:pre-wrap">        </span>map(lambda x: x/16, STEP_LIST)</div>will return a sequence [0, 1, 2, …]<div>
Is that what you're looking for?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div> -Les</div></font></span><div><div class="h5"><div><div><br></div><div><br><div><div><div>On 13 Jan 2013, at 6:29, Jim Unroe <<a href="mailto:rock.unroe@gmail.com" target="_blank">rock.unroe@gmail.com</a>> wrote:</div>
<blockquote type="cite"><br><div class="gmail_quote">On Sat, Jan 12, 2013 at 8:38 PM, Andrew Errington <span dir="ltr"><<a href="mailto:erringtona@gmail.com" target="_blank">erringtona@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><br>
<br>
</div></div>What do you need to do? If you are writing software and you need to convert<br>
0, 1, 2, 3 ... 14 to 0x00, 0x10, 0x20, 0x30 ... 0xE0 then just multiply by<br>
16.<br>
<br>
0 x 16 = 0 = 0x00<br>
1 x 16 = 16 = 0x10<br>
2 x 16 = 32 = 0x20<br>
3 x 16 = 48 = 0x30<br>
.<br>
.<br>
.<br>
14 x 16 = 224 = 0xE0<br>
<br>
Is that what you need to do, or do I misunderstand your question?<br>
<br></blockquote></div>Andrew,<br><br>I want to use this in a scenario similar to this to create a menu setting item for 'step'<br><br> rs = RadioSetting("vfoa.step", "VFO A Tuning Step",<br>
RadioSettingValueList(STEP_LIST,<br> STEP_LIST[self._memobj.vfoa.step]))<br> vfopresets.append(rs)<br><br>The structure 'vfoa' has 'step' in it but the above doesn't work (out of range) because of the difference between the 0, 1, 2, 3 ... 14 vs. the 0x00, 0x01, 0x02, 0x03 ... 0xE0 (or 0, 16, 32, 48 ... 224).<br>
<br>This is probably simple to implement but right now I can't see the forest for the trees.<br><br>73,<br>Jim<br></blockquote></div><br></div></div></div></div></div></div><br>_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br></blockquote></div><br>