I'm don't believe I understand what "try with integers" means.<br><br>Here's the portion of code that I think the problem is in. More specifically the 'def convert_freq_to_bytes(real_freq) part.<br>
<br>+ def convert_bytes_to_freq(bytes):<br>+ real_freq = 0<br>+ for byte in bytes:<br>+ real_freq = (real_freq * 10) + byte<br>+ return real_freq / 100000.0<br>+<br>+ def convert_freq_to_bytes(real_freq):<br>
+ bytes = [ 0 for x in range(0,8) ] # init list with 8 times 0<br>+ real_freq = int(freq * 100000) # it has to be integer<br>+ for i in range(7, -1, -1): # go from 7 to 0<br>
+ bytes[i] = real_freq%10 # extract last digit<br>+ real_freq /= 10 # throw away last digit<br>+ return bytes<br>+<br><br>So would integer mean, don't do the division and multiplication by 100000?<br>
<br>I've attached the original patch in case someone wants to take a look at it.<br><br>Jim<br><br><div class="gmail_quote">On Mon, Jan 28, 2013 at 4:16 AM, IZ3GME Marco <span dir="ltr"><<a href="mailto:iz3gme.marco@gmail.com" target="_blank">iz3gme.marco@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jim<br>
I really dont like this solution, did you try with integers as Andrew<br>
suggested?<br>
<br>
73 de IZ3GME Marco<br>
<div><div class="h5"><br>
On 27/01/2013 16:58, Jim Unroe wrote:<br>
> All,<br>
><br>
> I gave up on using the RadioSettingValueFloat(RadioSettingValue)<br>
> feature. So none of that code supplied by Dan has been included.<br>
><br>
> Being able to enter a floating point frequency looked nice but even<br>
> after quite a bit of research, I wasn't able to overcome the floating<br>
> point to binary conversion error (setting a frequency of 146.940 always<br>
> resulted in 146.390 (actually 146.39999 but I have step set to 10.0KHz)).<br>
><br>
> I think what I have provided here is very usable. I wish there was a way<br>
> to limit the 100's of MHz selections to 1, 4 & 5 and the 100's of Hz<br>
> settings to 0, 2, 5 and 7. At list I have them limited to their lowest<br>
> and highest settings.<br>
><br>
> I'd be willing to revisit this, but for now I'd like to review my todo<br>
> list and see what additional things I can add to CHIRP for the UV-5R.<br>
><br>
> Thanks for everyone's help. I learned a lot from everyone.<br>
><br>
> Jim Unroe<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
><br>
<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>