1
0
Fork 0

ATISEncoder: remove always true condition

This commit is contained in:
Scott Giese 2021-12-26 20:09:20 -06:00
parent 17fde93fb2
commit 3e096fed41

View file

@ -416,11 +416,11 @@ string ATISEncoder::getTakeoffRunway( SGPropertyNode_ptr p )
return getLandingRunway( p ); return getLandingRunway( p );
} }
string ATISEncoder::getTransitionLevel( SGPropertyNode_ptr ) string ATISEncoder::getTransitionLevel(SGPropertyNode_ptr)
{ {
double hPa = _atis->getQnh(); double hPa = _atis->getQnh();
/* Transition level is the flight level above which aircraft must use standard pressure and below /* Transition level is the flight level above which aircraft must use standard pressure and below
* which airport pressure settings must be used. * which airport pressure settings must be used.
* Following definitions are taken from German ATIS: * Following definitions are taken from German ATIS:
* QNH <= 977 hPa: TRL 80 * QNH <= 977 hPa: TRL 80
@ -428,26 +428,26 @@ string ATISEncoder::getTransitionLevel( SGPropertyNode_ptr )
* QNH > 1013 hPa: TRL 60 * QNH > 1013 hPa: TRL 60
* (maybe differs slightly for other countries...) * (maybe differs slightly for other countries...)
*/ */
int tl; int tl;
if (hPa <= 978) { if (hPa <= 978) {
tl = 80; tl = 80;
} else if( hPa > 978 && hPa <= 1013 ) { } else if (hPa <= 1013) {
tl = 70; tl = 70;
} else if( hPa > 1013 && hPa <= 1046 ) { } else if (hPa <= 1046) {
tl = 60; tl = 60;
} else { } else {
tl = 50; tl = 50;
} }
// add an offset to the transition level for high altitude airports (just guessing here, // add an offset to the transition level for high altitude airports (just guessing here,
// seems reasonable) // seems reasonable)
int e = int(airport->getElevation() / 1000.0); int e = int(airport->getElevation() / 1000.0);
if (e >= 3) { if (e >= 3) {
// TL steps in 10(00)ft // TL steps in 10(00)ft
tl += (e-2)*10; tl += (e - 2) * 10;
} }
return getSpokenNumber(tl); return getSpokenNumber(tl);
} }
string ATISEncoder::getWindDirection( SGPropertyNode_ptr ) string ATISEncoder::getWindDirection( SGPropertyNode_ptr )
@ -525,10 +525,12 @@ string ATISEncoder::getClouds( SGPropertyNode_ptr )
ATISInformationProvider::CloudEntries cloudEntries = _atis->getClouds(); ATISInformationProvider::CloudEntries cloudEntries = _atis->getClouds();
for( ATISInformationProvider::CloudEntries::iterator it = cloudEntries.begin(); it != cloudEntries.end(); it++ ) { for (ATISInformationProvider::CloudEntries::iterator it = cloudEntries.begin(); it != cloudEntries.end(); ++it) {
if( !reply.empty() ) reply.SPACE; if (!reply.empty())
reply.SPACE;
reply.append( it->second ).SPACE.append( getSpokenAltitude(it->first).SPACE.append( FEET ) ); reply.append( it->second ).SPACE.append( getSpokenAltitude(it->first).SPACE.append( FEET ) );
} }
return reply; return reply;
} }
@ -538,10 +540,12 @@ string ATISEncoder::getCloudsBrief( SGPropertyNode_ptr )
ATISInformationProvider::CloudEntries cloudEntries = _atis->getClouds(); ATISInformationProvider::CloudEntries cloudEntries = _atis->getClouds();
for( ATISInformationProvider::CloudEntries::iterator it = cloudEntries.begin(); it != cloudEntries.end(); it++ ) { for (ATISInformationProvider::CloudEntries::iterator it = cloudEntries.begin(); it != cloudEntries.end(); ++it) {
if( !reply.empty() ) reply.append(",").SPACE; if (!reply.empty())
reply.append(",").SPACE;
reply.append( it->second ).SPACE.append( getSpokenAltitude(it->first) ); reply.append( it->second ).SPACE.append( getSpokenAltitude(it->first) );
} }
return reply; return reply;
} }