From 67c145dd7d2290c7f0c7038aae99bddc02a7d7ef Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Thu, 1 Jun 2017 22:58:06 +0100 Subject: [PATCH] Fix height width and makefule issues --- Makefile | 4 +++- inputs.cc | 2 ++ main.cc | 38 +++++++++++++++++++------------------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 23ef504..56926bb 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ LIBS = -lm -lpthread -ldl VPATH = models objects = main.o cost.o ecc33.o ericsson.o fspl.o hata.o itwom3.0.o \ - los.o sui.o pel.o egli.o inputs.o outputs.o image.o image-ppm.o + los.o sui.o pel.o egli.o inputs.o outputs.o image.o image-ppm.o tiles.o GCC_MAJOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d . -f 1) GCC_MINOR := $(shell $(CXX) -dumpversion 2>&1 | cut -d . -f 2) @@ -52,6 +52,8 @@ image-ppm.o: image-ppm.cc los.o: los.cc common.h main.hh cost.hh ecc33.hh ericsson.hh fspl.hh hata.hh \ itwom3.0.hh sui.hh pel.hh egli.hh +tiles.o: tiles.cc tiles.hh common.h + .PHONY: clean clean: rm -f $(objects) signalserver signalserverHD signalserverLIDAR diff --git a/inputs.cc b/inputs.cc index c67b871..12364a9 100644 --- a/inputs.cc +++ b/inputs.cc @@ -76,6 +76,8 @@ int resample_data(int scaling_factor){ fprintf(stderr, "Resampling IPPD %d->%d min/max el %d/%d\n", IPPD, new_ippd, min_elevation, max_elevation); /* Finally, set the new IPPD value */ + height /= scaling_factor; + width /= scaling_factor; IPPD = new_ippd; ippd = IPPD; ARRAYSIZE = (MAXPAGES * IPPD) + 50; diff --git a/main.cc b/main.cc index 26b5026..4a0fbfb 100644 --- a/main.cc +++ b/main.cc @@ -1884,26 +1884,26 @@ int main(int argc, char *argv[]) } } - if(max_range<=100){ - // CROPPING. croplat assigned in propPathLoss() - max_north=cropLat; // MAX(path.lat[y]) - // Edge case #1 - EAST/WEST - if(cropLon>357 && tx_site[0].lon < 3) - cropLon=tx_site[0].lon+3; - // Edge case #2 - EAST/EAST - if(cropLon>359.5 && tx_site[0].lon > 359.5) - cropLon=362; - max_west=cropLon; // MAX(path.lon[y]) - cropLat-=tx_site[0].lat; // angle from tx to edge - cropLon-=tx_site[0].lon; - width=(int)((cropLon*ppd)*2); - height=(int)((cropLat*ppd)*2); + // if(max_range<=100){ + // // CROPPING. croplat assigned in propPathLoss() + // max_north=cropLat; // MAX(path.lat[y]) + // // Edge case #1 - EAST/WEST + // if(cropLon>357 && tx_site[0].lon < 3) + // cropLon=tx_site[0].lon+3; + // // Edge case #2 - EAST/EAST + // if(cropLon>359.5 && tx_site[0].lon > 359.5) + // cropLon=362; + // max_west=cropLon; // MAX(path.lon[y]) + // cropLat-=tx_site[0].lat; // angle from tx to edge + // cropLon-=tx_site[0].lon; + // width=(int)((cropLon*ppd)*2); + // height=(int)((cropLat*ppd)*2); - if(width>3600*10){ - fprintf(stderr,"FATAL BOUNDS! max_west: %.4f cropLat: %.4f cropLon: %.4f longitude: %.5f\n",max_west,cropLat,cropLon,tx_site[0].lon); - return 0; - } - } + // if(width>3600*10){ + // fprintf(stderr,"FATAL BOUNDS! max_west: %.4f cropLat: %.4f cropLon: %.4f longitude: %.5f\n",max_west,cropLat,cropLon,tx_site[0].lon); + // return 0; + // } + // } // Write bitmap if (LR.erp == 0.0)