|
|
|
@ -219,15 +219,15 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
private string calGrade_TOTAL_DEPTH(double avg) |
|
|
|
|
{ |
|
|
|
|
string result = ""; |
|
|
|
|
int order = calGrade("TOTAL_DEPTH", avg); |
|
|
|
|
int order = calGrade("TOTAL_DEPTH", avg * 100); |
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
private string calGrade_TABLE(double min,double max) |
|
|
|
|
{ |
|
|
|
|
string result = ""; |
|
|
|
|
int order1 = calGrade("TABLE", min); |
|
|
|
|
int order2 = calGrade("TABLE", max); |
|
|
|
|
int order1 = calGrade("TABLE", min * 100); |
|
|
|
|
int order2 = calGrade("TABLE", max * 100); |
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
return result; |
|
|
|
@ -244,8 +244,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
private string calGrade_CROWN_HEIGHT(double min, double max) |
|
|
|
|
{ |
|
|
|
|
string result = ""; |
|
|
|
|
int order1 = calGrade("CROWN_HEIGHT", min); |
|
|
|
|
int order2 = calGrade("CROWN_HEIGHT", max); |
|
|
|
|
int order1 = calGrade("CROWN_HEIGHT", min * 100); |
|
|
|
|
int order2 = calGrade("CROWN_HEIGHT", max * 100); |
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
return result; |
|
|
|
@ -253,8 +253,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
private string calGrade_GIRDLE(double min, double max) |
|
|
|
|
{ |
|
|
|
|
string result = ""; |
|
|
|
|
int order1 = calGrade("GIRDLE", min); |
|
|
|
|
int order2 = calGrade("GIRDLE", max); |
|
|
|
|
int order1 = calGrade("GIRDLE", min * 100); |
|
|
|
|
int order2 = calGrade("GIRDLE", max * 100); |
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
return result; |
|
|
|
@ -271,8 +271,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
private string calGrade_PAV_DEPTH(double min, double max) |
|
|
|
|
{ |
|
|
|
|
string result = ""; |
|
|
|
|
int order1 = calGrade("PAV_DEPTH", min); |
|
|
|
|
int order2 = calGrade("PAV_DEPTH", max); |
|
|
|
|
int order1 = calGrade("PAV_DEPTH", min * 100); |
|
|
|
|
int order2 = calGrade("PAV_DEPTH", max * 100); |
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
return result; |
|
|
|
@ -295,8 +295,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "TOTAL_DEPTH"; |
|
|
|
|
info.TestItemName = GetName("TOTAL_DEPTH"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.TOTAL_DEPTH*1000)/100).ToString(digitsFormat); |
|
|
|
|
info.CutLevel = calGrade_TOTAL_DEPTH(result.measurements.TOTAL_DEPTH * 100); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.TOTAL_DEPTH); |
|
|
|
|
info.CutLevel = calGrade_TOTAL_DEPTH(result.measurements.TOTAL_DEPTH); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -306,9 +306,9 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "TABLE"; |
|
|
|
|
info.TestItemName = GetName("TABLE"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.TABLE * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.TABLE_MIN * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.TABLE_MAX * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.TABLE); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.TABLE_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.TABLE_MAX); |
|
|
|
|
info.CutLevel = calGrade_TABLE(result.measurements.TABLE_MIN, result.measurements.TABLE_MAX); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
@ -319,10 +319,10 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "CROWN_ANGLE"; |
|
|
|
|
info.TestItemName = GetName("CROWN_ANGLE"); |
|
|
|
|
info.Avg = result.measurements.CROWN_ANGLE.ToString(digitsFormat); |
|
|
|
|
info.Dev = result.measurements.CROWN_ANGLE_DEV.ToString(digitsFormat); |
|
|
|
|
info.Min = result.measurements.CROWN_ANGLE_MIN.ToString(digitsFormat); |
|
|
|
|
info.Max = result.measurements.CROWN_ANGLE_MAX.ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_A(result.measurements.CROWN_ANGLE); |
|
|
|
|
info.Dev = FormatDouble_A(result.measurements.CROWN_ANGLE_DEV); |
|
|
|
|
info.Min = FormatDouble_A(result.measurements.CROWN_ANGLE_MIN); |
|
|
|
|
info.Max = FormatDouble_A(result.measurements.CROWN_ANGLE_MAX); |
|
|
|
|
info.CutLevel = calGrade_CROWN_ANGLE(result.measurements.CROWN_ANGLE_MIN, result.measurements.CROWN_ANGLE_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -332,11 +332,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "CROWN_HEIGHT"; |
|
|
|
|
info.TestItemName = GetName("CROWN_HEIGHT"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.CROWN_HEIGHT * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Dev = (Math.Floor(result.measurements.CROWN_H_DEV * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.CROWN_H_MIN * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.CROWN_H_MAX * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.CutLevel = calGrade_CROWN_HEIGHT(result.measurements.CROWN_H_MIN * 100, result.measurements.CROWN_H_MAX * 100); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.CROWN_HEIGHT); |
|
|
|
|
info.Dev = FormatDouble_P(result.measurements.CROWN_H_DEV); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.CROWN_H_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.CROWN_H_MAX); |
|
|
|
|
info.CutLevel = calGrade_CROWN_HEIGHT(result.measurements.CROWN_H_MIN, result.measurements.CROWN_H_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -345,10 +345,10 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "GIRDLE_BEZEL"; |
|
|
|
|
info.TestItemName = GetName("GIRDLE_BEZEL"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.GIRDLE_BEZEL * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Dev = (Math.Floor(result.measurements.GIRDLE_BEZEL_DEV * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.GIRDLE_BEZEL_MIN * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.GIRDLE_BEZEL_MAX * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.GIRDLE_BEZEL); |
|
|
|
|
info.Dev = FormatDouble_P(result.measurements.GIRDLE_BEZEL_DEV); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.GIRDLE_BEZEL_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.GIRDLE_BEZEL_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -357,9 +357,9 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "GIRDLE_BONE"; |
|
|
|
|
info.TestItemName = GetName("GIRDLE_BONE"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.GIRDLE_BONE * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.GIRDLE_BONE_MIN * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.GIRDLE_BONE_MAX * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.GIRDLE_BONE); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.GIRDLE_BONE_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.GIRDLE_BONE_MAX); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -369,11 +369,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "GIRDLE"; |
|
|
|
|
info.TestItemName = GetName("GIRDLE"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.GIRDLE * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Dev = (Math.Floor(result.measurements.GIRDLE_DEV * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.GIRDLE_MIN * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.GIRDLE_MAX * 1000) / 100).ToString(digitsFormat); |
|
|
|
|
info.CutLevel = calGrade_GIRDLE(result.measurements.GIRDLE_MIN*100, result.measurements.GIRDLE_MAX * 100); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.GIRDLE); |
|
|
|
|
info.Dev = FormatDouble_P(result.measurements.GIRDLE_DEV); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.GIRDLE_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.GIRDLE_MAX); |
|
|
|
|
info.CutLevel = calGrade_GIRDLE(result.measurements.GIRDLE_MIN, result.measurements.GIRDLE_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -386,7 +386,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
info.Dev = result.measurements.PAV_ANGLE_DEV.ToString(digitsFormat); |
|
|
|
|
info.Min = result.measurements.PAV_ANGLE_MIN.ToString(digitsFormat); |
|
|
|
|
info.Max = result.measurements.PAV_ANGLE_MAX.ToString(digitsFormat); |
|
|
|
|
info.CutLevel = calGrade_PAV_ANGLE(result.measurements.PAV_ANGLE_MIN, result.measurements.PAV_ANGLE_MAX * 100); |
|
|
|
|
info.CutLevel = calGrade_PAV_ANGLE(result.measurements.PAV_ANGLE_MIN, result.measurements.PAV_ANGLE_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -395,11 +395,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "PAV_DEPTH"; |
|
|
|
|
info.TestItemName = GetName("PAV_DEPTH"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.PAV_DEPTH * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Dev = (Math.Floor(result.measurements.PAV_DEPTH_DEV * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.PAV_DEPTH_MIN * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.PAV_DEPTH_MAX * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.CutLevel = calGrade_PAV_DEPTH(result.measurements.PAV_DEPTH_MIN*100, result.measurements.PAV_DEPTH_MAX * 100); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.PAV_DEPTH); |
|
|
|
|
info.Dev = FormatDouble_P(result.measurements.PAV_DEPTH_DEV); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.PAV_DEPTH_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.PAV_DEPTH_MAX); |
|
|
|
|
info.CutLevel = calGrade_PAV_DEPTH(result.measurements.PAV_DEPTH_MIN, result.measurements.PAV_DEPTH_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -408,9 +408,9 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "STAR"; |
|
|
|
|
info.TestItemName = GetName("STAR"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.STAR * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.STAR_MIN * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.STAR_MAX * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.STAR); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.STAR_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.STAR_MAX); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -420,9 +420,9 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "LOWER_HALVES_RATIO"; |
|
|
|
|
info.TestItemName = GetName("LOWER_HALVES_RATIO"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.LOWER_HALVES_RATIO * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.LOWER_HALVES_RATIO_MIN * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.LOWER_HALVES_RATIO_MAX * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.LOWER_HALVES_RATIO); |
|
|
|
|
info.Min = FormatDouble_P(result.measurements.LOWER_HALVES_RATIO_MIN); |
|
|
|
|
info.Max = FormatDouble_P(result.measurements.LOWER_HALVES_RATIO_MAX); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -432,7 +432,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "CULET"; |
|
|
|
|
info.TestItemName = GetName("CULET"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.CULET * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.CULET); |
|
|
|
|
info.isEnabled = false; |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
@ -442,7 +442,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "TOC"; |
|
|
|
|
info.TestItemName = GetName("TOC"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.TOC * 1000) / 10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.TOC); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -451,7 +451,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "COC"; |
|
|
|
|
info.TestItemName = GetName("COC"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.COC * 1000)/10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.COC); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -460,10 +460,10 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "TWIST"; |
|
|
|
|
info.TestItemName = GetName("TWIST"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.TWIST*100)/100).ToString(digitsFormat); |
|
|
|
|
info.Dev = (Math.Floor(result.measurements.TWIST_DEV * 100) / 100).ToString(digitsFormat); |
|
|
|
|
info.Min = (Math.Floor(result.measurements.TWIST_MIN * 100) / 100).ToString(digitsFormat); |
|
|
|
|
info.Max = (Math.Floor(result.measurements.TWIST_MAX * 100) / 100).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_A(result.measurements.TWIST); |
|
|
|
|
info.Dev = FormatDouble_A(result.measurements.TWIST_DEV); |
|
|
|
|
info.Min = FormatDouble_A(result.measurements.TWIST_MIN); |
|
|
|
|
info.Max = FormatDouble_A(result.measurements.TWIST_MAX); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -472,7 +472,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
info.TestItemId = "CULET_TO_TABLE"; |
|
|
|
|
info.TestItemName = GetName("CULET_TO_TABLE"); |
|
|
|
|
info.Avg = (Math.Floor(result.measurements.CULET_TO_TABLE * 1000)/10).ToString(digitsFormat); |
|
|
|
|
info.Avg = FormatDouble_P(result.measurements.CULET_TO_TABLE); |
|
|
|
|
return info; |
|
|
|
|
} |
|
|
|
|
#endregion |
|
|
|
@ -507,11 +507,11 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
{ |
|
|
|
|
if (string.IsNullOrEmpty(DiamondCode)) |
|
|
|
|
{ |
|
|
|
|
SaveDialog startDialog = new SaveDialog(); |
|
|
|
|
bool? a = startDialog.ShowDialog(); |
|
|
|
|
if (startDialog.DiamondCode.Text.Length > 0) |
|
|
|
|
SaveDialog saveDialog = new SaveDialog(); |
|
|
|
|
bool? a = saveDialog.ShowDialog(); |
|
|
|
|
if (saveDialog.DiamondCode.Text.Length > 0) |
|
|
|
|
{ |
|
|
|
|
this.DiamondCode = startDialog.DiamondCode.Text; |
|
|
|
|
this.DiamondCode = saveDialog.DiamondCode.Text; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
@ -674,7 +674,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_A(info.CULET)}(mm)"); |
|
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{FormatDouble_P(info.GIRDLE)}%"); |
|
|
|
|
// TODO 腰部厚度英文 |
|
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{info.M1}"); |
|
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{calGirdleName(info)}"); |
|
|
|
|
dataRow.CreateCell(col++).SetCellValue($""); |
|
|
|
|
string sysmlevel = ""; |
|
|
|
|
if (!string.IsNullOrEmpty(SymLevelTotal)) |
|
|
|
@ -690,6 +690,18 @@ public class GradingResultVM : BaseViewModel |
|
|
|
|
workbook.Write(stream); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private string calGirdleName(Measurements info) |
|
|
|
|
{ |
|
|
|
|
string gridleName = ""; |
|
|
|
|
// 有问题 问题1 1.6时为thin to slight thick,那么 thin为什么时刻出现 |
|
|
|
|
// 问题2 假如最小值为very thin,最大值为thick时用哪个 |
|
|
|
|
// if (info.GIRDLE) |
|
|
|
|
// { |
|
|
|
|
// |
|
|
|
|
// } |
|
|
|
|
return gridleName; |
|
|
|
|
} |
|
|
|
|
/// <summary> |
|
|
|
|
/// 百分比用的小数格式化 |
|
|
|
|
/// </summary> |
|
|
|
|