fix: 部署反馈修改

master
Tongg 5 months ago
parent 3f9da7bdbd
commit 115b06abaf
  1. 1
      Language/en_US.xaml
  2. 1
      Language/zh_CN.xaml
  3. 1
      MainWindow.xaml.cs
  4. 2
      SparkClient.sln.DotSettings.user
  5. 30
      ViewModel/BaseWindow/BaseControlVM.cs
  6. 2
      ViewModel/BaseWindow/WindowManager.cs
  7. 4
      ViewModel/Grading/DiamondSelectVM.cs
  8. 30
      ViewModel/Grading/GradingResultVM.cs
  9. 15
      Views/Dialog/LoadingDialog.xaml
  10. 32
      Views/Dialog/LoadingDialog.xaml.cs
  11. 57
      Views/Grading/GradingResult.xaml
  12. 4
      Views/UserControl/Viewport3D.xaml.cs
  13. 26
      Views/UserControl/ViewportData/Helper/RayHelper.cs

@ -65,6 +65,7 @@
<sys:String x:Key="异形钻">Fancy Shape</sys:String> <sys:String x:Key="异形钻">Fancy Shape</sys:String>
<!-- loading --> <!-- loading -->
<sys:String x:Key="wait">Detecting, please wait...</sys:String> <sys:String x:Key="wait">Detecting, please wait...</sys:String>
<sys:String x:Key="waitMinSize">Minimize</sys:String>
<sys:String x:Key="waitExport">Generating file, please wait...</sys:String> <sys:String x:Key="waitExport">Generating file, please wait...</sys:String>
<!-- Detection Result Report --> <!-- Detection Result Report -->
<sys:String x:Key="Avg">Average</sys:String> <sys:String x:Key="Avg">Average</sys:String>

@ -65,6 +65,7 @@
<sys:String x:Key="异形钻">异形钻</sys:String> <sys:String x:Key="异形钻">异形钻</sys:String>
<!-- loading --> <!-- loading -->
<sys:String x:Key="wait">正在检测,请等待...</sys:String> <sys:String x:Key="wait">正在检测,请等待...</sys:String>
<sys:String x:Key="waitMinSize">最小化</sys:String>
<sys:String x:Key="waitExport">正在生成文件,请稍等...</sys:String> <sys:String x:Key="waitExport">正在生成文件,请稍等...</sys:String>
<!--检测结果 报表--> <!--检测结果 报表-->
<sys:String x:Key="Avg">平均</sys:String> <sys:String x:Key="Avg">平均</sys:String>

@ -62,6 +62,7 @@ public partial class MainWindow
//初始化 //初始化
this.WindowState = WindowState.Maximized; this.WindowState = WindowState.Maximized;
WindowManager.MainWindow = this;
} }
#region 重写窗体操作按钮 #region 重写窗体操作按钮

