[chirp_devel] [PATCH 1 of 2] drivers/ft60: remove extra "(None)" in duplex drop down (#2893)
# HG changeset patch # User Cody P Schafer dev@codyps.com # Date 1443833108 14400 # Fri Oct 02 20:45:08 2015 -0400 # Node ID f599c685d5cc42229028905e63f606358e05462b # Parent a2aa4b8a4d92f619e6bd4512d3edbec8fef6174f drivers/ft60: remove extra "(None)" in duplex drop down (#2893)
ft60's driver uses the DUPLEX variable's indexes as the stored values in radio memory, and there are 2 empty string ("") options. Make chirpw's interface a bit nicer looking by hiding one of them (arbitrarily chose to hide the first as that is convenient code-wise).
diff --git a/chirp/drivers/ft60.py b/chirp/drivers/ft60.py --- a/chirp/drivers/ft60.py +++ b/chirp/drivers/ft60.py @@ -364,7 +364,7 @@ def get_features(self): rf = chirp_common.RadioFeatures() rf.memory_bounds = (1, 1000) - rf.valid_duplexes = DUPLEX + rf.valid_duplexes = DUPLEX[1:] rf.valid_tmodes = TMODES rf.valid_power_levels = POWER_LEVELS rf.valid_tuning_steps = STEPS
# HG changeset patch # User Cody P Schafer dev@codyps.com # Date 1443833114 14400 # Fri Oct 02 20:45:14 2015 -0400 # Node ID 2628a7decd6363fc5875c4ad5e84fc0323737c32 # Parent f599c685d5cc42229028905e63f606358e05462b drivers/ft60: add support for "off" duplex mode (#2891)
By using a tx frequency of '0', the radio (or at least my ft60) refuses to transmit (gives "ERROR" on the screen) when the PTT key is pressed.
diff --git a/chirp/drivers/ft60.py b/chirp/drivers/ft60.py --- a/chirp/drivers/ft60.py +++ b/chirp/drivers/ft60.py @@ -272,7 +272,7 @@ u8 checksum; """
-DUPLEX = ["", "", "-", "+", "split"] +DUPLEX = ["", "", "-", "+", "split", "off"] TMODES = ["", "Tone", "TSQL", "TSQL-R", "DTCS"] POWER_LEVELS = [chirp_common.PowerLevel("High", watts=5.0), chirp_common.PowerLevel("Mid", watts=2.0), @@ -703,7 +703,10 @@ mem.offset = int(_mem.offset) * 50000 mem.duplex = DUPLEX[_mem.duplex] if mem.duplex == "split": - mem.offset = _decode_freq(_mem.tx_freq) + if int(_mem.tx_freq) == 0: + mem.duplex = "off" + else: + mem.offset = _decode_freq(_mem.tx_freq) mem.tmode = TMODES[_mem.tmode] mem.rtone = chirp_common.TONES[_mem.tone] mem.dtcs = chirp_common.DTCS_CODES[_mem.dtcs] @@ -747,6 +750,9 @@ _mem.tx_freq, flags = _encode_freq(mem.offset) _mem.tx_freq[0].set_bits(flags) _mem.offset = 0 + elif mem.duplex == "off": + _mem.tx_freq = 0 + _mem.offset = 0 else: _mem.tx_freq = 0 _mem.offset = mem.offset / 50000
Hi Cody,
Thanks for submitting these! I just reviewed these and did some tests. I’m not too sure I understand what the intent was here, so I wanted to pose a question to the list.
For CHIRP in general - does “off” mean: a) duplex / repeater shift is disabled and the radio should operate in simplex mode or b) Tx is inhibited
I don’t see “off” listed as an option on other radios such as the VX-6.
If I change an existing simplex channel from “(None)” to “off” – the radio gives an error. Is that what was intended?
For issue 2891 – I think it would be cleaner to simply remove the extra “” from line 275, rather than stripping it from the array as its assigned to the rf object in line 367. Is the extra “”, “” needed in line 275 to effectively 1-index the duplex value instead? If not, it seems like we could just strip it out and assign the array as-is. This is how the VX-6 and most other drivers work.
73, Patrick KG7NSC
Sent from Mail for Windows 10
From: Cody P Schafer via chirp_devel Sent: Friday, October 2, 2015 5:47 PM To: chirp_devel@intrepid.danplanet.com Subject: [chirp_devel] [PATCH 2 of 2] drivers/ft60: add support for "off"duplex mode (#2891)
# HG changeset patch # User Cody P Schafer dev@codyps.com # Date 1443833114 14400 # Fri Oct 02 20:45:14 2015 -0400 # Node ID 2628a7decd6363fc5875c4ad5e84fc0323737c32 # Parent f599c685d5cc42229028905e63f606358e05462b drivers/ft60: add support for "off" duplex mode (#2891)
By using a tx frequency of '0', the radio (or at least my ft60) refuses to transmit (gives "ERROR" on the screen) when the PTT key is pressed.
diff --git a/chirp/drivers/ft60.py b/chirp/drivers/ft60.py --- a/chirp/drivers/ft60.py +++ b/chirp/drivers/ft60.py @@ -272,7 +272,7 @@ u8 checksum; """
-DUPLEX = ["", "", "-", "+", "split"] +DUPLEX = ["", "", "-", "+", "split", "off"] TMODES = ["", "Tone", "TSQL", "TSQL-R", "DTCS"] POWER_LEVELS = [chirp_common.PowerLevel("High", watts=5.0), chirp_common.PowerLevel("Mid", watts=2.0), @@ -703,7 +703,10 @@ mem.offset = int(_mem.offset) * 50000 mem.duplex = DUPLEX[_mem.duplex] if mem.duplex == "split": - mem.offset = _decode_freq(_mem.tx_freq) + if int(_mem.tx_freq) == 0: + mem.duplex = "off" + else: + mem.offset = _decode_freq(_mem.tx_freq) mem.tmode = TMODES[_mem.tmode] mem.rtone = chirp_common.TONES[_mem.tone] mem.dtcs = chirp_common.DTCS_CODES[_mem.dtcs] @@ -747,6 +750,9 @@ _mem.tx_freq, flags = _encode_freq(mem.offset) _mem.tx_freq[0].set_bits(flags) _mem.offset = 0 + elif mem.duplex == "off": + _mem.tx_freq = 0 + _mem.offset = 0 else: _mem.tx_freq = 0 _mem.offset = mem.offset / 50000 _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
On Tue, Oct 6, 2015 at 10:23 PM, Patrick Lang via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
For CHIRP in general - does “off” mean:
a) duplex / repeater shift is disabled and the radio should operate in simplex mode
or
b) Tx is inhibited
It's, of course, "b": http://chirp.danplanet.com/projects/chirp/wiki/MemoryEditorColumns#Duplex
For issue 2891 – I think it would be cleaner to simply remove the extra “” from line 275, rather than stripping it from the array as its assigned to the rf object in line 367. Is the extra “”, “” needed in line 275 to effectively 1-index the duplex value instead? If not, it seems like we could just strip it out and assign the array as-is. This is how the VX-6 and most other drivers work.
Yes, the array index is important here.
Tom KD7LXL
Thanks!
Looks good and everything is working as it should then. I'm surprised I never noticed the duplicate none entry before.
-----Original Message----- From: "Tom Hayward via chirp_devel" chirp_devel@intrepid.danplanet.com Sent: 10/7/2015 9:24 AM To: "chirp_devel@intrepid.danplanet.com" chirp_devel@intrepid.danplanet.com Subject: Re: [chirp_devel] [PATCH 2 of 2] drivers/ft60: add support for"off"duplex mode (#2891)
On Tue, Oct 6, 2015 at 10:23 PM, Patrick Lang via chirp_devel chirp_devel@intrepid.danplanet.com wrote:
For CHIRP in general - does “off” mean:
a) duplex / repeater shift is disabled and the radio should operate in simplex mode
or
b) Tx is inhibited
It's, of course, "b": http://chirp.danplanet.com/projects/chirp/wiki/MemoryEditorColumns#Duplex
For issue 2891 – I think it would be cleaner to simply remove the extra “” from line 275, rather than stripping it from the array as its assigned to the rf object in line 367. Is the extra “”, “” needed in line 275 to effectively 1-index the duplex value instead? If not, it seems like we could just strip it out and assign the array as-is. This is how the VX-6 and most other drivers work.
Yes, the array index is important here.
Tom KD7LXL _______________________________________________ chirp_devel mailing list chirp_devel@intrepid.danplanet.com http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
participants (3)
-
Cody P Schafer
-
Patrick Lang
-
Tom Hayward