Taxiway signs: print out more meaningful error messages on wrong size

settings and fall back to the default value in such cases.
This commit is contained in:
Christian Schmitt
2012-06-20 12:54:41 +02:00
committed by James Turner
parent 8a33223483
commit 190e6b3958

View File

@@ -373,36 +373,44 @@ void AirportSignBuilder::addSign(const SGGeod& pos, double heading, const std::s
n = n.substr(0, 2);
}
if (n == "@Y") {
if (size < 4) {
sign_height = HT[size < 0 ? 3 : size];
newmat = "YellowSign";
newtype = 'Y';
continue;
if (size > 3) {
size = -1;
SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
}
sign_height = HT[size < 0 ? 3 : size];
newmat = "YellowSign";
newtype = 'Y';
continue;
} else if (n == "@R") {
if (size < 4) {
sign_height = HT[size < 0 ? 3 : size];
newmat = "RedSign";
newtype = 'R';
continue;
if (size > 3) {
size = -1;
SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
}
sign_height = HT[size < 0 ? 3 : size];
newmat = "RedSign";
newtype = 'R';
continue;
} else if (n == "@L") {
if (size < 4) {
sign_height = HT[size < 0 ? 3 : size];
newmat = "FramedSign";
newtype = 'L';
continue;
if (size > 3) {
size = -1;
SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
}
sign_height = HT[size < 0 ? 3 : size];
newmat = "FramedSign";
newtype = 'L';
continue;
} else if (n == "@B") {
if (size < 0 || size == 4 || size == 5) {
sign_height = HT[size < 0 ? 4 : size];
newmat = "BlackSign";
newtype = 'B';
continue;
if ( (size != -1) && (size != 4) && (size != 5) ) {
size = -1;
SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 4 or 5");
}
sign_height = HT[size < 0 ? 4 : size];
newmat = "BlackSign";
newtype = 'B';
continue;
}
}