页面调整

This commit is contained in:
2026-04-27 17:41:15 +08:00
parent c5920022e8
commit 616d631e42
3 changed files with 12 additions and 12 deletions

View File

@@ -35,7 +35,7 @@ namespace 头罩视野.Services
// 剔除异常值,用相邻数据插值
public static List<ushort> RemoveOutliers(List<ushort> data)
public static List<dynamic> RemoveOutliers(List<dynamic> data)
{
for (int i = 1; i < data.Count - 1; i++)
{
@@ -62,7 +62,7 @@ namespace 头罩视野.Services
/// <param name="standardArea">如140</param>
/// <returns>计算好的面积</returns>
///
public static double CalculateEyeArea(List<double[]> groupData)
public static double CalculateEyeArea(List<dynamic> groupData)
{
double[] avg = new double[lightNum];
for (int c = 0; c < lightNum; c++)
@@ -84,8 +84,8 @@ namespace 头罩视野.Services
/// 计算双目视野面积(左右眼同时可见)
/// </summary>
public static double CalcBinocularArea(
List<double[]> leftGroups,
List<double[]> rightGroups
List<dynamic> leftGroups,
List<dynamic> rightGroups
)
{
// 1. 左眼平均数据
@@ -160,7 +160,7 @@ namespace 头罩视野.Services
/// </summary>
/// <param name="eyeGroups">多组采样数据集合</param>
/// <returns>lightNum点通道平均值数组</returns>
public static double[] GetEyeAvgArray(List<double[]> eyeGroups)
public static double[] GetEyeAvgArray(List<dynamic> eyeGroups)
{
if (eyeGroups == null || eyeGroups.Count == 0)
return new double[lightNum]; // 无数据时返回全0数组

View File

@@ -30,8 +30,8 @@ namespace 头罩视野.Views
private CancellationTokenSource? _cts;
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
public List<dynamic> LeftEyeDataList { get; private set; }
public List<dynamic> RightEyeDataList { get; private set; }
//public List<dynamic> LeftEyeDataList { get; private set; }
//public List<dynamic> RightEyeDataList { get; private set; }
DispatcherTimer _timer;
DataChange c = new DataChange();

View File

@@ -31,8 +31,8 @@ namespace 头罩视野.Views
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
private System.Timers.Timer? _plcReadTimer;
// 表跟数据存储列表
public List<double> LeftEyeDataList = new List<double>();
public List<double> RightEyeDataList = new List<double>();
public List<dynamic> LeftEyeDataList = new List<dynamic>();
public List<dynamic> RightEyeDataList = new List<dynamic>();
// 配置和你PLC地址完全对应 左目
private const int LeftEyeStartAddress = 1362; // D1362
@@ -139,7 +139,7 @@ namespace 头罩视野.Views
byte slaveAddress,
ushort startAddress,
ushort count,
List<double> dataList,
List<dynamic> dataList,
DataGrid dataGrid)
{
if (_modbusMaster == null || !ModbusHelper.TcpClient.Connected)
@@ -173,7 +173,7 @@ namespace 头罩视野.Views
/// <summary>
/// 把PLC数据添加到动态表格
/// </summary>
private void AddPlcDataRow(ushort[] registers, List<ushort> dataList, DataGrid dg)
private void AddPlcDataRow(ushort[] registers, List<dynamic> dataList, DataGrid dg)
{
// 清空旧数据,防止重复
@@ -205,7 +205,7 @@ namespace 头罩视野.Views
}
//面积的计算方法
public void getAllData(List<double> leftEyeDataList, List<double> RightEyeDataList, double perAngle)
public void getAllData(List<dynamic> leftEyeDataList, List<dynamic> RightEyeDataList, double perAngle)
{