diff --git a/help.csv b/help.csv new file mode 100644 index 0000000..e39e1ae --- /dev/null +++ b/help.csv @@ -0,0 +1,29 @@ +key,label,description +mission.task_count,任务数,当前任务计划中包含的任务总数 +mission.save_path,数据保存路径,采集数据保存的目录路径,支持浏览文件夹选择 +mission.file,文件,当前任务计划文件(.json)的保存路径 +mission.scheduled_time,计划时间,任务计划开始执行的时间 +task.halogen_preheat,卤素灯预热(分钟),高光谱相机执行前卤素灯需要预热的时间,单位为分钟 +subtask.exposure_time,曝光时间(ms),高光谱相机传感器的曝光时间,单位为毫秒 +subtask.frame_rate,帧率(fps),高光谱相机每秒钟采集的帧数 +subtask.capture_interval,采集间隔(s),单反或深度相机每次拍摄之间的间隔时间,单位为秒 +subtask.path_file,航线文件,关联的.RecordLine3格式航线文件路径 +subtask.view_path,查看,打开已存在的航线文件进行查看 +subtask.browse_path,浏览,浏览并选择已存在的航线文件 +subtask.generate_path,生成航线,打开路径规划器绘制区域并生成航线文件 +scan_area.x_min,X min,扫描区域的X轴最小坐标值,单位为cm +scan_area.x_max,X max,扫描区域的X轴最大坐标值,单位为cm +scan_area.y_min,Y min,扫描区域的Y轴最小坐标值,单位为cm +scan_area.y_max,Y max,扫描区域的Y轴最大坐标值,单位为cm +scan_area.background,背景图,画布底图路径,用于辅助绘制扫描区域 +planner.fov,FOV(°),相机视场角,不同设备有默认值(Pika L:17.6° Pika NIR:21.7° 单反:74° 深度:90°) +planner.height,高度(cm),相机安装高度,用于计算地面覆盖范围和步长 +planner.coverage,覆盖率(%),相邻扫描线之间的重叠率,值越大步长越小 +planner.speed_y,Y轴定位速度(cm/s),Y轴运动时的速度 +planner.speed_x_scan,X扫描速度(cm/s),X轴采集扫描时的运动速度 +planner.speed_x_return,X回起点速度(cm/s),X轴返回起点时的速度,OneWay模式使用 +planner.mode_zigzag,蛇形来回,扫描路径为"S"形来回折返,每行扫描方向交替,无需空跑回起点 +planner.mode_oneway,单向回起点,每行从左到右扫描,扫描完空跑回起点再扫下一行 +task.start_time,开始时间,任务实际开始执行的时间(由计算生成) +task.end_time,结束时间,任务实际结束执行的时间(由计算生成) +subtask.estimated_duration,预计耗时,子任务的预估执行时间 diff --git a/package.json b/package.json index 23d4142..630ebab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "happa-mission-plan", "private": true, - "version": "0.0.4", + "version": "0.0.5", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 0babd9a..6433060 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3180,7 +3180,7 @@ dependencies = [ [[package]] name = "spectral-insight-mission-plan" -version = "0.0.2" +version = "0.0.4" dependencies = [ "byteorder", "chrono", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index c7cd7d7..134e0f1 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spectral-insight-mission-plan" -version = "0.0.4" +version = "0.0.5" description = "Spectral Insight Mission Plan" authors = ["you"] edition = "2021" diff --git a/src-tauri/src/commands/help_commands.rs b/src-tauri/src/commands/help_commands.rs new file mode 100644 index 0000000..d90cd82 --- /dev/null +++ b/src-tauri/src/commands/help_commands.rs @@ -0,0 +1,54 @@ +use serde::Serialize; +use tauri::command; +use std::path::PathBuf; + +#[derive(Debug, Serialize)] +pub struct HelpEntry { + pub key: String, + pub label: String, + pub description: String, +} + +fn defaults_dir() -> PathBuf { + std::env::current_exe() + .unwrap_or_else(|_| PathBuf::from(".")) + .parent() + .unwrap_or_else(|| std::path::Path::new(".")) + .to_path_buf() +} + +const DEFAULT_CSV: &str = include_str!("../../../help.csv"); + +#[command] +pub fn load_help_csv() -> Vec { + let path = defaults_dir().join("help.csv"); + + // Always write embedded default so file stays in sync with the binary + if let Some(parent) = path.parent() { + let _ = std::fs::create_dir_all(parent); + } + let _ = std::fs::write(&path, DEFAULT_CSV); + + match std::fs::read_to_string(&path) { + Ok(c) => parse_csv(&c), + Err(_) => parse_csv(DEFAULT_CSV), + } +} + +fn parse_csv(content: &str) -> Vec { + let mut entries = Vec::new(); + for (i, line) in content.lines().enumerate() { + if i == 0 { continue; } + let trimmed = line.trim(); + if trimmed.is_empty() { continue; } + let parts: Vec<&str> = trimmed.splitn(3, ',').collect(); + if parts.len() == 3 { + entries.push(HelpEntry { + key: parts[0].trim().to_string(), + label: parts[1].trim().to_string(), + description: parts[2].trim().to_string(), + }); + } + } + entries +} diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs index 382ee1f..bdd6cbc 100644 --- a/src-tauri/src/commands/mod.rs +++ b/src-tauri/src/commands/mod.rs @@ -4,3 +4,4 @@ pub mod validation_commands; pub mod path_commands; pub mod devtools_commands; pub mod defaults_commands; +pub mod help_commands; diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 31c2e81..95c617a 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -47,6 +47,7 @@ pub fn run() { commands::defaults_commands::load_default_background, commands::defaults_commands::save_planner_defaults, commands::defaults_commands::load_planner_defaults, + commands::help_commands::load_help_csv, ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 2d9030f..7ae96a4 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Spectral Insight Mission Plan", - "version": "0.0.4", + "version": "0.0.5", "identifier": "com.spectral-insight.mission-plan", "build": { "beforeDevCommand": "npm run dev", @@ -39,7 +39,8 @@ ], "resources": [ "../update.md", - "../说明书.md" + "../说明书.md", + "../help.csv" ], "windows": { "nsis": { diff --git a/src/components/common/HelpIcon.vue b/src/components/common/HelpIcon.vue new file mode 100644 index 0000000..448f986 --- /dev/null +++ b/src/components/common/HelpIcon.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/src/components/planner/ScanCanvas.vue b/src/components/planner/ScanCanvas.vue index c77b80c..95252a4 100644 --- a/src/components/planner/ScanCanvas.vue +++ b/src/components/planner/ScanCanvas.vue @@ -113,7 +113,6 @@ function draw() { ctx.lineWidth = 1; for (let i = 0; i <= 10; i++) { const x = padding + (i / 10) * drawW; - const y = padding + (i / 10) * drawH; ctx.beginPath(); ctx.moveTo(x, padding); ctx.lineTo(x, padding + drawH); ctx.stroke(); } diff --git a/src/components/planner/ScanParamPanel.vue b/src/components/planner/ScanParamPanel.vue index 9c255fe..b5e5653 100644 --- a/src/components/planner/ScanParamPanel.vue +++ b/src/components/planner/ScanParamPanel.vue @@ -3,23 +3,37 @@ - - + + + + + + + + + + + + - + + {{ localCoverageRate }}% - + + - + + - + + @@ -27,8 +41,12 @@ - 蛇形来回 (Zigzag) - 单向回起点 (OneWay) + + 蛇形来回 (Zigzag) + + + 单向回起点 (OneWay) + @@ -47,6 +65,7 @@ import { ref, watch, computed } from 'vue'; import type { CameraParams, ScanMode } from '../../types/path-plan'; import { formatDuration } from '../../utils/constants'; +import HelpIcon from '../common/HelpIcon.vue'; const props = defineProps<{ camera: CameraParams; diff --git a/src/views/MissionEditorView.vue b/src/views/MissionEditorView.vue index 9c5a954..d91bdf6 100644 --- a/src/views/MissionEditorView.vue +++ b/src/views/MissionEditorView.vue @@ -2,7 +2,6 @@
- @@ -28,14 +27,13 @@ - - {{ missionStore.taskCount }} + {{ missionStore.taskCount }} - {{ missionStore.currentFilePath || '未保存' }} + {{ missionStore.currentFilePath || '未保存' }} @@ -43,17 +41,16 @@ - - - - - + + + + - + 浏览 清除 @@ -62,7 +59,6 @@ - - +