[chirp_devel] [PATCH] [uv-b5]Add Test Mode Settings for Squelch Levels and Power Output Levels

Jim Unroe
Tue Sep 10 08:31:57 PDT 2013


On Tue, Sep 10, 2013 at 8:08 AM, Dan Smith <dsmith at danplanet.com> wrote:

> > +        rs = RadioSetting("test.vhfsquelch0", "VHF Squelch 0",
> > +                          RadioSettingValueInteger(0,255,
> > self._memobj.test.vhfsquelch0))
> > +        testmode.append(rs)
> > +
>
> Hmm, this introduces a lot of redundant code. What would you think
> about trying to make it a little more automatic?
>
>   for band in ["vhf", "uhf"]:
>     for index in range(0, 10):
>       key = "test.%ssquelch%i" % (band, index)
>       name = "%s Squelch %i" % (band.upper(), index)
>       rs = RadioSetting(key, name, RadioSettingInteger(0, 255,
>           getattr(self._memobj.test, "%ssquelch%i" % (band, index))
>
> (Note that this is untested, just off the top of my head)
>
> You could do this for squelch and power and save a bunch of lines of
> copied code in this patch.
>
> What do you think?
>
> Actually, I woke up in the middle of the night last night thinking I could
have done this better.

Do you just reject what I submitted so I can just resubmit it after
reworking it?

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


More information about the chirp_devel mailing list