feat(travel): Refactor route handling to use direction instead of destination

This commit is contained in:
GW_MC
2026-02-03 20:11:16 +08:00
parent c4635948e4
commit 3617a206ff
9 changed files with 137 additions and 57 deletions

View File

@@ -51,3 +51,12 @@ LineInfo::LineInfo(cJSON* line_json) {
ESP_LOGW(LINE_INFO_TAG, "Missing or invalid 'stations' array");
}
}
const char* LineInfo::get_station_name(const std::string& station_code) const {
for (const auto& station : _stations) {
if (std::string(station.code()) == station_code) {
return station.name();
}
}
return "";
}