[chirp_devel] [PATCH 1 of 2] [KG-UVD1P KG-UV6] Allow changing freq ranges

Marco Filippi IZ3GME
Fri Nov 2 05:47:06 PDT 2012


# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1351859117 -3600
# Node ID 17c395df835a5e2fa88574cbeab7df2431237e06
# Parent  18b37c240b739db341b88a1cd1a4543d8084b6ec
[KG-UVD1P KG-UV6] Allow changing freq ranges
Feature #285
Thanks to Gary Errol N9PTC for asking and testing

diff -r 18b37c240b73 -r 17c395df835a chirp/wouxun.py
--- a/chirp/wouxun.py	gio nov 01 20:57:24 2012 +0100
+++ b/chirp/wouxun.py	ven nov 02 13:25:17 2012 +0100
@@ -211,7 +211,7 @@
         return rf
 
     def get_settings(self):
-        freqranges = RadioSettingGroup("freqranges", "Freq ranges (read only)")
+        freqranges = RadioSettingGroup("freqranges", "Freq ranges")
         top = RadioSettingGroup("top", "All Settings", freqranges)
 
         rs = RadioSetting("menu_available", "Menu Available",
@@ -273,8 +273,9 @@
         for element in settings:
             if not isinstance(element, RadioSetting):
                 if element.get_name() != "freqranges" :
-                    # frequency ranges are read only
                     self.set_settings(element)
+                else:
+                    self._set_freq_settings(element)
             else:
                 try:
                     setattr(self._memobj.settings,
@@ -284,7 +285,15 @@
                     print element.get_name()
                     raise
 
-
+    def _set_freq_settings(self, settings):
+        for element in settings:
+            try:
+                setattr(self._memobj.freq_ranges,
+                        element.get_name(),
+                        encode_freq(int(element.value)))
+            except Exception, e:
+                print element.get_name()
+                raise
 
     def get_raw_memory(self, number):
         return repr(self._memobj.memory[number - 1])



More information about the chirp_devel mailing list