[chirp_devel] New mod for issue 5943
OK, here is the patch to allow for driver-generated comments. Mods to chirp_common and run_tests. Otherwise pretty simple. Just ignores the Comment field in compare_mem module of runt_tests.py if the feature attribute 'generated_comment' is true. Also note my new issue #5941 about the View > Columns discrepancy in the latest release. I poked about a bit to try to find the problem and was only able to see that the wrong memedit page is being returned in mainapp at do_columns.
OK, here is the patch to allow for driver-generated comments. Mods to chirp_common and run_tests. Otherwise pretty simple. Just ignores the Comment field in compare_mem module of runt_tests.py if the feature attribute 'generated_comment' is true. Also note my new issue #5941 about the View > Columns discrepancy in the latest release. I poked about a bit to try to find the problem and was only able to see that the wrong memedit page is being returned in mainapp at do_columns.
@@ -371,17 +370,19 @@ def get_prompts(cls): rp = chirp_common.RadioPrompts() rp.info = _(dedent(""" - The FT-450 radio driver loads the 'Special Channels' tab + - The FT-450 radio driver loads the 'Special Channels' tab with the PMS scanning range memories (group 11), 60meter channels (group 12), the QMB (STO/RCL) memory, the HF and 50m HOME memories and all the A and B VFO memories. - There are VFO memories for the last frequency dialed in + - There are VFO memories for the last frequency dialed in each band. The last mem-tune config is also stored. - These Special Channels allow limited field editting. - This driver also populates the 'Other' tab in the channel + - These Special Channels allow limited field editting. + - This driver also populates the 'Other' tab in the channel memory Properties window. This tab contains values for those channel memory settings that don't fall under the standard Chirp display columns. + - The 'Comment' column contains the memory group label, + if groups are enabled. """))
I'm not sure what happened here. Why are the dashes added to these lines?
+ rf.has_comment = True + rf.generated_comment = True
Shouldn't has_comment be False now since this driver doesn't actually have the comment field (as originally intended) and no longer overrides it for the generated comment?
@@ -602,7 +604,7 @@ mx = (-self.LAST_PMS_INDEX) + mem.number _mem = self._memobj.pms[mx] mx = mx + 1 - if MEM_GRP_LBL: + if _settings.mem_grp: mem.comment = "M-11-%02i" % mx immutable = ["number", "rtone", "ctone", "extd_number", "tmode", "cross_mode", @@ -611,7 +613,7 @@ mx = (-self.LAST_60M_INDEX) + mem.number _mem = self._memobj.m60[mx] mx = mx + 1 - if MEM_GRP_LBL: + if _settings.mem_grp: mem.comment = "M-12-%02i" % mx
I must be missing something. Did you intend to set mem.generated_comment? Also, why are these hard-coded to M-11 and M-12? Something related to them being special memories maybe?
immutable = ["number", "rtone", "ctone", "extd_number", "tmode", "cross_mode", @@ -677,6 +679,7 @@
def _get_normal(self, number): _mem = self._memobj.memory[number - 1] + _settings = self._memobj.settings used = (self._memobj.visible[(number - 1) / 8] >> (number - 1) % 8) \ & 0x01 valid = (self._memobj.filled[(number - 1) / 8] >> (number - 1) % 8) \ @@ -688,9 +691,9 @@ mem.empty = True if not valid or _mem.freq == 0xffffffff: return mem - if MEM_GRP_LBL: + if _settings.mem_grp: mgrp = int((number - 1) / 50) - mem.comment = "M-%02i-%02i" % (mgrp + 1, number - (mgrp * 50)) + mem.comment= "M-%02i-%02i" % (mgrp + 1, number - (mgrp * 50))
Again, generated_comment? Also, you nuked the space before the '=' sign.
Okay, I'm a bit confused. I thought you wanted this new memory field to be a comment in the UI? This patch doesn't add any new UI elements, and still sets the old field so I think I'm missing something... :)
--Dan
Dan- After writing a mod that generated a new UI column, I realized that it was just duplicating the Comment field. So the intent of the "generated_comment" attribute is simply to flag the run_tests.py module to bypass the memory comparison test for Comment when set. This seemed like a much simpler implementation.
The dashes in the driver "info" string are just for formatting; They are supposed to look like bullets...
The M-11 and M-12 comments are hard-coded because they are the 60m frequencies and the Programmed Memory Scan limits. Not available for normal channel frequency assignments.
Rick DeWitt AA0RD Sequim, Washington, USA 360-681-3494
On 7/30/2018 12:21 PM, Dan Smith via chirp_devel wrote:
OK, here is the patch to allow for driver-generated comments. Mods to chirp_common and run_tests. Otherwise pretty simple. Just ignores the Comment field in compare_mem module of runt_tests.py if the feature attribute 'generated_comment' is true. Also note my new issue #5941 about the View > Columns discrepancy in the latest release. I poked about a bit to try to find the problem and was only able to see that the wrong memedit page is being returned in mainapp at do_columns.
@@ -371,17 +370,19 @@ def get_prompts(cls): rp = chirp_common.RadioPrompts() rp.info = _(dedent("""
The FT-450 radio driver loads the 'Special Channels' tab
- The FT-450 radio driver loads the 'Special Channels' tab with the PMS scanning range memories (group 11), 60meter channels (group 12), the QMB (STO/RCL) memory, the HF and 50m HOME memories and all the A and B VFO memories.
There are VFO memories for the last frequency dialed in
- There are VFO memories for the last frequency dialed in each band. The last mem-tune config is also stored.
These Special Channels allow limited field editting.
This driver also populates the 'Other' tab in the channel
- These Special Channels allow limited field editting.
- This driver also populates the 'Other' tab in the channel memory Properties window. This tab contains values for those channel memory settings that don't fall under the standard Chirp display columns.
- The 'Comment' column contains the memory group label,
if groups are enabled. """))
I'm not sure what happened here. Why are the dashes added to these lines?
rf.has_comment = True
rf.generated_comment = True
Shouldn't has_comment be False now since this driver doesn't actually have the comment field (as originally intended) and no longer overrides it for the generated comment?
@@ -602,7 +604,7 @@ mx = (-self.LAST_PMS_INDEX) + mem.number _mem = self._memobj.pms[mx] mx = mx + 1
if MEM_GRP_LBL:
if _settings.mem_grp: mem.comment = "M-11-%02i" % mx immutable = ["number", "rtone", "ctone", "extd_number", "tmode", "cross_mode",
@@ -611,7 +613,7 @@ mx = (-self.LAST_60M_INDEX) + mem.number _mem = self._memobj.m60[mx] mx = mx + 1
if MEM_GRP_LBL:
if _settings.mem_grp: mem.comment = "M-12-%02i" % mx
I must be missing something. Did you intend to set mem.generated_comment? Also, why are these hard-coded to M-11 and M-12? Something related to them being special memories maybe?
immutable = ["number", "rtone", "ctone", "extd_number", "tmode", "cross_mode",
@@ -677,6 +679,7 @@
def _get_normal(self, number): _mem = self._memobj.memory[number - 1]
_settings = self._memobj.settings used = (self._memobj.visible[(number - 1) / 8] >> (number - 1) % 8) \ & 0x01 valid = (self._memobj.filled[(number - 1) / 8] >> (number - 1) % 8) \
@@ -688,9 +691,9 @@ mem.empty = True if not valid or _mem.freq == 0xffffffff: return mem
if MEM_GRP_LBL:
if _settings.mem_grp: mgrp = int((number - 1) / 50)
mem.comment = "M-%02i-%02i" % (mgrp + 1, number - (mgrp * 50))
mem.comment= "M-%02i-%02i" % (mgrp + 1, number - (mgrp * 50))
Again, generated_comment? Also, you nuked the space before the '=' sign.
Okay, I'm a bit confused. I thought you wanted this new memory field to be a comment in the UI? This patch doesn't add any new UI elements, and still sets the old field so I think I'm missing something... :)
--Dan _______________________________________________ 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 (2)
-
Dan Smith
-
Rick DeWitt