Files
hoodFieldOfView/头罩视野slove/头罩视野/TestDataStore.cs
2026-05-13 14:14:14 +08:00

76 lines
2.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Text;
using static OfficeOpenXml.ExcelErrorValue;
namespace
{
public static class TestDataStore
{
// 单条测试数据
public class TestRecord
{
public int Id { get; set; }
public string Time { get; set; } = string.Empty;
public string Date { get; set; } = string.Empty;
public double LeftEyeArea { get; set; }
public double RightEyeArea { get; set; }
public double BinocularArea { get; set; }
//public double BlankArea { get; set; }
public double LowerVision { get; set; }
public double VisionRetentionRate { get; set; }
public double totalVisionArea { get; set; }
public double GetVisionRetentionRate { get; set; }
}
// 所有记录
public static List<TestRecord> Records { get; } = new List<TestRecord>();
private static int _nextId = 1;
public static void AddNewRecord(TestRecord record)
{
foreach (var r in Records)
{
// 5个字段都一样就认为是重复
if (Math.Abs(r.LeftEyeArea - record.LeftEyeArea) < 0.01 &&
Math.Abs(r.RightEyeArea - record.RightEyeArea) < 0.01 &&
Math.Abs(r.BinocularArea - record.BinocularArea) < 0.01 &&
Math.Abs(r.LowerVision - record.LowerVision) < 0.01 &&
Math.Abs(r.VisionRetentionRate - record.VisionRetentionRate) < 0.01)
{
// 找到重复直接return不添加
return;
}
}
record.Id = _nextId++;
Records.Add(record);
}
public static class GlobalData
{
// 要传的所有数据放这里
public static string CurrentMode{ get; set; } = "5";
public static string JudgmentalPerspective { get; set; } = "空白测试";
public static double LeftEyeArea { get; set; }
public static double RightEyeArea { get; set; }
public static double TotalEyeArea { get; set; }
public static double BinocularArea { get; set; }
public static double BlankArea { get; set; }
public static double LowerVision { get; set; }//下方视野角度
public static double VisionRetentionRate { get; set; }
public static double zsymjValue { get; set; }
public static double kbsmsyArea { get; set; }
//public static string LampValueLeft { get; set; } = "左眼开";
//public static string LampValueRight { get; set; } = "右眼开";
}
}
}