[chirp_devel] VFO Frequency Presets

Dan Smith
Sun Jan 20 08:39:09 PST 2013


> > It's a typo for sure :)
> > here's the function Dan had in mind ;)

Oops, yeah, that's what I meant, thanks Marco :)

> The driver is now reading and displaying the values from a saved
> image and the UV-5R.

Nice!

> Now I just need some guidance on how to go the
> other way.

So, set_settings() attempts to be automatic about how it applies the
settings, using the setting name to find the structure. Since you've
got a special case here, I think it's okay to call it out specifically.
In the big for loop, there's an if..else that handles the case where
settings are nested in structs, so it looks for a "." in the name. I'd
just add an "elif" in there for yours. Something like:

  elif element.get_name() == "vfoa.freq":
      convert_freq_to_bytes(self._memobj.vfoa.freq, element.value)

with convert_freq_to_bytes() being a helper function with something
like the example code I gave you in it for going the other direction.
It should take two arguments for the "real_freq" and "bytes". Take a
stab at writing it and let me know if you need a little more detail.

Thanks a lot for doing this Jim! How many things remain after this
before CHIRP is as functional as the OEM software? Seems like you're
going to run out of things to add pretty soon now! :)

-- 
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/20130120/e3948bae/attachment-0001.bin 


More information about the chirp_devel mailing list