[chirp_devel] [PATCH] [VV-898] Add Settings to Leixen VV-898 Module - Part 11

Jim Unroe
Sat Jun 6 18:51:59 PDT 2015


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1433641751 14400
# Node ID 25ce872ec0611c5916dc6f6ccb8576a838f8ae5b
# Parent  3b75d85a015903846cc1d323c5c7e7d7a55b3b7c
[VV-898] Add Settings to Leixen VV-898 Module - Part 11

add the following per channel settings:
Busy Channel Lockout
Squelch Tail Elimination
Audio Processing
VOX
PTT ID
DTMF
Display
Reverse Frequency
Talk Around

related to #2149

diff -r 3b75d85a0159 -r 25ce872ec061 chirp/drivers/leixen.py
--- a/chirp/drivers/leixen.py	Sat Jun 06 19:05:32 2015 -0400
+++ b/chirp/drivers/leixen.py	Sat Jun 06 21:49:11 2015 -0400
@@ -145,7 +145,8 @@
      mode:1
      reverseoff:1,
      blckoff:1,
-     unknown7:4;
+     unknown7:1,
+     apro:3;
   u8 unknown8;
 };
 
@@ -487,6 +488,60 @@
         mem.power = POWER_LEVELS[_mem.power]
         mem.skip = _mem.skip and "S" or ""
 
+        self._get_tone(mem, _mem)
+        mem.mode = MODES[_mem.mode]
+        mem.power = POWER_LEVELS[_mem.power]
+        mem.skip = _mem.skip and "S" or ""
+
+        mem.extra = RadioSettingGroup("Extra", "extra")
+
+        opts = ["On", "Off"]
+        rs = RadioSetting("blckoff", "Busy Channel Lockout",
+                          RadioSettingValueList(
+                              opts, opts[_mem.blckoff]))
+        mem.extra.append(rs)
+        opts = ["Off", "On"]
+        rs = RadioSetting("tailcut", "Squelch Tail Elimination",
+                          RadioSettingValueList(
+                              opts, opts[_mem.tailcut]))
+        mem.extra.append(rs)
+        opts = ["Off", "Compander", "Scrambler", "TX Scrambler",
+                "RX Scrambler"]
+        rs = RadioSetting("apro", "Audio Processing",
+                          RadioSettingValueList(
+                              opts, opts[_mem.apro]))
+        mem.extra.append(rs)
+        opts = ["On", "Off"]
+        rs = RadioSetting("voxoff", "VOX",
+                          RadioSettingValueList(
+                              opts, opts[_mem.voxoff]))
+        mem.extra.append(rs)
+        opts = ["On", "Off"]
+        rs = RadioSetting("pttidoff", "PTT ID",
+                          RadioSettingValueList(
+                              opts, opts[_mem.pttidoff]))
+        mem.extra.append(rs)
+        opts = ["On", "Off"]
+        rs = RadioSetting("dtmfoff", "DTMF",
+                          RadioSettingValueList(
+                              opts, opts[_mem.dtmfoff]))
+        mem.extra.append(rs)
+        opts = ["Name", "Frequency"]
+        aliasop = RadioSetting("aliasop", "Display",
+                               RadioSettingValueList(
+                                   opts, opts[_mem.aliasop]))
+        mem.extra.append(aliasop)
+        opts = ["On", "Off"]
+        rs = RadioSetting("reverseoff", "Reverse Frequency",
+                          RadioSettingValueList(
+                              opts, opts[_mem.reverseoff]))
+        mem.extra.append(rs)
+        opts = ["On", "Off"]
+        rs = RadioSetting("talkaroundoff", "Talk Around",
+                          RadioSettingValueList(
+                              opts, opts[_mem.talkaroundoff]))
+        mem.extra.append(rs)
+
         return mem
 
     def _set_tone(self, mem, _mem):
@@ -537,6 +592,24 @@
         _mem.skip = mem.skip == "S"
         _name.name = mem.name.ljust(7)
 
+        # autoset display to name if filled, else show frequency
+        if mem.extra:
+            # mem.extra only seems to be populated when called from edit panel
+            aliasop = mem.extra["aliasop"]
+        else:
+            aliasop = None
+        if mem.name:
+            _mem.aliasop = False
+            if aliasop and not aliasop.changed():
+                aliasop.value = "Name"
+        else:
+            _mem.aliasop = True
+            if aliasop and not aliasop.changed():
+                aliasop.value = "Frequency"
+
+        for setting in mem.extra:
+            setattr(_mem, setting.get_name(), setting.value)
+
     def _get_settings(self):
         _settings = self._memobj.settings
         _service = self._memobj.service



More information about the chirp_devel mailing list