Added ITWOM model now that it's under the GPL licence :)
This commit is contained in:
Cloud-RF
2014-09-30 21:46:54 +01:00
parent c7fc5903a7
commit df7a5ac0d3
5 changed files with 8614 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
double version=2.23;
double version=2.3;
/****************************************************************************\
* Signal Server: Server optimised SPLAT! by Alex Farrant *
******************************************************************************
@@ -22,7 +22,12 @@ double version=2.23;
******************************************************************************
* g++ -Wall -O3 -s -lm -fomit-frame-pointer itm.cpp hata.cpp cost.cpp fspl.cpp main.cpp -o ss *
\****************************************************************************/
/*
2.3 - Added ITWOM3.0
2.22 - Fixed LOS not outputting bounds
2.2 - Made .dot output opt in to save some disk space
2.1 - Added dual core support with -haf
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@@ -62,7 +67,7 @@ double earthradius, max_range=0.0, forced_erp, dpp, ppd,
int min_north=90, max_north=-90, min_west=360, max_west=-1, ippd, mpi,
max_elevation=-32768, min_elevation=32768, bzerror, contour_threshold,
pred,pblue,pgreen,ter,multiplier=256,debug=0,loops=64,jgets=0, MAXRAD, hottest=10,csv=0;
pred,pblue,pgreen,ter,multiplier=256,debug=0,loops=64,jgets=0, MAXRAD, hottest=10;
unsigned char got_elevation_pattern, got_azimuth_pattern, metric=0, dbm=0;
@@ -114,10 +119,16 @@ double elev[ARRAYSIZE+10];
struct site tx_site[2];
//ITWOM
void point_to_point(double elev[], double tht_m, double rht_m,
double eps_dielect, double sgm_conductivity, double eno_ns_surfref,
double frq_mhz, int radio_climate, int pol, double conf,
double rel, double &dbloss, char *strmode, int &errnum);
//ITM
void point_to_point_ITM(double elev[], double tht_m, double rht_m,
double eps_dielect, double sgm_conductivity, double eno_ns_surfref,
double frq_mhz, int radio_climate, int pol, double conf,
double rel, double &dbloss, char *strmode, int &errnum);
double HataLinkdB(float f,float h_B, float h_M, float d, int mode);
@@ -294,10 +305,7 @@ int PutSignal(double lat, double lon, unsigned char signal)
char dotfile[255];
FILE *fd=NULL;
snprintf(dotfile,80,"%s.dot%c",tx_site[0].filename,0);
if(csv)
fd=fopen(dotfile,"a");
int x, y, indx;
char found;
@@ -322,17 +330,10 @@ int PutSignal(double lat, double lon, unsigned char signal)
// Write values to file
dem[indx].signal[x][y]=signal;
if(signal>0 && csv){
fprintf(fd,"%.6f,%.6f,%d\n",lat,lon,signal);
}
if(csv)
fclose(fd);
return (dem[indx].signal[x][y]);
}
else
if(csv)
fclose(fd);
return 0;
}
@@ -1787,7 +1788,7 @@ void PlotPropPath(struct site source, struct site destination, unsigned char mas
{
case 1:
// Longley Rice
point_to_point(elev,source.alt*METERS_PER_FOOT,
point_to_point_ITM(elev,source.alt*METERS_PER_FOOT,
destination.alt*METERS_PER_FOOT, LR.eps_dielect,
LR.sgm_conductivity, LR.eno_ns_surfref, LR.frq_mhz,
LR.radio_climate, LR.pol, LR.conf, LR.rel, loss,
@@ -1814,9 +1815,17 @@ void PlotPropPath(struct site source, struct site destination, unsigned char mas
loss=FsplLinkdB(LR.frq_mhz,dkm);
//fprintf(stdout,"MHz: %1f KM: %1f = %1fdB",LR.frq_mhz,dkm,loss);
break;
case 8:
// ITWOM 3.0
point_to_point(elev,source.alt*METERS_PER_FOOT,
destination.alt*METERS_PER_FOOT, LR.eps_dielect,
LR.sgm_conductivity, LR.eno_ns_surfref, LR.frq_mhz,
LR.radio_climate, LR.pol, LR.conf, LR.rel, loss,
strmode, errnum);
break;
default:
point_to_point(elev,source.alt*METERS_PER_FOOT,
point_to_point_ITM(elev,source.alt*METERS_PER_FOOT,
destination.alt*METERS_PER_FOOT, LR.eps_dielect,
LR.sgm_conductivity, LR.eno_ns_surfref, LR.frq_mhz,
LR.radio_climate, LR.pol, LR.conf, LR.rel, loss,
@@ -4982,11 +4991,10 @@ int main(int argc, char *argv[])
fprintf(stdout," -R Radius (miles/kilometers)\n");
fprintf(stdout," -res Pixels per degree. 300/600/1200(default)/3600 (optional)\n");
fprintf(stdout," -t Terrain background\n");
fprintf(stdout," -pm Prop model. 1: ITM, 2: LOS, 3-5: Hata, 6: COST231, 7: ITU525\n");
fprintf(stdout," -pm Prop model. 1: ITM, 2: LOS, 3-5: Hata, 6: COST231, 7: ITU525, 8: ITWOM3.0\n");
fprintf(stdout," -ked Knife edge diffraction (Default for ITM)\n");
fprintf(stdout," -ng Normalise Path Profile graph\n");
fprintf(stdout," -haf Halve 1 or 2 (optional)\n");
fprintf(stdout," -csv Write CSV file with lat,lon,dbm\n");
fflush(stdout);
@@ -5429,12 +5437,7 @@ int main(int argc, char *argv[])
}
}
//CSV output
if (strcmp(argv[x],"-csv")==0)
{
z=x+1;
csv=1;
}
}
@@ -5498,7 +5501,7 @@ int main(int argc, char *argv[])
fprintf(stdout,"ERROR: Receiver threshold out of range (-200 / +200)");
exit(0);
}
if(propmodel>2 && propmodel<7 && LR.frq_mhz < 150){
if(propmodel>2 && propmodel<8 && LR.frq_mhz < 150){
fprintf(stdout,"ERROR: Frequency too low for Propagation model");
exit(0);
}