页面调整
This commit is contained in:
@@ -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++)
|
for (int i = 1; i < data.Count - 1; i++)
|
||||||
{
|
{
|
||||||
@@ -62,7 +62,7 @@ namespace 头罩视野.Services
|
|||||||
/// <param name="standardArea">(如140)</param>
|
/// <param name="standardArea">(如140)</param>
|
||||||
/// <returns>计算好的面积</returns>
|
/// <returns>计算好的面积</returns>
|
||||||
///
|
///
|
||||||
public static double CalculateEyeArea(List<double[]> groupData)
|
public static double CalculateEyeArea(List<dynamic> groupData)
|
||||||
{
|
{
|
||||||
double[] avg = new double[lightNum];
|
double[] avg = new double[lightNum];
|
||||||
for (int c = 0; c < lightNum; c++)
|
for (int c = 0; c < lightNum; c++)
|
||||||
@@ -84,8 +84,8 @@ namespace 头罩视野.Services
|
|||||||
/// 计算双目视野面积(左右眼同时可见)
|
/// 计算双目视野面积(左右眼同时可见)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static double CalcBinocularArea(
|
public static double CalcBinocularArea(
|
||||||
List<double[]> leftGroups,
|
List<dynamic> leftGroups,
|
||||||
List<double[]> rightGroups
|
List<dynamic> rightGroups
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// 1. 左眼平均数据
|
// 1. 左眼平均数据
|
||||||
@@ -160,7 +160,7 @@ namespace 头罩视野.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="eyeGroups">多组采样数据集合</param>
|
/// <param name="eyeGroups">多组采样数据集合</param>
|
||||||
/// <returns>lightNum点通道平均值数组</returns>
|
/// <returns>lightNum点通道平均值数组</returns>
|
||||||
public static double[] GetEyeAvgArray(List<double[]> eyeGroups)
|
public static double[] GetEyeAvgArray(List<dynamic> eyeGroups)
|
||||||
{
|
{
|
||||||
if (eyeGroups == null || eyeGroups.Count == 0)
|
if (eyeGroups == null || eyeGroups.Count == 0)
|
||||||
return new double[lightNum]; // 无数据时返回全0数组
|
return new double[lightNum]; // 无数据时返回全0数组
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ namespace 头罩视野.Views
|
|||||||
private CancellationTokenSource? _cts;
|
private CancellationTokenSource? _cts;
|
||||||
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
|
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
|
||||||
|
|
||||||
public List<dynamic> LeftEyeDataList { get; private set; }
|
//public List<dynamic> LeftEyeDataList { get; private set; }
|
||||||
public List<dynamic> RightEyeDataList { get; private set; }
|
//public List<dynamic> RightEyeDataList { get; private set; }
|
||||||
|
|
||||||
DispatcherTimer _timer;
|
DispatcherTimer _timer;
|
||||||
DataChange c = new DataChange();
|
DataChange c = new DataChange();
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ namespace 头罩视野.Views
|
|||||||
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
|
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
|
||||||
private System.Timers.Timer? _plcReadTimer;
|
private System.Timers.Timer? _plcReadTimer;
|
||||||
// 表跟数据存储列表
|
// 表跟数据存储列表
|
||||||
public List<double> LeftEyeDataList = new List<double>();
|
public List<dynamic> LeftEyeDataList = new List<dynamic>();
|
||||||
public List<double> RightEyeDataList = new List<double>();
|
public List<dynamic> RightEyeDataList = new List<dynamic>();
|
||||||
|
|
||||||
// 配置:和你PLC地址完全对应 左目
|
// 配置:和你PLC地址完全对应 左目
|
||||||
private const int LeftEyeStartAddress = 1362; // D1362
|
private const int LeftEyeStartAddress = 1362; // D1362
|
||||||
@@ -139,7 +139,7 @@ namespace 头罩视野.Views
|
|||||||
byte slaveAddress,
|
byte slaveAddress,
|
||||||
ushort startAddress,
|
ushort startAddress,
|
||||||
ushort count,
|
ushort count,
|
||||||
List<double> dataList,
|
List<dynamic> dataList,
|
||||||
DataGrid dataGrid)
|
DataGrid dataGrid)
|
||||||
{
|
{
|
||||||
if (_modbusMaster == null || !ModbusHelper.TcpClient.Connected)
|
if (_modbusMaster == null || !ModbusHelper.TcpClient.Connected)
|
||||||
@@ -173,7 +173,7 @@ namespace 头罩视野.Views
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 把PLC数据添加到动态表格
|
/// 把PLC数据添加到动态表格
|
||||||
/// </summary>
|
/// </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)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user