[chirp_devel] [PATCH 1 of 4] Add "valid_cross_modes" to RadioFeatures

IZ3GME Marco
Sat Jan 21 03:52:33 PST 2012


# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1327136373 -3600
# Node ID 70facf402fea4c7ef1742c22a20914845b0021d7
# Parent  f88a7674686e21a04ed74861bcbf9806bb753a21
Add "valid_cross_modes" to RadioFeatures.

diff -r f88a7674686e -r 70facf402fea chirp/chirp_common.py
--- a/chirp/chirp_common.py	Thu Jan 19 23:03:51 2012 +0100
+++ b/chirp/chirp_common.py	Sat Jan 21 09:59:33 2012 +0100
@@ -548,6 +548,7 @@
         "valid_power_levels"  : [],
         "valid_characters"    : "",
         "valid_name_length"   : 0,
+        "valid_cross_modes"   : [],
 
         "has_sub_devices"     : BOOLEAN,
         "memory_bounds"       : (0, 0),
@@ -647,6 +648,8 @@
         self.init("valid_name_length", 6,
                   "The maximum number of characters in a memory's " +
                   "alphanumeric tag")
+        self.init("valid_cross_modes", list(CROSS_MODES),
+                  "Supported tone cross modes")
 
         self.init("has_sub_devices", False,
                   "Indicates that the radio behaves as two semi-independent " +
@@ -764,6 +767,11 @@
         if rf.valid_tmodes and mem.tmode not in rf.valid_tmodes:
             msg = ValidationError("Tone mode %s not supported" % mem.tmode)
             msgs.append(msg)
+        else:
+            if mem.tmode == "Cross":
+                if rf.valid_cross_modes and mem.cross_mode not in rf.valid_cross_modes:
+                    msg = ValidationError("Cross tone mode %s not supported" % mem.cross_mode)
+                    msgs.append(msg)
 
         if rf.valid_duplexes and mem.duplex not in rf.valid_duplexes:
             msg = ValidationError("Duplex %s not supported" % mem.duplex)
diff -r f88a7674686e -r 70facf402fea chirpui/memedit.py
--- a/chirpui/memedit.py	Thu Jan 19 23:03:51 2012 +0100
+++ b/chirpui/memedit.py	Sat Jan 21 09:59:33 2012 +0100
@@ -1248,6 +1248,7 @@
         self.choices[_("Bank")] = gtk.ListStore(TYPE_STRING, TYPE_STRING)
         self.choices[_("Mode")] = features["valid_modes"]
         self.choices[_("Tone Mode")] = features["valid_tmodes"]
+        self.choices[_("Cross Mode")] = features["valid_cross_modes"]
         self.choices[_("Skip")] = features["valid_skips"]
         self.choices[_("Power")] = [str(x) for x in features["valid_power_levels"]]
 



More information about the chirp_devel mailing list