[chirp_devel] [PATCH] [uv-b5] Add 'off' to the list of Duplex options
# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1367671102 14400 # Node ID 5103b9345ba751082b0cdc007b094d445a402f6d # Parent ed86c7d025631d37e397016793fad549f3817151 [uv-b5] Add 'off' to the list of Duplex options so memory channels can programmed with TX inhibited. #837
diff -r ed86c7d02563 -r 5103b9345ba7 chirp/uvb5.py --- a/chirp/uvb5.py Sun Apr 21 19:08:06 2013 -0400 +++ b/chirp/uvb5.py Sat May 04 08:38:22 2013 -0400 @@ -141,7 +141,7 @@ raise errors.RadioError("Radio NAK'd block at address 0x%04x" % i) do_status(radio, "to", i)
-DUPLEX = ["", "-", "+"] +DUPLEX = ["", "-", "+", 'off'] CHARSET = "0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ_+*" SPECIALS = { "VFO1": -2, @@ -265,6 +265,10 @@ mem.skip = "" if _mem.scanadd else "S" mem.power = POWER_LEVELS[_mem.highpower]
+ if mem.freq == mem.offset and mem.duplex == "-": + mem.duplex = "off" + mem.offset = 0 + if _nam: for char in _nam: try: @@ -290,6 +294,10 @@ _mem.set_raw("\xFF" * 16) return
+ if mem.duplex == "off": + mem.offset = mem.freq + mem.duplex = "-" + _mem.freq = mem.freq / 10 _mem.offset = mem.offset / 10
@@ -290,6 +294,10 @@ _mem.set_raw("\xFF" * 16) return
if mem.duplex == "off":
mem.offset = mem.freq
mem.duplex = "-"
This modifies the object that was being passed in, which is "bad". It won't technically hurt anything when using the GUI, but it could have other ramifications if the driver is used for something else.
Instead, can you just handle this near where the _mem object is changed, like this:
if mem.duplex == "off": _mem.duplex = DUPLEX.index("-") _mem.offset = _mem.freq else: _mem.offset = mem.offset / 10 _mem.duplex = DUPLEX.index(mem.duplex)
On Sat, May 4, 2013 at 4:55 PM, Dan Smith dsmith@danplanet.com wrote:
@@ -290,6 +294,10 @@ _mem.set_raw("\xFF" * 16) return
if mem.duplex == "off":
mem.offset = mem.freq
mem.duplex = "-"
This modifies the object that was being passed in, which is "bad". It won't technically hurt anything when using the GUI, but it could have other ramifications if the driver is used for something else.
Instead, can you just handle this near where the _mem object is changed, like this:
if mem.duplex == "off": _mem.duplex = DUPLEX.index("-") _mem.offset = _mem.freq else: _mem.offset = mem.offset / 10 _mem.duplex = DUPLEX.index(mem.duplex)
Dan,
Yes. I'll take care of it. Thanks Jim
participants (2)
-
Dan Smith
-
Jim Unroe