mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-27 02:27:18 +00:00
route full support
This commit is contained in:
1 parent
c842da8dc1
commit
b6c0f5190a
91 files changed
+2523
-847
No files matched your search
@@ -313,7 +313,6 @@ pub struct ExportArguments {
|
||||
atemp: bool,
|
||||
power: bool,
|
||||
osm: bool,
|
||||
as_route: bool,
|
||||
}
|
||||
|
||||
impl From<ExportArguments> for ExportOptions {
|
||||
@@ -325,7 +324,6 @@ impl From<ExportArguments> for ExportOptions {
|
||||
atemp: arguments.atemp,
|
||||
power: arguments.power,
|
||||
osm: arguments.osm,
|
||||
as_route: arguments.as_route,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,11 @@ pub fn style(
|
||||
state.run(move |e| api::style(e, color.as_deref(), opacity, width))
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub fn new_route(state: State<AppState>) -> api::Outcome {
|
||||
state.run(api::new_route)
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub fn new_track(state: State<AppState>) -> api::Outcome {
|
||||
state.run(api::new_track)
|
||||
|
||||
@@ -79,7 +79,6 @@ pub fn export_file(
|
||||
atemp: bool,
|
||||
power: bool,
|
||||
osm: bool,
|
||||
as_route: bool,
|
||||
) -> Bytes {
|
||||
let options = ExportOptions {
|
||||
time,
|
||||
@@ -88,7 +87,6 @@ pub fn export_file(
|
||||
atemp,
|
||||
power,
|
||||
osm,
|
||||
as_route,
|
||||
};
|
||||
optional(state.read(move |e| api::export_file(e, file_id, options)))
|
||||
}
|
||||
|
||||
@@ -21,6 +21,16 @@ pub fn arrow_select(state: State<AppState>, down: bool, add: bool) -> api::Outco
|
||||
state.run(move |e| api::arrow_select(e, down, add))
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub fn select_routes(
|
||||
state: State<AppState>,
|
||||
file_id: Uuid,
|
||||
route_ids: Vec<Uuid>,
|
||||
mode: SelectMode,
|
||||
) -> api::Outcome {
|
||||
state.run(move |e| api::select_routes(e, file_id, &route_ids, mode))
|
||||
}
|
||||
|
||||
#[tauri::command(async)]
|
||||
pub fn select_tracks(
|
||||
state: State<AppState>,
|
||||
|
||||
@@ -114,6 +114,7 @@ fn register_commands<R: tauri::Runtime>(builder: tauri::Builder<R>) -> tauri::Bu
|
||||
selection::select,
|
||||
selection::select_all,
|
||||
selection::arrow_select,
|
||||
selection::select_routes,
|
||||
selection::select_tracks,
|
||||
selection::select_segments,
|
||||
selection::select_waypoint_group,
|
||||
@@ -134,6 +135,7 @@ fn register_commands<R: tauri::Runtime>(builder: tauri::Builder<R>) -> tauri::Bu
|
||||
// edits and tools
|
||||
edit::metadata,
|
||||
edit::style,
|
||||
edit::new_route,
|
||||
edit::new_track,
|
||||
edit::new_track_segment,
|
||||
edit::new_waypoint,
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ fn waypoints_exports_and_routing_revisions() {
|
||||
|
||||
let exported = app.bytes(
|
||||
"export_file",
|
||||
json!({ "fileId": file, "time": true, "hr": true, "cad": true, "atemp": true, "power": true, "osm": true, "asRoute": false }),
|
||||
json!({ "fileId": file, "time": true, "hr": true, "cad": true, "atemp": true, "power": true, "osm": true }),
|
||||
);
|
||||
assert_eq!(exported[0], 1);
|
||||
assert!(
|
||||
|
||||
@@ -1191,6 +1191,7 @@ mod tests {
|
||||
/// What the file holds: the name of its track (its own name is the one of the file).
|
||||
fn content(&self, id: Uuid) -> String {
|
||||
self.engine.file_structure(&FileId(id)).unwrap().tracks[0]
|
||||
.info
|
||||
.name
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
|
||||
Reference in new issue
Block a user