[chirp_devel] [PATCH] [BTECH] Add Advanced Settings

Jim Unroe
Mon Apr 11 17:54:09 PDT 2016


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1460421950 14400
# Node ID 664e9635fd53bc2e724a6b213a17c1f964558100
# Parent  eae0896c12a8e7a3f0c128f814a0539c7b5ba3b4
[BTECH] Add Advanced Settings

Add settings from the OEM software "Optional Features" menu that are
not related to the internal menus of these radios.

releated to #3015

diff -r eae0896c12a8 -r 664e9635fd53 chirp/drivers/btech.py
--- a/chirp/drivers/btech.py	Mon Apr 11 20:32:14 2016 -0400
+++ b/chirp/drivers/btech.py	Mon Apr 11 20:45:50 2016 -0400
@@ -98,6 +98,30 @@
   u8 rptdl;
 } settings;
 
+#seekto 0x0E80;
+struct {
+  u8 unknown1;
+  u8 vfomr;
+  u8 keylock;
+  u8 unknown2;
+  u8 unknown3:4,
+     vfomren:1,
+     unknown4:1,
+     reseten:1,
+     menuen:1;
+  u8 unknown5[11];
+  u8 dispab;
+  u8 mrcha;
+  u8 mrchb;
+  u8 menu;
+} settings2;
+
+#seekto 0x0EC0;
+struct {
+  char line1[6];
+  char line2[6];
+} poweron_msg;
+
 #seekto 0x1000;
 struct {
   char name[6];
@@ -996,7 +1020,8 @@
         """Translate the bit in the mem_struct into settings in the UI"""
         _mem = self._memobj
         basic = RadioSettingGroup("basic", "Basic Settings")
-        top = RadioSettings(basic)
+        advanced = RadioSettingGroup("advanced", "Advanced Settings")
+        top = RadioSettings(basic, advanced)
 
         # Basic
         tdr = RadioSetting("settings.tdr", "Transceiver dual receive",
@@ -1145,6 +1170,42 @@
                                      _mem.settings.rptdl]))
             basic.append(rptdl)
 
+        # Advanced
+        def _filter(name):
+            filtered = ""
+            for char in str(name):
+                if char in VALID_CHARS:
+                    filtered += char
+                else:
+                    filtered += " "
+            return filtered
+
+        _msg = self._memobj.poweron_msg
+        line1 = RadioSetting("poweron_msg.line1", "Power-on message line 1",
+                             RadioSettingValueString(0, 6, _filter(
+                                 _msg.line1)))
+        advanced.append(line1)
+        line2 = RadioSetting("poweron_msg.line2", "Power-on message line 2",
+                             RadioSettingValueString(0, 6, _filter(
+                                 _msg.line2)))
+        advanced.append(line2)
+
+        if self.MODEL in ("UV-2501", "UV-5001"):
+            vfomren = RadioSetting("settings2.vfomren", "VFO/MR switching",
+                                   RadioSettingValueBoolean(
+                                       not _mem.settings2.vfomr))
+            advanced.append(vfomren)
+
+            reseten = RadioSetting("settings2.reseten", "RESET",
+                                   RadioSettingValueBoolean(
+                                       _mem.settings2.reseten))
+            advanced.append(reseten)
+
+            menuen = RadioSetting("settings2.menuen", "Menu",
+                                  RadioSettingValueBoolean(
+                                      _mem.settings2.menuen))
+            advanced.append(menuen)
+
         return top
 
     def set_settings(self, settings):



More information about the chirp_devel mailing list