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-22 14:39:45 +02:00
committed by James Turner
parent 8a33223483
commit 190e6b3958
+28 -20
View File
@@ -373,36 +373,44 @@ void AirportSignBuilder::addSign(const SGGeod& pos, double heading, const std::s
n = n.substr(0, 2); n = n.substr(0, 2);
} }
if (n == "@Y") { if (n == "@Y") {
if (size < 4) { if (size > 3) {
sign_height = HT[size < 0 ? 3 : size]; size = -1;
newmat = "YellowSign"; SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
newtype = 'Y';
continue;
} }
sign_height = HT[size < 0 ? 3 : size];
newmat = "YellowSign";
newtype = 'Y';
continue;
} else if (n == "@R") { } else if (n == "@R") {
if (size < 4) { if (size > 3) {
sign_height = HT[size < 0 ? 3 : size]; size = -1;
newmat = "RedSign"; SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
newtype = 'R';
continue;
} }
sign_height = HT[size < 0 ? 3 : size];
newmat = "RedSign";
newtype = 'R';
continue;
} else if (n == "@L") { } else if (n == "@L") {
if (size < 4) { if (size > 3) {
sign_height = HT[size < 0 ? 3 : size]; size = -1;
newmat = "FramedSign"; SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 1 to 3");
newtype = 'L';
continue;
} }
sign_height = HT[size < 0 ? 3 : size];
newmat = "FramedSign";
newtype = 'L';
continue;
} else if (n == "@B") { } else if (n == "@B") {
if (size < 0 || size == 4 || size == 5) { if ( (size != -1) && (size != 4) && (size != 5) ) {
sign_height = HT[size < 0 ? 4 : size]; size = -1;
newmat = "BlackSign"; SG_LOG(SG_TERRAIN, SG_ALERT, SIGN "Wrong size for " << name << ". Allowed values are 4 or 5");
newtype = 'B';
continue;
} }
sign_height = HT[size < 0 ? 4 : size];
newmat = "BlackSign";
newtype = 'B';
continue;
} }
} }