forked from ExternalVendorCode/Signal-Server
Detect perm errors in loss colors
This commit is contained in:
12
inputs.cc
12
inputs.cc
@@ -1143,7 +1143,7 @@ int LoadSignalColors(struct site xmtr)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadLossColors(struct site xmtr)
|
int LoadLossColors(struct site xmtr)
|
||||||
{
|
{
|
||||||
int x, y, ok, val[4];
|
int x, y, ok, val[4];
|
||||||
char filename[255], string[80], *pointer = NULL, *s = NULL;
|
char filename[255], string[80], *pointer = NULL, *s = NULL;
|
||||||
@@ -1243,14 +1243,13 @@ void LoadLossColors(struct site xmtr)
|
|||||||
|
|
||||||
region.levels = 16;
|
region.levels = 16;
|
||||||
|
|
||||||
fd = fopen(filename, "r");
|
if ( xmtr.filename[0] == '\0' && (fd = fopen(filename, "r")) == NULL )
|
||||||
|
|
||||||
if (fd == NULL && xmtr.filename[0] == '\0')
|
|
||||||
/* Don't save if we don't have an output file */
|
/* Don't save if we don't have an output file */
|
||||||
return;
|
return 0;
|
||||||
|
|
||||||
if (fd == NULL) {
|
if (fd == NULL) {
|
||||||
fd = fopen(filename, "w");
|
if( (fd = fopen(filename, "w")) == NULL )
|
||||||
|
return errno;
|
||||||
|
|
||||||
for (x = 0; x < region.levels; x++)
|
for (x = 0; x < region.levels; x++)
|
||||||
fprintf(fd, "%3d: %3d, %3d, %3d\n", region.level[x],
|
fprintf(fd, "%3d: %3d, %3d, %3d\n", region.level[x],
|
||||||
@@ -1295,6 +1294,7 @@ void LoadLossColors(struct site xmtr)
|
|||||||
fclose(fd);
|
fclose(fd);
|
||||||
region.levels = x;
|
region.levels = x;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadDBMColors(struct site xmtr)
|
void LoadDBMColors(struct site xmtr)
|
||||||
|
@@ -7,7 +7,7 @@ int LoadSDF_SDF(char *name, int winfiles);
|
|||||||
char LoadSDF(char *name, int winfiles);
|
char 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);
|
||||||
void LoadLossColors(struct site xmtr);
|
int LoadLossColors(struct site xmtr);
|
||||||
void LoadDBMColors(struct site xmtr);
|
void LoadDBMColors(struct site xmtr);
|
||||||
void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat);
|
void LoadTopoData(int max_lon, int min_lon, int max_lat, int min_lat);
|
||||||
void LoadUDT(char *filename);
|
void LoadUDT(char *filename);
|
||||||
|
@@ -34,7 +34,7 @@ void DoPathLoss(char *filename, unsigned char geo, unsigned char kml,
|
|||||||
image_ctx_t ctx;
|
image_ctx_t ctx;
|
||||||
int success;
|
int success;
|
||||||
|
|
||||||
if((success = image_init(&ctx, width, (kml ? height : height + 30), IMAGE_RGB, IMAGE_DEFAULT)) != 0){
|
if( (success = image_init(&ctx, width, (kml ? height : height + 30), IMAGE_RGB, IMAGE_DEFAULT)) != 0 ){
|
||||||
fprintf(stderr,"Error initializing image\n");
|
fprintf(stderr,"Error initializing image\n");
|
||||||
exit(success);
|
exit(success);
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,10 @@ void DoPathLoss(char *filename, unsigned char geo, unsigned char kml,
|
|||||||
255.0 / pow((double)(max_elevation - min_elevation),
|
255.0 / pow((double)(max_elevation - min_elevation),
|
||||||
one_over_gamma);
|
one_over_gamma);
|
||||||
|
|
||||||
LoadLossColors(xmtr[0]);
|
if( (success = LoadLossColors(xmtr[0])) != 0 ){
|
||||||
|
fprintf(stderr,"Error loading loss colors\n");
|
||||||
|
exit(success);
|
||||||
|
}
|
||||||
|
|
||||||
if( filename != NULL ) {
|
if( filename != NULL ) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user