[chirp_devel] [PATCH] [uv5r] add work mode vfo settings to the work mode tab

Jim Unroe
Sat Jan 19 06:35:11 PST 2013


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1358605105 18000
# Node ID c6bdd55cac9a221948add4b4599cb223e8ee844f
# Parent  ff2816617437995e076c53f786006ef8bb446cf5
[uv5r] add work mode vfo settings to the work mode tab
#447

diff -r ff2816617437 -r c6bdd55cac9a chirp/uv5r.py
--- a/chirp/uv5r.py	Fri Jan 18 21:22:18 2013 -0500
+++ b/chirp/uv5r.py	Sat Jan 19 09:18:25 2013 -0500
@@ -106,6 +106,44 @@
      mrchb:7;
 } wmchannel;
 
+#seekto 0x0F10;
+struct {
+  u8 freq[8];
+  u8 unknown1;
+  u8 offset[4];
+  u8 unknown2;
+  ul16 rxtone;
+  ul16 txtone;
+  u8 band;
+  u8 unknown3;
+  u8 scode;
+  u8 unknown4;
+  u8 step:4,
+     unknown:4;
+  u8 txpower:1,
+     widenarr:1,
+     unknown5:6;
+} vfoa;
+
+#seekto 0x0F30;
+struct {
+  u8 freq[8];
+  u8 unknown1;
+  u8 offset[4];
+  u8 unknown2;
+  ul16 rxtone;
+  ul16 txtone;
+  u8 band;
+  u8 unknown3;
+  u8 scode;
+  u8 unknown4;
+  u8 step:4,
+     unknown:4;
+  u8 txpower:1,
+     widenarr:1,
+     unknown5:6;
+} vfob;
+
 #seekto 0x1000;
 struct {
   u8 unknown1[8];
@@ -153,6 +191,8 @@
 
 STEPS = [2.5, 5.0, 6.25, 10.0, 12.5, 25.0]
 STEP_LIST = [str(x) for x in STEPS]
+STEPS = [2.5, 5.0, 6.25, 10.0, 12.5, 20.0, 25.0, 50.0]
+STEP291_LIST = [str(x) for x in STEPS]
 TIMEOUT_LIST = ["%s sec" % x for x in range(15, 615, 15)]
 VOICE_LIST = ["Off", "English", "Chinese"]
 DTMFST_LIST = ["OFF", "DT-ST", "ANI-ST", "DT+ANI"]
@@ -166,9 +206,11 @@
 RPSTE_LIST.insert(0, "OFF")
 STEDELAY_LIST = ["%s ms" % x for x in range(100, 1100, 100)]
 STEDELAY_LIST.insert(0, "OFF")
+SCODE_LIST = ["%s" % x for x in range(1, 16)]
 
 SETTING_LISTS = {
     "step" : STEP_LIST,
+    "step291" : STEP291_LIST,
     "timeout" : TIMEOUT_LIST,
     "voice" : VOICE_LIST,
     "dtmfst" : DTMFST_LIST,
@@ -183,6 +225,7 @@
     "ponmsg" : PONMSG_LIST,
     "rpste" : RPSTE_LIST,
     "stedelay" : STEDELAY_LIST,
+    "scode" : SCODE_LIST,
 }
 
 def _do_status(radio, block):
@@ -608,16 +651,6 @@
                           RadioSettingValueInteger(0, 9, _settings.squelch))
         basic.append(rs)
 
-        tuning_steps = list(STEP_LIST) # Make a copy of the main list
-        if self._my_version() >= 291:  # update list for BFB291 and newer
-            tuning_steps.insert(5, "20.0")
-            tuning_steps.append("50.0")
-
-        rs = RadioSetting("step", "Tuning Step",
-                          RadioSettingValueList(tuning_steps,
-                                                tuning_steps[_settings.step]))
-        advanced.append(rs)
-
         rs = RadioSetting("dtmfst", "DTMF Sidetone",
                           RadioSettingValueList(DTMFST_LIST,
                                                 DTMFST_LIST[_settings.dtmfst]))
@@ -848,6 +881,69 @@
                           RadioSettingValueInteger(0, 127, _mrcnb))
         workmode.append(rs)
 
+        options = ["VHF", "UHF"]
+        rs = RadioSetting("vfoa.band", "VFO A Band",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfoa.band]))
+        workmode.append(rs)
+
+        rs = RadioSetting("vfob.band", "VFO B Band",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfob.band]))
+        workmode.append(rs)
+
+        options = ["High", "Low"]
+        rs = RadioSetting("vfoa.txpower", "VFO A Power",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfoa.txpower]))
+        workmode.append(rs)
+
+        rs = RadioSetting("vfob.txpower", "VFO B Power",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfob.txpower]))
+        workmode.append(rs)
+
+        options = ["Wide", "Narrow"]
+        rs = RadioSetting("vfoa.widenarr", "VFO A Bandwidth",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfoa.widenarr]))
+        workmode.append(rs)
+
+        rs = RadioSetting("vfob.widenarr", "VFO B Bandwidth",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfob.widenarr]))
+        workmode.append(rs)
+
+        options = ["%s" % x for x in range(1, 16)]
+        rs = RadioSetting("vfoa.scode", "VFO A PTT-ID",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfoa.scode]))
+        workmode.append(rs)
+
+        rs = RadioSetting("vfob.scode", "VFO B PTT-ID",
+                          RadioSettingValueList(options,
+                                                options[self._memobj.vfob.scode]))
+        workmode.append(rs)
+
+        if self._my_version() >= 291:
+            rs = RadioSetting("vfoa.step", "VFO A Tuning Step",
+                              RadioSettingValueList(STEP291_LIST,
+                                                    STEP291_LIST[self._memobj.vfoa.step]))
+            workmode.append(rs)
+            rs = RadioSetting("vfob.step", "VFO B Tuning Step",
+                              RadioSettingValueList(STEP291_LIST,
+                                                    STEP291_LIST[self._memobj.vfob.step]))
+            workmode.append(rs)
+        else:
+            rs = RadioSetting("vfoa.step", "VFO A Tuning Step",
+                              RadioSettingValueList(STEP_LIST,
+                                                    STEP_LIST[self._memobj.vfoa.step]))
+            workmode.append(rs)
+            rs = RadioSetting("vfob.step", "VFO B Tuning Step",
+                              RadioSettingValueList(STEP_LIST,
+                                                    STEP_LIST[self._memobj.vfob.step]))
+            workmode.append(rs)
+
         return group
 
     def set_settings(self, settings):



More information about the chirp_devel mailing list