From 9733c89a81671fd90a526c3cea959464cb2ffbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Fri, 19 Apr 2024 12:38:14 +0200 Subject: [PATCH] Complete task 2/3 of #4 --- src/config/mod.rs | 5 +++++ src/config/restart.rs | 1 + 2 files changed, 6 insertions(+) diff --git a/src/config/mod.rs b/src/config/mod.rs index f08406d..865cdac 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -217,6 +217,11 @@ impl Config { config.scene.camera.far = Some(far); } + // Restart parameters to be applied at the end. + if let Some(duration_more) = restart.duration_more { + config.simulation.duration += duration_more; + } + config.restart = Some(restart); config.preferences = new.preferences.clone(); diff --git a/src/config/restart.rs b/src/config/restart.rs index e133337..9170b09 100644 --- a/src/config/restart.rs +++ b/src/config/restart.rs @@ -6,6 +6,7 @@ use std::path::PathBuf; #[derive(Debug, Clone, Deserialize, Serialize, Default)] pub struct Restart { pub path: Option, + pub duration_more: Option, pub time_step_factor: Option, pub time_step_export_factor: Option, pub depth_step_factor: Option,