[chirp_devel] Luiton LT725UV Update
Attached is the #5595 fix adding Baojie BJ-218 and clones to the Luiton LT725UV driver. Also adds full Settings support.
Attached is the #5595 fix adding Baojie BJ-218 and clones to the Luiton LT725UV driver. Also adds full Settings support.
Thanks, I'll be looking for Jim's review of this before applying since he has context on it.
# HG changeset patch # Parent 056ccab1b395bd08613c67f81fff1a48f8ce1f06 [lt725uv] Added support for Baojie BJ-218 clones. Fixes #5595, #5407, #4645 Added full Settings capability user: Rick DeWitt aa0rd@yahoo.com branch 'default' changed chirp/drivers/lt725uv.py
It looks like this still isn't a proper exported commit.
https://chirp.danplanet.com/projects/chirp/wiki/DevelopersProcess#Submitting...
Please use "hg export tip" or (even better) use patchbomb to email the list directly.
https://chirp.danplanet.com/projects/chirp/wiki/DevelopersProcess#Setting-up...
@@ -322,11 +437,16 @@ def get_prompts(cls): rp = chirp_common.RadioPrompts() rp.experimental = \
('The LT725UV driver is a beta version.\n'
'\n'
'Please save an unedited copy of your first successful\n'
'download to a CHIRP Radio Images(*.img) file.'
('No, it is not experimental anymore!\n Some notes about POWER settings:\n'
This isn't really an appropriate thing to say here. If you're putting notes in rp.experimental then CHIRP is warning the user about the experimental nature already. Given the notes below this, I think it is still reasonable to have the experimental warning here. Please just remove the first sentence.
'- The individual channel power settings are ignored by the radio.\n'
' They are allowed to be set (and downloaded) in hopes of a future'
' firmware update.\n'
'- Power settings done \'Live\' in the radio apply to the entire upper or lower band.\n'
'- Tri-power radio models will set and download the three band-power'
' levels, but they are\n converted to just Low and High at upload.'
' The Mid setting reverts to Low.' )
Please don't add/change random whitespace :)
@@ -534,6 +657,7 @@ RadioSettingValueBoolean(bool(_mem.scrambler))) mem.extra.append(scrambler)
Here too. I won't call them all out, but please go through the patch and try to remove these :)
@@ -616,88 +740,562 @@
_mem.wide = self.MODES.index(mem.mode)
_mem.power = mem.power == POWER_LEVELS[1]
# extra settings
for setting in mem.extra: setattr(_mem, setting.get_name(), setting.value)
These are fine because you're adding space around new lines.
def my_word2raw(setting, obj, atrb, mlt=10):
"""Callback function to convert UI floating value 131.8 to u16 int 1318 ."""
if str( setting.value) == "Off":
This line has trailing whitespace and the spacing around operators isn't correct.
frq= 0x0FFFF
Same here.
else:
frq=int(float(str(setting.value)) * float(mlt))
if frq == 0 : frq = 0xFFFF
This works, but isn't stylistically like the rest of the code (nor any python convention). Please put these on separate lines and fix the whitespace before the colon.
There is a lot of this through the next block of code, so I won't call them all out. Please run the style tests on this to find all of the issues with "tox -estyle". It looks like you're on windows, which may make that hard, but try "python -mpip install tox" to get it installed.
rs = RadioSetting("settings.rptr_mode", "Repeater Mode",
RadioSettingValueBoolean(bool(_sets.rptr_mode)))
basic.append(rs)
- # UPPER BAND SETTINGS
Comments should be indented to the same level as the code they're in. Indentation matters in python :)
Once the style issues are worked out and Jim gives his ack, I'm good.
Thanks for your work on this Rick!
--Dan
OK Jim, try this out. I have scrubbed the style and made the exp prompt change. Tox won't load on my Win7 so I manually fixed all the style issues I could find. FYI: I have re-loaded tox via the 'mpip install tox' several times, but the Windows installation documentation is "vague". Windows needs to know where to start the install so I tried \chirp.hg and \Python27\tools but in neither case did the install create a 'tox' script, batch file or executable anywhere.
Rick DeWitt AA0RD Sequim, Washington, USA 360-681-3494
On 3/13/2018 5:41 PM, Jim Unroe via chirp_devel wrote:
Once the style issues are worked out and Jim gives his ack, I'm good.
I'll keep my radio handy for testing...
Jim _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
Rick,
OK Jim, try this out.
I'll try to remember to take a look at it after I get home from work.
Tox won't load on my Win7 so I manually fixed all the style issues I could find.
Same here. I do most of my CHIRP development on a Windows 7 64-bit desktop computer. I still use the RUN_ALL_TESTS.BAT batch file to run the tests. A recent change forces me to have to edit the file (I just made a copy and named it RAT.BAT). If I recall, I have to add the ".py" extension to one of the commands. I don't remember if it still runs the pep8 tests though.
Jim
Rick,
I have scrubbed the style and made the exp prompt change. Tox won't load on my Win7 so I manually fixed all the style issues I could find.
It doesn't check on my Windows PC like it used to. I can't get tox to work on my Linux PC either. :-(
But I did visually scan through the driver and I see things that I don't think would pass.
There are many lines that exceed 79 characters per line. There are some evaluations that have no white space and others that have too much white space on one side or the other and sometimes both.
Now concerning the driver.
The driver downloads from and uploads to my LT-725UV OK. I programmed my local 146.640- repeater into the top (A) VFO and the frequency displayed is 146.63974 MHz. I remember having this issue when I added the VFO frequency settings to the UV-5R driver. I believe I was told is has something to do with the error introduced when converting between binary and decimal numbers. You can look at the uv5r.py driver to see what I had to do to resolve this issue.
Jim
What happens when you try to run it on linux?
I get errors at the start that look like this.
====================================================================== ERROR: Failure: ImportError (No module named mox) ---------------------------------------------------------------------- Traceback (most recent call last): File "/media/data1/Radio_Stuff/chirp.hg/.tox/unit/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName addr.filename, addr.module) File "/media/data1/Radio_Stuff/chirp.hg/.tox/unit/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath return self.importFromDir(dir_path, fqname) File "/media/data1/Radio_Stuff/chirp.hg/.tox/unit/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/media/data1/Radio_Stuff/chirp.hg/tests/unit/test_shiftdialog.py", line 2, in <module> import mox ImportError: No module named mox
---------------------------------------------------------------------- Ran 38 tests in 0.017s
FAILED (errors=7)
I get errors at the start that look like this.
Okay I just pushed a fix for that, if you could try it. That's on the unit test target, which you probably don't need to run very often.
Try this for pep8:
tox -e style
and this for the driver tests separately:
tox -e driver
I should try running these in a clean sandbox to see what else might be missing from the requirements. Thanks for helping, sorry it's been a pain.
--Dan
Okay I just pushed a fix for that, if you could try it. That's on the unit test target, which you probably don't need to run very often.
I did an "hg clone" then and "hg diff" with completed with nothing showing (as expected).
I then did a "tox -e style" and then repeated the "hg diff" and get (the complete diff is attached) what is partially shown below. I wouldn't think this should happen.
Jim
diff -r 0a1f49c3f594 locale/de.po --- a/locale/de.po Thu Mar 15 17:12:30 2018 -0700 +++ b/locale/de.po Thu Mar 15 21:04:40 2018 -0400 @@ -7,228 +7,581 @@ msgstr "" "Project-Id-Version: CHIRP\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-10-02 00:01-0700\n" +"POT-Creation-Date: 2018-03-15 21:03-0400\n" "PO-Revision-Date: 2012-10-02 22:11+0100\n" "Last-Translator: Benjamin, HB9EUK hb9euk@hb9d.org\n" "Language-Team: German\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.5.3\n" "X-Poedit-SourceCharset: UTF-8\n"
I did an "hg clone" then and "hg diff" with completed with nothing showing (as expected).
I then did a "tox -e style" and then repeated the "hg diff" and get (the complete diff is attached) what is partially shown below. I wouldn't think this should happen.
I would agree that it shouldn't happen. It definitely doesn't for me, even in a clean clone. Running 'tox -e style' just runs 'python ./tools/cpep8.py' for you in a virtual environment. Running cpep8 shouldn't modify any files, and certainly not any locale ones.
Maybe try 'hg checkout -C' before you do the pre-diff and tox run?
--Dan
OK Jim, here is another style scrub (I wrote a parsing app in Visual Basic) and the fix for the underflow problem. Please give it a good thrashing. Thanks & 73
Rick DeWitt AA0RD Sequim, Washington, USA 360-681-3494
On 3/15/2018 3:37 PM, Jim Unroe wrote:
Rick,
I have scrubbed the style and made the exp prompt change. Tox won't load on my Win7 so I manually fixed all the style issues I could find.
It doesn't check on my Windows PC like it used to. I can't get tox to work on my Linux PC either. :-(
But I did visually scan through the driver and I see things that I don't think would pass.
There are many lines that exceed 79 characters per line. There are some evaluations that have no white space and others that have too much white space on one side or the other and sometimes both.
Now concerning the driver.
The driver downloads from and uploads to my LT-725UV OK. I programmed my local 146.640- repeater into the top (A) VFO and the frequency displayed is 146.63974 MHz. I remember having this issue when I added the VFO frequency settings to the UV-5R driver. I believe I was told is has something to do with the error introduced when converting between binary and decimal numbers. You can look at the uv5r.py driver to see what I had to do to resolve this issue.
Jim
I suppose you expected an attachment, eh?
Rick DeWitt AA0RD Sequim, Washington, USA 360-681-3494
On 3/15/2018 3:37 PM, Jim Unroe wrote:
Rick,
I have scrubbed the style and made the exp prompt change. Tox won't load on my Win7 so I manually fixed all the style issues I could find.
It doesn't check on my Windows PC like it used to. I can't get tox to work on my Linux PC either. :-(
But I did visually scan through the driver and I see things that I don't think would pass.
There are many lines that exceed 79 characters per line. There are some evaluations that have no white space and others that have too much white space on one side or the other and sometimes both.
Now concerning the driver.
The driver downloads from and uploads to my LT-725UV OK. I programmed my local 146.640- repeater into the top (A) VFO and the frequency displayed is 146.63974 MHz. I remember having this issue when I added the VFO frequency settings to the UV-5R driver. I believe I was told is has something to do with the error introduced when converting between binary and decimal numbers. You can look at the uv5r.py driver to see what I had to do to resolve this issue.
Jim
Rick,
I didn't get much done with it last nigh. My main development computer was giving me problems. :-(
The VFO issue that I reported was fixed. I did some additional scrubbing. File attached.
Jim
On Sun, Mar 18, 2018 at 3:29 PM, Rick DeWitt aa0rd@yahoo.com wrote:
I suppose you expected an attachment, eh?
Rick DeWitt AA0RD Sequim, Washington, USA 360-681-3494
On 3/15/2018 3:37 PM, Jim Unroe wrote:
Rick,
I have scrubbed the style and made the exp prompt change. Tox won't load on my Win7 so I manually fixed all the style issues I could find.
It doesn't check on my Windows PC like it used to. I can't get tox to work on my Linux PC either. :-(
But I did visually scan through the driver and I see things that I don't think would pass.
There are many lines that exceed 79 characters per line. There are some evaluations that have no white space and others that have too much white space on one side or the other and sometimes both.
Now concerning the driver.
The driver downloads from and uploads to my LT-725UV OK. I programmed my local 146.640- repeater into the top (A) VFO and the frequency displayed is 146.63974 MHz. I remember having this issue when I added the VFO frequency settings to the UV-5R driver. I believe I was told is has something to do with the error introduced when converting between binary and decimal numbers. You can look at the uv5r.py driver to see what I had to do to resolve this issue.
Jim
participants (3)
-
Dan Smith
-
Jim Unroe
-
Rick DeWitt