[chirp_devel] Before I commit my improvements to anytone.py (wrt Powerwerx DB-750X)

(I'm finally getting back to this issue I started working on last year.)
First of all, who on this list has an *AnyTone 5888UV*, a *Polmar DB-50M*, or a *Intek HR-2040*?
The *anytone.py* driver currently claims to support 4 radios (the 3 above, plus the *PowerWerx DB-750X*, which is what I have). I have found a half dozen discrepancies between my actual images and what the driver specifies -- differences in locations and/or field sizes within the image map. For the moment, I copied anytone.py as powerwerx_db750x.py and made the necessary changes. I also *added bank support* *plus a number of settings options *(programming lockout, RBG colors, etc.) while I was at it. That is all working for me. My question is, how I should proceed to commit my work? I see a number of options, here:
1. Add my powerwerx_db750x.py to the drivers and remove the DB-750X registration from anytone.py. I'd include copious comments in both files pointing to each other.
2. Merge my changes back into anytone.py, and work out the logic to make my changes conditional between the models.
3. Do #1 first, but plan on getting to #2 soon.
Since I don't have access to the 3 other radios, *I can't personally test that my changes are benign *for them. So, adding powerwerx_db750x.py as a separate driver is the safest route. But that would unnecessarily duplicate 700 lines of code. Also, it would be a shame if the new features I added (banks, settings) would be useful for those other models but only appeared in the DB-750X driver.
Please advise.
P.S. I'm curious. Does Chirp send back usage telemetry? Do we know if anyone is even using Chirp with those other radio models anymore?
NOTE: The biggest discrepancy, BTW, is that the flags map changed from 4 bits per channel to 8, to accommodate a bank assignment 0-10 (A-J).

- Add my powerwerx_db750x.py to the drivers and remove the DB-750X registration from anytone.py. I'd include copious comments in both files pointing to each other.
I'm really not interested in duplicating the bulk of the driver, so this is a non-starter for me. We have too much of that already.
- Merge my changes back into anytone.py, and work out the logic to make my changes conditional between the models.
This. You're welcome to still add a new file and inherit from the class in anytone to base yours on. Ideally, just refactor the base classes so that you can override what you need cleanly in the other. I have the original radio in that module and could do some targeted testing if needed.
Since I don't have access to the 3 other radios, I can't personally test that my changes are benign for them. So, adding powerwerx_db750x.py as a separate driver is the safest route. But that would unnecessarily duplicate 700 lines of code. Also, it would be a shame if the new features I added (banks, settings) would be useful for those other models but only appeared in the DB-750X driver.
Implement it in a way that will allow us to promote the common stuff up to the higher classes if it turns out they're useful. Asking for volunteers to test on the users list and then taking discussion to a bug where you can provide modules they can load would be the ideal route.
There are a number of other drivers that do this (see the ft817, ft857, ft1, ft2, ft3 drivers for examples).
Thanks for asking - it's much better to know now than to have me object to the duplicated code later.
--Dan
participants (2)
-
Craig Jones
-
Dan Smith