Extend GFS data and CGridPoint with surface pressure and temperature

This commit is contained in:
Roland Winklmeier
2016-03-28 21:09:01 +02:00
parent 9c869a16df
commit 5801962a99
6 changed files with 88 additions and 25 deletions

View File

@@ -32,33 +32,40 @@ void CWeatherDataPrinter::ps_printWeatherData(const BlackMisc::Weather::CWeather
{
qtout << "Latitude:" << gridPoint.getPosition().latitude().toQString() << endl;
qtout << "Longitude:" << gridPoint.getPosition().longitude().toQString() << endl;
qtout << " Surface Pressure: " << gridPoint.getSurfacePressure().toQString() << endl;
CTemperatureLayerList temperatureLayers = gridPoint.getTemperatureLayers();
temperatureLayers.sort([](const CTemperatureLayer &a, const CTemperatureLayer &b) { return a.getLevel() < b.getLevel(); });
CWindLayerList windLayers = gridPoint.getWindLayers();
windLayers.sort([](const CWindLayer &a, const CWindLayer &b) { return a.getLevel() < b.getLevel(); });
if (temperatureLayers.size() != windLayers.size()) { continue; }
for (int i = 0; i < temperatureLayers.size(); i++)
qtout << " Temperature Layers: " << endl;
for (const auto &temperatureLayer : as_const(temperatureLayers))
{
const CTemperatureLayer temperatureLayer = temperatureLayers[i];
const CWindLayer windLayer = windLayers[i];
qtout << " Level: " << temperatureLayer.getLevel().toQString() << endl;
qtout << " Temperature: " << temperatureLayer.getTemperature().toQString() << endl;
qtout << " Relative Humidity: " << temperatureLayer.getRelativeHumidity() << " %" << endl;
qtout << " Wind: " << windLayer.getDirection().toQString() << " at " << windLayer.getSpeed().toQString() << endl;
qtout << " Level: " << temperatureLayer.getLevel().toQString() << endl;
qtout << " Temperature: " << temperatureLayer.getTemperature().toQString() << endl;
qtout << " Relative Humidity: " << temperatureLayer.getRelativeHumidity() << " %" << endl;
}
qtout << endl;
qtout << " Clouds: " << endl;
CWindLayerList windLayers = gridPoint.getWindLayers();
windLayers.sort([](const CWindLayer &a, const CWindLayer &b) { return a.getLevel() < b.getLevel(); });
qtout << " Wind Layers: " << endl;
for (const auto &windLayer : as_const(windLayers))
{
qtout << " Level: " << windLayer.getLevel().toQString() << endl;
qtout << " Wind: " << windLayer.getDirection().toQString() << " at " << windLayer.getSpeed().toQString() << endl;
}
qtout << endl;
qtout << " Cloud Layers: " << endl;
CCloudLayerList cloudLayers = gridPoint.getCloudLayers();
cloudLayers.sort([](const CCloudLayer &a, const CCloudLayer &b) { return a.getBase() < b.getBase(); });
for (int i = 0; i < cloudLayers.size(); i++)
{
const CCloudLayer &cloudLayer = cloudLayers[i];
qtout << " Top: " << cloudLayer.getTop().toQString() << endl;
qtout << " Coverage: " << cloudLayer.getCoveragePercent() << " %" << endl;
qtout << " Precipitation type: " << cloudLayer.getPrecipitation() << endl;
qtout << " Precipitation rate: " << cloudLayer.getPrecipitationRate() << endl;
qtout << " Base: " << cloudLayer.getBase().toQString() << endl;
qtout << " Coverage: " << cloudLayer.getCoveragePercent() << " %" << endl;
}
qtout << endl << endl;
}