Hello Ervin,
Thank you very much for your help. I installed libhamlib-dev and
libhamlib-utils apt-get and tried this. Comments below.
On Mon, Dec 9, 2013 at 4:26 PM, Ervin Hegedüs <airw...@gmail.com> wrote:
> may be you don't need to reverse any Pascal code :)
>
Two of the three links I posted were C code, only one was Pascal. I didn't
try them,
> ... 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
>
It didn't work. Here is the gcc output:
mike@mike-ubuntu:~/local/share/tlf/tlf-devel$ sudo gcc -Wall gridtest.c
-lhamlib
[sudo] password for mike:
gridtest.c:1:1: error: expected identifier or ‘(’ before ‘==’ token
In file included from /usr/include/stdio.h:75:0,
from gridtest.c:2:
/usr/include/libio.h:334:3: error: unknown type name ‘size_t’
/usr/include/libio.h:338:67: error: ‘size_t’ undeclared here (not in a
function)
/usr/include/libio.h:366:62: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/libio.h:375:6: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/libio.h:497:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘_IO_sgetn’
In file included from gridtest.c:2:0:
/usr/include/stdio.h:320:35: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:326:47: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:338:20: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:345:10: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:387:44: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:391:45: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:663:11: error: expected declaration specifiers or
‘...’ before ‘size_t’
/usr/include/stdio.h:666:9: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:676:8: error: expected declaration specifiers or ‘...’
before ‘size_t’
/usr/include/stdio.h:706:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fread’
/usr/include/stdio.h:712:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fwrite’
/usr/include/stdio.h:734:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fread_unlocked’
/usr/include/stdio.h:736:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
‘__attribute__’ before ‘fwrite_unlocked’
gridtest.c:22:1: error: expected identifier or ‘(’ before ‘==’ token
and run:
>
> $ ./a.out
>
Since it didn't compile, there was no a.out to try.
gridtest.c is attached.
Do you have any suggestions?
73, Mike
www.w0btu.com
> 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
>
==%==
#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;
}
==%==
_______________________________________________
Tlf-devel mailing list
Tlf-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tlf-devel