diff --git a/XplorePlane/App.xaml.cs b/XplorePlane/App.xaml.cs index 696c467..e2ed480 100644 --- a/XplorePlane/App.xaml.cs +++ b/XplorePlane/App.xaml.cs @@ -166,12 +166,12 @@ namespace XplorePlane { var cameraVm = bootstrapper.Container.Resolve(); cameraVm?.Dispose(); - Log.Information("导航相机 ViewModel 已释放"); + Log.Information("Navigation camera ViewModel has been released"); } } catch (Exception ex) { - Log.Error(ex, "导航相机 ViewModel 释放失败"); + Log.Error(ex, "Navigation camera ViewModel release failed"); } // 释放导航相机服务资源 @@ -182,12 +182,12 @@ namespace XplorePlane { var cameraService = bootstrapper.Container.Resolve(); cameraService?.Dispose(); - Log.Information("导航相机服务资源已释放"); + Log.Information("Navigation camera service resources have been released"); } } catch (Exception ex) { - Log.Error(ex, "导航相机服务资源释放失败"); + Log.Error(ex, "Navigation camera service resource release failed"); } // 释放主界面探测器帧流水线资源 @@ -320,9 +320,6 @@ namespace XplorePlane // 主窗口加载完成后再连接相机,确保所有模块和原生 DLL 已完成初始化 shell.Loaded += (s, e) => { - // [DEV] 导航相机连接已屏蔽,开发阶段跳过以加快启动速度 - TryConnectCamera(); - // 初始化主界面探测器帧流水线,开始接收探测器图像事件 try { @@ -333,21 +330,22 @@ namespace XplorePlane Log.Error(ex, "初始化主界面探测器帧流水线失败"); } - // [DEV] 相机状态通知已屏蔽 - try - { - var cameraVm = Container.Resolve(); - cameraVm.OnCameraReady(); - } - catch (Exception ex) - { - Log.Error(ex, "通知相机 ViewModel 失败"); - } + // [DEV] 导航相机连接已屏蔽,开发阶段跳过以加快启动速度 + //TryConnectCamera(); + //try + //{ + // var cameraVm = Container.Resolve(); + // cameraVm.OnCameraReady(); + //} + //catch (Exception ex) + //{ + // Log.Error(ex, "Failed to notify the camera ViewModel"); + //} - if (_cameraError != null) - { - HexMessageBox.Show(_cameraError, MessageBoxButton.OK, MessageBoxImage.Error); - } + //if (_cameraError != null) + //{ + // HexMessageBox.Show(_cameraError, MessageBoxButton.OK, MessageBoxImage.Error); + //} }; return shell; @@ -364,17 +362,17 @@ namespace XplorePlane try { var info = camera.Open(); - Log.Information("导航相机已连接: {ModelName} (SN: {SerialNumber})", info.ModelName, info.SerialNumber); + Log.Information("Navigation camera connected: {ModelName} (SN: {SerialNumber})", info.ModelName, info.SerialNumber); } catch (DeviceNotFoundException) { - Log.Warning("未检测到导航相机"); - _cameraError = "未检测到导航相机,请检查连接后重启软件。"; + Log.Warning("Navigation camera not detected"); + _cameraError = "Navigation camera not detected,Please check the connection and restart the software.。"; } catch (Exception ex) { - Log.Warning(ex, "导航相机自动连接失败: {Message}", ex.Message); - _cameraError = $"导航相机连接失败: {ex.Message}"; + Log.Warning(ex, "Automatic connection of navigation camera failed: {Message}", ex.Message); + _cameraError = $"Navigation camera connection failed: {ex.Message}"; } } @@ -408,7 +406,6 @@ namespace XplorePlane containerRegistry.RegisterSingleton(); containerRegistry.Register(); - // 注册流水线服务(单例,共享 IImageProcessingService) containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); @@ -477,9 +474,9 @@ namespace XplorePlane } catch (Exception ex) { - Log.Warning(ex, "读取 CameraType 配置失败,使用默认值 Hikvision"); + Log.Warning(ex, "Failed to read CameraType configuration, using default value Hikvision"); } - Log.Information("相机类型: {CameraType}", cameraType); + Log.Information("Camera Type: {CameraType}", cameraType); return new CameraFactory().CreateController(cameraType); }); containerRegistry.RegisterSingleton(); @@ -505,4 +502,4 @@ namespace XplorePlane base.ConfigureModuleCatalog(moduleCatalog); } } -} +} \ No newline at end of file diff --git a/XplorePlane/Assets/Icons/FittedCircle.png b/XplorePlane/Assets/Icons/FittedCircle.png new file mode 100644 index 0000000..13ac0d8 Binary files /dev/null and b/XplorePlane/Assets/Icons/FittedCircle.png differ diff --git a/XplorePlane/Assets/Icons/FittedLine.png b/XplorePlane/Assets/Icons/FittedLine.png new file mode 100644 index 0000000..d6e7f7c Binary files /dev/null and b/XplorePlane/Assets/Icons/FittedLine.png differ diff --git a/XplorePlane/Assets/Icons/Matching.png b/XplorePlane/Assets/Icons/Matching.png new file mode 100644 index 0000000..bcf4ca2 Binary files /dev/null and b/XplorePlane/Assets/Icons/Matching.png differ diff --git a/XplorePlane/Views/Main/MainWindow.xaml b/XplorePlane/Views/Main/MainWindow.xaml index ac6d80d..49122a0 100644 --- a/XplorePlane/Views/Main/MainWindow.xaml +++ b/XplorePlane/Views/Main/MainWindow.xaml @@ -165,7 +165,7 @@ Size="Medium" SmallImage="/Assets/Icons/crosshair.png" Text="辅助线" /> - - - @@ -517,6 +503,45 @@ Text="坐标标定" /> + + + + + + + + + + + + + + +