[chirp_devel] [PATCH 0 of 2 ] Add cross dtcs support
This patches add the long waited support for cross dtcs in UI and FT857 Still missing the related CSV format changes to have time to test everything before to make it
Please people out there with an FT857, test tones carefully as in the big number of possible combinations it's not so difficult i've missed something
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1337713098 -7200 # Node ID 9bdc33a4911e933402243f6fa61e607b80228f9b # Parent ec4361ad770faedf0e25f697e9f74a3a80beb475 Add rx_dtcs and additional tone/dtcs modes support in UI needed for Feature #100
diff -r ec4361ad770f -r 9bdc33a4911e chirp/chirp_common.py --- a/chirp/chirp_common.py mar mag 22 18:23:51 2012 +0200 +++ b/chirp/chirp_common.py mar mag 22 20:58:18 2012 +0200 @@ -56,6 +56,8 @@ "DTCS->", "->Tone", "->DTCS", + "Tone->", + "DTCS->DTCS", ]
MODES = ["WFM", "FM", "NFM", "AM", "NAM", "DV", "USB", "LSB", "CW", "RTTY", @@ -121,6 +123,7 @@ "DTCS-R", "TSQL-R", "Cross", + "DTCS Enc", ]
TUNING_STEPS = [ @@ -213,6 +216,7 @@ rtone = 88.5 ctone = 88.5 dtcs = 23 + rx_dtcs = 23 tmode = "" cross_mode = "Tone->Tone" dtcs_polarity = "NN" @@ -242,6 +246,7 @@ self.rtone = 88.5 self.ctone = 88.5 self.dtcs = 23 + self.rx_dtcs = 23 self.tmode = "" self.cross_mode = "Tone->Tone" self.dtcs_polarity = "NN" @@ -262,6 +267,7 @@ "rtone" : TONES, "ctone" : TONES, "dtcs" : DTCS_CODES + DTCS_EXTRA_CODES, + "rx_dtcs" : DTCS_CODES + DTCS_EXTRA_CODES, "tmode" : TONE_MODES, "dtcs_polarity" : ["NN", "NR", "RN", "RR"], "cross_mode" : CROSS_MODES, @@ -444,6 +450,13 @@ if self.dtcs not in DTCS_CODES: raise errors.InvalidDataError("DTCS code is not valid")
+ try: + self.rx_dtcs = int(vals[8], 10) + except: + raise errors.InvalidDataError("DTCS Rx code is not a valid number") + if self.rx_dtcs not in DTCS_CODES: + raise errors.InvalidDataError("DTCS Rx code is not valid") + if vals[9] in ["NN", "NR", "RN", "RR"]: self.dtcs_polarity = vals[9] else: @@ -614,6 +627,7 @@ # General "has_bank_index" : BOOLEAN, "has_dtcs" : BOOLEAN, + "has_rx_dtcs" : BOOLEAN, "has_dtcs_polarity" : BOOLEAN, "has_mode" : BOOLEAN, "has_offset" : BOOLEAN, @@ -702,6 +716,8 @@ "an order other than in main memory") self.init("has_dtcs", True, "Indicates that DTCS tone mode is available") + self.init("has_rx_dtcs", False, + "Indicates that radio can use two different DTCS codes for rx and tx") self.init("has_dtcs_polarity", True, "Indicates that the DTCS polarity can be changed") self.init("has_mode", True, diff -r ec4361ad770f -r 9bdc33a4911e chirpui/memedit.py --- a/chirpui/memedit.py mar mag 22 18:23:51 2012 +0200 +++ b/chirpui/memedit.py mar mag 22 20:58:18 2012 +0200 @@ -67,6 +67,7 @@ (_("Tone") , TYPE_FLOAT, gtk.CellRendererCombo, ), (_("ToneSql") , TYPE_FLOAT, gtk.CellRendererCombo, ), (_("DTCS Code") , TYPE_INT, gtk.CellRendererCombo, ), + (_("DTCS Rx Code") , TYPE_INT, gtk.CellRendererCombo, ), (_("DTCS Pol") , TYPE_STRING, gtk.CellRendererCombo, ), (_("Cross Mode"), TYPE_STRING, gtk.CellRendererCombo, ), (_("Duplex") , TYPE_STRING, gtk.CellRendererCombo, ), @@ -87,6 +88,7 @@ _("Tone") : 88.5, _("ToneSql") : 88.5, _("DTCS Code") : 23, + _("DTCS Rx Code") : 23, _("DTCS Pol") : "NN", _("Cross Mode"): "Tone->Tone", _("Duplex") : "", @@ -103,6 +105,7 @@ _("Tone") : chirp_common.TONES, _("ToneSql") : chirp_common.TONES, _("DTCS Code") : chirp_common.DTCS_CODES, + _("DTCS Rx Code") : chirp_common.DTCS_CODES, _("DTCS Pol") : ["NN", "NR", "RN", "RR"], _("Mode") : chirp_common.MODES, _("Power") : [], @@ -206,19 +209,24 @@ if tmode == "Tone": hide += [self.col(_("ToneSql")), self.col(_("DTCS Code")), + self.col(_("DTCS Rx Code")), self.col(_("DTCS Pol"))] elif tmode == "TSQL": if self._features.has_ctone: hide += [self.col(_("Tone"))]
hide += [self.col(_("DTCS Code")), + self.col(_("DTCS Rx Code")), self.col(_("DTCS Pol"))] elif tmode == "DTCS": - hide += [self.col(_("Tone")), self.col(_("ToneSql"))] + hide += [self.col(_("Tone")), + self.col(_("DTCS Rx Code")), + self.col(_("ToneSql"))] elif tmode == "" or tmode == "(None)": hide += [self.col(_("Tone")), self.col(_("ToneSql")), self.col(_("DTCS Code")), + self.col(_("DTCS Rx Code")), self.col(_("DTCS Pol"))]
if duplex == "" or duplex == "(None)": @@ -303,7 +311,7 @@
if colnum == self.col(_("Frequency")): val = chirp_common.format_freq(val) - elif colnum == self.col(_("DTCS Code")): + elif colnum in [self.col(_("DTCS Code")), self.col(_("DTCS Rx Code"))]: val = "%03i" % int(val) elif colnum == self.col(_("Offset")): val = chirp_common.format_freq(val) @@ -890,6 +898,7 @@ self.col(_("Tone")), memory.rtone, self.col(_("ToneSql")), memory.ctone, self.col(_("DTCS Code")), memory.dtcs, + self.col(_("DTCS Rx Code")), memory.rx_dtcs, self.col(_("DTCS Pol")), memory.dtcs_polarity, self.col(_("Cross Mode")), memory.cross_mode, self.col(_("Duplex")), memory.duplex, @@ -944,6 +953,7 @@ mem.rtone = vals[self.col(_("Tone"))] mem.ctone = vals[self.col(_("ToneSql"))] mem.dtcs = vals[self.col(_("DTCS Code"))] + mem.rx_dtcs = vals[self.col(_("DTCS Rx Code"))] mem.tmode = vals[self.col(_("Tone Mode"))] mem.cross_mode = vals[self.col(_("Cross Mode"))] mem.dtcs_polarity = vals[self.col(_("DTCS Pol"))] @@ -1076,6 +1086,7 @@ def get_unsupported_columns(self): maybe_hide = [ ("has_dtcs", _("DTCS Code")), + ("has_rx_dtcs", _("DTCS Rx Code")), ("has_dtcs_polarity", _("DTCS Pol")), ("has_mode", _("Mode")), ("has_offset", _("Offset")),
- "Tone->",
Why do we need this? A tmode of "Tone" should be "transmit tone, but don't require one" which is what "Tone->" implies.
- "DTCS Enc",
What's this? The case where we transmit but don't require a DTCS code should be covered under the already-present "DTCS->" cross mode, right?
"dtcs" : DTCS_CODES + DTCS_EXTRA_CODES,
"rx_dtcs" : DTCS_CODES + DTCS_EXTRA_CODES, "tmode" : TONE_MODES,
Can you keep that aligned?
(_("DTCS Code") , TYPE_INT, gtk.CellRendererCombo, ),
(_("DTCS Rx Code") , TYPE_INT, gtk.CellRendererCombo, ), (_("DTCS Pol") , TYPE_STRING, gtk.CellRendererCombo, ),
This too.
_("DTCS Code") : 23,
_("DTCS Rx Code") : 23, _("DTCS Pol") : "NN",
And this.
Thanks Marco!
Hi Dan
- "Tone->",
Why do we need this? A tmode of "Tone" should be "transmit tone, but don't require one" which is what "Tone->" implies.
This is a valid cross mode for FT857 so yes it does the same as "Tone" but it's different
- "DTCS Enc",
What's this? The case where we transmit but don't require a DTCS code should be covered under the already-present "DTCS->" cross mode, right?
Same here: "DTCS Enc" (actually DEN on the radio display) does the same as "DTCS->" but is a non cross mode
"dtcs" : DTCS_CODES + DTCS_EXTRA_CODES,
"rx_dtcs" : DTCS_CODES + DTCS_EXTRA_CODES, "tmode" : TONE_MODES,
Can you keep that aligned?
...CUT...
This too.
...CUT...
And this.
Ops ... sorry .... Will patch later today
73 de IZ3GME Marco
# HG changeset patch # User Marco Filippi iz3gme.marco@gmail.com # Date 1337713200 -7200 # Node ID 0f4b9e7b7209e35cfd1cfee52727b6deecb6de7b # Parent 9bdc33a4911e933402243f6fa61e607b80228f9b [FT857] Add Dtcs cross modes support and other tones related features last part of Feature #100
diff -r 9bdc33a4911e -r 0f4b9e7b7209 chirp/ft857.py --- a/chirp/ft857.py mar mag 22 20:58:18 2012 +0200 +++ b/chirp/ft857.py mar mag 22 21:00:00 2012 +0200 @@ -27,6 +27,7 @@ TMODES = { 0x04 : "Tone", 0x05 : "TSQL", + 0x08 : "DTCS Enc", 0x0a : "DTCS", 0xff : "Cross", 0x00 : "", @@ -36,11 +37,12 @@ CROSS_MODES = { 0x01 : "->Tone", 0x02 : "->DTCS", - # 0x04 : "Tone->", not supported bi chirp UI + 0x04 : "Tone->", 0x05 : "Tone->Tone", 0x06 : "Tone->DTCS", 0x08 : "DTCS->", 0x09 : "DTCS->Tone", + 0x0a : "DTCS->DTCS", } CROSS_MODES_REV = dict(zip(CROSS_MODES.values(), CROSS_MODES.keys()))
@@ -188,6 +190,7 @@ rf = ft817.FT817Radio.get_features(self) rf.has_cross = True rf.has_ctone = True + rf.has_rx_dtcs = True rf.valid_tmodes = self.TMODES_REV.keys() rf.valid_cross_modes = self.CROSS_MODES_REV.keys() return rf @@ -209,8 +212,10 @@ mem.rtone = mem.ctone = chirp_common.TONES[_mem.tone] elif mem.tmode == "TSQL": mem.rtone = mem.ctone = chirp_common.TONES[_mem.tone] + elif mem.tmode == "DTCS Enc": + mem.dtcs = mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.dcs] elif mem.tmode == "DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] + mem.dtcs = mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.dcs] elif mem.tmode == "Cross": mem.ctone = chirp_common.TONES[_mem.rxtone] # don't want to fail for this @@ -218,15 +223,8 @@ mem.rtone = chirp_common.TONES[_mem.tone] except IndexError: mem.rtone = chirp_common.TONES[0] - if mem.cross_mode == "DTCS->": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] - elif mem.cross_mode == "Tone->DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.rxdcs] - elif mem.cross_mode == "DTCS->Tone": - mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] - elif mem.cross_mode == "->DTCS": - mem.dtcs = chirp_common.DTCS_CODES[_mem.rxdcs] - + mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs] + mem.rx_dtcs = chirp_common.DTCS_CODES[_mem.rxdcs]
def _set_tmode(self, mem, _mem): if mem.tmode != "Cross": @@ -240,12 +238,15 @@ _mem.tone = _mem.rxtone = chirp_common.TONES.index(mem.rtone) elif mem.tmode == "TSQL": _mem.tone = _mem.rxtone = chirp_common.TONES.index(mem.ctone) + elif mem.tmode == "DTCS Enc": + _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) elif mem.tmode == "DTCS": - _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.rx_dtcs) elif mem.tmode == "Cross": _mem.tone = chirp_common.TONES.index(mem.rtone) _mem.rxtone = chirp_common.TONES.index(mem.ctone) - _mem.dcs = _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs) + _mem.rxdcs = chirp_common.DTCS_CODES.index(mem.rx_dtcs) # have to put this bit to 0 otherwise we get strange display in tone # frequency (menu 83). See bug #88 and #163 _mem.unknown_toneflag = 0
participants (3)
-
Dan Smith
-
IZ3GME Marco
-
Marco Filippi IZ3GME