[chirp_devel] [PATCH] [UV-5R] Add support for editing the 15 PTT ID Codes

Jim Unroe
Sat Feb 9 17:00:57 PST 2013


# HG changeset patch
# User Jim Unroe <rock.unroe at gmail.com>
# Date 1360457827 18000
# Node ID cee9b13d3842a257da6e1de6362dad02d88638d2
# Parent  2b2d547074f2b177447b39cbf4dd67f02a775a92
[UV-5R] Add support for editing the 15 PTT ID Codes
add supporting structure for PTT ID Codes
add DTMF Settings tab
add PTT ID Code 1-15 settings
#539

diff -r 2b2d547074f2 -r cee9b13d3842 chirp/uv5r.py
--- a/chirp/uv5r.py	Fri Feb 08 16:20:22 2013 -0800
+++ b/chirp/uv5r.py	Sat Feb 09 19:57:07 2013 -0500
@@ -44,6 +44,40 @@
      pttidbot:1;
 } memory[128];
 
+#seekto 0x0B08;
+struct {
+  u8 code0[5];
+  u8 unused1[11];
+  u8 code1[5];
+  u8 unused2[11];
+  u8 code2[5];
+  u8 unused3[11];
+  u8 code3[5];
+  u8 unused4[11];
+  u8 code4[5];
+  u8 unused5[11];
+  u8 code5[5];
+  u8 unused6[11];
+  u8 code6[5];
+  u8 unused7[11];
+  u8 code7[5];
+  u8 unused8[11];
+  u8 code8[5];
+  u8 unused9[11];
+  u8 code9[5];
+  u8 unused10[11];
+  u8 codea[5];
+  u8 unused11[11];
+  u8 codeb[5];
+  u8 unused12[11];
+  u8 codec[5];
+  u8 unused13[11];
+  u8 coded[5];
+  u8 unused14[11];
+  u8 codee[5];
+  u8 unused15[11];
+} pttid;
+
 #seekto 0x0CB2;
 struct {
   u8 code[5];
@@ -962,6 +996,204 @@
                                                     STEP_LIST[self._memobj.vfob.step]))
             workmode.append(rs)
 
+        dtmf = RadioSettingGroup("dtmf", "DTMF Settings")
+        group.append(dtmf)
+
+        try:
+            _code = self._memobj.pttid.code0
+            rs = RadioSetting("pttid.code0", "PTT ID Code 1",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code1
+            rs = RadioSetting("pttid.code1", "PTT ID Code 2",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code2
+            rs = RadioSetting("pttid.code2", "PTT ID Code 3",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code3
+            rs = RadioSetting("pttid.code3", "PTT ID Code 4",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code4
+            rs = RadioSetting("pttid.code4", "PTT ID Code 5",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code5
+            rs = RadioSetting("pttid.code5", "PTT ID Code 6",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code6
+            rs = RadioSetting("pttid.code6", "PTT ID Code 7",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code7
+            rs = RadioSetting("pttid.code7", "PTT ID Code 8",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code8
+            rs = RadioSetting("pttid.code8", "PTT ID Code 9",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.code9
+            rs = RadioSetting("pttid.code9", "PTT ID Code 10",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.codea
+            rs = RadioSetting("pttid.codea", "PTT ID Code 11",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.codeb
+            rs = RadioSetting("pttid.codeb", "PTT ID Code 12",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.codec
+            rs = RadioSetting("pttid.codec", "PTT ID Code 13",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.coded
+            rs = RadioSetting("pttid.coded", "PTT ID Code 14",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
+        try:
+            _code = self._memobj.pttid.codee
+            rs = RadioSetting("pttid.codee", "PTT ID Code 15",
+                              RadioSettingValueInteger(0, 9, _code[0]),
+                              RadioSettingValueInteger(0, 9, _code[1]),
+                              RadioSettingValueInteger(0, 9, _code[2]),
+                              RadioSettingValueInteger(0, 9, _code[3]),
+                              RadioSettingValueInteger(0, 9, _code[4]))
+            dtmf.append(rs)
+        except Exception:
+            print ("Your PTD ID code is not five digits, which is not currently"
+                   " supported in CHIRP.")
+
         return group
 
     def get_settings(self):



More information about the chirp_devel mailing list