[chirp_devel] [PATCH] Add Travel Plus (.tpe) import support
Tom Hayward
Thu Apr 12 17:30:07 PDT 2012
# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1334277000 21600
# Node ID 6a0fcb537a00a9bc942a6d32c19a870e4c9eff16
# Parent 0ee4af13c81f43101fddfa04119a6459560094bf
Add Travel Plus (.tpe) import support.
I've only tested this with a single small .tpe file, so this may be missing a
lot of special cases. If you have access to Travel Plus, please test for me!
diff -r 0ee4af13c81f -r 6a0fcb537a00 chirp/generic_tpe.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/chirp/generic_tpe.py Thu Apr 12 18:30:00 2012 -0600
@@ -0,0 +1,41 @@
+# Copyright 2012 Tom Haywward <tom at tomh.us>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+import os
+import csv
+
+from chirp import chirp_common, directory, generic_csv
+
+class TpeMap:
+ """Pretend we're a dict"""
+ def items(self):
+ return [
+ ("Sequence Number" , (int, "number")),
+ ("Location" , (str, "comment")),
+ ("Call Sign" , (str, "name")),
+ ("Output Frequency", (chirp_common.parse_freq, "freq")),
+ ("Input Frequency" , (str, "duplex")),
+ ("CTCSS Tones" , (lambda v: "Tone" if float(v) in chirp_common.TONES else "", "tmode")),
+ ("CTCSS Tones" , (lambda v: float(v) if float(v) in chirp_common.TONES else 88.5, "rtone")),
+ ("CTCSS Tones" , (lambda v: float(v) if float(v) in chirp_common.TONES else 88.5, "ctone")),
+ ]
+
+ at directory.register
+class TpeRadio(generic_csv.CSVRadio):
+ VENDOR = "ARRL"
+ MODEL = "Travel Plus"
+ FILE_EXTENSION = "tpe"
+
+ ATTR_MAP = TpeMap()
diff -r 0ee4af13c81f -r 6a0fcb537a00 chirpui/mainapp.py
--- a/chirpui/mainapp.py Wed Apr 11 13:23:24 2012 +0200
+++ b/chirpui/mainapp.py Thu Apr 12 18:30:00 2012 -0600
@@ -669,6 +669,7 @@
(_("EVE Files (VX5)") + " (*.eve)", "*.eve"),
(_("ICF Files") + " (*.icf)", "*.icf"),
(_("Kenwood HMK Files") + " (*.hmk)", "*.hmk"),
+ (_("Travel Plus Files") + " (*.tpe)", "*.tpe"),
(_("VX5 Commander Files") + " (*.vx5)", "*.vx5"),
(_("VX7 Commander Files") + " (*.vx7)", "*.vx7")]
filen = platform.get_platform().gui_open_file(types=types)
More information about the chirp_devel
mailing list