Cleanup QWeatherInfoWindow and rjust wind bearings. (#456)

This commit is contained in:
Ignacio Muñoz Fernandez 2020-11-26 03:10:46 +01:00 committed by GitHub
parent 80bc9d6b23
commit a1b64bc72d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 20 deletions

View File

@ -6,7 +6,6 @@ from game.weather import Conditions, TimeOfDay, Weather
from game.utils import meter_to_nm, mps_to_knots
from dcs.weather import Weather as PydcsWeather
from qt_ui.windows.weather.QWeatherInfoWindow import QWeatherInfoWindow
import qt_ui.uiconstants as CONST
class QTimeTurnWidget(QGroupBox):
@ -165,17 +164,17 @@ class QWeatherWidget(QGroupBox):
"""Updates the UI with the current conditions wind info.
"""
windGlSpeed = mps_to_knots(self.conditions.weather.wind.at_0m.speed or 0)
windGlDir = self.conditions.weather.wind.at_0m.direction or 0
windGlDir = str(self.conditions.weather.wind.at_0m.direction or 0).rjust(3, '0')
self.windGLSpeedLabel.setText('{}kts'.format(windGlSpeed))
self.windGLDirLabel.setText('{}º'.format(windGlDir))
windFL08Speed = mps_to_knots(self.conditions.weather.wind.at_2000m.speed or 0)
windFL08Dir = self.conditions.weather.wind.at_2000m.direction or 0
windFL08Dir = str(self.conditions.weather.wind.at_2000m.direction or 0).rjust(3, '0')
self.windFL08SpeedLabel.setText('{}kts'.format(windFL08Speed))
self.windFL08DirLabel.setText('{}º'.format(windFL08Dir))
windFL26Speed = mps_to_knots(self.conditions.weather.wind.at_8000m.speed or 0)
windFL26Dir = self.conditions.weather.wind.at_8000m.direction or 0
windFL26Dir = str(self.conditions.weather.wind.at_8000m.direction or 0).rjust(3, '0')
self.windFL26SpeedLabel.setText('{}kts'.format(windFL26Speed))
self.windFL26DirLabel.setText('{}º'.format(windFL26Dir))

View File

@ -1,16 +0,0 @@
from PySide2.QtWidgets import QDialog, QGridLayout, QLabel, QFrame, QSizePolicy
from game.game import Game
from game.weather import Conditions, TimeOfDay, Weather
import qt_ui.uiconstants as CONST
class QWeatherInfoWindow(QDialog):
def __init__(self, turn: int, conditions: Conditions):
super(QWeatherInfoWindow, self).__init__()
self.setModal(True)
self.setWindowTitle("Weather Forecast Report")
self.setWindowIcon(CONST.ICONS["Money"])
self.setMinimumSize(450, 200)