[chirp_devel] [PATCH] [vx5] Add support for reading masked memories, masking and unmasking memories. #94
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1333146010 21600 # Node ID 948c46031144a0818d9b680664a37408e0172ef1 # Parent 912a360d7ef655091916da58dab51e74fddc93a1 [vx5] Add support for reading masked memories, masking and unmasking memories. #94
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 948c46031144 chirp/vx5.py --- a/chirp/vx5.py Fri Mar 30 13:49:25 2012 -0600 +++ b/chirp/vx5.py Fri Mar 30 16:20:10 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 948c46031144 chirpui/memedit.py --- a/chirpui/memedit.py Fri Mar 30 13:49:25 2012 -0600 +++ b/chirpui/memedit.py Fri Mar 30 16:20:10 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)
participants (2)
-
Dan Smith
-
Tom Hayward