tlf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tlf-devel] Tlf scoring for Stew Perry?


From: Ervin Hegedüs
Subject: Re: [Tlf-devel] Tlf scoring for Stew Perry?
Date: Mon, 9 Dec 2013 23:26:18 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hello Mike,

may be you don't need to reverse any Pascal code :)

I hope, every Linux user had been installed Hamlib - and Hamlib
contains many good functions, eg. it can calculate the distance
(and bearing) between two locator.

Here is a sample code:

==%==
#include <stdio.h>
#include <hamlib/rotator.h>

int main(int argc, char ** argv) {
    double s1long, s1lat, s2long, s2lat;
    char s1qra[] = "EM37cg";
    char s2qra[] = "jn97om";
    double dist = 1000, az = 90;

    locator2longlat(&s1long, &s1lat, s1qra);
    locator2longlat(&s2long, &s2lat, s2qra);

    printf("W0BTU coords: lat: %f lon: %f\n", s1lat, s1long);
    printf("HA2OS coords: lat: %f lon: %f\n", s2lat, s2long);

    qrb(s1long, s1lat, s2long, s2lat, &dist, &az);

    printf("distance between W0BTU and HA2OS: %f km, dir: %f\n", dist, az);
    return 0;
}
==%==

You can compile that code with this command:

gcc -Wall qrasrc.c -lhamlib

and run:

$ ./a.out 
W0BTU coords: lat: 37.270833 lon: -93.791667
HA2OS coords: lat: 47.520833 lon: 19.208333
distance between W0BTU and HA2OS: 8485.799136 km, dir: 40.000000

These values are the short path info's.


Please note, this is just an after-a-fast-explore snippet, there
isn't any error handling.


73,


Ervin
HA2OS


On Sun, Dec 08, 2013 at 08:24:55PM -0600, Mike Waters wrote:
> Thanks to Pat's help via e-mail, I was able to get tlf working for the ARRL
> 160. I have never used tlf before, and love it. I noticed that tlf's
> constant score update feature adds to the enjoyment of the contest as well
> as providing some incentive to keep going when a body gets tired. :-)
> 
> I know that tlf can be used in the Stew Perry for logging, but will not
> display the score. I would really, REALLY like to see it display the
> running score for the Stew (at the end of this month), which is based on
> the distance between grid squares.
> 
> I just did some searching and found some C source that I believe could be
> used for that here:
> 
> http://dev.unclassified.de/en/source/locator-distance
> http://dev.unclassified.de/en/source/maidenheadlocator
> 
> There are links on those pages that appear to lead to more useful code,
> including Pascal, which I used to program in years ago. I've done very
> little in C.
> 
> I know nothing about the C source structure of tlf, and I was wondering if
> anyone could steer us in the right direction. I would appreciate any advice.
> 
> 73, Mike
> www.w0btu.com

> _______________________________________________
> Tlf-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tlf-devel


-- 
I � UTF-8



reply via email to

[Prev in Thread] Current Thread [Next in Thread]