[chirp_devel] [PATCH] [uv5r]Add Shift and Offset support to Work Mode VFO Presets

Dan Smith
Tue Feb 19 16:57:52 PST 2013


Hi Jim,

> # HG changeset patch
> # User Jim Unroe <rock.unroe at gmail.com>
> # Date 1361319296 18000
> # Node ID 36293926e162128da56feec659698981119fff3a
> # Parent  4bf797d4483c5b521f81639dd4405d82c05ff4a7
> [uv5r]Add Shift and Offset support to Work Mode VFO Presets
> update vfoa and vfob structure to support sftd (shift direction)
> add the following Work Mode tab presets
> Shift (Off, +, -)
> Offset (0.00 - 69.95 MHz)
> #599

Thanks for this. I wish all the drivers could get this much attention
to detail :)

> +        def convert_bytes_to_offset(bytes):
> +           real_offset = 0
> +           for byte in bytes:
> +               real_offset = (real_offset * 10) + byte
> +           return chirp_common.format_freq(real_offset * 10000)
> +
> +        def apply_offset(setting, obj):
> +            print setting.value
> +            value = chirp_common.parse_freq(str(setting.value)) /
> 10000
> +            print value
> +            print obj
> +            for i in range(3, -1, -1):
> +                obj.offset[i] = value % 10
> +                value /= 10
> +            print "Applied %s:\n%s" % (setting.value, obj)

I've already applied this, but could you follow up with a patch to
remove all the debug print statements that we've added while working on
this? The UV5R driver is really chatty and I think we can clean up most
of that stuff now that we know it's working. Just if/when you have
time, I'd appreciate it.

I'm also a little concerned at the size of the get_settings() function
now that you've gone and added every dang feature the radio supports :)

I think we should make a point of going back and splitting these out
into separate functions, just for cleanliness. It won't really affect
how it works, just how it looks to the developer. I think maybe one
helper function per page would be fine.

Are you interested in helping with this? I don't want to derail your
progress towards getting anything else closed out, but definitely don't
want it to get away from us :)

Thanks!

-- 
Dan Smith
www.danplanet.com
KK7DS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20130219/381a6e4a/attachment-0001.bin 


More information about the chirp_devel mailing list