[chirp_devel] [PATCH] [vx5] Add support for reading masked memories, masking and unmasking memories
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1333144722 21600 # Node ID 802dcbafb5937dae4e174174f2fd81952b332696 # Parent 912a360d7ef655091916da58dab51e74fddc93a1 [vx5] Add support for reading masked memories, masking and unmasking memories.
On import/download, mark masked memories as empty, and populate fields anyway. On edit of masked memory, convert to normal memory. On delete of normal memory, mark memory as masked and empty. On delete of masked memory, mark memory as unused and empty.
Example: http://i.imgur.com/vapi9.png
diff -r 912a360d7ef6 -r 802dcbafb593 chirp/vx5.py --- a/chirp/vx5.py Fri Mar 30 13:49:25 2012 -0600 +++ b/chirp/vx5.py Fri Mar 30 15:58:42 2012 -0600 @@ -109,7 +109,9 @@ mem = chirp_common.Memory() mem.number = number
- if not _flg.used or not _flg.visible: + if not _flg.visible: + mem.empty = True + if not _flg.used: mem.empty = True return mem
@@ -136,6 +138,7 @@
# initialize new channel to safe defaults if not mem.empty and not _flg.used: + _flg.used = True _mem.unknown1 = 0x00 _mem.unknown2 = 0x00 _mem.unknown3 = 0x00 @@ -145,7 +148,9 @@ _mem.unknown8 = 0x00 _mem.unknown9 = 0x00
- _flg.used = not mem.empty + if mem.empty and _flg.used and not _flg.visible: + _flg.used = False + return _flg.visible = not mem.empty if mem.empty: return diff -r 912a360d7ef6 -r 802dcbafb593 chirpui/memedit.py --- a/chirpui/memedit.py Fri Mar 30 13:49:25 2012 -0600 +++ b/chirpui/memedit.py Fri Mar 30 15:58:42 2012 -0600 @@ -237,7 +237,8 @@ return
iter = self.store.get_iter(path) - if not self.store.get(iter, self.col("_filled"))[0]: + if not self.store.get(iter, self.col("_filled"))[0] \ + and self.store.get(iter, self.col(_("Frequency")))[0] == 0: print _("Editing new item, taking defaults") self.insert_new(iter)
[vx5] Add support for reading masked memories, masking and unmasking memories.
On import/download, mark masked memories as empty, and populate fields anyway. On edit of masked memory, convert to normal memory. On delete of normal memory, mark memory as masked and empty. On delete of masked memory, mark memory as unused and empty.
Sweet, nice! I'll do the rest of the VX-* radios at least so they're consistent.
Is there a feature issue for this and if so, could you resend with it in the commit log like "Bug #123"? :)
I'm going to try to be good about this until I get yelled at :P
participants (2)
-
Dan Smith
-
Tom Hayward