[chirp_devel] [PATCH 0 of 1 ] Wouxun tx inhibit
I was sure to have sent this already but some days ago but ...
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1351799844 -3600 # Node ID 18b37c240b739db341b88a1cd1a4543d8084b6ec # Parent e2e1f0e8fe7480b24981abf470d4d85d314f29e8 [KG-UVD1P KG-UV6] Add support for tx inhibit implements #336
diff --git a/chirp/wouxun.py b/chirp/wouxun.py --- a/chirp/wouxun.py +++ b/chirp/wouxun.py @@ -199,7 +199,7 @@ rf.valid_bands = self.valid_freq rf.valid_characters = "".join(self.CHARSET) rf.valid_name_length = 6 - rf.valid_duplexes = ["", "+", "-", "split"] + rf.valid_duplexes = ["", "+", "-", "split", "off"] rf.has_ctone = True rf.has_rx_dtcs = True rf.has_cross = True @@ -332,6 +332,12 @@ print "Got TX %s (%i) RX %s (%i)" % (txmode, _mem.tx_tone, rxmode, _mem.rx_tone)
+ def _is_txinh(self, _mem): + raw_tx = "" + for i in range(0, 4): + raw_tx += _mem.tx_freq[i].get_raw() + return raw_tx == "\xFF\xFF\xFF\xFF" + def get_memory(self, number): _mem = self._memobj.memory[number - 1] _nam = self._memobj.names[number - 1] @@ -346,12 +352,14 @@ mem.freq = int(_mem.rx_freq) * 10 if _mem.splitdup: mem.duplex = "split" + elif self._is_txinh(_mem): + mem.duplex = "off" elif int(_mem.rx_freq) < int(_mem.tx_freq): mem.duplex = "+" elif int(_mem.rx_freq) > int(_mem.tx_freq): mem.duplex = "-"
- if mem.duplex == "": + if mem.duplex == "" or mem.duplex == "off": mem.offset = 0 elif mem.duplex == "split": mem.offset = int(_mem.tx_freq) * 10 @@ -431,6 +439,9 @@ _mem.rx_freq = int(mem.freq / 10) if mem.duplex == "split": _mem.tx_freq = int(mem.offset / 10) + elif mem.duplex == "off": + for i in range(0, 4): + _mem.tx_freq[i].set_raw("\xFF") elif mem.duplex == "+": _mem.tx_freq = int(mem.freq / 10) + int(mem.offset / 10) elif mem.duplex == "-":
OK, I have applied the patch using:
jadler@server:~/usb-minne/Dokument/ssa-amatörradio/chirp/chirp.hg$ patch -p1 < ../devel-121105-0.diff
The patched wouxun.py looks OK to me. How do I run this local copy of the development version instead of the installed daily build (Ubuntu, pulled from repository)? Running <chirp base>/chirpw.py seems to use the installed version instead. Do I have to remove the installed daily build and manually install the patched development version?
You seem to have used "diff --git a/chirp/wouxun.py b/chirp/wouxun.py" to produce the diff. Is there a significant reason not to use the diff command of hg, e.g. "hg diff chirp.hg/ > wouxun-121103-01.diff"? The latter is aware of development tree version, and I guess it is more likely to gracefully handle attempts to apply the patch to a source tree that has not been updated.
Regards, Johan Adler Stockholm, Sweden
2012/11/5 Marco Filippi IZ3GME iz3gme.marco@gmail.com:
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1351799844 -3600 # Node ID 18b37c240b739db341b88a1cd1a4543d8084b6ec # Parent e2e1f0e8fe7480b24981abf470d4d85d314f29e8 [KG-UVD1P KG-UV6] Add support for tx inhibit implements #336
diff --git a/chirp/wouxun.py b/chirp/wouxun.py --- a/chirp/wouxun.py +++ b/chirp/wouxun.py @@ -199,7 +199,7 @@ rf.valid_bands = self.valid_freq rf.valid_characters = "".join(self.CHARSET) rf.valid_name_length = 6
rf.valid_duplexes = ["", "+", "-", "split"]
rf.valid_duplexes = ["", "+", "-", "split", "off"] rf.has_ctone = True rf.has_rx_dtcs = True rf.has_cross = True
@@ -332,6 +332,12 @@ print "Got TX %s (%i) RX %s (%i)" % (txmode, _mem.tx_tone, rxmode, _mem.rx_tone)
- def _is_txinh(self, _mem):
raw_tx = ""
for i in range(0, 4):
raw_tx += _mem.tx_freq[i].get_raw()
return raw_tx == "\xFF\xFF\xFF\xFF"
- def get_memory(self, number): _mem = self._memobj.memory[number - 1] _nam = self._memobj.names[number - 1]
@@ -346,12 +352,14 @@ mem.freq = int(_mem.rx_freq) * 10 if _mem.splitdup: mem.duplex = "split"
elif self._is_txinh(_mem):
mem.duplex = "off" elif int(_mem.rx_freq) < int(_mem.tx_freq): mem.duplex = "+" elif int(_mem.rx_freq) > int(_mem.tx_freq): mem.duplex = "-"
if mem.duplex == "":
if mem.duplex == "" or mem.duplex == "off": mem.offset = 0 elif mem.duplex == "split": mem.offset = int(_mem.tx_freq) * 10
@@ -431,6 +439,9 @@ _mem.rx_freq = int(mem.freq / 10) if mem.duplex == "split": _mem.tx_freq = int(mem.offset / 10)
elif mem.duplex == "off":
for i in range(0, 4):
_mem.tx_freq[i].set_raw("\xFF") elif mem.duplex == "+": _mem.tx_freq = int(mem.freq / 10) + int(mem.offset / 10) elif mem.duplex == "-":
chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Hi Johan first I suggest you to use tortoisehg as gui interface to mercurial.
On 05/11/2012 17:53, Johan Adler wrote:
OK, I have applied the patch using:
jadler@server:~/usb-minne/Dokument/ssa-amatörradio/chirp/chirp.hg$ patch -p1 < ../devel-121105-0.diff
It would be better to import it to mercurial with hg import /path/to/mail/file (but I use to do this using tortoisehg)
I found the guide http://mercurial.selenic.com/guide/ very useful when I started using mercurial.
The patched wouxun.py looks OK to me. How do I run this local copy of the development version instead of the installed daily build (Ubuntu, pulled from repository)? Running <chirp base>/chirpw.py seems to use the installed version instead. Do I have to remove the installed daily build and manually install the patched development version?
You can run the development version running it's chirpw
cd /usb-minne/Dokument/ssa-amatörradio/chirp/chirp.hg ./chirpw
but you can also load a "chirp module" at runtime using menu File - Load module (you must enable developer functions in help menu first)
You seem to have used "diff --git a/chirp/wouxun.py b/chirp/wouxun.py" to produce the diff. Is there a significant reason not to use the diff command of hg, e.g. "hg diff chirp.hg/ > wouxun-121103-01.diff"? The latter is aware of development tree version, and I guess it is more likely to gracefully handle attempts to apply the patch to a source tree that has not been updated.
I first committed the changes to my local hg repository and then sent the newly created revision to the list as a PatchBomb.
Hope this can help
73 de IZ3GME Marco
participants (3)
-
IZ3GME Marco
-
Johan Adler
-
Marco Filippi IZ3GME