Georacer / ardupilog

A ardupilot log to MATLAB converter
GNU General Public License v3.0
48 stars 36 forks source link

Remove (empty) LogMsgGroup if filtered out? #32

Open hunt0r opened 7 years ago

hunt0r commented 7 years ago

With the filter capability (as added in #26) it makes sense to me to delete the (empty) LogMsgGroup if it was filtered out by the user. Do you agree?

I began working on it myself, but found it's a little more complicated than I thought. Just calling "delete(obj.(msgName))" deletes the object, but doesn't get rid of the property. I haven't yet figured out an easy way to clear it completely...

(Also, we'd want to move the call to obj.findInfo() from line 65 to be inside readLog(), perhaps around line 120ish right before % Iterate over all the discovered msgs)

hunt0r commented 7 years ago

When we filter, we might also want to delete the FMT data, I think it is saved before the filtering is applied.

Georacer commented 7 years ago

Regarding deleting unwanted LogMsgGroups, including FMT, I'm for it.

Regarding the location of findInfo(), I placed it there to contrast again readLog. In my head, readLog is a dumb cataloguing and distribution of the content in the correct LogMsgGroups, whereas findInfo() is about meta-information. I don't have a strong opinion on the subject, I just didn't want to overbloat readLog() without reason.

Georacer commented 7 years ago

It doesn't look like property handles can be deleted (sigh). How about we copy the structure and keep only the non-empy properties?