mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Set weather position and pressure at MSL in Weather Status line
This commit is contained in:
committed by
Mat Sutcliffe
parent
5c84cff6e4
commit
66f0a27647
@@ -139,6 +139,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
const auto nearestGridPoint = fetchedWeatherGrid.findClosest(1, gridPoint.getPosition()).frontOrDefault();
|
const auto nearestGridPoint = fetchedWeatherGrid.findClosest(1, gridPoint.getPosition()).frontOrDefault();
|
||||||
gridPoint.copyWeatherDataFrom(nearestGridPoint);
|
gridPoint.copyWeatherDataFrom(nearestGridPoint);
|
||||||
|
gridPoint.setPosition(nearestGridPoint.getPosition());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (weatherRequest.callback) { weatherRequest.callback(requestedWeatherGrid); }
|
if (weatherRequest.callback) { weatherRequest.callback(requestedWeatherGrid); }
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
#include <QRegExpValidator>
|
#include <QRegExpValidator>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#include <QStringView>
|
||||||
|
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
using namespace BlackCore::Context;
|
using namespace BlackCore::Context;
|
||||||
@@ -221,10 +222,15 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CWeatherComponent::setWeatherGrid(const CWeatherGrid &weatherGrid)
|
void CWeatherComponent::setWeatherGrid(const CWeatherGrid &weatherGrid)
|
||||||
{
|
{
|
||||||
auto gridPoint = weatherGrid.frontOrDefault();
|
CGridPoint gridPoint = weatherGrid.frontOrDefault();
|
||||||
ui->tvp_TemperatureLayers->updateContainer(gridPoint.getTemperatureLayers());
|
ui->tvp_TemperatureLayers->updateContainer(gridPoint.getTemperatureLayers());
|
||||||
ui->tvp_CloudLayers->updateContainer(gridPoint.getCloudLayers());
|
ui->tvp_CloudLayers->updateContainer(gridPoint.getCloudLayers());
|
||||||
ui->tvp_WindLayers->updateContainer(gridPoint.getWindLayers());
|
ui->tvp_WindLayers->updateContainer(gridPoint.getWindLayers());
|
||||||
|
CCoordinateGeodetic position = gridPoint.getPosition();
|
||||||
|
double pressureAtMsl = gridPoint.getPressureAtMsl().value(CPressureUnit::hPa());
|
||||||
|
QString status = QString("Weather Position: %1 %2").arg(position.latitude().toWgs84(), position.longitude().toWgs84());
|
||||||
|
status += QString("\nPressure (MSL): %1 hPa").arg(pressureAtMsl);
|
||||||
|
ui->lbl_Status->setText(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWeatherComponent::requestWeatherGrid(const CCoordinateGeodetic &position)
|
void CWeatherComponent::requestWeatherGrid(const CCoordinateGeodetic &position)
|
||||||
|
|||||||
@@ -121,6 +121,9 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string><status will go here></string>
|
<string><status will go here></string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user