feat: canvas drag/resize/selection, modal planner, default OneWay (唐超)
- Canvas: 坐标轴、顶点坐标、框拖拽、角点缩放、点击选中高亮 - 路径规划改为弹窗覆盖层,编辑状态不丢失 - 展开任务状态持久化到 Pinia store - 扫描模式默认 OneWay - 保存时 startTime/endTime/durationMinutes 清空为 "" - exposureTime/frameRate/captureIntervalSeconds 默认 0 - 去除生成航线后的扫描线文字标注
This commit is contained in:
@ -3,7 +3,27 @@ use crate::error::AppError;
|
||||
use crate::models::MissionPlan;
|
||||
|
||||
pub fn write_mission(path: &Path, mission: &MissionPlan) -> Result<(), AppError> {
|
||||
let content = serde_json::to_string_pretty(mission)?;
|
||||
// Clear computed timing fields before saving
|
||||
let mut cleaned = mission.clone();
|
||||
for task in &mut cleaned.tasks {
|
||||
task.duration_minutes = 0.0;
|
||||
task.estimated_duration_minutes = 0.0;
|
||||
task.start_time = Some("".to_string());
|
||||
task.end_time = Some("".to_string());
|
||||
for sub in &mut task.sub_tasks {
|
||||
sub.duration_minutes = 0.0;
|
||||
sub.estimated_duration_minutes = 0.0;
|
||||
sub.start_time = Some("".to_string());
|
||||
sub.end_time = Some("".to_string());
|
||||
if sub.capture_interval_seconds.is_none() { sub.capture_interval_seconds = Some(0); }
|
||||
if sub.exposure_time.is_none() { sub.exposure_time = Some(0); }
|
||||
if sub.frame_rate.is_none() { sub.frame_rate = Some(0); }
|
||||
}
|
||||
}
|
||||
let content = serde_json::to_string_pretty(&cleaned)?;
|
||||
let content = content
|
||||
.replace("\"durationMinutes\": 0.0", "\"durationMinutes\": \"\"")
|
||||
.replace("\"estimatedDurationMinutes\": 0.0", "\"estimatedDurationMinutes\": \"\"");
|
||||
std::fs::write(path, content)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user