You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.3 KiB
34 lines
1.3 KiB
using BrilliantSightClient.Model.Entity.ApiEntity; |
|
using BrilliantSightClient.Model.GradeLevel.Helper; |
|
using BrilliantSightClient.Model.GradeResult.Entity; |
|
using BrilliantSightClient.Model.GradeResult.Entity.Enums; |
|
using BrilliantSightClient.Model.Helper; |
|
using Newtonsoft.Json; |
|
using Newtonsoft.Json.Linq; |
|
|
|
namespace BrilliantSightClient.Model.GradeResult.Helper; |
|
|
|
/// <summary> |
|
/// 视图 DataInfo工具类 |
|
/// </summary> |
|
public class ViewDataInfoHelper |
|
{ |
|
public static List<DataInfo> GenerateDataInfos(AlgorithmResultEntity result) |
|
{ |
|
JToken measurements = JToken.Parse(JsonConvert.SerializeObject(result.Measurements)); |
|
List<DataInfo> dataInfos = new List<DataInfo>(); |
|
int shape = EntityHelper.GetValueFromName<DiamondShape>(result.Shape)??-1; |
|
if(shape == -1) throw new Exception("Unsupported shapes"); |
|
string viewDataSql = $"SELECT * FROM ViewData WHERE Shape = {shape} AND Specifications = '{result.PavType}-{result.CrownType}' AND RunMode = {Common.RunMode}"; |
|
List<ViewData> showViewData = DataBaseHelper.ExecuteQuery<ViewData>(viewDataSql); |
|
foreach (var viewData in showViewData) |
|
{ |
|
DataInfo dataInfo = new DataInfo(); |
|
|
|
} |
|
|
|
return dataInfos; |
|
} |
|
|
|
|
|
} |