From 45025759ecdff360a9ad2d8aae338b81a282eda3 Mon Sep 17 00:00:00 2001 From: Tongg Date: Wed, 14 May 2025 14:35:12 +0800 Subject: [PATCH] fix: a few bugs --- Model/Helper/MultilingualHelper.cs | 1 - ViewModel/Grading/DiamondSelectVM.cs | 3 ++- ViewModel/Grading/GradingResultVM.cs | 38 ++++++++++++++++++---------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Model/Helper/MultilingualHelper.cs b/Model/Helper/MultilingualHelper.cs index bc33184..1ac0566 100644 --- a/Model/Helper/MultilingualHelper.cs +++ b/Model/Helper/MultilingualHelper.cs @@ -27,7 +27,6 @@ public class MultilingualHelper /// /// 获取多语言字符 /// - /// KEY /// 文字 /// public static string getLangType() diff --git a/ViewModel/Grading/DiamondSelectVM.cs b/ViewModel/Grading/DiamondSelectVM.cs index 71c1df4..d7bc2ba 100644 --- a/ViewModel/Grading/DiamondSelectVM.cs +++ b/ViewModel/Grading/DiamondSelectVM.cs @@ -351,10 +351,11 @@ public class DiamondSelectVM : BaseViewModel if (res > -100 && res < 0) { + await SOCClientService.Service.OpenPump(false); //返回 loadingView.Dispose(); WindowManager.mainViewModel.Content = WindowManager.PreviousVM(); - await SOCClientService.Service.OpenPump(false); + return; } if (res <= -100) diff --git a/ViewModel/Grading/GradingResultVM.cs b/ViewModel/Grading/GradingResultVM.cs index 0e22126..0bbecf3 100644 --- a/ViewModel/Grading/GradingResultVM.cs +++ b/ViewModel/Grading/GradingResultVM.cs @@ -305,18 +305,18 @@ public class GradingResultVM : BaseViewModel var info = algorithmResult.Measurements; string line = $"{DiamondCode}," + - $"{Wight}(ct)," + - $"{FormatDouble_A2(info.M1)}(mm)," + - $"{FormatDouble_A2(info.M2)}(mm)," + - $"{FormatDouble_A2(info.M3)}(mm)," + - $"{FormatDouble_P2(info.TABLE)}%," + - $"{FormatDouble_P2(info.CROWN_HEIGHT)}%," + - $"{FormatDouble_P2(info.PAV_DEPTH)}%," + - $"{FormatDouble_P2(info.TOTAL_DEPTH)}%," + - $"{FormatDouble_A2(info.CROWN_ANGLE)}°," + - $"{FormatDouble_A2(info.PAV_ANGLE)}°," + - $"{FormatDouble_A2(info.CULET_SIZE)}(mm)," + - $"{FormatDouble_A2(info.GIRDLE)}%," + + $"{Wight}," + + $"{FormatDouble_A2(info.M1)}," + + $"{FormatDouble_A2(info.M2)}," + + $"{FormatDouble_A2(info.M3)}," + + $"{FormatDouble_P2(info.TABLE)}," + + $"{FormatDouble_P2(info.CROWN_HEIGHT)}," + + $"{FormatDouble_P2(info.PAV_DEPTH)}," + + $"{FormatDouble_P2(info.TOTAL_DEPTH)}," + + $"{FormatDouble_A2(info.CROWN_ANGLE)}," + + $"{FormatDouble_A2(info.PAV_ANGLE)}," + + $"{FormatDouble_A2(info.CULET_SIZE)}," + + $"{FormatDouble_P2(info.GIRDLE)}," + $"{calGirdleName(info)}," + $"," + $"{GetGradeEnName(GetGradeOrder(SymLevelTotal))}," + @@ -332,10 +332,20 @@ public class GradingResultVM : BaseViewModel else { File.Create(filePath).Close(); - string header = - "Diamond Code,Wight,Measurement1, Measurement2, Measurement3, Table, Crown Height,Pavilion Depth, Total Depth,Crown Angle, Pavilion Angle,Culet Size, Girdle Percent,Girdle Name, POL or Pol/ Sym,SYM,CUT - PROP"; + string header = string.Empty; + if ("zh-cn".Equals(MultilingualHelper.getLangType())) + { + header = "Diamond Code,Wight(ct),Measurement1(mm), Measurement2(mm), Measurement3(mm), Table(%), Crown Height(%),Pavilion Depth(%), Total Depth(%),Crown Angle(°), Pavilion Angle(°),Culet Size(mm), Girdle Percent(%),Girdle Name, POL or Pol/ Sym,SYM,CUT - PROP"; + } + else + { + header = "钻石编码,预估重量(克拉),长(毫米), 宽(毫米), 高(毫米), 台宽比(%), 冠高比(%),亭深比(%), 全深比(%),冠角(°), 亭角(°),底尖偏心(mm), 腰厚比(%),腰厚分级, 修饰度,对称性,切工比例"; + } + // string header = + // "Diamond Code,Wight,Measurement1, Measurement2, Measurement3, Table, Crown Height,Pavilion Depth, Total Depth,Crown Angle, Pavilion Angle,Culet Size, Girdle Percent,Girdle Name, POL or Pol/ Sym,SYM,CUT - PROP"; using (var writer = new StreamWriter(filePath, true)) { + writer.WriteLine(header); writer.WriteLine(line); }