@ -66,6 +66,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APrintController_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb6416db4533e4255bc43c1cfd556a910175930_003Fd9_003Fccfaf320_003FPrintController_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APrintController_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb6416db4533e4255bc43c1cfd556a910175930_003Fd9_003Fccfaf320_003FPrintController_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APrintPreviewDialog_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1f2f0b08d2574f1aa35973d1cd0ae347cef920_003F07_003Fd26ee918_003FPrintPreviewDialog_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APrintPreviewDialog_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F1f2f0b08d2574f1aa35973d1cd0ae347cef920_003F07_003Fd26ee918_003FPrintPreviewDialog_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APropertyChangedEventArgs_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4a37508f5f72412da47f18c02ce8145313928_003F27_003F53f616d3_003FPropertyChangedEventArgs_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003APropertyChangedEventArgs_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F4a37508f5f72412da47f18c02ce8145313928_003F27_003F53f616d3_003FPropertyChangedEventArgs_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AResizeMode_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F6412d4331611499aab4eb63809a2a83bf60910_003F5d_003Fbab92bb0_003FResizeMode_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARougamoPool_00601_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe6791e39471d4d42a4a2478530abe7195a00_003F5e_003Fc0560022_003FRougamoPool_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARougamoPool_00601_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe6791e39471d4d42a4a2478530abe7195a00_003F5e_003Fc0560022_003FRougamoPool_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARoutedEventArgs_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1a88b4a860176dd5f825206bbebf3ee3d44ff3f058ceed9eb693c1eaa018_003FRoutedEventArgs_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARoutedEventArgs_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F1a88b4a860176dd5f825206bbebf3ee3d44ff3f058ceed9eb693c1eaa018_003FRoutedEventArgs_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARuntimeType_002ECoreCLR_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F955ec549fe664629353c3b5424b6ad6c7dfcec4ab59bae709ab962c228cf45_003FRuntimeType_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ARuntimeType_002ECoreCLR_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F955ec549fe664629353c3b5424b6ad6c7dfcec4ab59bae709ab962c228cf45_003FRuntimeType_002ECoreCLR_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
@ -84,6 +85,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fcca5cfb955e146648d91eb22ffe4627a84930_003F7a_003F2d86be72_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fcca5cfb955e146648d91eb22ffe4627a84930_003F7a_003F2d86be72_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fdad8a84eb59b44ebb2ed26202283a85984920_003F4b_003F3f166652_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fdad8a84eb59b44ebb2ed26202283a85984920_003F4b_003F3f166652_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2c8e7ca976f350cba9836d5565dac56b11e0b56656fa786460eb1395857a6fa_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F2c8e7ca976f350cba9836d5565dac56b11e0b56656fa786460eb1395857a6fa_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AThrowHelper_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003Fc7da56581ee7b20208f09e80b735961e4d5d7b9e5562bfdec94a75c57b391_003FThrowHelper_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATriggerAction_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F95b2fd5cb826a0d61aff88f87b258644cfe6df15959e521eb9d6cc8da70dc52_003FTriggerAction_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ATriggerAction_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FSourcesCache_003F95b2fd5cb826a0d61aff88f87b258644cfe6df15959e521eb9d6cc8da70dc52_003FTriggerAction_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUIElement_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F96a561fe76144633acef44f09d0dcb8a825920_003F3e_003Fdefca5b2_003FUIElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUIElement_002Ecs_002Fl_003AC_0021_003FUsers_003FAdministrator_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F96a561fe76144633acef44f09d0dcb8a825920_003F3e_003Fdefca5b2_003FUIElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUIElement_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F96a561fe76144633acef44f09d0dcb8a825920_003F3e_003Fdefca5b2_003FUIElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String> <s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AUIElement_002Ecs_002Fl_003AC_0021_003FUsers_003Ftongg_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F96a561fe76144633acef44f09d0dcb8a825920_003F3e_003Fdefca5b2_003FUIElement_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

