From b26ec05b81ee6ef0d15deb9da9ce255e056d3609 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 10 May 2026 20:19:48 +0800 Subject: [PATCH] =?UTF-8?q?AMOS=20=E8=B7=91=E9=81=93=E6=B8=A9=E5=BA=A6?= =?UTF-8?q?=E8=8C=83=E5=9B=B4=EF=BC=9A=E5=9F=8E=E5=B8=82=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E5=8D=A1=E5=A4=B4=E9=83=A8=E5=B1=95=E7=A4=BA"=E8=B7=91?= =?UTF-8?q?=E9=81=93=E5=AE=9E=E5=86=B5=2014.6~15.2=E2=84=83"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端: - amos_station_sources.py 新增 runway_temp_range (跑道温度 min,max) - 取所有有效跑道温度的最小值和最大值 前端: - CityCardHeader 新增 observedLabel prop(标签自定义) - 有 AMOS 数据时显示"跑道实况"替代"当前温度" - 温度展示格式:14.6~15.2℃(跑道温度范围) - 无 AMOS 时回退原有 METAR 温度显示 --- .../dashboard/scan-terminal/AiPinnedCityCard.tsx | 8 ++++++-- .../components/dashboard/scan-terminal/CityCardHeader.tsx | 4 +++- frontend/lib/dashboard-types.ts | 1 + src/data_collection/amos_station_sources.py | 8 ++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx b/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx index 4dff9bf2..59c1134e 100644 --- a/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx +++ b/frontend/components/dashboard/scan-terminal/AiPinnedCityCard.tsx @@ -388,8 +388,11 @@ export function AiPinnedCityCard({ decisionExpectedHighNumber != null ? formatTemperatureValue(decisionExpectedHighNumber, tempSymbol, { digits: 1 }) : "--"; - const currentTempText = - currentTempNumber != null + const amosRange = detail?.amos?.runway_temp_range; + const observedLabel = amosRange ? (isEn ? "Runway" : "跑道实况") : undefined; + const currentTempText = amosRange + ? `${amosRange[0].toFixed(1)}~${amosRange[1].toFixed(1)}${tempSymbol}` + : currentTempNumber != null ? formatTemperatureValue(currentTempNumber, tempSymbol, { digits: 1 }) : "--"; const debText = @@ -597,6 +600,7 @@ export function AiPinnedCityCard({ collapseId={collapseId} collapsed={collapsed} currentTempText={currentTempText} + observedLabel={observedLabel} dataFreshnessRows={dataFreshnessRows} debText={debText} detailLocalTime={detail?.local_time} diff --git a/frontend/components/dashboard/scan-terminal/CityCardHeader.tsx b/frontend/components/dashboard/scan-terminal/CityCardHeader.tsx index 6c20d35e..89efc1dc 100644 --- a/frontend/components/dashboard/scan-terminal/CityCardHeader.tsx +++ b/frontend/components/dashboard/scan-terminal/CityCardHeader.tsx @@ -18,6 +18,7 @@ export function CityCardHeader({ collapseId, collapsed, currentTempText, + observedLabel, dataFreshnessRows, debText, detailLocalTime, @@ -40,6 +41,7 @@ export function CityCardHeader({ collapseId: string; collapsed: boolean; currentTempText: string; + observedLabel?: string; dataFreshnessRows: DataFreshnessRow[]; debText: string; detailLocalTime?: string | null; @@ -76,7 +78,7 @@ export function CityCardHeader({
- {isEn ? "Observed" : "当前温度"} + {observedLabel || (isEn ? "Observed" : "当前温度")} {currentTempText} diff --git a/frontend/lib/dashboard-types.ts b/frontend/lib/dashboard-types.ts index 48d992a4..a6b0418b 100644 --- a/frontend/lib/dashboard-types.ts +++ b/frontend/lib/dashboard-types.ts @@ -923,6 +923,7 @@ export interface AmosData { wind_kt?: number | null; temp_source?: string | null; runway_temps?: Array<[number | null, number | null]> | null; + runway_temp_range?: [number, number] | null; source?: string | null; source_label?: string | null; icao?: string | null; diff --git a/src/data_collection/amos_station_sources.py b/src/data_collection/amos_station_sources.py index b4862793..9d63bf1d 100644 --- a/src/data_collection/amos_station_sources.py +++ b/src/data_collection/amos_station_sources.py @@ -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,