[chirp_devel] Baofeng UV-6 Radio

Jim Unroe
Sun Feb 16 18:32:05 PST 2014


On Sun, Feb 16, 2014 at 7:00 PM, Jim Unroe <rock.unroe at gmail.com> wrote:

>
>
>
> On Wed, Feb 5, 2014 at 8:17 PM, Dan Smith <dsmith at danplanet.com> wrote:
>
>>
>> It also looks like the two radios count their memories differently, one
>> being from zero and the other from one. In that case, you might just add
>> a method like this for the uv5:
>>
>>   def _get_mem(self, number):
>>       return self._memobj.memory[number]
>>
>> and then override it in the UV6 class like this:
>>
>>   def _get_mem(self, number):
>>       return self._memobj.memory[number - 1]
>>
>> then in get_memory(), you can do this:
>>
>>   mem = self._get_mem(number)
>>
>> and it will do the right thing in each class.
>>
>
> Apparently I need to do something similar for set_memory(). I've tried to
> do it similar to the above but can't quite get it. Here are the original
> lines...
>
>     def set_memory(self, mem):
>         _mem = self._memobj.memory[mem.number]
>
> I think I may have figure it out on my own.

    def _set_mem(self, number):
        return self._memobj.memory[number]

     def set_memory(self, mem):
        _mem = self._get_mem(mem.number)

Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20140216/ba40ccda/attachment-0001.html 


More information about the chirp_devel mailing list