using System; using System.Collections.Generic; using System.Linq; using System.Text; using Misc; using System.Collections.Specialized; using System.ComponentModel; using System.Collections.ObjectModel; namespace FLY.Thick.Base.Common { /// /// 动态数据,推送当前所有状态 /// public class DynArea : INotifyPropertyChanged { public DynArea() { this.PropertyChanged += new PropertyChangedEventHandler(DynArea_PropertyChanged); } void DynArea_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "Hrs") { if (Hrs == 0) { SecuteLock = true; } else { SecuteLock = false; } } } #region BASE /// /// x100 /// public int Thick { get; set; } = 3210; /// /// 编码器1 位置 脉冲 /// public int Position { get; set; } /// /// 分区序号 /// public int BoltIndex { get; set; } /// /// 分区号 /// public int BoltNo { get { return BoltIndex + FirstBoltNo; } } /// /// AD值 /// public int AD { get; set; } = 12345; /// /// 最大AD值 /// public int ADMax { get; set; } = 65535; #endregion #region POSITION2 /// /// 编码器2 位置 脉冲 /// public int Position2 { get; set; } #endregion #region 扫描 /// /// 最新样品AD /// [PropertyChanged.DoNotCheckEquality] public int[] SampleAD { get; set; } /// /// 数据是否有效, 当膜没有动时,为无效。 通过PLC获取,或编码器判断 /// public bool DataValid { get; set; } /// /// 扫描方向 /// public Misc.DIRECTION Direction { get; set; } = DIRECTION.FIX; /// /// 膜宽 mm /// public double Width { get; set; } = 600; /// /// 生产速度 m/min /// public double FilmVelocity { get; set; } /// /// 膜生产位置 m /// public double FilmPosition { get; set; } /// /// 测厚仪速度 m/min /// public double Velocity { get; set; } #endregion #region 运行状态 /// /// 运行状态 /// public CTRL_STATE ControllerState { get; set; } /// /// /// public int AutoScanCounter { get; set; } = 5; #endregion #region IO public UInt16 IStatus { get; set; } = 0xffff; public UInt16 OStatus { get; set; } = 0xffff; #endregion #region 系统 /// /// 系统剩余小时数 /// public int Hrs { get; set; } = 3; /// /// FLYAD 连接状态 /// public bool FLYADIsConnect { get; set; } /// /// 过期, 锁ing /// public bool SecuteLock { get; set; } /// /// 服务器连接断开 /// public bool ServerIsConnected { get; set; } #endregion #region PROFILE 运行参数 /// /// 产品名称 /// public string ProductName { get; set; } = "default"; /// /// 目标值 x100 /// public int Target { get; set; } = 3000; /// /// 报警值 x100 /// public int Alarm { get; set; } = 100; /// /// Y轴范围 /// public int YRange { get { return Alarm * 3; } } /// /// 斜率补偿 /// public double Comp { get; set; } = 1; /// /// 平移补偿 /// public int Shift { get; set; } = 0; /// /// 数据开始分区号 /// public int DataBoltNoBegin { get; set; } = 0; /// /// 数据结束分区号 /// public int DataBoltNoEnd { get; set; } = 30; /// /// 扫描范围 开始 /// public int ScanBoltNoBegin { get; set; } = 0; /// /// 扫描范围 结束 /// public int ScanBoltNoEnd { get; set; } = 30; #endregion #region BOLTMAP 分区信息 /// /// 总分区数 /// public int NBolts { get; set; } = 50; /// /// 开始分区号 /// public int FirstBoltNo { get; set; } #endregion #region INotifyPropertyChanged 成员 public event PropertyChangedEventHandler PropertyChanged; #endregion } }