liteon/Model/StationDataModel.cs
2025-07-12 14:05:35 +08:00

143 lines
3.4 KiB
C#

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; }
/// <summary>
/// 机种ID
/// </summary>
public int MachineID { get; set; }
/// <summary>
/// 站别ID
/// </summary>
public int StattionID { get; set; }
/// <summary>
/// 站别名称
/// </summary>
public string StationName { get; set; }
private int productionQuantity;
/// <summary>
/// 生产数量
/// </summary>
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;
/// <summary>
/// 不良数
/// </summary>
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;
/// <summary>
/// 良率
/// </summary>
public decimal Yield
{
get { return yield; }
set
{
yield = value;
this.RaisePropertyChanged("Yield");
}
}
private int probeFrequency;
/// <summary>
/// 探针次数
/// </summary>
public int ProbeFrequency
{
get { return probeFrequency; }
set
{
probeFrequency = value;
this.RaisePropertyChanged("ProbeFrequency");
}
}
private int fingerprintFrequency;
/// <summary>
/// 指纹次数
/// </summary>
public int FingerprintFrequency
{
get { return fingerprintFrequency; }
set
{
fingerprintFrequency = value;
this.RaisePropertyChanged("FingerprintFrequency");
}
}
/// <summary>
/// 清空当前站别的生产数据
/// </summary>
public DelegateCommand WipeDataCommand { get; set; }
public StationDataModel()
{
WipeDataCommand = new DelegateCommand();
WipeDataCommand.ExecuteAction = new Action<object>(WipeData);
}
/// <summary>
/// 清空当前站别的生产数据
/// </summary>
/// <param name="obj"></param>
public void WipeData(object obj)
{
this.ProductionQuantity = 0;
this.Bads = 0;
this.Yield = 0;
}
}
}