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

Jim Unroe
Wed Dec 31 10:36:42 PST 2014


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1420049828 18000
# Node ID 6e0dc6de8bd4d4b9d39fe2bf24491e5ca4b4628e
# Parent  54ba9427051ed7928acb7ff204b015f1aa8297aa
[VV-898] Add Settings to Leixen VV-898 Module - Part 3

Add the following settings:
- Custom Display Message 1
- Custom Display Message 2
- System Message (display only)
- Backlight
- Key Lock Mode
- A/B Select

related to #2149

diff -r 54ba9427051e -r 6e0dc6de8bd4 chirp/leixen.py
--- a/chirp/leixen.py	Wed Dec 31 12:31:16 2014 -0500
+++ b/chirp/leixen.py	Wed Dec 31 13:17:08 2014 -0500
@@ -60,11 +60,26 @@
   u8 unknown0x0192;
   u8 unknown0x0193;
   u8 unknown0x0194;
-  u8 unknown0x0195;
+  u8 menuen:1,           // menu enable
+     absel:1,            // a/b select
+     unknown:2
+     keymshort:4;        // m key short press
   u8 unknown:6,
      monitor:2;          // monitor
 } settings;
 
+#seekto 0x0900;
+struct {
+  char user1[7];         // user message 1
+  char unknown0x0907;
+  char unknown0x0908[8];
+  char unknown0x0910[8];
+  char system[7];        // system message
+  char unknown0x091F;
+  char user2[7];         // user message 2
+  char unknown0x0927;
+} messages;
+
 struct channel {
   bbcd rx_freq[4];
   bbcd tx_freq[4];
@@ -115,6 +130,9 @@
 MRCHA_LIST = ["MR CHA", "Freq. MR"]
 VOL_LIST = ["OFF"] + ["%s" % x for x in range(1, 16)]
 OPENDIS_LIST = ["All", "Lease Time", "User-defined", "Leixen"]
+LAMP_LIST = ["OFF", "KEY", "CONT"]
+KEYLOCKM_LIST = ["K+S", "PTT", "KEY", "ALL"]
+ABSEL_LIST = ["B Channel",  "A Channel"]
 
 POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=4),
                 chirp_common.PowerLevel("High", watts=10)]
@@ -466,6 +484,41 @@
                                               OPENDIS_LIST[_settings.opendis]))
         cfg_grp.append(rs)
 
+        def _filter(name):
+            filtered = ""
+            for char in str(name):
+                if char in chirp_common.CHARSET_ASCII:
+                    filtered += char
+                else:
+                    filtered += " "
+            print "Filtered: %s" % filtered
+            return filtered
+
+        rs = RadioSetting("messages.user1", "User-defined Message 1",
+                          RadioSettingValueString(0, 7, _filter(_msg.user1)))
+        cfg_grp.append(rs)
+        rs = RadioSetting("messages.user2", "User-defined Message 2",
+                          RadioSettingValueString(0, 7, _filter(_msg.user2)))
+        cfg_grp.append(rs)
+
+        val = RadioSettingValueString(0, 7, _filter(_msg.system))
+        val.set_mutable(False)
+        rs = RadioSetting("messages.system", "System Message", val)
+        cfg_grp.append(rs)
+
+        rs = RadioSetting("lamp", "Backlight",
+                          RadioSettingValueList(LAMP_LIST,
+                                                LAMP_LIST[_settings.lamp]))
+        cfg_grp.append(rs)
+        rs = RadioSetting("keylockm", "Key Lock Mode",
+                          RadioSettingValueList(KEYLOCKM_LIST,
+                                            KEYLOCKM_LIST[_settings.keylockm]))
+        cfg_grp.append(rs)
+        rs = RadioSetting("absel", "A/B Select",
+                          RadioSettingValueList(ABSEL_LIST,
+                                                ABSEL_LIST[_settings.absel]))
+        cfg_grp.append(rs)
+
         return group
 
     def get_settings(self):



More information about the chirp_devel mailing list