AMOS 跑道温度范围:城市决策卡头部展示"跑道实况 14.6~15.2℃"
后端: - amos_station_sources.py 新增 runway_temp_range (跑道温度 min,max) - 取所有有效跑道温度的最小值和最大值 前端: - CityCardHeader 新增 observedLabel prop(标签自定义) - 有 AMOS 数据时显示"跑道实况"替代"当前温度" - 温度展示格式:14.6~15.2℃(跑道温度范围) - 无 AMOS 时回退原有 METAR 温度显示
This commit is contained in:
@@ -490,6 +490,7 @@ class AmosStationSourceMixin:
|
||||
"wind_kt": wind_kt,
|
||||
"temp_source": temp_source,
|
||||
"runway_temps": runway_temps,
|
||||
"runway_temp_range": None,
|
||||
"source": "amos",
|
||||
"source_label": f"AMOS {airport_meta['label_en']} ({icao})",
|
||||
"source_code": "amos",
|
||||
@@ -508,6 +509,13 @@ class AmosStationSourceMixin:
|
||||
"observation_time": datetime.now().strftime("%Y-%m-%dT%H:%M:%S"),
|
||||
}
|
||||
|
||||
# Compute runway temp range for compact display ("14.6~15.2")
|
||||
valid = [t[0] for t in runway_temps if t[0] is not None and -50 < float(t[0]) < 60]
|
||||
if len(valid) >= 2:
|
||||
result["runway_temp_range"] = (round(min(valid), 1), round(max(valid), 1))
|
||||
elif len(valid) == 1:
|
||||
result["runway_temp_range"] = (round(valid[0], 1), round(valid[0], 1))
|
||||
|
||||
record_source_call(
|
||||
"amos", "current", "success",
|
||||
(time.perf_counter() - started) * 1000.0,
|
||||
|
||||
Reference in New Issue
Block a user