diff --git a/CHANGELOG b/CHANGELOG index a9ef787..7326a69 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ SIGNAL SERVER CHANGELOG +2.75 - 22 Apr 2016 +Added Hata model logic for f < 200MHz + + 2.72 - 07 Feb 2016 Expanded LIDAR coverage to read in 4 adjacent ASCII tiles in a 2x2 grid Removed requirement to specify -res in LIDAR mode as it's in the file header diff --git a/Makefile b/Makefile index ea51ead..2cdc783 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/sh CC = gcc CXX = g++ -CFLAGS = -Wall -O3 -s -ffast-amth +CFLAGS = -Wall -O3 -s -ffast-math CXXFLAGS = -Wall -O3 -s -ffast-math LIBS = -lm -lpthread diff --git a/inputs.cc b/inputs.cc index f10700a..ab57ca5 100644 --- a/inputs.cc +++ b/inputs.cc @@ -157,12 +157,12 @@ int loadLIDAR(char *filenames) fprintf(stdout,"Loading \"%s\" into page %d...\n",files[indx], indx); fflush(stdout); } - if (fgets(line, 18, fd) != NULL) { + if (fgets(line, 19, fd) != NULL) { pch = strtok (line," "); pch = strtok (NULL, " "); width=atoi(pch); } - if (fgets(line, 18, fd) != NULL) { + if (fgets(line, 19, fd) != NULL) { height=atoi(pch); } fgets(line, 24, fd); // @@ -211,33 +211,36 @@ int loadLIDAR(char *filenames) eastoffset=xur; if(xll>westoffset) westoffset=xll; + + if(debug){ + fprintf(stdout,"PRE yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n",yll,yur,xur,xll,delta); + } // Greenwich straddling hack if(xll < 0 && xur > 0){ - delta = (xur - xll); - xur=0.0; - xll=delta; + xll = (xur - xll); // full width + xur=0.0; // budge it along so it's west of greenwich delta=eastoffset; // add to Tx longitude later }else{ - // Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;) - if(xll > 0){ - xll=360-xll; - } - if(xur > 0){ - xur=360-xur; - } - if(xll < 0){ - xll=xll*-1; - } - if(xur < 0){ - xur=xur*-1; - } + // Transform WGS84 longitudes into 'west' values as society finishes east of Greenwich ;) + if(xll > 0){ + xll=360-xll; + } + if(xur > 0){ + xur=360-xur; + } + if(xll < 0){ + xll=xll*-1; + } + if(xur < 0){ + xur=xur*-1; + } } if(debug){ - fprintf(stdout,"yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n",yll,yur,xur,xll,delta); + fprintf(stdout,"POST yll %.7f yur %.7f xur %.7f xll %.7f delta %.6f\n",yll,yur,xur,xll,delta); } if (yll < min_north) diff --git a/main.cc b/main.cc index 585abdb..bd610b1 100644 --- a/main.cc +++ b/main.cc @@ -1,4 +1,4 @@ -double version = 2.72; +double version = 2.75; /****************************************************************************\ * Signal Server: Server optimised SPLAT! by Alex Farrant, M6ZUJ * ****************************************************************************** @@ -1464,7 +1464,7 @@ int main(int argc, char *argv[]) "ERROR: Either the Frequency was missing or out of range!"); exit(0); } - if (LR.erp > 5000000) { + if (LR.erp > 500000000) { fprintf(stdout, "ERROR: Power was out of range!"); exit(0); @@ -1693,7 +1693,11 @@ int main(int argc, char *argv[]) PlotPropagation(tx_site[0], altitudeLR, ano_filename, propmodel, knifeedge, haf, pmenv, use_threads); + if(!lidar){ + if (LR.erp == 0.0) + hottest=9; // 9dB nearfield + // nearfield bugfix for (lat = tx_site[0].lat - 0.001; lat <= tx_site[0].lat + 0.001; @@ -1723,6 +1727,7 @@ int main(int argc, char *argv[]) east=eastoffset; west=westoffset; } + // Print WGS84 bounds fprintf(stdout, "|%.6f", north); fprintf(stdout, "|%.6f", east); @@ -1735,7 +1740,7 @@ int main(int argc, char *argv[]) PlotPath(tx_site[0], tx_site[1], 1); PathReport(tx_site[0], tx_site[1], tx_site[0].filename, 0, propmodel, pmenv); - SeriesData(tx_site[0], tx_site[1], tx_site[0].filename, 1, + SeriesData(tx_site[1], tx_site[0], tx_site[0].filename, 1, normalise); } fflush(stdout); diff --git a/models/hata.cc b/models/hata.cc index f936e53..7cfd429 100644 --- a/models/hata.cc +++ b/models/hata.cc @@ -27,17 +27,19 @@ mode 1 = URBAN mode 2 = SUBURBAN mode 3 = OPEN */ +float lh_M; +float C_H; +float logf = log10(f); - float lh_M = log10(11.75 * h_M); - float C_H = 3.2 * lh_M * lh_M - 4.97; + if(f<200){ + lh_M = log10(1.54 * h_M); + C_H = 8.29 * (lh_M * lh_M) - 1.1; + }else{ + lh_M = log10(11.75 * h_M); + C_H = 3.2 * (lh_M * lh_M) - 4.97; + } - float logf = log10(f); - - float L_u = - 69.55 + 26.16 * logf - 13.82 * log10(h_B) - C_H + (44.9 - - 6.55 * - log10(h_B)) * - log10(d); + float L_u = 69.55 + 26.16 * logf - 13.82 * log10(h_B) - C_H + (44.9 - 6.55 * log10(h_B)) * log10(d); if (!mode || mode == 1) { return L_u; //URBAN diff --git a/outputs.cc b/outputs.cc index 1b52d82..3e47859 100644 --- a/outputs.cc +++ b/outputs.cc @@ -103,8 +103,8 @@ void DoPathLoss(char *filename, unsigned char geo, unsigned char kml, lon))); // fix for multi-tile lidar if(width==10000 && (indx==1 || indx==3)){ - if(y0 >= 3510){ //3535 - y0=y0-3510; + if(y0 >= 3432){ //3535 + y0=y0-3432; } } @@ -331,8 +331,8 @@ void DoSigStr(char *filename, unsigned char geo, unsigned char kml, // fix for multi-tile lidar if(width==10000 && (indx==1 || indx==3)){ - if(y0 >= 3510){ //3535 - y0=y0-3510; + if(y0 >= 3432){ //3535 + y0=y0-3432; } } @@ -575,8 +575,8 @@ void DoRxdPwr(char *filename, unsigned char geo, unsigned char kml, // fix for multi-tile lidar if(width==10000 && (indx==1 || indx==3)){ - if(y0 >= 3510){ //3535 - y0=y0-3510; + if(y0 >= 3432){ //3510,3535 + y0=y0-3432; } } @@ -997,14 +997,21 @@ void PathReport(struct site source, struct site destination, char *name, fprintf(fd2, "Transmitter site: %s\n", source.name); if (source.lat >= 0.0) { - fprintf(fd2, "Site location: %.4f North / %.4f West\n", - source.lat, source.lon); + + if (source.lon <= 180){ + fprintf(fd2, "Site location: %.4f, -%.4f\n",source.lat, source.lon); + }else{ + fprintf(fd2, "Site location: %.4f, %.4f\n",source.lat, 360 - source.lon); + } } else { - fprintf(fd2, "Site location: %.4f South / %.4f West\n", - -source.lat, source.lon); + if (source.lon <= 180){ + fprintf(fd2, "Site location: %.4f, -%.4f\n",source.lat, source.lon); + }else{ + fprintf(fd2, "Site location: %.4f, %.4f\n",source.lat, 360 - source.lon); + } } if (metric) { @@ -1069,13 +1076,21 @@ void PathReport(struct site source, struct site destination, char *name, fprintf(fd2, "\nReceiver site: %s\n", destination.name); if (destination.lat >= 0.0) { - fprintf(fd2, "Site location: %.4f North / %.4f West\n", - destination.lat, destination.lon); + + if (destination.lon <= 180){ + fprintf(fd2, "Site location: %.4f, -%.4f\n",destination.lat, destination.lon); + }else{ + fprintf(fd2, "Site location: %.4f, %.4f\n",destination.lat, 360 - destination.lon); + } } else { - fprintf(fd2, "Site location: %.4f South / %.4f West\n", - -destination.lat, destination.lon); + + if (destination.lon <= 180){ + fprintf(fd2, "Site location: %.4f, -%.4f\n",destination.lat, destination.lon); + }else{ + fprintf(fd2, "Site location: %.4f, %.4f\n",destination.lat, 360 - destination.lon); + } } if (metric) { diff --git a/signalserver b/signalserver new file mode 100755 index 0000000..1811198 Binary files /dev/null and b/signalserver differ diff --git a/signalserverHD b/signalserverHD new file mode 120000 index 0000000..2e55dc6 --- /dev/null +++ b/signalserverHD @@ -0,0 +1 @@ +signalserver \ No newline at end of file diff --git a/signalserverLIDAR b/signalserverLIDAR new file mode 120000 index 0000000..2e55dc6 --- /dev/null +++ b/signalserverLIDAR @@ -0,0 +1 @@ +signalserver \ No newline at end of file