forked from ExternalVendorCode/Signal-Server
Handle missing antenna pattern file
This commit is contained in:
12
inputs.cc
12
inputs.cc
@@ -659,7 +659,7 @@ char LoadSDF(char *name)
|
|||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadPAT(char *filename)
|
int LoadPAT(char *filename)
|
||||||
{
|
{
|
||||||
/* This function reads and processes antenna pattern (.az
|
/* This function reads and processes antenna pattern (.az
|
||||||
and .el) files that correspond in name to previously
|
and .el) files that correspond in name to previously
|
||||||
@@ -696,9 +696,9 @@ void LoadPAT(char *filename)
|
|||||||
|
|
||||||
/* Load .az antenna pattern file */
|
/* Load .az antenna pattern file */
|
||||||
|
|
||||||
fd = fopen(azfile, "r");
|
if( (fd = fopen(azfile, "r")) == NULL )
|
||||||
|
return errno;
|
||||||
|
|
||||||
if (fd != NULL) {
|
|
||||||
/* Clear azimuth pattern array */
|
/* Clear azimuth pattern array */
|
||||||
|
|
||||||
for (x = 0; x <= 360; x++) {
|
for (x = 0; x <= 360; x++) {
|
||||||
@@ -824,13 +824,12 @@ void LoadPAT(char *filename)
|
|||||||
azimuth_pattern[360] = azimuth_pattern[0];
|
azimuth_pattern[360] = azimuth_pattern[0];
|
||||||
|
|
||||||
got_azimuth_pattern = 255;
|
got_azimuth_pattern = 255;
|
||||||
}
|
|
||||||
|
|
||||||
/* Read and process .el file */
|
/* Read and process .el file */
|
||||||
|
|
||||||
fd = fopen(elfile, "r");
|
if( (fd = fopen(elfile, "r")) == NULL )
|
||||||
|
return errno;
|
||||||
|
|
||||||
if (fd != NULL) {
|
|
||||||
for (x = 0; x <= 10000; x++) {
|
for (x = 0; x <= 10000; x++) {
|
||||||
el_pattern[x] = 0.0;
|
el_pattern[x] = 0.0;
|
||||||
read_count[x] = 0;
|
read_count[x] = 0;
|
||||||
@@ -993,7 +992,6 @@ void LoadPAT(char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
got_elevation_pattern = 255;
|
got_elevation_pattern = 255;
|
||||||
}
|
|
||||||
|
|
||||||
for (x = 0; x <= 360; x++) {
|
for (x = 0; x <= 360; x++) {
|
||||||
for (y = 0; y <= 1000; y++) {
|
for (y = 0; y <= 1000; y++) {
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
int LoadSDF_SDF(char *name, int winfiles);
|
int LoadSDF_SDF(char *name, int winfiles);
|
||||||
char LoadSDF(char *name, int winfiles);
|
char LoadSDF(char *name, int winfiles);
|
||||||
void LoadPAT(char *filename);
|
int LoadPAT(char *filename);
|
||||||
void LoadSignalColors(struct site xmtr);
|
void LoadSignalColors(struct site xmtr);
|
||||||
void LoadLossColors(struct site xmtr);
|
void LoadLossColors(struct site xmtr);
|
||||||
void LoadDBMColors(struct site xmtr);
|
void LoadDBMColors(struct site xmtr);
|
||||||
|
5
main.cc
5
main.cc
@@ -1218,7 +1218,10 @@ int main(int argc, char *argv[])
|
|||||||
strncpy(mapfile, argv[z], 253);
|
strncpy(mapfile, argv[z], 253);
|
||||||
strncpy(tx_site[0].name, "Tx", 2);
|
strncpy(tx_site[0].name, "Tx", 2);
|
||||||
strncpy(tx_site[0].filename, argv[z], 253);
|
strncpy(tx_site[0].filename, argv[z], 253);
|
||||||
LoadPAT(argv[z]);
|
if( (result = LoadPAT(argv[z])) != 0 ){
|
||||||
|
fprintf(stderr,"Error reading antenna pattern file\n");
|
||||||
|
exit(result);
|
||||||
|
}
|
||||||
} else if (z <= y && argv[z][0] && argv[z][0] == '-' && argv[z][1] == '\0' ) {
|
} else if (z <= y && argv[z][0] && argv[z][0] == '-' && argv[z][1] == '\0' ) {
|
||||||
/* Handle writing image data to stdout */
|
/* Handle writing image data to stdout */
|
||||||
to_stdout = true;
|
to_stdout = true;
|
||||||
|
Reference in New Issue
Block a user