fix: a few bugs

master
Tongg 7 months ago
parent 722c6f0d83
commit 45025759ec
  1. 1
      Model/Helper/MultilingualHelper.cs
  2. 3
      ViewModel/Grading/DiamondSelectVM.cs
  3. 38
      ViewModel/Grading/GradingResultVM.cs

@ -27,7 +27,6 @@ public class MultilingualHelper
/// <summary> /// <summary>
/// 获取多语言字符 /// 获取多语言字符
/// </summary> /// </summary>
/// <param name="key">KEY</param>
/// <returns>文字</returns> /// <returns>文字</returns>
/// <exception cref="NullReferenceException"></exception> /// <exception cref="NullReferenceException"></exception>
public static string getLangType() public static string getLangType()

@ -351,10 +351,11 @@ public class DiamondSelectVM : BaseViewModel
if (res > -100 && res < 0) if (res > -100 && res < 0)
{ {
await SOCClientService.Service.OpenPump(false);
//返回 //返回
loadingView.Dispose(); loadingView.Dispose();
WindowManager.mainViewModel.Content = WindowManager.PreviousVM(); WindowManager.mainViewModel.Content = WindowManager.PreviousVM();
await SOCClientService.Service.OpenPump(false);
return; return;
} }
if (res <= -100) if (res <= -100)

@ -305,18 +305,18 @@ public class GradingResultVM : BaseViewModel
var info = algorithmResult.Measurements; var info = algorithmResult.Measurements;
string line = string line =
$"{DiamondCode}," + $"{DiamondCode}," +
$"{Wight}(ct)," + $"{Wight}," +
$"{FormatDouble_A2(info.M1)}(mm)," + $"{FormatDouble_A2(info.M1)}," +
$"{FormatDouble_A2(info.M2)}(mm)," + $"{FormatDouble_A2(info.M2)}," +
$"{FormatDouble_A2(info.M3)}(mm)," + $"{FormatDouble_A2(info.M3)}," +
$"{FormatDouble_P2(info.TABLE)}%," + $"{FormatDouble_P2(info.TABLE)}," +
$"{FormatDouble_P2(info.CROWN_HEIGHT)}%," + $"{FormatDouble_P2(info.CROWN_HEIGHT)}," +
$"{FormatDouble_P2(info.PAV_DEPTH)}%," + $"{FormatDouble_P2(info.PAV_DEPTH)}," +
$"{FormatDouble_P2(info.TOTAL_DEPTH)}%," + $"{FormatDouble_P2(info.TOTAL_DEPTH)}," +
$"{FormatDouble_A2(info.CROWN_ANGLE)}°," + $"{FormatDouble_A2(info.CROWN_ANGLE)}," +
$"{FormatDouble_A2(info.PAV_ANGLE)}°," + $"{FormatDouble_A2(info.PAV_ANGLE)}," +
$"{FormatDouble_A2(info.CULET_SIZE)}(mm)," + $"{FormatDouble_A2(info.CULET_SIZE)}," +
$"{FormatDouble_A2(info.GIRDLE)}%," + $"{FormatDouble_P2(info.GIRDLE)}," +
$"{calGirdleName(info)}," + $"{calGirdleName(info)}," +
$"," + $"," +
$"{GetGradeEnName(GetGradeOrder(SymLevelTotal))}," + $"{GetGradeEnName(GetGradeOrder(SymLevelTotal))}," +
@ -332,10 +332,20 @@ public class GradingResultVM : BaseViewModel
else else
{ {
File.Create(filePath).Close(); File.Create(filePath).Close();
string header = string header = string.Empty;
"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"; 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)) using (var writer = new StreamWriter(filePath, true))
{ {
writer.WriteLine(header); writer.WriteLine(header);
writer.WriteLine(line); writer.WriteLine(line);
} }

Loading…
Cancel
Save