|
|
|
@ -123,7 +123,7 @@ SGMetar::SGMetar(const string& m) :
|
|
|
|
|
while (scanVisibility()) ;
|
|
|
|
|
while (scanRwyVisRange()) ;
|
|
|
|
|
while (scanWeather()) ;
|
|
|
|
|
while (scanSkyCondition()) ;
|
|
|
|
|
while (scanSkyCondition()) { }
|
|
|
|
|
|
|
|
|
|
if (!scanTemperature()) {
|
|
|
|
|
throw sg_io_exception("metar temperature data malformed or missing ", sg_location(_url));
|
|
|
|
@ -1048,12 +1048,12 @@ bool SGMetar::scanSkyCondition()
|
|
|
|
|
SGMetarCloud cl;
|
|
|
|
|
|
|
|
|
|
if (!strncmp(m, "//////", 6)) {
|
|
|
|
|
m += 6;
|
|
|
|
|
if (!scanBoundary(&m))
|
|
|
|
|
return false;
|
|
|
|
|
_m = m;
|
|
|
|
|
char* m2 = m+6;
|
|
|
|
|
if (scanBoundary(&m2)) {
|
|
|
|
|
_m = m2;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!strncmp(m, "CLR", i = 3) // clear
|
|
|
|
|
|| !strncmp(m, "SKC", i = 3) // sky clear
|
|
|
|
@ -1074,9 +1074,10 @@ bool SGMetar::scanSkyCondition()
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!strncmp(m, "VV", i = 2)) // vertical visibility
|
|
|
|
|
;
|
|
|
|
|
else if (!strncmp(m, "FEW", i = 3))
|
|
|
|
|
bool verticalVisibility = false;
|
|
|
|
|
if (!strncmp(m, "VV", i = 2)) { // vertical visibility
|
|
|
|
|
verticalVisibility = true;
|
|
|
|
|
} else if (!strncmp(m, "FEW", i = 3))
|
|
|
|
|
cl._coverage = SGMetarCloud::COVERAGE_FEW;
|
|
|
|
|
else if (!strncmp(m, "SCT", i = 3))
|
|
|
|
|
cl._coverage = SGMetarCloud::COVERAGE_SCATTERED;
|
|
|
|
@ -1084,6 +1085,8 @@ bool SGMetar::scanSkyCondition()
|
|
|
|
|
cl._coverage = SGMetarCloud::COVERAGE_BROKEN;
|
|
|
|
|
else if (!strncmp(m, "OVC", i = 3))
|
|
|
|
|
cl._coverage = SGMetarCloud::COVERAGE_OVERCAST;
|
|
|
|
|
else if (!strncmp(m, "///", i = 3))
|
|
|
|
|
cl._coverage = SGMetarCloud::COVERAGE_NIL; // should we add 'unknown'?
|
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
m += i;
|
|
|
|
@ -1099,7 +1102,7 @@ bool SGMetar::scanSkyCondition()
|
|
|
|
|
} else if (!scanNumber(&m, &i, 3))
|
|
|
|
|
i = -1;
|
|
|
|
|
|
|
|
|
|
if (cl._coverage == SGMetarCloud::COVERAGE_NIL) {
|
|
|
|
|
if (verticalVisibility) {
|
|
|
|
|
if (!scanBoundary(&m))
|
|
|
|
|
return false;
|
|
|
|
|
if (i == -1) // 'VV///'
|
|
|
|
|