[chirp_devel] [UV-5R] Looking for Advice

Dan Smith
Sat Feb 23 16:03:42 PST 2013


> I want to create a selection for the UV-5R that depending the the
> users' selection (either tick like Boolean, or a two choice list),
> one or the other of the following is written.
> 
> "\x0E\x0F\x10\x11\x15"
> "\x00\x00\x00\x00\x00"

You mean a RadioSetting? Maybe something like this untested snipped:

 def apply_foobar(setting, obj):
     if setting.value == True:
         obj.foobar = "\x0E\x0F\x10\x11\x15"
     else:
         obj.foobar = "\x00\x00\x00\x00\x00"    

 rs = RadioSetting("foobar", "Enable Foobar", RadioSettingBoolean(False))
 rs.set_apply_callback(apply_foobar, self._memobj)

Note that it will always default to False unless you change how the 
RadioSettingBoolean is initialized. The callback "apply_foobar" gets
called when the setting is to be applied to the radio, so that's where
your logic goes to check the value that the user has chosen and apply
it to the memory object. 

-- 
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/20130223/380cc65c/attachment-0001.bin 


More information about the chirp_devel mailing list