[chirp_devel] [PATCH] [uv-b5]Add Test Mode Settings for Squelch Levels and Power Output Levels

Jim Unroe
Tue Sep 10 19:32:29 PDT 2013


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1378866694 14400
# Node ID 96f54c5afe2ada5b0f4874de0a264e6930ba412c
# Parent  c60b1cdee0f0549b7c1ae56507b3738778fc5b5d
[uv-b5]Add Test Mode Settings for Squelch Levels and Power Output Levels
that correspond to the OEM software's Test Mode settings menu.

add structure to support test mode settings
add Test Mode menu
add 8 VHF High Power settings
add 8 VHF Low Power settings
add 8 UHF High Power settings
add 8 UHF Low Power settings
add 10 VHF Squelch settings
add 10 UHF Squelch settings
#1123

diff -r c60b1cdee0f0 -r 96f54c5afe2a chirp/uvb5.py
--- a/chirp/uvb5.py	Mon Sep 09 14:06:23 2013 -0700
+++ b/chirp/uvb5.py	Tue Sep 10 22:31:34 2013 -0400
@@ -96,6 +96,64 @@
   lbcd lower_uhf[2];
   lbcd upper_uhf[2];
 } limits;
+
+#seekto 0x0FF0;
+struct {
+  u8 vhfsquelch0;
+  u8 vhfsquelch1;
+  u8 vhfsquelch2;
+  u8 vhfsquelch3;
+  u8 vhfsquelch4;
+  u8 vhfsquelch5;
+  u8 vhfsquelch6;
+  u8 vhfsquelch7;
+  u8 vhfsquelch8;
+  u8 vhfsquelch9;
+  u8 unknown1[6];
+  u8 uhfsquelch0;
+  u8 uhfsquelch1;
+  u8 uhfsquelch2;
+  u8 uhfsquelch3;
+  u8 uhfsquelch4;
+  u8 uhfsquelch5;
+  u8 uhfsquelch6;
+  u8 uhfsquelch7;
+  u8 uhfsquelch8;
+  u8 uhfsquelch9;
+  u8 unknown2[6];
+  u8 vhfhipwr0;
+  u8 vhfhipwr1;
+  u8 vhfhipwr2;
+  u8 vhfhipwr3;
+  u8 vhfhipwr4;
+  u8 vhfhipwr5;
+  u8 vhfhipwr6;
+  u8 vhfhipwr7;
+  u8 vhflopwr0;
+  u8 vhflopwr1;
+  u8 vhflopwr2;
+  u8 vhflopwr3;
+  u8 vhflopwr4;
+  u8 vhflopwr5;
+  u8 vhflopwr6;
+  u8 vhflopwr7;
+  u8 uhfhipwr0;
+  u8 uhfhipwr1;
+  u8 uhfhipwr2;
+  u8 uhfhipwr3;
+  u8 uhfhipwr4;
+  u8 uhfhipwr5;
+  u8 uhfhipwr6;
+  u8 uhfhipwr7;
+  u8 uhflopwr0;
+  u8 uhflopwr1;
+  u8 uhflopwr2;
+  u8 uhflopwr3;
+  u8 uhflopwr4;
+  u8 uhflopwr5;
+  u8 uhflopwr6;
+  u8 uhflopwr7;
+} test;
 """
 
 def do_ident(radio):
@@ -542,6 +600,45 @@
             rs.set_apply_callback(apply_freq, self._memobj.broadcastfm[i])
             bcastfm.append(rs)
 
+        testmode = RadioSettingGroup("testmode", "Test Mode Settings")
+        group.append(testmode)
+
+        vhfdata = ["136-139", "140-144", "145-149", "150-154",
+                   "155-159", "160-164", "165-169", "170-174"]
+        uhfdata = ["400-409", "410-419", "420-429", "430-439",
+                   "440-449", "450-459", "460-469", "470-479"]
+        powernamedata = ["Hi", "Lo"]
+        powerkeydata = ["hipwr", "lopwr"]
+
+        for power in range (0, 2):
+            for index in range(0, 8):
+                key = "test.vhf%s%i" % (powerkeydata[power], index)
+                name = "%s Mhz %s Power" % (vhfdata[index],
+                                            powernamedata[power])
+                rs = RadioSetting(key, name, RadioSettingValueInteger(0, 255,
+                        getattr(self._memobj.test, "vhf%s%i"
+                                % (powerkeydata[power], index))))
+                testmode.append(rs)
+
+        for power in range (0, 2):
+            for index in range(0, 8):
+                key = "test.uhf%s%i" % (powerkeydata[power], index)
+                name = "%s Mhz %s Power" % (uhfdata[index],
+                                            powernamedata[power])
+                rs = RadioSetting(key, name, RadioSettingValueInteger(0, 255,
+                        getattr(self._memobj.test, "uhf%s%i"
+                                % (powerkeydata[power], index))))
+                testmode.append(rs)
+
+        for band in ["vhf", "uhf"]:
+            for index in range(0, 10):
+                key = "test.%ssquelch%i" % (band, index)
+                name = "%s Squelch %i" % (band.upper(), index)
+                rs = RadioSetting(key, name, RadioSettingValueInteger(0, 255,
+                        getattr(self._memobj.test, "%ssquelch%i" 
+                                % (band, index))))
+                testmode.append(rs)
+
         return group
 
     def set_settings(self, settings):



More information about the chirp_devel mailing list