<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'># HG changeset patch<br># User K. Arvanitis <<a href="mailto:kosta@alumni.uvic.ca">kosta@alumni.uvic.ca</a>><br># Date 1422243928 28800<br># Sun Jan 25 19:45:28 2015 -0800<br># Node ID 1e842859ec126d1e7bb336d13ee9c3d68ff1d3b0<br># Parent b25606106a9c0cd78f3cc5f602475da64cde081d<br>[FT-60] Memory Bank Link Scan<BR>Added settings support for memory bank link scan.<BR>Extended bitwise int data element to support xor operator.<BR>Note: The mbs settings are stored in the 16 bits located at<br>memory location 0x09E in the high order bits.<BR>Note: A bank can be linked even if it contains no memories.<br>In this case the radio ignores it during the mbl scan.<BR>Bug #675<br>Bug #1945<BR>diff -r b25606106a9c -r 1e842859ec12 chirp/bitwise.py<br>--- a/chirp/bitwise.py Wed Jan 21 23:30:19 2015 -0800<br>+++ b/chirp/bitwise.py Sun Jan 25 19:45:28 2015 -0800<br>@@ -304,6 +304,9 @@<br> def __or__(self, val):<br> return self.get_value() | val<br> <br>+ def __xor__(self, val):<br>+ return self.get_value() ^ val<br>+<br> def __and__(self, val):<br> return self.get_value() & val<br> <br>@@ -325,6 +328,9 @@<br> def __ror__(self, val):<br> return val | self.get_value()<br> <br>+ def __rxor__(self, val):<br>+ return val ^ self.get_value()<br>+<br> def __rmod__(self, val):<br> return val % self.get_value()<br> <br>@@ -362,6 +368,10 @@<br> self.set_value(self.get_value() | val)<br> return self<br> <br>+ def __ixor__(self, val):<br>+ self.set_value(self.get_value() ^ val)<br>+ return self<br>+<br> def __index__(self):<br> return abs(self)<br> <br>diff -r b25606106a9c -r 1e842859ec12 chirp/ft60.py<br>--- a/chirp/ft60.py Wed Jan 21 23:30:19 2015 -0800<br>+++ b/chirp/ft60.py Sun Jan 25 19:45:28 2015 -0800<br>@@ -274,10 +274,6 @@<br> bank = chirp_common.Bank(self, "%i" % (i + 1), "Bank %i" % (i + 1))<br> bank.index = i<br> banks.append(bank)<br>-<br>- #mbs = (self._radio._memobj.mbs >> i) & 1<br>- #print "Bank %i: mbs: %i " % (i, mbs) <br>-<br> return banks<br> <br> def add_memory_to_mapping(self, memory, bank):<br>@@ -402,9 +398,10 @@<br> eai = RadioSettingGroup("eai", "EAI/EPCS Settings")<br> switch = RadioSettingGroup("switch", "Switch/Knob Settings")<br> misc = RadioSettingGroup("misc", "Miscellaneous Settings")<br>+ mbls = RadioSettingGroup("banks", "Memory Bank Link Scan")<br> <br> setmode = RadioSettingGroup("top", "Set Mode",<br>- repeater, ctcss, arts, scan, power, wires, eai, switch, misc)<br>+ repeater, ctcss, arts, scan, power, wires, eai, switch, misc, mbls)<br> <br> # APO<br> opts = [ "OFF" ] + [ "%0.1f" % (x * 0.5) for x in range(1, 24+1) ]<br>@@ -585,6 +582,20 @@<br> scan.append( RadioSetting("wx_alt", "Weather Alert Scan",<br> RadioSettingValueList(opts, opts[_settings.wx_alt])))<br> <br>+ # MBS<br>+ for i in range(0, 10):<br>+ opts = [ "OFF" ] + [ "ON" ]<br>+ mbs = (self._memobj.mbs >> i) & 1<br>+ rs = RadioSetting("mbs%i" % i, "Bank %s Scan" % (i + 1),<br>+ RadioSettingValueList(opts, opts[mbs]))<br>+ def apply_mbs(s, index):<br>+ if int(s.value):<br>+ self._memobj.mbs |= (1 << index)<br>+ else:<br>+ self._memobj.mbs &= ~(1 << index);<br>+ rs.set_apply_callback(apply_mbs, i);<br>+ mbls.append(rs)<br>+<br> return setmode<br> <br> def set_settings(self, uisettings):<br>@@ -599,16 +610,16 @@<br> try:<br> name = element.get_name()<br> value = element.value<br>- obj = getattr(_settings, name)<br> <br> if element.has_apply_callback():<br> print "Using apply callback"<br> element.run_apply_callback()<br> else:<br>+ obj = getattr(_settings, name)<br> setattr(_settings, name, value)<br> <br> if os.getenv("CHIRP_DEBUG"):<br>- print "Setting %s: %s <= %s" % (name, obj, element.value)<br>+ print "Setting %s: %s" % (name, value)<br> except Exception, e:<br> print element.get_name()<br> raise<br> <BR>                                            </div></body>
</html>