[chirp_devel] Separate OBLTR-8R from TERMN-8R
Dan Smith
Mon May 4 20:27:17 PDT 2015
> If I need to separate these two radios, what is the best way to go about it?
>
> Looking at the wouxun.py driver, it appears that the common things
> like the download/upload routines are at the beginning of the driver
> and then the radios are separated below that. Is that what I should be
> attempting to emulate?
Probably so. Many of the radios are separated into a base class that
isn't actually registered, and then subclasses that inherit from that
base which are registered. In the case of the uv5 driver you're familiar
with, the main UV5R is the base, which is registered, and then some
variants override a few things to account for the differences.
So, if the OBLTR-8R is only slightly different from the TERMN-8R, then
you could go the approach where one inherits from the other. If there is
more that is different then it might make sense to create one very
generic base class (which isn't registered) and then subclass that for
the two models.
Do you get what is going on with subclasses overriding things from the
base class? If things are mostly the same but in different places, you
might be able to have a single get_memory() on the base class, and just
have the subclasses use different MEM_FORMAT strings to describe where
things are. For anything that needs to be different, just break that out
into a helper method so that you can override that piece of behavior in
a subclass.
--Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
Url : http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20150504/0432aec0/attachment-0001.bin
More information about the chirp_devel
mailing list