allow unset weather provider
This commit is contained in:
		| @@ -98,6 +98,9 @@ class WeatherModel: | ||||
|         return ias * math.sqrt(1.225 / self.densityModel(altitude).item()) | ||||
|  | ||||
|     def updateWindModel(self): | ||||
|         if None == self.Weather or None == self.Weather.Provider: | ||||
|             return | ||||
|  | ||||
|         if None == self.LastWeatherUpdate or self.LastWeatherUpdate != self.Weather.Provider.UpdateTime: | ||||
|             self.MinimumAltitude = 1000000 | ||||
|             self.MaximumAltitude = -1 | ||||
|   | ||||
| @@ -27,7 +27,10 @@ class Worker(Thread): | ||||
|         self.PerformanceData = performance | ||||
|         self.UpdateLock = Lock() | ||||
|         self.ReportQueue = {} | ||||
|         self.WeatherModel = WeatherModel(configuration.GaforId, weather) | ||||
|         if None != weather: | ||||
|             self.WeatherModel = WeatherModel(configuration.GaforId, weather) | ||||
|         else: | ||||
|             self.WeatherModel = WeatherModel(0, None) | ||||
|         self.RecedingHorizonControl = RecedingHorizonControl(configuration.RecedingHorizonControl) | ||||
|         self.Euroscope = euroscope | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user