[chirp_devel] Question regarding issue #4121

Dan Smith
Tue Oct 11 08:56:58 PDT 2016


> the btech-driver (and some others as well) reset the mem.extra-settings,
> when properties of the channels are edited from the memory-table.
>  
> The root-cause seems to be the following: In set_memory, the driver
> checks whether there are mem.extra-settings, and if they are, it copies
> them. If the mem.extra-list is empty, resets all the values to the
> default (which seems to be reasonable for me).
> 
> But, obviously he list mem.extra is only populated
> - when the memory is edited using the properties-window
> - when channels are shifted
> and remains empty when using the memories-table for editing general
> settings.
>  
> In my first attempt, I just tried to uncomment the "reset to default" if
> the list is empty, and it seems to work (lines 1105ff of btech.py).
> However, is it safe to do so? Or are there any cases where it is
> necessary to reset the defaults of mem.extra in "set_memory"?

Hmm, yeah, I think that's a bug, and probably pretty confusing to users.
However, I expect the intent there was to initialize the settings if you
were opening that memory for the first time. So, probably what should
happen is:

 if extra:
   set_extra()
 elif not mem.empty and (mem was empty):
   initialize_extra()

That last "was empty" part would require looking at the current memory
map to see if it looks like a deleted memory.

Jim, does that make sense?

Michael, are you offering to fix up the drivers that behave this way?

Thanks!

--Dan



More information about the chirp_devel mailing list