|
|
|
@ -22,7 +22,6 @@ using BrilliantSightClient.Views.UserControl.ViewportData.Helper; |
|
|
|
using log4net; |
|
|
|
using log4net; |
|
|
|
using NPOI.SS.Util; |
|
|
|
using NPOI.SS.Util; |
|
|
|
using BrilliantSightClient.Model.Attributes; |
|
|
|
using BrilliantSightClient.Model.Attributes; |
|
|
|
using BrilliantSightClient.Model; |
|
|
|
|
|
|
|
using BrilliantSightClient.Model.Extension; |
|
|
|
using BrilliantSightClient.Model.Extension; |
|
|
|
using BrilliantSightClient.Model.GradeResult.Entity; |
|
|
|
using BrilliantSightClient.Model.GradeResult.Entity; |
|
|
|
using BrilliantSightClient.Model.GradeResult.Entity.Enums; |
|
|
|
using BrilliantSightClient.Model.GradeResult.Entity.Enums; |
|
|
|
@ -174,7 +173,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
/// 构造 |
|
|
|
/// 构造 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="result">检测结果</param> |
|
|
|
/// <param name="result">检测结果</param> |
|
|
|
public GradingResultVM(object result) |
|
|
|
public GradingResultVM(object? result) |
|
|
|
{ |
|
|
|
{ |
|
|
|
try |
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -192,21 +191,13 @@ public class GradingResultVM : BaseViewModel |
|
|
|
InitView(algorithmResult); |
|
|
|
InitView(algorithmResult); |
|
|
|
machine = algorithmResult.DeviceId; |
|
|
|
machine = algorithmResult.DeviceId; |
|
|
|
username = Settings.SelectValueById("PERMISSIONS"); |
|
|
|
username = Settings.SelectValueById("PERMISSIONS"); |
|
|
|
|
|
|
|
|
|
|
|
// if (ruleId.StartsWith("IGI")) |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// IsEnabled = true; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// else |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// IsEnabled = false; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
IsEnabled = true; |
|
|
|
IsEnabled = true; |
|
|
|
if (algorithmResult.Status.Equals(StatusCodes.Recheck)) IsEnabled = false; |
|
|
|
if (algorithmResult.Status.Equals(StatusCodes.Recheck)) IsEnabled = false; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DS = ConfigurationManager.AppSettings["DSSet"]; |
|
|
|
DS = ConfigurationHelper.ReadConfigValue("DSSet"); |
|
|
|
|
|
|
|
|
|
|
|
if (shapeId.Equals("ROUND")) |
|
|
|
if (shapeId.Equals("ROUND")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -239,6 +230,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
// GradeList = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
// GradeList = DataBaseHelper.ExecuteQuery(sql); |
|
|
|
|
|
|
|
|
|
|
|
DataTable dt = new DataTable(); |
|
|
|
DataTable dt = new DataTable(); |
|
|
|
|
|
|
|
dt.TableName = "GRADE"; |
|
|
|
dt.Columns.Add("NAME"); |
|
|
|
dt.Columns.Add("NAME"); |
|
|
|
dt.Columns.Add("EN_NAME"); |
|
|
|
dt.Columns.Add("EN_NAME"); |
|
|
|
dt.Columns.Add("EN_ALL_NAME"); |
|
|
|
dt.Columns.Add("EN_ALL_NAME"); |
|
|
|
@ -249,8 +241,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
DataRow dr = dt.NewRow(); |
|
|
|
DataRow dr = dt.NewRow(); |
|
|
|
dr["NAME"] = gradeSet.Name; |
|
|
|
dr["NAME"] = gradeSet.Name; |
|
|
|
dr["EN_NAME"] = gradeSet.EName; |
|
|
|
dr["EN_NAME"] = gradeSet.AName; |
|
|
|
dr["EN_ALL_NAME"] = gradeSet.AName; |
|
|
|
dr["EN_ALL_NAME"] = gradeSet.EName; |
|
|
|
dr["GRADE_ORDER"] = gradeSet.Short; |
|
|
|
dr["GRADE_ORDER"] = gradeSet.Short; |
|
|
|
dt.Rows.Add(dr); |
|
|
|
dt.Rows.Add(dr); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -402,26 +394,12 @@ public class GradingResultVM : BaseViewModel |
|
|
|
if (shapeId.Equals("ROUND")) |
|
|
|
if (shapeId.Equals("ROUND")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var data = ViewDataInfoHelper.GenerateDataInfos(result); |
|
|
|
var data = ViewDataInfoHelper.GenerateDataInfos(result); |
|
|
|
DtResults = data; |
|
|
|
|
|
|
|
InitCombobox(); |
|
|
|
InitCombobox(); |
|
|
|
// var testItemList = GetTestItemList(); |
|
|
|
DtResults = data; |
|
|
|
// Type type = this.GetType(); |
|
|
|
|
|
|
|
// foreach (var testItem in testItemList) |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// string methodName = "get" + testItem; |
|
|
|
|
|
|
|
// MethodInfo? methodInfo = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.NonPublic); |
|
|
|
|
|
|
|
// if (methodInfo != null) |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// object[] parameters = new object[] { result }; |
|
|
|
|
|
|
|
// DataInfo? dataInfo = methodInfo.Invoke(this, parameters) as DataInfo; |
|
|
|
|
|
|
|
// if (dataInfo != null) |
|
|
|
|
|
|
|
// { |
|
|
|
|
|
|
|
// dataInfo.GradeList = GradeList; |
|
|
|
|
|
|
|
// DtResults.Add(dataInfo); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// CutLevelTotal = GetGradeName(totalCutGrade); |
|
|
|
// CutLevelTotal = GetGradeName(totalCutGrade); |
|
|
|
|
|
|
|
var totalCutLevel = ViewDataInfoHelper.levelCalculator.GetCutTotalGradeLevelSet(data); |
|
|
|
|
|
|
|
CutLevelTotal = ViewDataInfoHelper.MultilingualLevelSet(totalCutLevel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -438,34 +416,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
return Settings.SelectValueById("RuleId"); |
|
|
|
return Settings.SelectValueById("RuleId"); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 参数列表测试内容获取 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private List<string> GetTestItemList() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// DB 没关联 |
|
|
|
|
|
|
|
List<string> list = new List<string>(); |
|
|
|
|
|
|
|
list.Add("DIAMETER"); |
|
|
|
|
|
|
|
list.Add("TOTAL_DEPTH"); |
|
|
|
|
|
|
|
list.Add("TABLE"); |
|
|
|
|
|
|
|
list.Add("CROWN_ANGLE"); |
|
|
|
|
|
|
|
list.Add("CROWN_HEIGHT"); |
|
|
|
|
|
|
|
list.Add("GIRDLE_BEZEL"); |
|
|
|
|
|
|
|
list.Add("GIRDLE_BONE"); |
|
|
|
|
|
|
|
list.Add("GIRDLE"); |
|
|
|
|
|
|
|
list.Add("PAV_ANGLE"); |
|
|
|
|
|
|
|
list.Add("PAV_DEPTH"); |
|
|
|
|
|
|
|
list.Add("STAR"); |
|
|
|
|
|
|
|
list.Add("LOWER_HALVES_RATIO"); |
|
|
|
|
|
|
|
list.Add("CULET"); |
|
|
|
|
|
|
|
list.Add("TOC"); |
|
|
|
|
|
|
|
list.Add("COC"); |
|
|
|
|
|
|
|
list.Add("TWIST"); |
|
|
|
|
|
|
|
list.Add("CULET_TO_TABLE"); |
|
|
|
|
|
|
|
return list; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#region 定级计算 |
|
|
|
#region 定级计算 |
|
|
|
[Log] |
|
|
|
[Log] |
|
|
|
private string getActualRuleId() |
|
|
|
private string getActualRuleId() |
|
|
|
@ -514,661 +465,8 @@ public class GradingResultVM : BaseViewModel |
|
|
|
List<CalGradeInfo> calGrades = DataBaseHelper.ExecuteQuery<CalGradeInfo>(sql); |
|
|
|
List<CalGradeInfo> calGrades = DataBaseHelper.ExecuteQuery<CalGradeInfo>(sql); |
|
|
|
return calGrades; |
|
|
|
return calGrades; |
|
|
|
} |
|
|
|
} |
|
|
|
[Log] |
|
|
|
|
|
|
|
private int calGradeSym(string item, double value) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int order = 1; |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
decimal cValue = Convert.ToDecimal(value); |
|
|
|
|
|
|
|
List<CalGradeInfo> calGrades = GetCalGradeInfos_SYM(item); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (calGrades == null || calGrades.Count == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
foreach (CalGradeInfo gradeInfo in calGrades) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool isThisGrade = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (gradeInfo.Max != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (gradeInfo.isMaxExist == 1 && cValue.CompareTo(gradeInfo.Max) <= 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (gradeInfo.isMaxExist == 0 && cValue.CompareTo(gradeInfo.Max) < 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isThisGrade = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (gradeInfo.Min != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (gradeInfo.isMinExist == 1 && cValue.CompareTo(gradeInfo.Min) >= 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (gradeInfo.isMinExist == 0 && cValue.CompareTo(gradeInfo.Min) > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isThisGrade = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (isThisGrade) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
order = gradeInfo.gradeOrder; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
order = gradeInfo.gradeOrder; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
totalSymGrade = Math.Max(order, totalSymGrade); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
new MessageBox().Show($"{MultilingualHelper.getString("ApplicationError")}{ex.Message}"); |
|
|
|
|
|
|
|
Logger.Error($"全局异常捕获:{ex.Message}", ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return order; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private int calGrade(string item ,double value,bool isCut=true) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int order = 1; |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
decimal cValue = Convert.ToDecimal(value); |
|
|
|
|
|
|
|
List<CalGradeInfo> calGrades = new(); |
|
|
|
|
|
|
|
if (isCut) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
calGrades = GetCalGradeInfos(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
calGrades = GetCalGradeInfos_SYM(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (calGrades == null || calGrades.Count == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
foreach (CalGradeInfo gradeInfo in calGrades) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
bool isThisGrade = true; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (gradeInfo.Max!= null) { |
|
|
|
|
|
|
|
if ( gradeInfo.isMaxExist == 1 && cValue.CompareTo(gradeInfo.Max)<=0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
}else if(gradeInfo.isMaxExist == 0 && cValue.CompareTo(gradeInfo.Max) < 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isThisGrade = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (gradeInfo.Min != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (gradeInfo.isMinExist == 1 && cValue.CompareTo(gradeInfo.Min) >= 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (gradeInfo.isMinExist == 0 && cValue.CompareTo(gradeInfo.Min) > 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
isThisGrade = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (isThisGrade) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
order = gradeInfo.gradeOrder; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
order = gradeInfo.gradeOrder; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
totalCutGrade = Math.Max(order, totalCutGrade); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
new MessageBox().Show($"{MultilingualHelper.getString("ApplicationError")}{ex.Message}"); |
|
|
|
|
|
|
|
Logger.Error($"全局异常捕获:{ex.Message}", ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return order; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_TOTAL_DEPTH(double avg) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order = calGrade("TOTAL_DEPTH", avg * 100); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_TABLE(double min,double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("TABLE", min * 100); |
|
|
|
|
|
|
|
int order2 = calGrade("TABLE", max * 100); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_CROWN_ANGLE(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("CROWN_ANGLE", min); |
|
|
|
|
|
|
|
int order2 = calGrade("CROWN_ANGLE", max); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_CROWN_HEIGHT(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_GIRDLE(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("GIRDLE", min * 100); |
|
|
|
|
|
|
|
int order2 = calGrade("GIRDLE", max * 100); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_PAV_ANGLE(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("PAV_ANGLE", min); |
|
|
|
|
|
|
|
int order2 = calGrade("PAV_ANGLE", max); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_PAV_DEPTH(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_CULET(double avg) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order = calGrade("CULET", avg * 100); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_STAR(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("STAR", min * 100); |
|
|
|
|
|
|
|
int order2 = calGrade("STAR", max * 100); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calGrade_LOWER_HALVES_RATIO(double min, double max) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string result = ""; |
|
|
|
|
|
|
|
int order1 = calGrade("LOWER_HALVES_RATIO", min * 100); |
|
|
|
|
|
|
|
int order2 = calGrade("LOWER_HALVES_RATIO", max * 100); |
|
|
|
|
|
|
|
int order = Math.Max(order1, order2); |
|
|
|
|
|
|
|
result = GetGradeName(order); |
|
|
|
|
|
|
|
return result; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
#region 参数列表行编辑 |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private string calDev(string max,string min) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
decimal Max = 0; |
|
|
|
|
|
|
|
decimal Min = 0; |
|
|
|
|
|
|
|
decimal.TryParse(max, out Max); |
|
|
|
|
|
|
|
decimal.TryParse(min, out Min); |
|
|
|
|
|
|
|
return (Max-Min).ToString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private double calSymValue(double Min, double Max, double Avg,bool isPercentage = true) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int c = 1; |
|
|
|
|
|
|
|
if (isPercentage) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
c = 100; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return (Max - Min) * c; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getDIAMETER(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "DIAMETER"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("DIAMETER"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_D(result.Measurements.DIAMETER); |
|
|
|
|
|
|
|
info.Dev = result.Measurements.DIAMETER_DEV.ToString(DoubleDataFormatHelper.DigitsFormat); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_D(result.Measurements.M1); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_D(result.Measurements.M2); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.DIAMETER_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_D(data.DIAMETER_DETAIL.DIAMETER_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym("DIAMETER", calSymValue(data.M1, data.M2, data.DIAMETER,false)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getTOTAL_DEPTH(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "TOTAL_DEPTH"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("TOTAL_DEPTH"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.TOTAL_DEPTH*100,Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_TOTAL_DEPTH(result.Measurements.TOTAL_DEPTH); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getTABLE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "TABLE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("TABLE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.TABLE*100, Accuracy.IntegerFloor); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.TABLE_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.TABLE_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_TABLE(result.Measurements.TABLE_MIN, result.Measurements.TABLE_MAX); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.TABLE_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.TABLE_DETAIL.TABLE_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.TABLE_DETAIL.TABLE_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.TABLE_DETAIL.TABLE_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.TABLE_DETAIL.TABLE_4); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getCROWN_ANGLE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "CROWN_ANGLE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("CROWN_ANGLE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.CROWN_ANGLE, Accuracy.DecimalTwoStepRounding); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.CROWN_ANGLE_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.CROWN_ANGLE_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.CROWN_ANGLE_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_CROWN_ANGLE(result.Measurements.CROWN_ANGLE_MIN, result.Measurements.CROWN_ANGLE_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.CROWN_ANGLE_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_A(data.CROWN_ANGLE_DETAIL.CROWN_ANGLE_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.CROWN_ANGLE_MIN, data.CROWN_ANGLE_MAX, data.CROWN_ANGLE,false)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getCROWN_HEIGHT(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "CROWN_HEIGHT"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("CROWN_HEIGHT"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.CROWN_HEIGHT * 100, Accuracy.HalfStepRounding); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.CROWN_H_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.CROWN_H_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.CROWN_H_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_CROWN_HEIGHT(result.Measurements.CROWN_H_MIN, result.Measurements.CROWN_H_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.CROWN_HEIGHT_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.CROWN_HEIGHT_DETAIL.CROWN_HEIGHT_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.CROWN_H_MIN, data.CROWN_H_MAX, data.CROWN_HEIGHT)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getGIRDLE_BEZEL(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "GIRDLE_BEZEL"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("GIRDLE_BEZEL"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.GIRDLE_BEZEL * 100, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_BEZEL_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_BEZEL_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_BEZEL_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.GIRDLE_BEZEL_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BEZEL_DETAIL.GIRDLE_BEZEL_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.GIRDLE_BEZEL_MIN, data.GIRDLE_BEZEL_MAX, data.GIRDLE_BEZEL)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getGIRDLE_BONE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "GIRDLE_BONE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("GIRDLE_BONE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.GIRDLE_BONE * 100, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_BONE_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_BONE_MAX); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.GIRDLE_BONE_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.GIRDLE_BONE_DETAIL.GIRDLE_BONE_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getGIRDLE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "GIRDLE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("GIRDLE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.GIRDLE_VALLEY * 100, Accuracy.HalfStepRounding); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_VALLEY_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_VALLEY_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.GIRDLE_VALLEY_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_GIRDLE(result.Measurements.GIRDLE, result.Measurements.GIRDLE); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
var girdleValleyDetail = data.GIRDLE_VALLEY_DETAIL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (girdleValleyDetail != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
List<double> doubles = new List<double>(); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_1); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_2); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_3); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_4); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_5); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_6); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_7); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_8); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_9); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_10); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_11); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_12); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_13); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_14); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_15); |
|
|
|
|
|
|
|
doubles.Add(girdleValleyDetail.GIRDLE_VALLEY_16); |
|
|
|
|
|
|
|
doubles.Sort(); |
|
|
|
|
|
|
|
info.Dtl1= DoubleDataFormatHelper.FormatDouble_P2(doubles[0]); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P2(doubles[1]); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P2(doubles[2]); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P2(doubles[3]); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P2(doubles[12]); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P2(doubles[13]); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P2(doubles[14]); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P2(doubles[15]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.GIRDLE_VALLEY_MIN, data.GIRDLE_VALLEY_MAX, data.GIRDLE_VALLEY)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getPAV_ANGLE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "PAV_ANGLE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("PAV_ANGLE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.PAV_ANGLE, Accuracy.DecimalTwoStepRounding); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.PAV_ANGLE_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.PAV_ANGLE_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.PAV_ANGLE_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_PAV_ANGLE(result.Measurements.PAV_ANGLE_MIN, result.Measurements.PAV_ANGLE_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.PAV_ANGLE_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_A(data.PAV_ANGLE_DETAIL.PAV_ANGLE_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.PAV_ANGLE_MIN, data.PAV_ANGLE_MAX, data.PAV_ANGLE, false)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getPAV_DEPTH(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "PAV_DEPTH"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("PAV_DEPTH"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.PAV_DEPTH*100, Accuracy.HalfStepRounding); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.PAV_DEPTH_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.PAV_DEPTH_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.PAV_DEPTH_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_PAV_DEPTH(result.Measurements.PAV_DEPTH_MIN, result.Measurements.PAV_DEPTH_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.PAV_DEPTH_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.PAV_DEPTH_DETAIL.PAV_DEPTH_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.PAV_DEPTH_MIN, data.PAV_DEPTH_MAX, data.PAV_DEPTH)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getSTAR(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "STAR"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("STAR"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.STAR*100, Accuracy.MultipleOfFive); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.STAR_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.STAR_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_STAR(result.Measurements.STAR_MIN, result.Measurements.STAR_MAX); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.STAR_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.STAR_DETAIL.STAR_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getLOWER_HALVES_RATIO(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "LOWER_HALVES_RATIO"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("LOWER_HALVES_RATIO"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.LOWER_HALVES_RATIO*100, Accuracy.MultipleOfFive); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.LOWER_HALVES_RATIO_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_P(result.Measurements.LOWER_HALVES_RATIO_MAX); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_LOWER_HALVES_RATIO(result.Measurements.LOWER_HALVES_RATIO_MIN, result.Measurements.LOWER_HALVES_RATIO_MAX); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.LOWER_HALVES_RATIO_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_P(data.LOWER_HALVES_RATIO_DETAIL.LOWER_HALVES_RATIO_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getCULET(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "CULET"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("CULET"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.CULET * 100, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
info.CutLevel = calGrade_CULET(result.Measurements.CULET); |
|
|
|
|
|
|
|
info.isEnabled = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getTOC(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "TOC"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("TOC"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.TOC * 100, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, data.TOC * 100); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getCOC(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "COC"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("COC"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.COC*100, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, data.COC * 100); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getTWIST(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "TWIST"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("TWIST"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.TWIST, Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
info.Dev = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.TWIST_DEV); |
|
|
|
|
|
|
|
info.Min = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.TWIST_MIN); |
|
|
|
|
|
|
|
info.Max = DoubleDataFormatHelper.FormatDouble_A(result.Measurements.TWIST_MAX); |
|
|
|
|
|
|
|
info.Dev = calDev(info.Max, info.Min); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
if (data.TWIST_DETAIL != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
info.Dtl1 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_1); |
|
|
|
|
|
|
|
info.Dtl2 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_2); |
|
|
|
|
|
|
|
info.Dtl3 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_3); |
|
|
|
|
|
|
|
info.Dtl4 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_4); |
|
|
|
|
|
|
|
info.Dtl5 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_5); |
|
|
|
|
|
|
|
info.Dtl6 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_6); |
|
|
|
|
|
|
|
info.Dtl7 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_7); |
|
|
|
|
|
|
|
info.Dtl8 = DoubleDataFormatHelper.FormatDouble_A(data.TWIST_DETAIL.TWIST_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, calSymValue(data.TWIST_MIN, data.TWIST_MAX, data.TWIST)); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private DataInfo getCULET_TO_TABLE(AlgorithmResultEntity result) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DataInfo info = new DataInfo(); |
|
|
|
|
|
|
|
info.TestItemId = "CULET_TO_TABLE"; |
|
|
|
|
|
|
|
info.TestItemName = GetName("CULET_TO_TABLE"); |
|
|
|
|
|
|
|
info.Avg = DoubleDataFormatHelper.FormatDouble_Avg(result.Measurements.CULET_TO_TABLE*100,Accuracy.ForceOneDecimal); |
|
|
|
|
|
|
|
var data = result.Measurements; |
|
|
|
|
|
|
|
info.SymLevel = calGradeSym(info.TestItemId, data.CULET_TO_TABLE * 100); |
|
|
|
|
|
|
|
return info; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
[Log] |
|
|
|
[Log] |
|
|
|
private double CalWight(AlgorithmResultEntity result) |
|
|
|
private double CalWight(AlgorithmResultEntity result) |
|
|
|
@ -1183,11 +481,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
return wight; |
|
|
|
return wight; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
[Log] |
|
|
|
|
|
|
|
private double Square(double m) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return m*m; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
[Log] |
|
|
|
[Log] |
|
|
|
private void AutoSave() |
|
|
|
private void AutoSave() |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -1546,7 +840,7 @@ public class GradingResultVM : BaseViewModel |
|
|
|
sysmlevel = GetGradeEnName(GetGradeOrder(SymLevelTotal ?? "")); |
|
|
|
sysmlevel = GetGradeEnName(GetGradeOrder(SymLevelTotal ?? "")); |
|
|
|
} |
|
|
|
} |
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{sysmlevel}"); |
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{sysmlevel}"); |
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{GetGradeEnName(GetGradeOrder(CutLevelTotal))}"); |
|
|
|
dataRow.CreateCell(col++).SetCellValue($"{GetGradeEnNameByAName(CutLevelTotal)}"); |
|
|
|
|
|
|
|
|
|
|
|
// 保存Excel文件 |
|
|
|
// 保存Excel文件 |
|
|
|
using (FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write)) |
|
|
|
using (FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write)) |
|
|
|
@ -1745,6 +1039,14 @@ public class GradingResultVM : BaseViewModel |
|
|
|
// return dictionary[order]; |
|
|
|
// return dictionary[order]; |
|
|
|
return name; |
|
|
|
return name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string GetGradeEnNameByAName(string order) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var data = ViewDataInfoHelper.levelCalculator.GradeLevelCutSets.FirstOrDefault(x => x.AName.Equals(order)); |
|
|
|
|
|
|
|
if(data==null) data = ViewDataInfoHelper.levelCalculator.GradeLevelCutSets.FirstOrDefault(x => x.Name.Equals(order)); |
|
|
|
|
|
|
|
return data==null?string.Empty:data.EName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -2291,7 +1593,3 @@ public class GradingResultVM : BaseViewModel |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|