Imported Upstream version 1.2.0b
[debian/splat] / splat.cpp
index 4c801c02913af133d86f894db828b8584296056f..119551071b19919bf3723bc1f47952a86923acfb 100644 (file)
--- a/splat.cpp
+++ b/splat.cpp
@@ -1,6 +1,6 @@
 /****************************************************************************
 *      SPLAT: An RF Signal Propagation Loss and Terrain Analysis Tool       *
-*                        Last update: 21-Dec-2006                          *
+*                        Last update: 15-Mar-2007                          *
 *****************************************************************************
 *           Project started in 1997 by John A. Magliacane, KD2BD           *
 *****************************************************************************
@@ -56,7 +56,7 @@
 #define ARRAYSIZE 30025
 #endif
 
-char   string[255], sdf_path[255], opened=0, *splat_version={"1.2.0"};
+char   string[255], sdf_path[255], opened=0, *splat_version={"1.2.0b"};
 
 double TWOPI=6.283185307179586, HALFPI=1.570796326794896,
        PI=3.141592653589793, deg2rad=1.74532925199e-02,
@@ -2459,8 +2459,7 @@ void PlotLRPath(struct site source, struct site destination, FILE *fd)
        double  loss, azimuth, pattern=0.0, 
                source_alt, dest_alt, source_alt2, dest_alt2,
                cos_xmtr_angle, cos_test_angle=0.0, test_alt,
-               elevation, distance=0.0,
-               four_thirds_earth;
+               elevation, distance=0.0, four_thirds_earth;
        struct  site temp;
 
        ReadPath(source,destination);
@@ -2509,9 +2508,9 @@ void PlotLRPath(struct site source, struct site destination, FILE *fd)
                                   that determines the elevation angle to the first
                                   obstruction along the path is bypassed. */
 
-                               for (x=2, block=0; x<y && block==0; x++)
+                               for (x=2, block=0; (x<y && block==0); x++)
                                {
-                                       distance=5280.0*(path.distance[y]-path.distance[x]);
+                                       distance=5280.0*path.distance[x];
                                        test_alt=four_thirds_earth+path.elevation[x];
 
                                        /* Calculate the cosine of the elevation
@@ -3906,14 +3905,14 @@ void GraphHeight(struct site source, struct site destination, char *name, double
        {
                if (metric)
                {
-                       fprintf(fd3,"%f\t%f\n",path.distance[path.length-1],r);
-                       fprintf(fd4,"%f\t%f\n",path.distance[path.length-1],r);
+                       fprintf(fd3,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
+                       fprintf(fd4,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
                }
 
                else
                {
-                       fprintf(fd3,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
-                       fprintf(fd4,"%f\t%f\n",KM_PER_MILE*path.distance[path.length-1],METERS_PER_FOOT*r);
+                       fprintf(fd3,"%f\t%f\n",path.distance[path.length-1],r);
+                       fprintf(fd4,"%f\t%f\n",path.distance[path.length-1],r);
                }
        }
        
@@ -6017,7 +6016,8 @@ int main(char argc, char *argv[])
 
        if (freq==0.0 && nf==0)
                freq=LR.frq_mhz;
-       else
+
+       else if (nf==1)
                freq=0.0;
 
        if (coverage | LRmap)