feat: add SD-backed Agenda and waypoint map integration

This commit is contained in:
liu weikai
2026-09-23 18:11:27 +08:00
parent 617a7cf0b9
commit e88f60ce19
239 changed files with 17251 additions and 291 deletions
@@ -2,6 +2,7 @@
#include "sys/clock.h"
#include "ui/presentation_sources/runtime_map_workspace_source.h"
#include "ui_presentation/common/fixed_text.h"
#include "ui_presentation/map/map_workspace_model.h"
#include <cassert>
#include <cstring>
@@ -215,5 +216,26 @@ int main()
assert(source.buildMapWorkspaceSnapshot(request, snapshot));
assert(!snapshot.team.available);
// Location selection uses the real runtime state/source/sink path. Once
// the renderer commits a centre, a moving GPS fix must not replace it.
ui::map::MapWorkspaceModel model(source, sink);
assert(model.setActiveTool(ui::map::MapToolKind::MeasureDistance).ok);
assert(model.beginLocationSelection().ok);
assert(state.active_tool == ui::map::MapToolKind::SelectLocation);
assert(model.setViewport(viewport(0.0, 0.0, 12)).ok);
gps.snapshot.latitude = 35.0;
gps.snapshot.longitude = 110.0;
assert(model.pickLocation().ok);
const auto selected = model.locationSelection();
assert(selected.state == ui::map::MapLocationSelectionState::Picked);
assert(selected.latitude == 0.0 && selected.longitude == 0.0);
assert(state.active_tool == ui::map::MapToolKind::MeasureDistance);
assert(state.layers.terrain && !state.layers.contour);
assert(model.beginLocationSelection().ok);
assert(model.setViewport(viewport(-30.0, -120.0, 10)).ok);
assert(model.cancelLocationSelection().ok);
assert(model.locationSelection().state == ui::map::MapLocationSelectionState::Cancelled);
assert(state.active_tool == ui::map::MapToolKind::MeasureDistance);
return 0;
}