refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Aitex.Core.UI.ControlDataContext;
namespace SicModules.PMs.RecipeExecutions
{
public class RecipeEndDataItem
{
public RecipeEndDataItem(string name, List<HistoryDataItem> historyDataItem)
{
Name = name;
HistoryDataItem = historyDataItem;
}
public List<HistoryDataItem> HistoryDataItem { get; set; }
public string Name { get; }
public string Max
{
get { return HistoryDataItem.Count > 0 ? HistoryDataItem.Max(item => item.value).ToString("F2") : "0"; }
}
public string Min
{
get { return HistoryDataItem.Count > 0 ? HistoryDataItem.Min(item => item.value).ToString("F2") : "0"; }
}
public string Mean
{
get { return HistoryDataItem.Count > 0 ? HistoryDataItem.Average(item => item.value).ToString("F2") : "0"; }
}
/// <summary>
/// 样本标准差
/// </summary>
public string StdDev
{
get
{
if (HistoryDataItem.Count == 0)
return "0";
double avg = HistoryDataItem.Average(item => item.value); // 计算平均数
double sum = HistoryDataItem.Sum(item => Math.Pow(item.value - avg, 2)); // 计算各数值与平均数的差值的平方,然后求和
double stdDev = Math.Sqrt(sum / (HistoryDataItem.Count - 1)); // 除以数量减1,然后开方
return stdDev.ToString("F2");
}
}
}
}