[chirp_devel] [PATCH] Fix logic error preventing auto repeater setting in some cases

Sean Burford
Tue Mar 12 19:18:52 PDT 2013


Hi,

+        is_changed = new != prev if was_filled else True
+        if new and self._config.get_bool("autorpt") and is_changed:

If you drop self._config.get_bool("autorpt"), this reads:
+        is_changed = new != prev if was_filled else True
+        if new and is_changed:

Which is really strange.



On Wed, Mar 13, 2013 at 1:03 PM, Dan Smith <dsmith at danplanet.com> wrote:

> # HG changeset patch
> # User Dan Smith <dsmith at danplanet.com>
> # Date 1363140169 25200
> # Node ID 39add30a1ee5ea0c652f5ff4a310bcb1c0426eca
> # Parent  443ea98c0840de12f8ee149ccd8eecc78bb69a51
> Fix logic error preventing auto repeater setting in some cases
>
> If autorpt is enabled and you enter a frequency into a blank channel
> that is the same as was previously just entered, the new item defaulting
> code fools ed_freq() into thinking that the frequency field was unchanged,
> and thus that the auto repeater logic should not be applied. This
> enhances the logic that determines if the frequency was changed to avoid
> this problem.
>
> Fixes #683
>
> diff -r 443ea98c0840 -r 39add30a1ee5 chirpui/memedit.py
> --- a/chirpui/memedit.py        Tue Mar 05 09:49:47 2013 -0800
> +++ b/chirpui/memedit.py        Tue Mar 12 19:02:49 2013 -0700
> @@ -123,7 +123,7 @@
>
>      def ed_freq(self, _foo, path, new, colnum):
>          iter = self.store.get_iter(path)
> -        prev, = self.store.get(iter, colnum)
> +        was_filled, prev = self.store.get(iter, self.col("_filled"),
> colnum)
>
>          def set_offset(path, offset):
>              if offset > 0:
> @@ -154,7 +154,8 @@
>          if not self._features.has_nostep_tuning:
>              set_ts(chirp_common.required_step(new))
>
> -        if new and self._config.get_bool("autorpt") and new != prev:
> +        is_changed = new != prev if was_filled else True
> +        if new and self._config.get_bool("autorpt") and is_changed:
>              try:
>                  band = chirp_common.freq_to_band(new)
>                  set_offset(path, 0)
> _______________________________________________
> chirp_devel mailing list
> chirp_devel at intrepid.danplanet.com
> http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers
>



-- 
Sean Burford <sburford at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20130313/21ad0b59/attachment-0001.html 


More information about the chirp_devel mailing list