[chirp_devel] [PATCH] [vx8] New settings, from a VX-8GR

ray c
Sun Aug 3 09:55:52 PDT 2014


Hello,
I'm new to Mercurial, but have been enjoying the fruits of your project for
a while. I recently picked up a VX-8GR and noticed that not many settings
were populated, so this is my first stab at adding some...

Ray

# HG changeset patch
# User Ray Cielencki <rayslinky at gmail.com>
# Date 1407084280 14400
#      Sun Aug 03 12:44:40 2014 -0400
# Node ID de092ff89055726b65a355a2e8c8444f3fbb972b
# Parent  73e127bbd9813b6cf966bdca1fefdc6c4ecac058
[vx8] New settings, from a VX-8GR

diff -r 73e127bbd981 -r de092ff89055 chirp/vx8.py
--- a/chirp/vx8.py    Tue Jul 22 19:31:33 2014 -0400
+++ b/chirp/vx8.py    Sun Aug 03 12:44:40 2014 -0400
@@ -264,6 +264,27 @@
   char padded_string[60];
 } aprs_beacon_status_txt[5];

+#seekto 0x04bf;
+struct {
+  u8 beep;
+} beep_select;
+
+#seekto 0x047f;
+struct {
+  u8 flag;
+  u16 unknown;
+  struct {
+    u8 padded_yaesu[16];
+  } message;
+} opening_message;
+
+#seekto 0x04da;
+struct {
+  u8 scan_restart;
+  u8 unknown;
+  u8 scan_resume;
+} scan_settings;
+
 #seekto 0xFECA;
 u8 checksum;
 """
@@ -650,6 +671,15 @@
               "every 2 minutes", "every 3 minutes", "every 4 minutes",
               "every 5 minutes", "every 6 minutes", "every 7 minutes",
               "every 8 minutes", "every 9 minutes", "every 10 minutes")
+    _BEEP_SELECT = ("Off", "Key+Scan", "Key")
+    _OPENING_MESSAGE = ("Off", "DC", "Message", "Normal")
+    _SCAN_RESUME = ("2.0s", "2.5s", "3.0s", "3.5s", "4.0s", "4.5s", "5.0s",
+                    "5.5s", "6.0s", "6.5s", "7.0s", "7.5s", "8.0s", "8.5s",
+                    "9.0s", "9.5s", "10.0s", "Busy", "Hold")
+    _SCAN_RESTART = ("0.1s", "0.2s", "0.3s", "0.4s", "0.5s", "0.6s",
"0.7s",
+                     "0.8s", "0.9s", "1.0s", "1.5s", "2.0s", "2.5s",
"3.0s",
+                     "3.5s", "4.0s", "4.5s", "5.0s", "5.5s", "6.0s",
"6.5s",
+                     "7.0s", "7.5s", "8.0s", "8.5s", "9.0s", "9.5s",
"10.0s")
     _MY_SYMBOL = ("/[ Person", "/b Bike", "/> Car", "User selected")

     def get_features(self):
@@ -1135,12 +1165,73 @@

         return menu

+    def _get_beep_select(self):
+        menu = RadioSettingGroup("beep_select", "Beep Select")
+        beep_select = self._memobj.beep_select
+
+        val = RadioSettingValueList(
+            self._BEEP_SELECT,
+            self._BEEP_SELECT[beep_select.beep])
+        rs = RadioSetting("beep_select.beep", "Beep Select",
+                          val)
+        menu.append(rs)
+
+        return menu
+
+    def _get_scan_settings(self):
+        menu = RadioSettingGroup("scan_settings", "Scan Settings")
+        scan_settings = self._memobj.scan_settings
+
+        val = RadioSettingValueList(
+            self._SCAN_RESTART,
+            self._SCAN_RESTART[scan_settings.scan_restart])
+        rs = RadioSetting("scan_settings.scan_restart", "Scan Restart",
+                          val)
+        menu.append(rs)
+
+        val = RadioSettingValueList(
+            self._SCAN_RESUME,
+            self._SCAN_RESUME[scan_settings.scan_resume])
+        rs = RadioSetting("scan_settings.scan_resume", "Scan Resume",
+                          val)
+        menu.append(rs)
+
+        return menu
+
+    def _get_opening_message(self):
+        menu = RadioSettingGroup("opening_message", "Opening Message")
+        opening_message = self._memobj.opening_message
+
+        val = RadioSettingValueList(
+            self._OPENING_MESSAGE,
+            self._OPENING_MESSAGE[opening_message.flag])
+        rs = RadioSetting("opening_message.flag", "Flag",
+                          val)
+        menu.append(rs)
+
+        msg = ""
+        for i in opening_message.message.padded_yaesu:
+            if i == 0xFF:
+                break
+            msg += CHARSET[i & 0x7F]
+        val = RadioSettingValueString(0, 16, msg)
+        rs = RadioSetting("opening_message.message.padded_yaesu",
"Message",
+                          val)
+        rs.set_apply_callback(self.apply_ff_padded_yaesu,
+                              opening_message.message)
+        menu.append(rs)
+
+        return menu
+
     def _get_settings(self):
         top = RadioSettingGroup("all", "All Settings",
                                 self._get_aprs_general_settings(),
                                 self._get_aprs_rx_settings(),
                                 self._get_aprs_tx_settings(),
-                                self._get_aprs_smartbeacon())
+                                self._get_aprs_smartbeacon(),
+                                self._get_beep_select(),
+                                self._get_scan_settings(),
+                                self._get_opening_message())
         return top

     def get_settings(self):
@@ -1272,6 +1363,16 @@
                 print element.get_name()
                 raise

+    def apply_ff_padded_yaesu(cls, setting, obj):
+        # FF pad yaesus custom string format.
+        rawval = setting.value.get_value()
+        max_len = getattr(obj, "padded_yaesu").size() / 8
+        rawval = str(rawval).rstrip()
+        val = [CHARSET.index(x) for x in rawval]
+        for x in range(len(val), max_len):
+            val.append(0xFF)
+        setattr(obj, "padded_yaesu", val)
+
 @directory.register
 class VX8GERadio(VX8DRadio):
     """Yaesu VX-8GE"""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20140803/9b947531/attachment-0001.html 


More information about the chirp_devel mailing list