Commit ae1b83d2 authored by 潘栩锋's avatar 潘栩锋 🚴

1. 修改 property 的 {get;set;}

parent 4032422a
...@@ -9,6 +9,7 @@ using System.Text; ...@@ -9,6 +9,7 @@ using System.Text;
using System.ComponentModel; using System.ComponentModel;
using FLY.FeedbackRenZiJia.IService; using FLY.FeedbackRenZiJia.IService;
using FObjBase; using FObjBase;
using PropertyChanged;
namespace FLY.FeedbackRenZiJia.Server namespace FLY.FeedbackRenZiJia.Server
{ {
...@@ -25,424 +26,164 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -25,424 +26,164 @@ namespace FLY.FeedbackRenZiJia.Server
#region 参数 #region 参数
private List<int> heatEffectCurve = new List<int>(); [DoNotCheckEquality]
/// <summary> /// <summary>
/// 加热生效曲线,允许为空,则不生效 /// 加热生效曲线,允许为空,则不生效
/// </summary> /// </summary>
public List<int> HeatEffectCurve public List<int> HeatEffectCurve { get; set; } = new List<int>();
{
get{
return heatEffectCurve;
}
set {
heatEffectCurve = value;
NotifyPropertyChanged("HeatEffectCurve");
}
}
private int stablerange = 2;
/// <summary> /// <summary>
/// 厚度稳定范围 %, 偏差在范围内,都是稳定的 /// 厚度稳定范围 %, 偏差在范围内,都是稳定的
/// </summary> /// </summary>
public int StableRange public int StableRange { get; set; } = 2;
{
get { return stablerange; }
set {
if (stablerange != value)
{
stablerange = value;
NotifyPropertyChanged("StableRange");
}
}
}
private int stablerange0 = 2;
/// <summary> /// <summary>
/// 厚度稳定范围 %, 加热量变化为0时,偏差在范围内,都是稳定的 /// 厚度稳定范围 %, 加热量变化为0时,偏差在范围内,都是稳定的
/// </summary> /// </summary>
public int StableRange0 public int StableRange0 { get; set; } = 2;
{
get { return stablerange0; }
set
{
if (stablerange0 != value)
{
stablerange0 = value;
NotifyPropertyChanged("StableRange0");
}
}
}
private double thresholdR = 0.7;
/// <summary> /// <summary>
/// 对位模式, 加热与厚度相关性阀值, 相关性 >=0.7 /// 对位模式, 加热与厚度相关性阀值, 相关性 >=0.7
/// </summary> /// </summary>
public double ThresholdR public double ThresholdR { get; set; } = 0.7;
{
get { return thresholdR; }
set {
if (thresholdR != value)
{
thresholdR = value;
NotifyPropertyChanged("ThresholdR");
}
}
}
private int thresholdMaxMin = 8;
/// <summary> /// <summary>
/// 对位模式 厚度%差 的极差 >= +4%-4%=8%, 单位% /// 对位模式 厚度%差 的极差 >= +4%-4%=8%, 单位%
/// </summary> /// </summary>
public int ThresholdMaxMin public int ThresholdMaxMin { get; set; } = 8;
{
get { return thresholdMaxMin; }
set
{
if (thresholdMaxMin != value)
{
thresholdMaxMin = value;
NotifyPropertyChanged("ThresholdMaxMin");
}
}
}
private int thresholdSigmaMax = 20;
/// <summary> /// <summary>
/// % /// %
/// 最大sigma, 只有当前的sigma 在 最大sigma 与 最小 sigma 内,才能控制 /// 最大sigma, 只有当前的sigma 在 最大sigma 与 最小 sigma 内,才能控制
/// </summary> /// </summary>
public int ThresholdSigmaMax public int ThresholdSigmaMax { get; set; } = 20;
{
get { return thresholdSigmaMax; }
set
{
if (thresholdSigmaMax != value)
{
thresholdSigmaMax = value;
NotifyPropertyChanged("ThresholdSigmaMax");
}
}
}
private bool isUsedKp = false;
/// <summary> /// <summary>
/// 使用这里独立的Kp, 与 HeatCell 不一样 /// 使用这里独立的Kp, 与 HeatCell 不一样
/// </summary> /// </summary>
public bool IsUsedLocalKp public bool IsUsedLocalKp { get; set; } = false;
{
get { return isUsedKp; }
set {
if (isUsedKp != value)
{
isUsedKp = value;
NotifyPropertyChanged("IsUsedLocalKp");
}
}
}
private double localkp = 3;
/// <summary> /// <summary>
/// 本地Kp, 用于判断稳定性 /// 本地Kp, 用于判断稳定性
/// </summary> /// </summary>
public double LocalKp public double LocalKp { get; set; } = 3;
{
get { return localkp; }
set {
if (localkp != value)
{
localkp = value;
NotifyPropertyChanged("LocalKp");
}
}
}
#endregion #endregion
#region 状态 #region 状态
private TimeSpan delay = TimeSpan.FromSeconds(100);
/// <summary> /// <summary>
/// 总延时 =Delay+mRenZiJiaService.FilmLength/mRenZiJiaService.Velocity /// 总延时 =Delay+mRenZiJiaService.FilmLength/mRenZiJiaService.Velocity
/// </summary> /// </summary>
public TimeSpan Delay public TimeSpan Delay { get; set; } = TimeSpan.FromSeconds(100);
{
get { return delay; }
set
{
if (delay != value)
{
delay = value;
NotifyPropertyChanged("Delay");
}
}
}
#region 对位 #region 对位
private bool isIntoAutoONo = false;
/// <summary> /// <summary>
/// 进入了对位模式 /// 进入了对位模式
/// </summary> /// </summary>
public bool IsIntoAutoONo public bool IsIntoAutoONo { get; set; }
{
get { return isIntoAutoONo; }
set
{
if (isIntoAutoONo != value)
{
isIntoAutoONo = value;
NotifyPropertyChanged("IsIntoAutoONo");
}
}
}
private EAutoONoResult autoONoResult = EAutoONoResult.Idle;
/// <summary> /// <summary>
/// 对位模式结果 /// 对位模式结果
/// </summary> /// </summary>
public EAutoONoResult AutoONoResult public EAutoONoResult AutoONoResult { get; set; } = EAutoONoResult.Idle;
{
get { return autoONoResult; }
set {
if (autoONoResult != value)
{
autoONoResult = value;
NotifyPropertyChanged("AutoONoResult");
}
}
}
private int bestOrgBoltNo = -1;
/// <summary> /// <summary>
/// 计算的最佳复位区号 /// 计算的最佳复位区号
/// </summary> /// </summary>
public int BestOrgBoltNo public int BestOrgBoltNo { get; set; } = -1;
{
get { return bestOrgBoltNo; }
set {
if (bestOrgBoltNo != value)
{
bestOrgBoltNo = value;
NotifyPropertyChanged("BestOrgBoltNo");
}
}
}
private double bestkp = -1;
/// <summary> /// <summary>
/// 计算的最佳复位区号 对应的 加热/厚度 /// 计算的最佳复位区号 对应的 加热/厚度
/// </summary> /// </summary>
public double BestKp public double BestKp { get; set; } = -1;
{
get { return bestkp; }
set
{
if (bestkp != value)
{
bestkp = value;
NotifyPropertyChanged("BestKp");
}
}
}
private double maxR = -1;
/// <summary> /// <summary>
/// 计算的最佳复位区号 对应的 加热与厚度相关性 /// 计算的最佳复位区号 对应的 加热与厚度相关性
/// </summary> /// </summary>
public double MaxR public double MaxR { get; set; } = -1;
{
get { return maxR; }
set
{
if (maxR != value)
{
maxR = value;
NotifyPropertyChanged("MaxR");
}
}
}
private double maxmin = -1;
/// <summary> /// <summary>
/// 计算的最佳复位区号 对应的 厚度%变化极差 单位% /// 计算的最佳复位区号 对应的 厚度%变化极差 单位%
/// </summary> /// </summary>
public double MaxMin public double MaxMin { get; set; } = -1;
{
get { return maxmin; }
set {
if (maxmin != value)
{
maxmin = value;
NotifyPropertyChanged("MaxMin");
}
}
}
#endregion #endregion
#region 稳定性 #region 稳定性
private STABILITY stability = STABILITY.IDLE;
/// <summary> /// <summary>
/// 当前检测出来的厚度数据 稳定状态 /// 当前检测出来的厚度数据 稳定状态
/// </summary> /// </summary>
public STABILITY Stability public STABILITY Stability { get; protected set; } = STABILITY.IDLE;
{
get { return stability; }
protected set {
if (stability != value)
{
stability = value;
NotifyPropertyChanged("Stability");
}
}
}
private double currR = -1;
/// <summary> /// <summary>
/// 当前检测出来的厚度数据 的稳定性 /// 当前检测出来的厚度数据 的稳定性
/// </summary> /// </summary>
public double CurrR public double CurrR { get; set; } = -1;
{
get { return currR; }
set {
if (currR != value)
{
currR = value;
NotifyPropertyChanged("CurrR");
}
}
}
private double curr2Sigma = -1;
/// <summary> /// <summary>
/// 当前检测出来的厚度数据 2Sigma /// 当前检测出来的厚度数据 2Sigma
/// </summary> /// </summary>
public double Curr2Sigma public double Curr2Sigma { get; set; } = -1;
{
get
{
return curr2Sigma;
}
set {
if (curr2Sigma != value)
{
curr2Sigma = value;
NotifyPropertyChanged("Curr2Sigma");
}
}
}
private double currBreakUp = 50;
/// <summary> /// <summary>
/// 当前打散程度。 /// 当前打散程度。
/// 连续N点都在平均值同一侧为一个块; /// 连续N点都在平均值同一侧为一个块;
/// 这些块的长度平均值/总长度, 为打散度; /// 这些块的长度平均值/总长度, 为打散度;
/// 打散度越小越好, 最小为 1/NBolts /// 打散度越小越好, 最小为 1/NBolts
/// </summary> /// </summary>
public double CurrBreakUp public double CurrBreakUp { get; protected set; } = 50;
{
get
{
return currBreakUp;
}
protected set
{
if (currBreakUp != value)
{
currBreakUp = value;
NotifyPropertyChanged("CurrBreakUp");
}
}
}
DateTime currtime = DateTime.MinValue;
/// <summary> /// <summary>
/// 当前检测出来的厚度数据,时间 /// 当前检测出来的厚度数据,时间
/// </summary> /// </summary>
public DateTime CurrTime public DateTime CurrTime { get; set; } = DateTime.MinValue;
{
get
{
return currtime;
}
set
{
if (currtime != value)
{
currtime = value;
NotifyPropertyChanged("CurrTime");
}
}
}
private Misc.DIRECTION currDirection = Misc.DIRECTION.FORWARD;
/// <summary> /// <summary>
/// 当前检测出来的厚度数据,方向 /// 当前检测出来的厚度数据,方向
/// </summary> /// </summary>
public Misc.DIRECTION CurrDirection public Misc.DIRECTION CurrDirection { get; protected set; } = Misc.DIRECTION.FORWARD;
{
get { return currDirection; }
protected set
{
if (currDirection != value)
{
currDirection = value;
NotifyPropertyChanged("CurrDirection ");
}
}
}
#endregion #endregion
#region 列表 #region 列表
private int lastbm = 0;
/// <summary> /// <summary>
/// 列表最后1个BM /// 列表最后1个BM
/// </summary> /// </summary>
public int LastBM public int LastBM { get; protected set; }
{
get { return lastbm; }
protected set
{
if (lastbm != value)
{
lastbm = value;
NotifyPropertyChanged("LastBM");
}
}
}
private int firstbm = 0;
/// <summary> /// <summary>
/// 列表第1个BM /// 列表第1个BM
/// </summary> /// </summary>
public int FirstBM public int FirstBM { get; protected set; }
{
get { return firstbm; }
protected set
{
if (firstbm != value)
{
firstbm = value;
NotifyPropertyChanged("FirstBM");
}
}
}
#endregion #endregion
#region 每个分区状态 #region 每个分区状态
private bool[] boltIsStable;
public bool[] BoltIsStable [DoNotCheckEquality]
{ public bool[] BoltIsStable { get; set; }
get { return boltIsStable; }
set {
boltIsStable = value;
NotifyPropertyChanged("BoltIsStable");
}
}
#endregion #endregion
#endregion #endregion
...@@ -450,22 +191,11 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -450,22 +191,11 @@ namespace FLY.FeedbackRenZiJia.Server
#endregion #endregion
private double kp = 3;
/// <summary> /// <summary>
/// HeatCell 的 Kp /// HeatCell 的 Kp
/// </summary> /// </summary>
public double Kp public double Kp { get; set; } = 3;
{
get { return kp; }
set
{
if (kp != value)
{
kp = value;
NotifyPropertyChanged("Kp");
}
}
}
/// <summary> /// <summary>
/// 厚度数量 /// 厚度数量
......
...@@ -7,6 +7,7 @@ using System.Collections.ObjectModel; ...@@ -7,6 +7,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using FLY.FeedbackRenZiJia.Common; using FLY.FeedbackRenZiJia.Common;
using FLY.FeedbackRenZiJia.IService; using FLY.FeedbackRenZiJia.IService;
using PropertyChanged;
namespace FLY.FeedbackRenZiJia.Server namespace FLY.FeedbackRenZiJia.Server
{ {
...@@ -62,77 +63,41 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -62,77 +63,41 @@ namespace FLY.FeedbackRenZiJia.Server
#endregion #endregion
#region 状态 #region 状态
int[] thickpercents;
/// <summary> /// <summary>
/// 对应的100% 数据,单位是% 数量是BoltCnt, 数据肯定是完整的!!!!! /// 对应的100% 数据,单位是% 数量是BoltCnt, 数据肯定是完整的!!!!!
/// </summary> /// </summary>
public int[] ThickPercents [DoNotCheckEquality]
{ public int[] ThickPercents { get; set; }
get
{
return thickpercents;
}
set
{
thickpercents = value;
NotifyPropertyChanged("ThickPercents");
}
}
int[] heats;
/// <summary> /// <summary>
/// 当前方向的加热策略,必须保证 0~100 /// 当前方向的加热策略,必须保证 0~100
/// </summary> /// </summary>
public int[] Heats [DoNotCheckEquality]
{ public int[] Heats { get; protected set; }
get
{
return heats;
}
protected set
{
heats = value;
NotifyPropertyChanged("Heats");
}
}
private int Base { get; set; } = 0; private int Base { get; set; } = 0;
int[] offsets;
/// <summary> /// <summary>
/// 加热偏移量 /// 加热偏移量
/// </summary> /// </summary>
public int[] Offsets [DoNotCheckEquality]
{ public int[] Offsets { get; protected set; }
get
{
return offsets;
}
protected set
{
offsets = value;
NotifyPropertyChanged("Offsets");
}
}
int[] preheats;
/// <summary> /// <summary>
/// Heats+Offsets+Base /// Heats+Offsets+Base
/// </summary> /// </summary>
public int[] PreHeats [DoNotCheckEquality]
{ public int[] PreHeats { get; protected set; }
get
{
return preheats;
}
protected set
{
preheats = value;
NotifyPropertyChanged("PreHeats");
}
}
/// <summary> /// <summary>
/// 加热量 每3个计算的sigma,最大值 /// 加热量 每3个计算的sigma,最大值
......
...@@ -26,18 +26,8 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -26,18 +26,8 @@ namespace FLY.FeedbackRenZiJia.Server
public int[] Heats;//加热 public int[] Heats;//加热
} }
DateTime last = DateTime.MinValue;
public DateTime Last public DateTime Last { get; set; } = DateTime.MinValue;
{
get { return last; }
set {
if (last != value)
{
last = value;
NotifyPropertyChanged("Last");
}
}
}
/// <summary> /// <summary>
...@@ -120,13 +110,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -120,13 +110,7 @@ namespace FLY.FeedbackRenZiJia.Server
#region INotifyPropertyChanged 成员 #region INotifyPropertyChanged 成员
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyname));
}
}
#endregion #endregion
} }
} }
...@@ -6,6 +6,7 @@ using System.Collections.ObjectModel; ...@@ -6,6 +6,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using FLY.FeedbackRenZiJia.IService; using FLY.FeedbackRenZiJia.IService;
using FLY.FeedbackRenZiJia.Common; using FLY.FeedbackRenZiJia.Common;
using PropertyChanged;
namespace FLY.FeedbackRenZiJia.Server namespace FLY.FeedbackRenZiJia.Server
{ {
...@@ -75,6 +76,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -75,6 +76,7 @@ namespace FLY.FeedbackRenZiJia.Server
/// <summary> /// <summary>
/// 坏的加热棒 /// 坏的加热棒
/// </summary> /// </summary>
[DoNotCheckEquality]
public bool[] Bads { get; set; } public bool[] Bads { get; set; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment