<div dir="ltr">Same message and patch, but I wasn't sure the one from gmail got through due to mailing list configuration. Sorry for the confusion!<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 5:34 PM, Dan Smith <span dir="ltr"><<a href="mailto:dsmith@danplanet.com" target="_blank">dsmith@danplanet.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This looks like a repeat of your mail from 10/31. Is this patch<br>
different? Which one should I look at?<br>
<br>
--Dan<br>
<div><div class="h5"><br>
On 11/05/2013 12:18 PM, Eric Allen wrote:<br>
> Cool, thanks! Just a few comments from a quick skim:<br>
> > - return "Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
> d%03i%s%s [%.2f]"% \<br>
> > + return "Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
> d%03i%s%s [%.2f]"% \<br>
> The number is an integer, so this doesn't make sense, AFAICT.<br>
><br>
><br>
> aw shucks, you're totally right. I had it in there before I figured out<br>
> how to use special channels correctly.<br>
><br>
><br>
> > + #if data != radio._mmap[:32]:<br>
> > + #raise errors.RadioError("Model mis-match: \n%s\n%s" %<br>
> (util.hexprint(data),<br>
> > +<br>
> #util.hexprint(radio._mmap[:32])))<br>
> Why is this commented-out?<br>
><br>
><br>
> Thanks for catching that! Disabled it while getting the hang of the<br>
> memory layout and forgot to re-enable<br>
><br>
><br>
> > +<br>
> > + for i in range(0, 0x4000, 0x20):<br>
> > + addr = i + 0x20<br>
> > + msg = struct.pack(">cHb", "W", i, 0x20)<br>
> > + msg += radio._mmap[addr:addr+0x20]<br>
> Need space around the + operator here<br>
><br>
><br>
> Fixed.<br>
><br>
><br>
><br>
> > + def _decode_tone(self, toneval):<br>
> > + pol = "N"<br>
> > + rawval = (toneval[1].get_bits(0xFF) << 8) |<br>
> toneval[0].get_bits(0xFF)<br>
> Doesn't this just mean you need to use the other endianess of your<br>
> toneval?<br>
><br>
><br>
> I copy-pasted from thuv1f.py without thinking too hard about it. There's<br>
> a bunch more code in _decode_tone and _encode_tone that rely on this<br>
> particular endianness. Can we just leave it as-is, since the other code<br>
> does it this way?<br>
><br>
><br>
> > + if isinstance(number, int):<br>
> > + enabled = self._memobj.enable[(number - 1) /<br>
> 8].flags[7-((number - 1) % 8)]<br>
> > + dont_skip = self._memobj.skip[(number - 1) /<br>
> 8].flags[7-((number - 1) % 8)]<br>
> Need space around the - operator.<br>
><br>
><br>
> fixed<br>
><br>
><br>
> > + if dont_skip:<br>
> > + mem.skip = ""<br>
> > + else:<br>
> > + mem.skip = "S"<br>
> This should be four-space indented.<br>
><br>
><br>
> fixed<br>
><br>
><br>
> Also, this could be compacted to:<br>
> mem.skip = "S" if not dont_skip else ""<br>
><br>
><br>
> Thanks! fixed<br>
><br>
><br>
> > + if mem.empty:<br>
> > + _mem.set_raw("\xFF" * 32)<br>
> > + self._memobj.enable[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = False<br>
> > + self._memobj.skip[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = False<br>
> > + return<br>
> > + else:<br>
> > + self._memobj.enable[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = True<br>
><br>
> Need spaces around the - operator.<br>
><br>
> fixed<br>
><br>
><br>
> > + self._memobj.skip[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = (mem.skip == "")<br>
> Here too.<br>
><br>
><br>
> fixed<br>
><br>
><br>
> On Mon, Oct 7, 2013 at 8:00 AM, Dan Smith <<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a><br>
</div></div><div><div class="h5">> <mailto:<a href="mailto:dsmith@danplanet.com">dsmith@danplanet.com</a>>> wrote:<br>
><br>
> > I acquired a TYT TH-UVF8D several months back, and I've finally found<br>
> > the time to finish off adding support for it to CHIRP. In adding<br>
> support<br>
> > for editing the VFO channels as "Special Channels", I had to make a<br>
> > small tweak to the command-line utility so it didn't choke on<br>
> > non-numeric channel names. Attached is the patch for that, the<br>
> patch for<br>
> > the radio, and an image file dumped from the radio for testing<br>
> purposes.<br>
><br>
> Cool, thanks! Just a few comments from a quick skim:<br>
><br>
> > - return "Memory %i: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
> d%03i%s%s [%.2f]"% \<br>
> > + return "Memory %s: %s%s%s %s (%s) r%.1f%s c%.1f%s<br>
> d%03i%s%s [%.2f]"% \<br>
><br>
> The number is an integer, so this doesn't make sense, AFAICT.<br>
><br>
> > + #if data != radio._mmap[:32]:<br>
> > + #raise errors.RadioError("Model mis-match: \n%s\n%s" %<br>
> (util.hexprint(data),<br>
> > +<br>
> #util.hexprint(radio._mmap[:32])))<br>
><br>
> Why is this commented-out?<br>
><br>
> > +<br>
> > + for i in range(0, 0x4000, 0x20):<br>
> > + addr = i + 0x20<br>
> > + msg = struct.pack(">cHb", "W", i, 0x20)<br>
> > + msg += radio._mmap[addr:addr+0x20]<br>
><br>
> Need space around the + operator here<br>
><br>
> > + def _decode_tone(self, toneval):<br>
> > + pol = "N"<br>
> > + rawval = (toneval[1].get_bits(0xFF) << 8) |<br>
> toneval[0].get_bits(0xFF)<br>
><br>
> Doesn't this just mean you need to use the other endianess of your<br>
> toneval?<br>
><br>
> > + if isinstance(number, int):<br>
> > + enabled = self._memobj.enable[(number - 1) /<br>
> 8].flags[7-((number - 1) % 8)]<br>
> > + dont_skip = self._memobj.skip[(number - 1) /<br>
> 8].flags[7-((number - 1) % 8)]<br>
><br>
> Need space around the - operator.<br>
><br>
> > + if dont_skip:<br>
> > + mem.skip = ""<br>
> > + else:<br>
> > + mem.skip = "S"<br>
><br>
> This should be four-space indented.<br>
><br>
> Also, this could be compacted to:<br>
><br>
> mem.skip = "S" if not dont_skip else ""<br>
><br>
> > + if mem.empty:<br>
> > + _mem.set_raw("\xFF" * 32)<br>
> > + self._memobj.enable[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = False<br>
> > + self._memobj.skip[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = False<br>
> > + return<br>
> > + else:<br>
> > + self._memobj.enable[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = True<br>
><br>
> Need spaces around the - operator.<br>
><br>
> > + self._memobj.skip[(mem.number - 1) /<br>
> 8].flags[7-((mem.number - 1) % 8)] = (mem.skip == "")<br>
><br>
> Here too.<br>
><br>
> --<br>
> Dan Smith<br>
</div></div>> <a href="http://www.danplanet.com" target="_blank">www.danplanet.com</a> <<a href="http://www.danplanet.com" target="_blank">http://www.danplanet.com</a>><br>
<div class="im">> KK7DS<br>
><br>
><br>
> _______________________________________________<br>
> chirp_devel mailing list<br>
> <a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
</div>> <mailto:<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a>><br>
<div class="HOEnZb"><div class="h5">> <a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
> Developer docs:<br>
> <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> chirp_devel mailing list<br>
> <a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
> <a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
> Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br>
><br>
<br>
</div></div><br>_______________________________________________<br>
chirp_devel mailing list<br>
<a href="mailto:chirp_devel@intrepid.danplanet.com">chirp_devel@intrepid.danplanet.com</a><br>
<a href="http://intrepid.danplanet.com/mailman/listinfo/chirp_devel" target="_blank">http://intrepid.danplanet.com/mailman/listinfo/chirp_devel</a><br>
Developer docs: <a href="http://chirp.danplanet.com/projects/chirp/wiki/Developers" target="_blank">http://chirp.danplanet.com/projects/chirp/wiki/Developers</a><br></blockquote></div><br></div></div>