<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20689">
<style type="text/css"><!--html { font-family: "Color Emoji", "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; }--></style><style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst,
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;"><div>Ah, I see. I misunderstood why you were adding _encode/_decode_name. It was code cleanup for the Yaesu specific character translation, not a reimplementation of chirp_common.filter_name. I guess that's what I get for working in two different radio codebases at once.</div><div><br></div><div>Anyway, thanks for all the work on the FT-60. Let me know if you're thinking of adding settings and need help or testing. </div><div><br></div><div>I'm probably going to look at the bug I filed on com port handling in Windows #2087 next. Since I'm trying to Bluetooth SPP enable my Kenwood next, I would like better error handling. It needs two serial ports (one for TNC, one for programming) and choosing the wrong one is going to happen frequently<br></div><div data-signatureblock="true"><div><br></div><div>Sent from Windows Mail</div><div><br></div></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;'><b>From:</b> <a href="mailto:kosta@alumni.uvic.ca" target="_parent">Kosta Arvanitis</a><br><b>Sent:</b> Sunday, January 11, 2015 12:01 AM<br><b>To:</b> <a href="mailto:chirp_devel@intrepid.danplanet.com" target="_parent">chirp_devel@intrepid.danplanet.com</a></font></div></div><div><br></div><div dir=""><div id="readingPaneBodyContent">Good questions.<br><br><br>First, the ft-60 memory is zero indexed (0-999) however, the radio itself displays memories as (1-1000). This change mimics the behaviour of the radio more closely, in that the user in the chirp app will see memories labeled 1-1000 as in the radio.<br><br><br>Second, the decoding/encoding of the name was not altered in any way from the original implementation as continues to pass unit test for this. ie: invalid characters continue to be replaced with ' ', as to why this is case I am not sure as I would expect either a truncation or invalid char to be displayed.<br><br><br><br>-kosta<br><br><br><br>________________________________<br>> From: stickpatrick@gmail.com <br>> To: chirp_devel@intrepid.danplanet.com <br>> Date: Sun, 11 Jan 2015 06:09:04 +0000 <br>> Subject: [chirp_devel] Re: [PATCH] [FT-60] Fix Memory Bounds and Seek Offsets <br>> <br>> I'll give this a try tomorrow, but 2 questions: <br>> From the radio standpoint, is the memory laid out as 000-999, or 1-999, <br>> then 000? <br>> Or to put it another way - will CHIRP display the radio's 000 as 1000 or 0? <br>> <br>> (this one is for Dan) - it looks like this replaces invalid characters <br>> with ' 'rather than truncating them. Is this the desired behavior? <br>> When I fixed a similar bug for the TH-D7, I preserved the existing <br>> truncation behavior rather than replacing with ' ‘ <br>> <br>> Sent from Windows Mail <br>> <br>> From: Kosta Arvanitis<mailto:kosta@alumni.uvic.ca> <br>> Sent: Saturday, January 10, 2015 7:40 PM <br>> To: chirp_devel@intrepid.danplanet.com<mailto:chirp_devel@intrepid.danplanet.com> <br>> <br>> # HG changeset patch <br>> # User K. Arvanitis <kosta@alumni.uvic.ca> <br>> # Date 1420442263 28800 <br>> # Sun Jan 04 23:17:43 2015 -0800 <br>> # Node ID 15c8e53a218702d708f5a018c115965dd2fdbb0c <br>> # Parent 9e67e7ba60e0fd2accd89d899735b5040da8032b <br>> [FT-60] Fix Memory Bounds and Seek Offsets <br>> <br>> This adjusts the memory bounds of the Yaesu FT-60 to include all 1000 <br>> memory channels, in addition the seek offsets were adjusted to align <br>> correctly to their appropriate memory locations. <br>> <br>> diff -r 9e67e7ba60e0 -r 15c8e53a2187 chirp/ft60.py <br>> --- a/chirp/ft60.py Sun Jan 04 23:15:45 2015 -0800 <br>> +++ b/chirp/ft60.py Sun Jan 04 23:17:43 2015 -0800 <br>> @@ -104,9 +104,31 @@ <br>> flags += 0x40 <br>> return freqraw, flags <br>> <br>> +def _decode_name(mem): <br>> + name = "" <br>> + for i in mem: <br>> + if i == 0xFF: <br>> + break <br>> + try: <br>> + name += CHARSET[i] <br>> + except IndexError: <br>> + print "Unknown char index: %i " % (i) <br>> + return name <br>> + <br>> + <br>> +def _encode_name(mem): <br>> + name = [None]*6 <br>> + for i in range(0, 6): <br>> + try: <br>> + name[i] = CHARSET.index(mem[i]) <br>> + except IndexError: <br>> + name[i] = CHARSET.index(" ") <br>> + <br>> + return name <br>> + <br>> <br>> MEM_FORMAT = """ <br>> -#seekto 0x0238; <br>> +#seekto 0x0248; <br>> struct { <br>> u8 used:1, <br>> unknown1:1, <br>> @@ -129,7 +151,7 @@ <br>> } memory[1000]; <br>> <br>> #seekto 0x6EC8; <br>> -// skips:2 for Memory M in [1, 1000] is in skipflags[(M-1)/4].skip((M-1)%4). <br>> +// skips:2 for Memory M in [1, 1000] is in flags[(M-1)/4].skip((M-1)%4). <br>> // Interpret with SKIPS[]. <br>> // PMS memories L0 - U50 aka memory 1001 - 1100 don't have skip flags. <br>> struct { <br>> @@ -137,9 +159,9 @@ <br>> skip2:2, <br>> skip1:2, <br>> skip0:2; <br>> -} skipflags[250]; <br>> +} flags[250]; <br>> <br>> -#seekto 0x4700; <br>> +#seekto 0x4708; <br>> struct { <br>> u8 name[6]; <br>> u8 use_name:1, <br>> @@ -239,7 +261,7 @@ <br>> <br>> def get_features(self): <br>> rf = chirp_common.RadioFeatures() <br>> - rf.memory_bounds = (1, 999) <br>> + rf.memory_bounds = (1, 1000) <br>> rf.valid_duplexes = DUPLEX <br>> rf.valid_tmodes = TMODES <br>> rf.valid_power_levels = POWER_LEVELS <br>> @@ -285,18 +307,16 @@ <br>> self._memobj = bitwise.parse(MEM_FORMAT, self._mmap) <br>> <br>> def get_raw_memory(self, number): <br>> - _array_index = number - 1 <br>> - return repr(self._memobj.memory[number]) + \ <br>> - repr(self._memobj.skipflags[_array_index/4]) + \ <br>> - repr(self._memobj.names[number]) <br>> + return repr(self._memobj.memory[number - 1]) + \ <br>> + repr(self._memobj.flags[(number - 1) / 4]) + \ <br>> + repr(self._memobj.names[number - 1]) <br>> <br>> def get_memory(self, number): <br>> - _array_index = number - 1 <br>> - _mem = self._memobj.memory[number] <br>> - _skp = self._memobj.skipflags[_array_index/4] <br>> - _nam = self._memobj.names[number] <br>> + _mem = self._memobj.memory[number - 1] <br>> + _skp = self._memobj.flags[(number - 1) / 4] <br>> + _nam = self._memobj.names[number - 1] <br>> <br>> - skip = _skp["skip%i" % (_array_index%4)] <br>> + skip = _skp["skip%i" % ((number - 1) % 4)] <br>> <br>> mem = chirp_common.Memory() <br>> mem.number = number <br>> @@ -320,22 +340,14 @@ <br>> mem.skip = SKIPS[skip] <br>> <br>> if _nam.use_name and _nam.valid: <br>> - for i in _nam.name: <br>> - if i == 0xFF: <br>> - break <br>> - try: <br>> - mem.name += CHARSET[i] <br>> - except IndexError: <br>> - print "Memory %i: Unknown char index: %i " % (number, i) <br>> - mem.name = mem.name.rstrip() <br>> + mem.name = _decode_name(_nam.name).rstrip() <br>> <br>> return mem <br>> <br>> def set_memory(self, mem): <br>> - _array_index = mem.number - 1 <br>> - _mem = self._memobj.memory[mem.number] <br>> - _skp = self._memobj.skipflags[_array_index/4] <br>> - _nam = self._memobj.names[mem.number] <br>> + _mem = self._memobj.memory[mem.number - 1] <br>> + _skp = self._memobj.flags[(mem.number - 1) / 4] <br>> + _nam = self._memobj.names[mem.number - 1] <br>> <br>> if mem.empty: <br>> _mem.used = False <br>> @@ -364,13 +376,8 @@ <br>> _mem.isam = mem.mode == "AM" <br>> _mem.step = STEPS.index(mem.tuning_step) <br>> <br>> - _skp["skip%i" % (_array_index%4)] = SKIPS.index(mem.skip) <br>> + _skp["skip%i" % ((mem.number - 1) % 4)] = SKIPS.index(mem.skip) <br>> <br>> - for i in range(0, 6): <br>> - try: <br>> - _nam.name[i] = CHARSET.index(mem.name[i]) <br>> - except IndexError: <br>> - _nam.name[i] = CHARSET.index(" ") <br>> - <br>> + _nam.name = _encode_name(mem.name) <br>> _nam.use_name = mem.name.strip() and True or False <br>> _nam.valid = _nam.use_name <br>> _______________________________________________ <br>> chirp_devel mailing list <br>> chirp_devel@intrepid.danplanet.com <br>> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel <br>> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers <br>> <br>> _______________________________________________ chirp_devel mailing <br>> list chirp_devel@intrepid.danplanet.com <br>> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel Developer <br>> docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers <br>_______________________________________________<br>chirp_devel mailing list<br>chirp_devel@intrepid.danplanet.com<br>http://intrepid.danplanet.com/mailman/listinfo/chirp_devel<br>Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers</div></div></div>
</body>
</html>