[chirp_devel] [PATCH 4 of 4] [ft8x7] Add messages to help users remember clone procedure

Marco Filippi IZ3GME
Tue Oct 8 07:16:25 PDT 2013


# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1381241078 -7200
# Node ID 48a7440ca0bad50ac8099e6d61e943e85dce1084
# Parent  8c40aba830d23eec3f53ef93af4a2bac95075f44
[ft8x7] Add messages to help users remember clone procedure
part of feature #1163

diff --git a/chirp/ft817.py b/chirp/ft817.py
--- a/chirp/ft817.py
+++ b/chirp/ft817.py
@@ -272,6 +272,18 @@
     
     SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(),
                                     SPECIAL_MEMORIES.keys()))
+                                    
+    _START_CLONE_TX_MSG = _("Waiting for FT817 to start clone process\n"
+                            "If you didn't already please:\n"
+                            "- switch on the radio while pressing both <- -> "
+                            "buttons to push it to clone mode\n"
+                            "- start send pressing A button on the radio")
+    _START_CLONE_RX_MSG = _("This is often because, before to press the OK "
+                            "button, you forget to:\n"
+                            "- switch on the radio while pressing both <- -> "
+                            "buttons to push it to clone mode\n"
+                            "- start receive pressing C button on the radio")
+  
 
     def _read(self, block, blocknum):
         for _i in range(0, 60):
@@ -304,8 +316,10 @@
         data = ""
         blocks = 0
         status = chirp_common.Status()
-        status.msg = "Cloning from radio"
+        status.msg = self._START_CLONE_TX_MSG
         status.max = len(self._block_lengths) + 39
+        status.cur = 0
+        self.status_fn(status)
         for block in self._block_lengths:
             if blocks == 8:
                 # repeated read of 40 block same size (memory area)
@@ -318,6 +332,7 @@
                 blocks += 1
                 status.cur = blocks
                 self.status_fn(status)
+            status.msg = _("Clone in progress")
                 
         status.msg = "Clone completed, checking for spurious bytes"
         self.status_fn(status)
@@ -340,7 +355,6 @@
         blocks = 0
         pos = 0
         status = chirp_common.Status()
-        status.msg = "Cloning to radio"
         status.max = len(self._block_lengths) + 39
         for block in self._block_lengths:
             if blocks == 8:
@@ -370,7 +384,11 @@
                 if not buf or buf[0] != chr(CMD_ACK):
                     if os.getenv("CHIRP_DEBUG"):
                         print util.hexprint(buf)
-                    raise Exception("Radio did not ack block %i" % blocks)
+                    if blocks == 0:
+                        raise Exception(_("Radio did not ack first block\n")
+                                 + self._START_CLONE_RX_MSG)
+                    else :
+                        raise Exception(_("Radio did not ack block %i") % blocks)
                 pos += block
                 blocks += 1
                 status.cur = blocks
diff --git a/chirp/ft857.py b/chirp/ft857.py
--- a/chirp/ft857.py
+++ b/chirp/ft857.py
@@ -412,6 +412,16 @@
         "91:XVTR SEL",
         "MONI", "Q.SPL",  "TCALL",  "ATC",  "USER"]
         
+    _START_CLONE_TX_MSG = _("Waiting for FT857 to start clone process\n"
+                            "If you didn't already please:\n"
+                            "- switch on the radio while pressing both <- -> "
+                            "buttons to push it to clone mode\n"
+                            "- start send pressing C button on the radio")
+    _START_CLONE_RX_MSG = _("This is often because, before to press the OK "
+                            "button, you forget to:\n"
+                            "- switch on the radio while pressing both <- -> "
+                            "buttons to push it to clone mode\n"
+                            "- start receive pressing A button on the radio")
     def get_features(self):
         rf = ft817.FT817Radio.get_features(self)
         rf.has_cross = True



More information about the chirp_devel mailing list