[chirp_devel] [PATCH 0 of 1 ] Split duplex for UV-B5 - second try
Thanks to Jim here's a new corrected version of the patch.
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1380184356 -7200 # Node ID 2613ace47d8bed6fae116ded2ec373c1cafaeb95 # Parent 6ef322950bd884fa4148386eb94771b14fb641a1 [uv-b5] Add split duplex and calculate shift Implement feature #1149
diff --git a/chirp/uvb5.py b/chirp/uvb5.py --- a/chirp/uvb5.py +++ b/chirp/uvb5.py @@ -214,7 +214,7 @@ raise errors.RadioError("Radio NAK'd block at address 0x%04x" % i) do_status(radio, "to", i)
-DUPLEX = ["", "-", "+", 'off'] +DUPLEX = ["", "-", "+", 'off', "split"] CHARSET = "0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ/_+*" SPECIALS = { "VFO1": -2, @@ -391,6 +391,10 @@ if mem.duplex == "off": _mem.duplex = DUPLEX.index("-") _mem.offset = _mem.freq + elif mem.duplex == "split": + diff = mem.offset - mem.freq + _mem.duplex = DUPLEX.index("-") if diff < 0 else DUPLEX.index("+") + _mem.offset = abs(diff) / 10 else: _mem.offset = mem.offset / 10 _mem.duplex = DUPLEX.index(mem.duplex) @@ -413,6 +417,15 @@ for setting in mem.extra: setattr(_mem, setting.get_name(), setting.value)
+ def validate_memory(self, mem): + msgs = chirp_common.CloneModeRadio.validate_memory(self, mem) + + if mem.duplex == "split" and abs(mem.freq - mem.offset)>69995000: + msgs.append(chirp_common.ValidationError( + "Max split is 69.995MHz")) + return msgs + + def get_settings(self): basic = RadioSettingGroup("basic", "Basic Settings") group = RadioSettingGroup("top", "All Settings", basic)
On Thu, Sep 26, 2013 at 4:38 AM, Marco Filippi IZ3GME < iz3gme.marco@gmail.com> wrote:
Thanks to Jim here's a new corrected version of the patch.
73 de IZ3GME Marco
Tested. Works great. Thanks for adding this feature. Jim KC9HI
participants (2)
-
Jim Unroe
-
Marco Filippi IZ3GME