[chirp_devel] [PATCH 2 of 3] [VX7] Add support for available cross tones

Marco Filippi
Wed May 2 12:47:02 PDT 2012


# HG changeset patch
# User Filippi Marco <iz3gme.marco at gmail.com>
# Date 1335987114 -7200
# Node ID dc9edca7b05c7a555e53f7c3a8d84f1b88c498f6
# Parent  f347b682185ecb66c9d11ac51261ee9b9d3feb45
[VX7] Add support for available cross tones
feature #158

diff -r f347b682185e -r dc9edca7b05c chirp/vx7.py
--- a/chirp/vx7.py	Wed May 02 21:27:03 2012 +0200
+++ b/chirp/vx7.py	Wed May 02 21:31:54 2012 +0200
@@ -66,7 +66,8 @@
        tone:6;
   u8   zeros4:1,
        dcs:7;
-  u8   zeros5:6,
+  u8   zeros5:5,
+       is_split_tone:1,
        tmode:2;
   u8   charset;
 } memory[450];
@@ -74,7 +75,8 @@
 
 DUPLEX = ["", "-", "+", "split"]
 MODES  = ["FM", "AM", "WFM", "FM"] # last is auto
-TMODES = ["", "Tone", "TSQL", "DTCS"]
+TMODES = ["", "Tone", "TSQL", "DTCS", "Cross"]
+CROSS_MODES = ["DTCS->", "Tone->DTCS", "DTCS->Tone"]
 STEPS = list(chirp_common.TUNING_STEPS)
 STEPS.remove(6.25)
 STEPS.remove(30.0)
@@ -202,6 +204,8 @@
         rf.memory_bounds = (1, 450)
         rf.can_odd_split = True
         rf.has_ctone = False
+        rf.has_cross = True
+        rf.valid_cross_modes = list(CROSS_MODES)
         return rf
 
     def get_raw_memory(self, number):
@@ -229,7 +233,12 @@
         mem.freq = chirp_common.fix_rounded_step(int(_mem.freq) * 1000)
         mem.offset = int(_mem.offset) * 1000
         mem.rtone = mem.ctone = chirp_common.TONES[_mem.tone]
-        mem.tmode = TMODES[_mem.tmode]
+        if not _mem.is_split_tone:
+            mem.tmode = TMODES[_mem.tmode]
+            mem.cross_mode = CROSS_MODES[0]
+        else:
+            mem.tmode = "Cross"
+            mem.cross_mode = CROSS_MODES[int(_mem.tmode)]
         mem.duplex = DUPLEX[_mem.duplex]
         if mem.duplex == "split":
             mem.offset = chirp_common.fix_rounded_step(mem.offset)
@@ -277,7 +286,12 @@
         _mem.freq = mem.freq / 1000
         _mem.offset = mem.offset / 1000
         _mem.tone = chirp_common.TONES.index(mem.rtone)
-        _mem.tmode = TMODES.index(mem.tmode)
+        if mem.tmode != "Cross":
+            _mem.is_split_tone = 0
+            _mem.tmode = TMODES.index(mem.tmode)
+        else:
+            _mem.is_split_tone = 1
+            _mem.tmode = CROSS_MODES.index(mem.cross_mode)
         _mem.duplex = DUPLEX.index(mem.duplex)
         _mem.mode = MODES.index(mem.mode)
         _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs)



More information about the chirp_devel mailing list