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:
xin
2026-06-18 16:35:39 +08:00
parent c017129c9f
commit 02d490e714
12 changed files with 221 additions and 342 deletions

2
src-tauri/Cargo.lock generated
View File

@ -3180,7 +3180,7 @@ dependencies = [
[[package]]
name = "spectral-insight-mission-plan"
version = "0.0.4"
version = "0.0.5"
dependencies = [
"byteorder",
"chrono",

View File

@ -1,6 +1,6 @@
[package]
name = "spectral-insight-mission-plan"
version = "0.0.5"
version = "0.0.6"
description = "Spectral Insight Mission Plan"
authors = ["you"]
edition = "2021"

View File

@ -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(())
}

View File

@ -10,8 +10,12 @@ pub struct ScanRegion {
pub y_min: f64,
#[serde(rename = "yMax")]
pub y_max: f64,
#[serde(default = "default_shape")]
pub shape: String,
}
fn default_shape() -> String { "Rect".to_string() }
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CameraParams {
#[serde(rename = "fovDegrees")]
@ -67,7 +71,7 @@ impl Default for PlannerDefaults {
speed_y_cm_s: 5.0,
speed_x_start_cm_s: 20.0,
speed_x_scan_cm_s: 10.0,
mode: "Zigzag".to_string(),
mode: "OneWay".to_string(),
}
}
}

View File

@ -68,10 +68,10 @@ impl SubTask {
Self {
id: default_subtask_id(),
sub_task_type,
capture_interval_seconds: None,
capture_interval_seconds: Some(0),
default_render_band: Some(550),
exposure_time: None,
frame_rate: None,
exposure_time: Some(0),
frame_rate: Some(0),
path_line_file_path: String::new(),
duration_minutes: 0.0,
estimated_duration_minutes: 0.0,

View File

@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Spectral Insight Mission Plan",
"version": "0.0.5",
"version": "0.0.6",
"identifier": "com.spectral-insight.mission-plan",
"build": {
"beforeDevCommand": "npm run dev",