[chirp_devel] [PATCH 0 of 5 ] More clone instructions
The following patches have to be applied after last set of "prompt" patches from Tom. That is the best solution so far to add instructions to radio, please forgive my "clone message" patches of yesterday.
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1381310189 -7200 # Node ID fbb1c3a7be93999436a7c56b19221cbe78c0a58c # Parent e895b97a86339b3152e55a56e454a1eeb8ad5e0e [ui] set ok button the default with focus on instructions dialog related to #1163
diff --git a/chirpui/mainapp.py b/chirpui/mainapp.py --- a/chirpui/mainapp.py +++ b/chirpui/mainapp.py @@ -591,6 +591,10 @@ again = gtk.CheckButton(_("Don't show instructions for any radio again")) again.show() d.vbox.pack_start(again, 0, 0, 0) + h_button_box=d.vbox.get_children()[2] + ok_button=h_button_box.get_children()[0] + ok_button.grab_default() + ok_button.grab_focus() d.run() d.destroy() CONF.set_bool("clone_instructions", again.get_active(), "noconfirm")
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1381310189 -7200 # Node ID 89e710ef0a315ceaea585640f0277c9078a7d593 # Parent fbb1c3a7be93999436a7c56b19221cbe78c0a58c [vx7] Add instructions for clone mode part of feature #1163
diff --git a/chirp/vx7.py b/chirp/vx7.py --- a/chirp/vx7.py +++ b/chirp/vx7.py @@ -15,6 +15,7 @@
from chirp import chirp_common, yaesu_clone, directory from chirp import bitwise +from textwrap import dedent
MEM_FORMAT = """ #seekto 0x0611; @@ -183,6 +184,23 @@ _block_lengths = [ 10, 8, 16193 ] _block_size = 8
+ @classmethod + def get_prompts(cls): + rp = chirp_common.RadioPrompts() + rp.pre_download = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to MIC/SP jack. + 3. Press and hold in the [MON-F] key while turning the radio on + ("CLONE" will appear on the display). + 4. <b>After clicking OK</b>, press the [BAND] key to send image.""")) + rp.pre_upload = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to MIC/SP jack. + 3. Press and hold in the [MON-F] key while turning the radio on + ("CLONE" will appear on the display). + 4. Press the [V/M] key ("CLONE WAIT" will appear on the LCD).""")) + return rp + def _checksums(self): return [ yaesu_clone.YaesuChecksum(0x0592, 0x0610), yaesu_clone.YaesuChecksum(0x0612, 0x0690),
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1381310189 -7200 # Node ID fbbdb323d3ff92346d53d7ebd95e5de5a5627b21 # Parent 89e710ef0a315ceaea585640f0277c9078a7d593 [ft60] Add instructions for clone mode part of feature #1163
diff --git a/chirp/ft60.py b/chirp/ft60.py --- a/chirp/ft60.py +++ b/chirp/ft60.py @@ -16,6 +16,7 @@ import time from chirp import chirp_common, yaesu_clone, memmap, bitwise, directory from chirp import errors +from textwrap import dedent
ACK = "\x06"
@@ -71,7 +72,7 @@ _send(radio.pipe, radio.get_mmap()[offset:offset+64]) ack = radio.pipe.read(1) if ack != ACK: - raise Exception("Radio did not ack block %i" % i) + raise Exception(_("Radio did not ack block %i") % i)
if radio.status_fn: status = chirp_common.Status() @@ -166,6 +167,27 @@
_memsize = 28617
+ @classmethod + def get_prompts(cls): + rp = chirp_common.RadioPrompts() + rp.pre_download = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to MIC/SP jack. + 3. Press and hold in the [MONI] switch while turning the + radio on. + 4. Rotate the DIAL job to select "F8 CLONE". + 5. Press the [F/W] key momentarily. + 6. <b>After clicking OK</b>, press the [PTT] switch to send image.""")) + rp.pre_upload = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to MIC/SP jack. + 3. Press and hold in the [MONI] switch while turning the + radio on. + 4. Rotate the DIAL job to select "F8 CLONE". + 5. Press the [F/W] key momentarily. + 6. Press the [MONI] switch ("--RX--" will appear on the LCD).""")) + return rp + def get_features(self): rf = chirp_common.RadioFeatures() rf.memory_bounds = (1, 999)
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1381310189 -7200 # Node ID ac46d408eea8615a13c837fe98ce03309c658d7f # Parent fbbdb323d3ff92346d53d7ebd95e5de5a5627b21 [ft817] Add instructions for clone mode part of feature #1163
diff --git a/chirp/ft817.py b/chirp/ft817.py --- a/chirp/ft817.py +++ b/chirp/ft817.py @@ -22,6 +22,7 @@ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString import time, os +from textwrap import dedent
CMD_ACK = 0x06
@@ -272,6 +273,25 @@
SPECIAL_MEMORIES_REV = dict(zip(SPECIAL_MEMORIES.values(), SPECIAL_MEMORIES.keys())) + + @classmethod + def get_prompts(cls): + rp = chirp_common.RadioPrompts() + rp.pre_download = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to ACC jack. + 3. Press and hold in the [MODE <] and [MODE >] keys while + turning the radio on ("CLONE MODE" will appear on the + display). + 4. <b>After clicking OK</b>, press the [A] key to send image.""")) + rp.pre_upload = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to ACC jack. + 3. Press and hold in the [MODE <] and [MODE >] keys while + turning the radio on ("CLONE MODE" will appear on the + display). + 4. Press the [C] key ("RX" will appear on the LCD).""")) + return rp
def _read(self, block, blocknum): for _i in range(0, 60): @@ -304,7 +324,7 @@ data = "" blocks = 0 status = chirp_common.Status() - status.msg = "Cloning from radio" + status.msg = _("Cloning from radio") status.max = len(self._block_lengths) + 39 for block in self._block_lengths: if blocks == 8: @@ -319,14 +339,14 @@ status.cur = blocks self.status_fn(status)
- status.msg = "Clone completed, checking for spurious bytes" + status.msg = _("Clone completed, checking for spurious bytes") self.status_fn(status) moredata = self.pipe.read(2) if moredata: - raise Exception("Radio sent data after the last awaited block, " + raise Exception(_("Radio sent data after the last awaited block, " "this happens when the selected model is a non-US " "but the radio is a US one. " - "Please choose the correct model and try again.") + "Please choose the correct model and try again."))
print "Clone completed in %i seconds" % (time.time() - start) @@ -340,7 +360,7 @@ blocks = 0 pos = 0 status = chirp_common.Status() - status.msg = "Cloning to radio" + status.msg = _("Cloning to radio") status.max = len(self._block_lengths) + 39 for block in self._block_lengths: if blocks == 8: @@ -370,7 +390,7 @@ 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) + raise Exception(_("Radio did not ack block %i") % blocks) pos += block blocks += 1 status.cur = blocks
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1381310443 -7200 # Node ID fdecd9d7b1e72bc98b7677be871fc9f41320345d # Parent ac46d408eea8615a13c837fe98ce03309c658d7f [ft857] Add instructions for clone mode part of feature #1163
diff --git a/chirp/ft857.py b/chirp/ft857.py --- a/chirp/ft857.py +++ b/chirp/ft857.py @@ -21,6 +21,7 @@ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString import os +from textwrap import dedent
@directory.register class FT857Radio(ft817.FT817Radio): @@ -412,6 +413,25 @@ "91:XVTR SEL", "MONI", "Q.SPL", "TCALL", "ATC", "USER"]
+ @classmethod + def get_prompts(cls): + rp = chirp_common.RadioPrompts() + rp.pre_download = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to CAT/LINEAR jack. + 3. Press and hold in the [MODE <] and [MODE >] keys while + turning the radio on ("CLONE MODE" will appear on the + display). + 4. <b>After clicking OK</b>, press the [C](SEND) key to send image.""")) + rp.pre_upload = _(dedent("""\ + 1. Turn radio off. + 2. Connect cable to ACC jack. + 3. Press and hold in the [MODE <] and [MODE >] keys while + turning the radio on ("CLONE MODE" will appear on the + display). + 4. Press the [A](RCV) key ("receiving" will appear on the LCD).""")) + return rp + def get_features(self): rf = ft817.FT817Radio.get_features(self) rf.has_cross = True
That is the best solution so far to add instructions to radio, please forgive my "clone message" patches of yesterday.
I agree! Thanks very much to both of you for working on this. I know the users will very much appreciate it :)
participants (2)
-
Dan Smith
-
Marco Filippi IZ3GME