[chirp_devel] [PATCH 1 of 1] [uv-b5] Add split duplex and calculate shift
Marco Filippi IZ3GME
Thu Sep 26 01:38:31 PDT 2013
# HG changeset patch
# User Marco Filippi <iz3gme.marco at 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)
More information about the chirp_devel
mailing list