Some Amateur Radio Programs in FreeBasic

General Remarks
All programs must be run by first compiling them with the FreeBasic compiler, which is available for LINUX and Windows from www.freebasic.net. The progams here need the switch -lang qb to compile successfully: fbc -lang qb myprog.bas giving you an executable myprog.

LINUX Notes:
  1. In case you get a compile time error message akin to: .../ld cannot find -lXpm install libxpm-devel!
  2. Similarly if lncurses is missing, install libncurses-devel!
  3. Install freebasic by running install-sh as root from the distribution directory.
The usual disclaimer applies: I cannot guarantee that the programs are bug-free! If you find a bug please contact me on
My E-mail
Last update: 10th May 2014.

Contents
  1.  MHD Locator and Distance Calculation
  2.  NCDX/IARU Beacon Timer
  3.  PC Timer Set
  4.  Maximum Distances AE, Satellites, EME
  5.  Footprint of Planes Flying Sydney - Melbourne
  6.  Doppler Shift of Reflected Signals
  7.  Doppler Shift in an AE Scenario on VHF/UHF
  8.  Generalised Doppler Shift for AE
  9.  Converting wsjtx.log to .adif Format
Maidenhead Locator and Distance Calculation
This program allows you to convert latitude/longitude to 6 digit MHD locator and vice versa and also to calculate the distance between two 6 digit MHD locators as well as between 2 sets of latitude and longitude. Another function is beam-direction between 2 stations (defined by MHD locators or latitude/longitude). It is written without  much logic checking,  so beware: Garbage In Garbage Out! Feel free to add such checks, also feel free to change the COLOR statements, if you want a different colour scheme.
*** Updated 18/11/06 standardised earth radius to 6,371.01 km ***
REM Maidenhead locators
PI# = 3.14159265#
DIM C%(6), D%(6)
mains:
SCREEN 0: COLOR 5, 7: CLS
LOCATE 8, 1:  PRINT "MHD Locators and DX data by VK1WJ"
LOCATE 10, 1: PRINT "Selection Menu"
LOCATE 12, 5: PRINT "1: Latitude/Longitude to Maidenhead Locator";
LOCATE 13, 5: PRINT "2: Maidenhead Locator to Latitude/Longitude";
LOCATE 14, 5: PRINT "3: Distance between Locators";
LOCATE 15, 5: PRINT "4: Distance between Latitudes/Longitudes";
LOCATE 16, 5: PRINT "5: Beam Headings between Locators";
LOCATE 17, 5: PRINT "6: Beam Headings between Latitudes/Longitudes";
LOCATE 22, 5: PRINT "7: Finish this Program";
LOCATE 24, 1: INPUT "Your selection="; i%
IF i% > 7 OR i% < 1 THEN GOTO mains
ON i% GOTO laloloc, loclalo, lodis, lldis, beamlo, beamll, fini
laloloc:
REM ############### latitude and Longitude to Locator
CLS : PRINT "To find your locator square:": PRINT
GOSUB LALOIN
EM# = 10800 + EM#: NM# = 5400 + NM#
C%(1) = INT(EM# / 1200#): EM# = EM# - C%(1) * 1200
C%(3) = INT(EM# / 120#): EM# = EM# - C%(3) * 120: C%(5) = INT(EM# / 5)
C%(2) = INT(NM# / 600#): NM# = NM# - C%(2) * 600
C%(4) = INT(NM# / 60#): NM# = NM# - C%(4) * 60: C%(6) = INT(NM# / 2.5)
L$ = "": RESTORE: DATA 65,65,48,48,65,65
FOR N = 1 TO 6: READ D%(N): L$ = L$ + CHR$(D%(N) + C%(N)): NEXT
PRINT : PRINT "Six digit locator is: "; L$
INPUT "Hit Enter to continue";dum$
GOTO mains
loclalo:
REM ############### Locator to latitude/longitude
COLOR 0, 7: CLS
lo6:
INPUT "Enter 6 digit locator: "; L$
IF LEN(L$) <> 6 THEN GOTO lo6
FOR X = 1 TO 6
   C%(X) = ASC(MID$(L$, X, 1)): IF C%(X) > 96 AND C%(X) < 123 THEN C%(X) = C%(X) - 32
NEXT X
E# = -180 + 20 * (C%(1) - 65) + 2 * (C%(3) - 48) + (C%(5) - 65) / 12
N# = -90 + 10 * (C%(2) - 65) + (C%(4) - 48) + (C%(6) - 65) / 24
ILO$ = " eastern ": ILA$ = " northern "
IF E# < 0 THEN ILO$ = " western ": E# = -E#
IF N# < 0 THEN ILA$ = " southern ": N# = -N#
E1% = INT(E#): E2# = (E# - E1%) * 60
N1% = INT(N#): N2# = (N# - N1%) * 60
PRINT "Longitude="; E1%; " degrees and ";
PRINT USING "##.##"; E2#;: PRINT " minutes "; ILO$
PRINT "Latitude ="; N1%; " degrees and "; 
PRINT USING "##.##"; N2#;: PRINT " minutes "; ILA$
INPUT "Hit Enter to continue";dum$
GOTO mains
lodis:
REM ############### locator to distance
COLOR 4, 7: CLS
loc1:
LOCATE 1, 4: INPUT "Locator #1"; L$: IF LEN(L$) <> 6 THEN GOTO loc1
GOSUB LLLS: E# = E# * PI# / 180#: N# = N# * PI# / 180#: E1# = E#: N1# = N#
loc2:
LOCATE 3, 4: INPUT "Locator #2"; L$: IF LEN(L$) <> 6 THEN GOTO loc2
GOSUB LLLS: E# = E# * PI# / 180#: N# = N# * PI# / 180#: E2# = E#: N2# = N#
discal:
AN# = COS(E1# - E2#) * COS(N1#) * COS(N2#) + SIN(N1#) * SIN(N2#)
AC# = ATN(ABS(SQR(1 - AN# ^ 2) / AN#)): IF AN# < 0 THEN AC# = PI# - AC#
DX = INT(AC# * 6371.01)
REM 6371.01 is the mean radius of the earth
LOCATE 5, 6: PRINT "Distance in km: "; DX
INPUT "Hit Enter to continue";dum$
GOTO mains
lldis:
REM ############### distance between latitudes longitudes
COLOR 2, 0: CLS
PRINT "First latitude/longitude set:": PRINT
GOSUB LALOIN: E1# = EM#/60: N1# = NM#/60
E1# = E1# * PI# / 180#: N1# = N1# * PI# / 180#
CLS : PRINT "Second latitude/longitude set:": PRINT
GOSUB LALOIN: E2# = EM#/60: N2# = NM#/60
E2# = E2# * PI# / 180#: N2# = N2# * PI# / 180#
CLS
GOTO discal
REM Common code for distance calculation
beamlo:
REM ############### Beam headings between locators
COLOR 0, 6: CLS
bloc1:
LOCATE 1, 4: INPUT "Beam owner's locator"; L$: IF LEN(L$) <> 6 THEN GOTO bloc1
GOSUB LLLS: E1# = E#: N1# = N#
bloc2:
LOCATE 3, 4: INPUT "QSO partner's locator"; L$: IF LEN(L$) <> 6 THEN GOTO bloc2
GOSUB LLLS: E2# = E#: N2# = N#
GOTO headcom
REM The common part of the beam heading routine.
beamll:
REM ############### Beam headings latitude/longitude
COLOR 0, 7: CLS
PRINT "Your latitude/longitude set:": PRINT
GOSUB LALOIN: E1# = EM#/60# : N1# = NM#/60#
REM Giving the source latitude / longitude in degrees and fractions thereof
CLS : PRINT "QSO partners latitude/longitude set:": PRINT
GOSUB LALOIN: E2# = EM#/60: N2# = NM#/60
REM Giving the target latitude / longitude in degrees and fractions thereof
headcom:
gkt# = (6371.01# * 2# * PI#) * ((E2# - E1#)/360#) * cos(N2# * PI# / 180#)
akt# = (N2# - N1#) * PI# * 6371.01# / 180
alpha# = ATN(gkt# / akt#) * 180# / PI#
IF akt# < 0 then alpha# = 180# + alpha#
IF alpha# < 0 then alpha# = 360# + alpha#
PRINT "Beam Heading: ";:PRINT USING "###.##";alpha#;:PRINT " degrees"
INPUT "Hit Enter to continue";dum$
GOTO mains
LALOIN: 
REM ############### Enter lattitude/longitude subroutine
PRINT "Enter latitude & longitude in degrees & minutes (decimals ok for minutes)."
PRINT "Do not enter a sign. Query for N-S-E-W will follow"
PRINT "Type the two figures separated by commas.": PRINT
INPUT "Latitude (deg,min):  "; ND, NM#: NM# = ND * 60 + NM#
INPUT "North or South (N/S) "; NS$: IF NS$ = "S" OR NS$ = "s" THEN NM# = -NM#
REM NM# is the latitude in minutes. Negative if southern.
INPUT "Longitude (deg,min): "; ED, EM#: EM# = ED * 60 + EM#
INPUT "East or West (E/W)   "; EW$: IF EW$ = "W" OR EW$ = "w" THEN EM# = -EM#
REM EM# is the longitude in minutes. Negative if western.
RETURN
LLLS:
REM ############### locator to longitude/latitude subroutine
FOR X = 1 TO 6
   C%(X) = ASC(MID$(L$, X, 1)): IF C%(X) > 96 AND C%(X) < 123 THEN C%(X) = C%(X) - 32
NEXT X
E# = -180# + 20# * (C%(1) - 65#) + 2# * (C%(3) - 48#) + (C%(5) - 65#) / 12#
N# = -90# + 10# * (C%(2) - 65#) + (C%(4) - 48#) + (C%(6) - 65#) / 24#
REM E# is the longitude and N# the latitude in degrees.
RETURN
fini:
SYSTEM
NCDX/IARU Beacon Timer
This program displays which beacon appears on which frequency. Useful to check condx on DX. Set your PC clock very accurately!
*** Updated 15/7/06 ***
REM NCDX/IARU Beacon timer - Press Cntrl-c to EXIT 
DIM B$(18) 
DIM fr!(5) 
DIM BOF$(5) 
RESTORE 
FOR i = 1 TO 5 
  READ fr!(i) 
NEXT i 
DATA 14.1,18.11,21.15,24.93,28.2 
FOR i = 1 TO 18 
  READ B$(i) 
NEXT i 
DATA "4U1UN","VE8AT","W6WX","KH6WO","ZL6B","VK6RBP","JA2IGY","RR9O","VR2B" 
DATA "4S7B","ZS6DN","5Z4B","4X6TU","OH2B","CS3B","LU4AA","OA4B","YV5B" 
a: 
T$ = TIME$ 
IF RIGHT$(T$, 1) <> "0" THEN GOTO a: 
REM Now we are at a Beacon start Interval 
i0! = VAL(MID$(T$, 4, 2)) / 3 
REM gives 1/3 of the minutes of an hour. 
i1% = INT(i0!) 
i2% = CINT((i0! - i1%) * 3) 
REM this should give 0, 1, 2 
j0% = CINT(VAL(RIGHT$(T$, 2)) / 10) 
REM this should give 0,...5 
k0% = 6 * i2% + j0% 
REM this is the index of the beacon interval 
CLS 
PRINT T$; " Hit Cntrl-c to exit" 
k1% = k0% + 2: IF k1% > 18 THEN k1% = k1% - 18 
PRINT "Next: "; B$(k1%) 
FOR i% = 0 TO 4 
 j% = k0% + 1 - i% 
 IF j% < 1 THEN j% = j% + 18 
 BOF$(i%) = B$(j%) 
 PRINT USING "##.##";fr!(i% + 1);: PRINT " ";BOF$(i%) 
NEXT i% 
B: 
IF INKEY$ <> "" THEN GOTO FINI 
IF TIME$ <> T$ THEN GOTO a 
IF INKEY$ <> "" THEN GOTO FINI 
GOTO B 
FINI: 
SYSTEM 

PC Timer Set
A program to set the PC timer more accurately than with the "adjust date/time" GUI. It also allows  you to just set the hour and minute, leaving the seconds unchanged. Good for WSJT: Listen to WWD or WWDH on 5, 10 or 15 MHz and set you clock accordingly! Note: Under LINUX you have to be root to use the program. Also you might have to set the time in UTC!
STRT: 
REM Converted to FreeBASIC format!
CLS 
PRINT "Synchronise Time to a standard like WWV"
TSET: 
INPUT "Enter time in format hh:mm:ss or hh:mm you want the clock to be set to: "; T$
IF LEN(T$) = 5 OR LEN(T$) = 8 THEN GOTO LOK
GOTO TSET
LOK: 
PRINT "I have "; T$
INPUT "Is this OK (Y/N)"; YN$
IF YN$ = "Y" OR YN$ = "y" THEN GOTO TOK
GOTO TSET
TOK: 
PRINT "Wait for the time to arrive, then hit enter to set"
HIT: 
A$ = INKEY$
IF A$ = "" THEN GOTO HIT
IF LEN(T$) = 5 THEN GOSUB HMSET
SETTIME T$
CLS
LOCATE 1, 1: PRINT "If displayed time is OK hit q else space to set the time: "
TDIS: 
T$ = TIME$
LOCATE 2, 1: PRINT T$
QLP: 
T1$ = TIME$
A$ = INKEY$
IF A$ = "q" OR A$ = "Q" THEN SYSTEM
IF A$ <> "" THEN GOTO STRT
IF T1$ = T$ THEN GOTO QLP
GOTO TDIS
HMSET: 
T$ = T$ + ":" + RIGHT$(TIME$, 2)
RETURN
Maximum Distances AE, Satellites, EME
This program calculates the absolute "best case" scenario. The plane, satellite or moon has to be in the zenith of the mid-point between the stations conducting the QSO to achieve this distance. This will rarely be the case.
*** Updated 18/11/06 standardised earth radius to 6,371.01 km ***
REM Maximum distance between stations working AE, via satellites
REM or EME depending on height of object (plane, satellite, moon)
pi# = 3.141592654#
re# = 6371.01
REM Earth-radius in km                                                      
resq# = re# * re#
DIM I(12)
REM I(x) is height of object in km
DATA 2,4,6,8,10,12,20,100,300,600,35000,384000
RESTORE
CLS
PRINT "Altitude (Km)  Max_distance"
PRINT "---------------------------"
FOR j% = 1 TO 12
    READ I(j%)
    gkt# = SQR((re# + I(j%)) * (re# + I(j%)) - resq#)
    alpha# = ATN(gkt# / re#)
    a% = 2 * re# * alpha#
    PRINT I(j%), a%
NEXT j%
wlop:
a$ = INKEY$
IF a$ = "" THEN GOTO wlop
STOP
SYSTEM

Footprint of Planes Flying Sydney - Melbourne
This program shows a map of SE Australia plus the "footprint" of a plane flying from Sydney to Melbourne. You will be prompted for the maximum altitude of the plane. The program is quite lengthy because it contains the map within "DATA" statements. Download MAP.BAS (source) and compile it!

Doppler Shift of Reflected Signals (AE)
This program assumes a signal being reflected off a moving object. The speed of  the object is relative to the path of propagation.
DEFDBL A
DEFDBL C
DEFDBL I
INPUT "Frequency in MHz"; A0
INPUT "Speed of moving Object in km/h"; COB
A = A0 * 1E+07
I = 3 * 1000000! * 3600 + COB
I1 = 3 * 1000000! * 3600 - COB
A1 = A * I / I1
PRINT "Dopplershift ="; A1 - A; "Hertz"
xx:
IF INKEY$ = "" THEN GOTO xx
STOP
SYSTEM
Doppler Shift in an AE Scenario on VHF/UHF
This program evaluates the following AE scenario:
AE Scenario
REM Dopplershift calculation and plot in case of a plane
REM crossing the midway point between 2 stations in a right angle.
DEFDBL A-Z
DEFDBL d-s
INPUT "Enter operating frequency in MHZ"; A0
INPUT "Enter distance between stations in Km"; d2
d = d2 / 2
REM Half distance between stations
INPUT "Enter speed of plane in  Km/h"; v1
v = v1 / 3600
REM Km/sec plane movement
INPUT "Enter duration of QSO expected in seconds (even number)"; tm%
tmh% = tm% / 2
tm% = 2 * tmh%
REM tm% must be even!
sold = SQR(v * v * (tmh% + 1) * (tmh% + 1) + d * d)
REM to get delta s
dsmax% = 0
CLS
FOR t = -tmh% TO tmh%
 s0 = v * t
 s = SQR(s0 * s0 + d * d)
 COB = (s - sold) * 3600
 REM Relative speed of plane in km/h
 GOSUB SRD
 s% = s
 s0% = s0
 t% = t
 c% = COB
 ds% = ds
 IF dsmax% < ds% THEN dsmax% = ds%
 REM Time, Distance of Plane from midway position, True distance of plane,
 REM Relative speed, Dopplershift
 PRINT t%; s0%, s%, c%, ds%
 sold = s
 NEXT t
INPUT "Would you like to see the data plotted (Y/N)"; A$
IF A$ = "Y" OR A$ = "y" THEN GOTO plot
STOP
SYSTEM
plot:
REM Y value maximum
REM X value maximum is tm%
SCREEN 12, 1, 0
WINDOW (-tmh%, -dsmax%)-(tmh%, dsmax%)
CLS
LINE (-tmh%, 0)-(tmh%, 0)
LINE (0, -dsmax%)-(0, dsmax%)
sold = SQR(v * v * (tmh% + 1) * (tmh% + 1) + d * d)
FOR t = -tmh% TO tmh%
 s0 = v * t
 s = SQR(s0 * s0 + d * d)
 COB = (s - sold) * 3600
 REM Relative speed of plane in km/h
 GOSUB SRD
 t% = t
 ds% = ds
 PSET (t%, ds%)
 IF t > -tmh% THEN LINE (tp%, dsp%)-(t%, ds%)
 tp% = t%
 dsp% = ds%
 sold = s
NEXT t
F% = A0
LOCATE 21, 2
PRINT "Frequency = "; F%; " MHz";
LOCATE 22, 2
PRINT "Station Distance = "; d2; " Km";
LOCATE 23, 2
PRINT "Plane Speed = "; v1; " Km/h";
LOCATE 24, 2
PRINT "Maximum Doppler = "; dsmax%; " Hertz";
        LOCATE 25, 2
PRINT "x-axis: -"; tmh%; " to "; tmh%; " seconds";
wl:  
b$ = INKEY$
IF b$ = "" THEN GOTO wl
STOP
SYSTEM
SRD:
REM Frequency in MHz is A0
REM Relative speed of plane km/h is COB
A = A0 * 1E+07
I = 3 * 1000000! * 3600 + COB
I1 = 3 * 1000000! * 3600 - COB
A1 = A * I / I1
ds = A - A1
RETURN

Generalised Doppler Shift for AE
This program evaluates a generalised scenario where 2 stations work via reflection at a plane that moves according to specifications in subroutine "plapos". The following assumptions are made:
You look at the scenario in 2 dimensions from above. The height of the plane is not taken into account. You have to enter the operating frequency in MHz (decimals accepted). You have to enter the distance between stations A and B in Km (decimals accepted). You have to enter the duration of the QSO in an even number of seconds. This value we will call T. Station A is at coordinates (0,d), d being half the distance you entered above. Station B is at coordinates (0,-d).
Thus in subroutine "plapos" you have to calculate the horizontal coordinates x1 and y1 of the plane (in Km) depending on the (given) time t (in seconds), according to an algorithm of your chosing. The variable t will run from -T/2-1 to T/2.
Of course you will have to change the subroutine, if you change your scenario!

 I will show 3 example subroutines here. First the program with a subroutine simulating the scenario of the previous one (plane moving at constant speed perpendicular to and crossing the centre of the connecting line between the 2 stations):
REM Dopplershift calculation and plot in case of a plane
REM moving relative to two amateur stations
DEFDBL A-Z
DEFDBL d-y
INPUT "Enter operating frequency in MHZ"; A0
INPUT "Enter distance between stations in Km"; d2
d = d2 / 2
REM Half distance between stations
REM Coordinates of the stations are (0,d) and (0,-d)
INPUT "Enter duration of QSO expected in seconds (even number)"; tm%
tmh% = tm% / 2
tm% = 2 * tmh%
REM tm% must be even!
REM sold = SQR(v * v * (tmh% + 1) * (tmh% + 1) + d * d)
REM to get delta s
REM dsmax% = 0
CLS
stmh% = tmh% + 1
REM to get start values OK
FOR t = -stmh% TO tmh%
 GOSUB plapos
 REM Routine plapos returns co-ordinates x1 and y1 of the plane
 REM in Kilometres depending on time t
 s1 = SQR(x1 * x1 + (y1 + d) * (y1 + d))
 REM Distance from station A in Km
 s2 = SQR(x1 * x1 + (y1 - d) * (y1 - d))
 REM Distance from station B in Km
 s = (s1 + s2) / 2
 REM Relative Distance
 IF t > -stmh% THEN
    COB = (s - sold) * 3600
    REM Relative speed of plane in km/h
    GOSUB SRD
    s% = s
    t% = t
    c% = COB
    ds% = ds
    IF dsmax% < ABS(ds%) THEN dsmax% = ABS(ds%)
    REM Time, relative distance
    REM Relative speed, Dopplershift
    PRINT t%; s%, c%, ds%
 END IF
 sold = s
 NEXT t
INPUT "Would you like to see the data plotted (Y/N)"; A$
IF A$ = "Y" OR A$ = "y" THEN GOTO plot
STOP
SYSTEM
plot:
REM Y value maximum
REM X value maximum is tm%
SCREEN 12, 1, 0
WINDOW (-tmh%, -dsmax%)-(tmh%, dsmax%)
CLS
LINE (-tmh%, 0)-(tmh%, 0)
LINE (0, -dsmax%)-(0, dsmax%)
FOR t = -stmh% TO tmh%
 GOSUB plapos
 REM Routine plapos returns co-ordinates x1 and y1 of the plane
 REM in Kilometres depending on time t
 s1 = SQR(x1 * x1 + (y1 + d) * (y1 + d))
 REM Distance from station A in Km
 s2 = SQR(x1 * x1 + (y1 - d) * (y1 - d))
 REM Distance from station B in Km
 s = (s1 + s2) / 2
 REM Relative Distance
 IF t > -stmh% THEN
    COB = (s - sold) * 3600
    REM Relative speed of plane in km/h
    GOSUB SRD
    t% = t
    ds% = ds
    PSET (t%, ds%)
    IF t > -tmh% THEN LINE (tp%, dsp%)-(t%, ds%)
    tp% = t%
    dsp% = ds%
 END IF
 sold = s
NEXT t
F% = A0
LOCATE 22, 2
PRINT "Frequency = "; F%; " MHz";
LOCATE 23, 2
PRINT "Station Distance = "; d2; " Km";
LOCATE 24, 2
PRINT "Maximum Doppler = "; dsmax%; " Hertz";
        LOCATE 25, 2
PRINT "x-axis: -"; tmh%; " to "; tmh%; " seconds";
wl:
b$ = INKEY$
IF b$ = "" THEN GOTO wl
STOP
SYSTEM
SRD:
REM Frequency in MHz is A0
REM Relative speed of plane km/h is COB
A = A0 * 1E+07
I = 3 * 1000000! * 3600 + COB
I1 = 3 * 1000000! * 3600 - COB
A1 = A * I / I1
ds = A - A1
RETURN
plapos:
REM Routine returning plane position x1 and y1 in Km depending on time t
REM in seconds running from negative to positive values.
REM Coordinates of the stations are (0,d) and (0,-d)
REM Example1: plane going perpendicular at constant speed.
vpla = 900 / 3600
REM km/sec coming from 900 km/h
x1 = vpla * t
y1 = 0
RETURN

Here a routine plapos that shows a plane circling around the mid point between the two stations: 

plapos:
REM Routine returning plane position x1 and y1 in Km depending on time t
REM in seconds running from negative to positive values.
REM Coordinates of the stations are (0,d) and (0,-d) in Km
REM Example2: plane going in a 100 Km circle at 400 Km/h
REM Centered on the mid point between the two stations
REM In this case it goes around once every pi*100/vpla seconds
PI# = 3.141592654#
vpla = 400 / 3600
REM Giving Km/sec
Perio# = PI# * 100 / vpla
REM Periode of the plane in seconds
x1 = 50 * SIN(2 * PI# * t / Perio#)
y1 = 50 * COS(2 * PI# * t / Perio#)
RETURN

Here a routine plapos that shows a plane circling around an arbitrary point: 

REM Routine returning plane position x1 and y1 in Km depending on time t
REM in seconds running from negative to positive values.
REM Coordinates of the stations are (0,d) and (0,-d) in Km
REM Example3: plane going in a 100 Km circle at 400 Km/h
REM Centered on the mid point between the two stations + 170 Km in y
REM and +150 km in x direction
REM In this case it goes around once every pi*100/vpla seconds
PI# = 3.141592654#
vpla = 400 / 3600
REM Giving Km/sec
Perio# = PI# * 100 / vpla
REM Periode of the plane in seconds
x1 = 50 * SIN(2 * PI# * t / Perio#) + 150
y1 = 50 * COS(2 * PI# * t / Perio#) + 170
RETURN

Converting wsjtx.log to .adif Format
This saves plenty of time. The created file uploads nicely to eQSL.cc.
REM Converting wsjtx.log to adif
FINA1$="/home/waldis/.wsjtx/wsjtx.log"
INPUT "Input File to use  (/home/waldis/.wsjtx/wsjtx.log)";FINA$
IF FINA$<>"" THEN FINA1$=FINA$
OPEN FINA1$ FOR INPUT AS #1
INPUT "Output File to use =";FINA2$
OPEN FINA2$ FOR OUTPUT AS #2
PRINT #2,"2.2.3"
PRINT #2,"wjwxadif"
PRINT #2,""
PRINT "started"
WHILE NOT EOF(1)
  INPUT #1,DATUM$, ZEIT$, CALL$, MHD$, QRG$, MODE$,RSENT$, RRX$
  LEBAND$="3"
  BAND$=""
  IF LEFT$(QRG$,1)="3" THEN BAND$="80m"
  IF LEFT$(QRG$,1)="7" THEN BAND$="40m"
  IF LEFT$(QRG$,2)="10" THEN BAND$="30m"
  IF LEFT$(QRG$,2)="14" THEN BAND$="20m"
  IF LEFT$(QRG$,2)="18" THEN BAND$="17m"
  IF LEFT$(QRG$,2)="21" THEN BAND$="15m"
  IF LEFT$(QRG$,2)="24" THEN BAND$="12m"
  IF LEFT$(QRG$,2)="28" THEN BAND$="10m"
  IF BAND$="" THEN STOP
  PRINT #2,"";BAND$;"";CALL$;"";QRG$;"";MODE$;"";LEFT$(DATUM$,4);
  IF MID$(DATUM$,6,3)="Jan" THEN MTH$="01"
  IF MID$(DATUM$,6,3)="Feb" THEN MTH$="02"
  IF MID$(DATUM$,6,3)="Mar" THEN MTH$="03"
  IF MID$(DATUM$,6,3)="Apr" THEN MTH$="04"
  IF MID$(DATUM$,6,3)="May" THEN MTH$="05"
  IF MID$(DATUM$,6,3)="Jun" THEN MTH$="06"
  IF MID$(DATUM$,6,3)="Jul" THEN MTH$="07"
  IF MID$(DATUM$,6,3)="Aug" THEN MTH$="08"
  IF MID$(DATUM$,6,3)="Sep" THEN MTH$="09"
  IF MID$(DATUM$,6,3)="Oct" THEN MTH$="10"
  IF MID$(DATUM$,6,3)="Nov" THEN MTH$="11"
  IF MID$(DATUM$,6,3)="Dec" THEN MTH$="12"
  PRINT #2,MTH$;RIGHT$(DATUM$,2);"";LEFT$(DATUM$,4);MTH$;RIGHT$(DATUM$,2);
  PRINT #2,"";RSENT$;
  PRINT #2,"";LEFT$(ZEIT$,2);RIGHT$(ZEIT$,2);
  PRINT #2,"";LEFT$(ZEIT$,2);RIGHT$(ZEIT$,2);""
WEND
CLOSE #1
CLOSE #2
END  
Click here to return to Waldis' home-page
Free Web Hosting