[chirp_devel] [PATCH 1 of 3] [id31] Backport ID-51 mode logic to ID-31. Related to #553

Tom Hayward
Thu Feb 21 17:28:00 PST 2013


On Thu, Feb 21, 2013 at 5:16 PM, Dean Gibson AE7Q <data at ae7q.net> wrote:
> I see Tom back-ported the relevant differences between the ID-51 and
> ID-31, which I'd already done (see multiple eMails from Monday) three
> days ago, but was saving until the ID-51 submission was accepted.  I was
> going to create a separate bug, and submit my ID-31 changes tonight;
> he's saved me the trouble, and I will discard my changes.
>
> The only thing I would suggest for the future, is that if someone is
> going to duplicate the advertized effort of someone else, that he/she
> give notice of doing so, so that the first person doesn't continue
> working on the same thing.  Fortunately, that did not happen in this case.

Sorry, I missed that you volunteered to do this. Maybe I was
distracted by all the whining. We often chat about future development
on IRC (freenode #chirp).

> I'm just curious as to methodology for Chirp development:  Do we inherit
> one radio from another, or create a common "abstract" radio , and then
> inherit both from that?

This is not so much a Chirp question as a Python question. For Python
(and Chirp), the mantra is DRY (Don't Repeat Yourself). This means you
attempt to not duplicate any code. If you find yourself duplicating
code, maybe a new class or function is needed.

All Chirp radio drivers inherit from chirp_common.Radio, but from
there things are subclassed however is needed. For example, I thought
the ID-51 would subclass nicely from the ID-31, but now it looks like
the valid modes differ enough for the two that a base class, ID-x1,
should be used for both so we can tweak each slightly.

Tom KD7LXL



More information about the chirp_devel mailing list