[UAT] Mic-E bug (with fix)

Martin Hebnes Pedersen
Sun Jan 20 14:25:19 PST 2013


On 17. jan. 2013 23:27, Dan Smith wrote:
> Hi Martin!
>
>> I realized that the previous patch had a ugly bug. So here's a new
>> and (hopefully) more accurate patch.
> Ah, thanks very much for the patch, and in top form even!
Great, glad to be of help :)
>
> When this came in, I realized that I never told folks that we moved the
> tree to github. I imported and pushed your patch:
>
> https://github.com/kk7ds/dantracker
>
> You (and others) are welcome to use the github methods for submitting
> code, or just send patches here for discussion.
Ok, good to know you're still working on the project! I'll clone that
repo and continue from there.
>
> I'm more than happy to integrate code for metric unit display, as long
> as it doesn't break the imperial stuff. Do you need some pointers, or
> can you do it yourself?
Thanks, it would be great to get metric units for us here in Europe :)

I have some experience with C, and believe I will be able to implement 
it. I was thinking of writing a couple of functions for distance, 
altitude, speed etc.

My first suggestion would be something like
const char *format_distance(struct state*state, const char *format, 
float dist);

The format string would be something like "%.2f %s", passed directly to 
snprintf(). This solution would give us some flexibility regarding 
formatting of values (most notably, number of digits I guess) and at the 
same time minimize the noise of dealing with two unit systems.

I guess will also could do this compile time, but I believe it will be 
easier for users if it's a config option.

What do you think, any thoughts?

--
Martin Hebnes Pedersen
LA5NTA



More information about the UAT mailing list