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

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

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