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,