using Community; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Model { public class StationDataModel : NotificationObject { public int ID { get; set; } /// /// 机种ID /// public int MachineID { get; set; } /// /// 站别ID /// public int StattionID { get; set; } /// /// 站别名称 /// public string StationName { get; set; } private int productionQuantity; /// /// 生产数量 /// public int ProductionQuantity { get { return productionQuantity; } set { productionQuantity = value; try { Yield = 1 - Math.Round(((decimal)Bads / value), 4); } catch { } ProbeFrequency = value; FingerprintFrequency = value; this.RaisePropertyChanged("ProductionQuantity"); } } private int bads; /// /// 不良数 /// public int Bads { get { return bads; } set { bads = value; try { Yield = 1 - Math.Round(((decimal)value / ProductionQuantity), 4); } catch { } this.RaisePropertyChanged("Bads"); } } private decimal yield; /// /// 良率 /// public decimal Yield { get { return yield; } set { yield = value; this.RaisePropertyChanged("Yield"); } } private int probeFrequency; /// /// 探针次数 /// public int ProbeFrequency { get { return probeFrequency; } set { probeFrequency = value; this.RaisePropertyChanged("ProbeFrequency"); } } private int fingerprintFrequency; /// /// 指纹次数 /// public int FingerprintFrequency { get { return fingerprintFrequency; } set { fingerprintFrequency = value; this.RaisePropertyChanged("FingerprintFrequency"); } } /// /// 清空当前站别的生产数据 /// public DelegateCommand WipeDataCommand { get; set; } public StationDataModel() { WipeDataCommand = new DelegateCommand(); WipeDataCommand.ExecuteAction = new Action(WipeData); } /// /// 清空当前站别的生产数据 /// /// public void WipeData(object obj) { this.ProductionQuantity = 0; this.Bads = 0; this.Yield = 0; } } }