forked from ExternalVendorCode/Signal-Server
Detect and handle errors in topo data
This commit is contained in:
14
inputs.cc
14
inputs.cc
@@ -533,7 +533,7 @@ int LoadSDF_SDF(char *name)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
char LoadSDF(char *name)
|
int LoadSDF(char *name)
|
||||||
{
|
{
|
||||||
/* This function loads the requested SDF file from the filesystem.
|
/* This function loads the requested SDF file from the filesystem.
|
||||||
It first tries to invoke the LoadSDF_SDF() function to load an
|
It first tries to invoke the LoadSDF_SDF() function to load an
|
||||||
@@ -1458,12 +1458,13 @@ int LoadDBMColors(struct site xmtr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat)
|
int LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat)
|
||||||
{
|
{
|
||||||
/* This function loads the SDF files required
|
/* This function loads the SDF files required
|
||||||
to cover the limits of the region specified. */
|
to cover the limits of the region specified. */
|
||||||
|
|
||||||
int x, y, width, ymin, ymax;
|
int x, y, width, ymin, ymax;
|
||||||
|
int success;
|
||||||
|
|
||||||
width = ReduceAngle(max_lon - min_lon);
|
width = ReduceAngle(max_lon - min_lon);
|
||||||
|
|
||||||
@@ -1495,7 +1496,9 @@ void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat)
|
|||||||
snprintf(string, 16,
|
snprintf(string, 16,
|
||||||
"%d:%d:%d:%d", x,
|
"%d:%d:%d:%d", x,
|
||||||
x + 1, ymin, ymax);
|
x + 1, ymin, ymax);
|
||||||
LoadSDF(string);
|
if( (success = LoadSDF(string)) < 0 ){
|
||||||
|
return -success;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1526,10 +1529,13 @@ void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat)
|
|||||||
snprintf(string, 16,
|
snprintf(string, 16,
|
||||||
"%d:%d:%d:%d", x,
|
"%d:%d:%d:%d", x,
|
||||||
x + 1, ymin, ymax);
|
x + 1, ymin, ymax);
|
||||||
LoadSDF(string);
|
if( (success = LoadSDF(string)) < 0 ){
|
||||||
|
return -success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void LoadUDT(char *filename)
|
void LoadUDT(char *filename)
|
||||||
{
|
{
|
||||||
|
@@ -4,12 +4,12 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
int LoadSDF_SDF(char *name, int winfiles);
|
int LoadSDF_SDF(char *name, int winfiles);
|
||||||
char LoadSDF(char *name, int winfiles);
|
int LoadSDF(char *name, int winfiles);
|
||||||
int LoadPAT(char *az_filename, char *el_filename);
|
int LoadPAT(char *az_filename, char *el_filename);
|
||||||
int LoadSignalColors(struct site xmtr);
|
int LoadSignalColors(struct site xmtr);
|
||||||
int LoadLossColors(struct site xmtr);
|
int LoadLossColors(struct site xmtr);
|
||||||
int LoadDBMColors(struct site xmtr);
|
int LoadDBMColors(struct site xmtr);
|
||||||
void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat);
|
int LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat);
|
||||||
void LoadUDT(char *filename);
|
void LoadUDT(char *filename);
|
||||||
int loadLIDAR(char *filename);
|
int loadLIDAR(char *filename);
|
||||||
int loadClutter(char *filename, double radius, struct site tx);
|
int loadClutter(char *filename, double radius, struct site tx);
|
||||||
|
12
main.cc
12
main.cc
@@ -1708,7 +1708,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
// DEM first
|
// DEM first
|
||||||
LoadTopoData(max_lon, min_lon, max_lat, min_lat);
|
if( (result = LoadTopoData(max_lon, min_lon, max_lat, min_lat)) != 0 ){
|
||||||
|
// This only fails on errors loading SDF tiles
|
||||||
|
fprintf(stderr, "Error loading topo data\n");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
if (area_mode || topomap) {
|
if (area_mode || topomap) {
|
||||||
for (z = 0; z < txsites && z < max_txsites; z++) {
|
for (z = 0; z < txsites && z < max_txsites; z++) {
|
||||||
@@ -1793,7 +1797,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Load any additional SDF files, if required */
|
/* Load any additional SDF files, if required */
|
||||||
|
|
||||||
LoadTopoData(max_lon, min_lon, max_lat, min_lat);
|
if( (result = LoadTopoData(max_lon, min_lon, max_lat, min_lat)) != 0 ){
|
||||||
|
// This only fails on errors loading SDF tiles
|
||||||
|
fprintf(stderr, "Error loading topo data\n");
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ppd=(double)ippd;
|
ppd=(double)ippd;
|
||||||
yppd=ppd;
|
yppd=ppd;
|
||||||
|
Reference in New Issue
Block a user