@ -28,8 +28,6 @@ public class BaseControlVM : BaseViewModel
public ICommand NextCommand { get; } public ICommand NextCommand { get; }
private HotKeyManager _hotKeyManager;
/// <summary> /// <summary>
@ -45,7 +43,6 @@ public class BaseControlVM : BaseViewModel
CloseCommand = new RelayCommand(CloseVM); CloseCommand = new RelayCommand(CloseVM);
EscCloseCommand = new RelayCommand(OnClose); EscCloseCommand = new RelayCommand(OnClose);
NextCommand = new RelayCommand(NextDiamond); NextCommand = new RelayCommand(NextDiamond);
_hotKeyManager = new HotKeyManager();
} }
/// <summary> /// <summary>
@ -67,10 +64,15 @@ public class BaseControlVM : BaseViewModel
{ {
try try
{ {
_hotKeyManager = new HotKeyManager(); HotKeyManager _hotKeyManager = new HotKeyManager();
var hotKey = new HotKey(Key.Q, ModifierKeys.Control | ModifierKeys.Alt); var hotKey = new HotKey(Key.Q, ModifierKeys.Control | ModifierKeys.Alt);
_hotKeyManager.Register(hotKey); _hotKeyManager.Register(hotKey);
_hotKeyManager.KeyPressed += OnHotKeyPressed; _hotKeyManager.KeyPressed += OnHotKeyPressed;
HotKeyManager _hotKeyManagerClose = new HotKeyManager();
var hotKeyClose = new HotKey(Key.E, ModifierKeys.Control | ModifierKeys.Alt);
_hotKeyManagerClose.Register(hotKeyClose);
_hotKeyManagerClose.KeyPressed += OnHotKeyPressedClose;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -105,8 +107,24 @@ public class BaseControlVM : BaseViewModel
private void OnHotKeyPressed(object sender, KeyPressedEventArgs e) private void OnHotKeyPressed(object sender, KeyPressedEventArgs e)
{ {
if(WindowTitle.StartsWith(MultilingualHelper.getString("DetectionResult"))) // if(Content.GetType().Equals(typeof(GradingResultVM)))
NextDiamond(""); //
if (WindowManager.mainViewModel.Content is BaseControlVM baseVM)
{
if(baseVM.Content.GetType().Equals(typeof(GradingResultVM)))
NextDiamond("");
}
}
private void OnHotKeyPressedClose(object sender, KeyPressedEventArgs e)
{
// if(WindowTitle.StartsWith(MultilingualHelper.getString("DetectionResult")))
if (WindowManager.mainViewModel.Content is BaseControlVM baseVM)
{
if(baseVM.Content.GetType().Equals(typeof(GradingResultVM)))
CloseVM("");
}
} }
public void NextDiamond(object parameter) public void NextDiamond(object parameter)

@ -4,6 +4,8 @@ public class WindowManager
{ {
public static MainViewModel mainViewModel; public static MainViewModel mainViewModel;
public static MainWindow MainWindow;
public static List<Object> openContent = new List<Object>(); public static List<Object> openContent = new List<Object>();
/// <summary> /// <summary>

@ -150,7 +150,7 @@ public class DiamondSelectVM : BaseViewModel
#if DEBUG #if DEBUG
DoStartGrading(param); DoStartGrading(param);
#else #else
LoadingDialog loading = new LoadingDialog(); LoadingDialog loading = new LoadingDialog(DiamondCode);
try try
{ {
if (param != null) if (param != null)
@ -354,7 +354,7 @@ public class DiamondSelectVM : BaseViewModel
[Log] [Log]
public async void DoStartGrading(object param) public async void DoStartGrading(object param)
{ {
LoadingDialog loading = new LoadingDialog(); LoadingDialog loading = new LoadingDialog(DiamondCode);
try { try {
if (param != null) if (param != null)
{ {

@ -832,27 +832,20 @@ public class GradingResultVM : BaseViewModel
[Log] [Log]
private void AutoSave() private void AutoSave()
{ {
if (string.IsNullOrEmpty(DiamondCode)) if (!Directory.Exists(getFilePath()))
{ {
return; //new MessageBox().Show(MultilingualHelper.getString("SavePathIsnotExists"));
//return;
throw new DirectoryNotFoundException(getFilePath());
} }
else string fullPath = Path.Combine(getFilePath(), string.IsNullOrEmpty(DiamondCode)?"temp":DiamondCode);
if (FileSaveEnabled("Txt"))
{ {
if (!Directory.Exists(getFilePath())) TxtFile(fullPath);
{ }
//new MessageBox().Show(MultilingualHelper.getString("SavePathIsnotExists")); if (FileSaveEnabled("Excel"))
//return; {
throw new DirectoryNotFoundException(getFilePath()); ExcelFile(fullPath);
}
string fullPath = Path.Combine(getFilePath(), this.DiamondCode);
if (FileSaveEnabled("Txt"))
{
TxtFile(fullPath);
}
if (FileSaveEnabled("Excel"))
{
ExcelFile(fullPath);
}
} }
} }
@ -1078,6 +1071,7 @@ public class GradingResultVM : BaseViewModel
try try
{ {
string fileName = filePath + ".txt"; string fileName = filePath + ".txt";
using (var file = File.Create(fileName)) using (var file = File.Create(fileName))
{ {
Measurements info = algorithmResult.measurements; Measurements info = algorithmResult.measurements;

@ -7,18 +7,25 @@
mc:Ignorable="d" mc:Ignorable="d"
Title="LoadingDialog" Height="450" Width="800" Title="LoadingDialog" Height="450" Width="800"
WindowStyle="None" AllowsTransparency="True" Background="Transparent" WindowStyle="None" AllowsTransparency="True" Background="Transparent"
WindowState="Maximized"> WindowState="Maximized" StateChanged="LoadingDialog_OnStateChanged" SizeChanged="LoadingDialog_OnSizeChanged">
<Border Background="#00BFFF" Opacity="0.6"> <Border Background="#00BFFF" Opacity="0.6">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition/> <RowDefinition/>
<RowDefinition/> <RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/> <RowDefinition/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Grid.Row="1" Text="{DynamicResource wait}" FontFamily="PingFangSC-bold" FontWeight="Bold" <TextBlock Grid.Row="1" Text="{DynamicResource wait}" FontFamily="PingFangSC-bold" FontWeight="Bold"
FontSize="36" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center" Foreground="#FFFFFF"/> FontSize="36" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center" Foreground="#FFFFFF"/>
<ProgressBar x:Name="ProgressBar" Style="{StaticResource ProgressBarSuccess}" Height="25" FontSize="16" Grid.Row="2" Width="544"/> <TextBlock Grid.Row="2" Text="Nothing" FontFamily="PingFangSC-bold" FontWeight="Bold" x:Name="DCodeTextBlock"
FontSize="26" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center" Foreground="#FFFFFF"/>
<TextBlock Grid.Row="4" Text="{DynamicResource waitMinSize}" FontFamily="PingFangSC-bold" FontWeight="Bold" MouseLeftButtonDown="UIElement_OnMouseLeftButtonDown"
FontSize="16" VerticalAlignment="Center" Background="Transparent" HorizontalAlignment="Center" Foreground="#FF4000"/>
<ProgressBar x:Name="ProgressBar" Style="{StaticResource ProgressBarSuccess}"
Height="25" FontSize="16" Margin=" 0 30 0 20" Grid.Row="3" Width="544"/>
</Grid> </Grid>
</Border> </Border>
</Window> </Window>

@ -12,6 +12,7 @@ using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Shapes; using System.Windows.Shapes;
using SparkClient.ViewModel.BaseWindow;
namespace SparkClient.Views.Dialog namespace SparkClient.Views.Dialog
{ {
@ -20,11 +21,24 @@ namespace SparkClient.Views.Dialog
/// </summary> /// </summary>
public partial class LoadingDialog : Window public partial class LoadingDialog : Window
{ {
public LoadingDialog() private Window parentWindow;
public LoadingDialog(string DiaCode)
{ {
InitializeComponent(); InitializeComponent();
this.MinWidth = 1000; this.MinWidth = 1000;
this.MinHeight = 1000; this.MinHeight = 1000;
this.WindowState = WindowState.Maximized;
if (string.IsNullOrWhiteSpace(DiaCode))
{
DCodeTextBlock.Visibility = Visibility.Hidden;
DCodeTextBlock.Text = "";
}
else
{
DCodeTextBlock.Text = DiaCode;
}
parentWindow = WindowManager.MainWindow;
} }
@ -32,5 +46,21 @@ namespace SparkClient.Views.Dialog
{ {
ProgressBar.Value = i; ProgressBar.Value = i;
} }
private void UIElement_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.WindowState = WindowState.Minimized;
}
private void LoadingDialog_OnStateChanged(object? sender, EventArgs e)
{
if(parentWindow != null)parentWindow.WindowState = WindowState;
}
private void LoadingDialog_OnSizeChanged(object sender, SizeChangedEventArgs e)
{
}
} }
} }

@ -20,9 +20,61 @@
</Style> </Style>
<Style x:Key="CustomDataGridRowStyle" TargetType="DataGridRow"> <Style x:Key="CustomDataGridRowStyle" TargetType="DataGridRow">
<Setter Property="Background" Value="#f0f1f6"/>
<Setter Property="Margin" Value="0,0,0,2"/> <Setter Property="Margin" Value="0,0,0,2"/>
<Setter Property="Height" Value="50"/> <Setter Property="Height" Value="50"/>
<!-- 禁用所有系统默认视觉效果 -->
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<!-- 核心技巧:用Grid做容器控制视觉层级 -->
<Grid>
<!-- 第1层:基础圆角背景 -->
<Border x:Name="BaseBackground"
CornerRadius="5"
Background="{TemplateBinding Background}"
Margin="2"/>
<!-- 第2层:选中状态圆角层(默认隐藏) -->
<Border x:Name="SelectedHighlight"
CornerRadius="5"
Background="Transparent"
Margin="2"/>
<!-- 第3层:内容展示层(不受覆盖影响) -->
<SelectiveScrollingGrid>
<SelectiveScrollingGrid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</SelectiveScrollingGrid.ColumnDefinitions>
<DataGridCellsPresenter Grid.Column="1"/>
<DataGridRowHeader Grid.Column="0"/>
</SelectiveScrollingGrid>
</Grid>
<!-- 状态触发器 -->
<ControlTemplate.Triggers>
<!-- 强制清除HandyControl的默认选中边框 -->
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter Property="BorderBrush" Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<!-- 交替行背景色 -->
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="#D4FCFF"/>
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#E4ECFF"/>
</Trigger>
</Style.Triggers>
</Style> </Style>
<Style x:Key="CustomColumnHeaderStyle" TargetType="DataGridColumnHeader"> <Style x:Key="CustomColumnHeaderStyle" TargetType="DataGridColumnHeader">
@ -292,7 +344,8 @@
IsReadOnly="True" IsReadOnly="True"
RowStyle="{StaticResource CustomDataGridRowStyle}" RowStyle="{StaticResource CustomDataGridRowStyle}"
ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}" ColumnHeaderStyle="{StaticResource CustomColumnHeaderStyle}"
CellStyle="{StaticResource CustomDataGridCellStyle}"> CellStyle="{StaticResource CustomDataGridCellStyle}"
AlternationCount="2">
<DataGrid.Resources> <DataGrid.Resources>
<Style TargetType="ScrollBar"> <Style TargetType="ScrollBar">
<Setter Property="Visibility" Value="Collapsed"/> <Setter Property="Visibility" Value="Collapsed"/>

@ -219,8 +219,8 @@ public partial class Viewport3D
ViewportManager.DoubleClickSelect = !false; ViewportManager.DoubleClickSelect = !false;
break; break;
case "BtnShow3DView": case "BtnShow3DView":
ObjExporter.ExportToObj2(ViewportManager.ViewportTriangle, @"D:\id03.obj"); // ObjExporter.ExportToObj2(ViewportManager.ViewportTriangle, @"D:\id03.obj");
// UnityHelper.GenerateRender(ViewportManager.ViewportTriangle.First().TriangleCode, "123"); RayHelper.GenerateRender(ViewportManager.ViewportTriangle.First().TriangleCode, "123");
break; break;
} }

@ -7,17 +7,17 @@ using System.Windows.Forms;
public class RayHelper public class RayHelper
{ {
//unity渲染结果(运行前清理) //unity渲染结果(运行前清理)
private static string _image_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\image\"; private static string _image_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\Image\";
//unity渲染模型缓存(运行前清理) //unity渲染模型缓存(运行前清理)
private static string _stl_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\"; private static string _obj_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\Obj";
//用于存放unity渲染插件(版本发布独立更新) //用于存放unity渲染插件(版本发布独立更新)
private static string _unity_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\core\"; private static string _unity_path = AppDomain.CurrentDomain.BaseDirectory + @"Ray\Core\";
public static void GenerateRender(string modelInfo, string diamondCode) public static void GenerateRender(string modelInfo, string diamondCode)
{ {
string fileName = GenerateSignature(modelInfo, diamondCode); string fileName = GenerateSignature(modelInfo, diamondCode);
string fullStlPath = Path.Combine(_stl_path, fileName); string fullStlPath = Path.Combine(_obj_path, fileName);
// 1. 检查STL文件是否存在 // 1. 检查STL文件是否存在
if (File.Exists(fullStlPath)) if (File.Exists(fullStlPath))
@ -31,7 +31,7 @@ public class RayHelper
// 2. 清理Unity相关目录 // 2. 清理Unity相关目录
CleanDirectory(_image_path); CleanDirectory(_image_path);
CleanDirectory(_stl_path); CleanDirectory(_obj_path);
// 3. 导出模型为STL // 3. 导出模型为STL
ObjExporter.ExportToObj2(ViewportManager.ViewportTriangle, fullStlPath + ".obj"); ObjExporter.ExportToObj2(ViewportManager.ViewportTriangle, fullStlPath + ".obj");
@ -73,12 +73,12 @@ public class RayHelper
private static void ExecuteUnityRendering(string fileName, int type) private static void ExecuteUnityRendering(string fileName, int type)
{ {
string arguments = $"--model={_stl_path + fileName} --output={_image_path} --type={type}"; string arguments = $@"--model {_obj_path + fileName + ".obj"} --output {_image_path}\{type}.jpg --type {type}";
string exePath = Path.Combine(_unity_path, "RayTracing.exe"); string exePath = Path.Combine(_unity_path, "raytracing2.exe");
if (!File.Exists(exePath)) if (!File.Exists(exePath))
{ {
throw new FileNotFoundException("Unity渲染插件未找到", exePath); throw new FileNotFoundException("渲染插件未找到", exePath);
} }
using (Process process = new Process()) using (Process process = new Process())
@ -92,15 +92,15 @@ public class RayHelper
if (process.ExitCode != 0) if (process.ExitCode != 0)
{ {
throw new Exception("Unity渲染进程异常退出。"); throw new Exception("渲染进程异常退出。");
} }
} }
} }
private static bool ValidateImages() private static bool ValidateImages()
{ {
string heartImage = Path.Combine(_image_path, "0.png"); string heartImage = Path.Combine(_image_path, "0.jpg");
string arrowImage = Path.Combine(_image_path, "1.png"); string arrowImage = Path.Combine(_image_path, "1.jpg");
return File.Exists(heartImage) && File.Exists(arrowImage); return File.Exists(heartImage) && File.Exists(arrowImage);
} }
@ -119,7 +119,7 @@ public class RayHelper
PictureBox heartBox = new PictureBox PictureBox heartBox = new PictureBox
{ {
ImageLocation = Path.Combine(_image_path, "0.png"), ImageLocation = Path.Combine(_image_path, "0.jpg"),
SizeMode = PictureBoxSizeMode.CenterImage, SizeMode = PictureBoxSizeMode.CenterImage,
Dock = DockStyle.Left, Dock = DockStyle.Left,
Width = 400 Width = 400
@ -127,7 +127,7 @@ public class RayHelper
PictureBox arrowBox = new PictureBox PictureBox arrowBox = new PictureBox
{ {
ImageLocation = Path.Combine(_image_path, "1.png"), ImageLocation = Path.Combine(_image_path, "1.jpg"),
SizeMode = PictureBoxSizeMode.CenterImage, SizeMode = PictureBoxSizeMode.CenterImage,
Dock = DockStyle.Right, Dock = DockStyle.Right,
Width = 400 Width = 400

Loading…
Cancel
Save