using Community;
using Model.MotionControl;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
///
/// 机种类
///
public class MachineModel : NotificationObject
{
///
/// ID
///
public int ID { get; set; }
private string machineName;
///
/// 机种名称
///
public string MachineName
{
get { return machineName; }
set
{
machineName = value;
this.RaisePropertyChanged("MachineName");
}
}
private DateTime addTime;
///
/// 添加时间
///
public DateTime AddTime
{
get { return addTime; }
set
{
addTime = value;
this.RaisePropertyChanged("AddTime");
}
}
private bool enableS;
///
/// 是否启用
///
public bool EnableS
{
get { return enableS; }
set
{
enableS = value;
this.RaisePropertyChanged("EnableS");
}
}
private long productionTime;
///
/// 此机种生产时间
///
public long ProductionTime
{
get { return productionTime; }
set
{
productionTime = value;
RunSpan = new TimeSpan(value);
}
}
private int quantitys;
///
/// 生产数量(投入数量)
///
public int Quantitys
{
get { return quantitys; }
set
{
quantitys = value;
try
{
RejectRatio = Math.Round(((decimal)Produce / value), 4);
}
catch
{
}
this.RaisePropertyChanged("Quantitys");
}
}
private int produce;
///
/// 产出数量
///
public int Produce
{
get { return produce; }
set
{
produce = value;
try
{
ProduceBads = Quantitys - value;
RejectRatio = Math.Round(((decimal)value / Quantitys), 4);
}
catch
{
}
this.RaisePropertyChanged("Produce");
}
}
private int produceBads;
///
/// 产出不良
///
public int ProduceBads
{
get { return produceBads; }
set
{
produceBads = value;
this.RaisePropertyChanged("ProduceBads");
}
}
private decimal rejectRatio;
///
/// 良率
///
public decimal RejectRatio
{
get { return rejectRatio; }
set
{
rejectRatio = value;
this.RaisePropertyChanged("RejectRatio");
}
}
///
/// 此机种生产的时间间隔
///
public TimeSpan RunSpan { get; set; }
private int capacity;
///
/// 产能
///
public int Capacity
{
get { return capacity; }
set
{
capacity = value;
this.RaisePropertyChanged("Capacity");
}
}
private int coloumsNumber;
///
/// 料盘列数
///
public int ColoumsNumber
{
get { return coloumsNumber; }
set
{
coloumsNumber = value;
this.RaisePropertyChanged("ColoumsNumber");
}
}
private int rowsNumber;
///
/// 料盘行数
///
public int RowsNumber
{
get { return rowsNumber; }
set
{
rowsNumber = value;
this.RaisePropertyChanged("RowsNumber");
}
}
private int pictureColoumns;
///
/// 进料连板列数
///
public int PictureColoumns
{
get { return pictureColoumns; }
set
{
pictureColoumns = value;
this.RaisePropertyChanged("PictureColoumns");
}
}
private int pictureRows;
///
/// 进料连板行数
///
public int PictureRows
{
get { return pictureRows; }
set { pictureRows = value; this.RaisePropertyChanged("PictureRows"); }
}
private double p_lenght;
///
/// 产品长度
///
public double P_lenght
{
get { return p_lenght; }
set { p_lenght = value; RaisePropertyChanged("P_lenght"); }
}
private double p_width;
///
/// 产品宽度
///
public double P_width
{
get { return p_width; }
set { p_width = value; RaisePropertyChanged("P_width"); }
}
private double lenght_dev;
///
/// 长度偏差值
///
public double Lenght_dev
{
get { return lenght_dev; }
set {
lenght_dev = value;
RaisePropertyChanged("Lenght_dev");
}
}
private double width_dev;
///
/// 宽度偏差值
///
public double Width_dev
{
get { return width_dev; }
set { width_dev = value;
RaisePropertyChanged("Width_dev");
}
}
///
/// 料盘1的产品状态字符串
///
public string Tray1 { get; set; }
public string Tray2 { get; set; }
public string Tray3 { get; set; }
public string Tray4 { get; set; }
public string Tray5 { get; set; }
public string Tray6 { get; set; }
public string Tray7 { get; set; }
public string Tray8 { get; set; }
private List robotPointList;
///
/// 机器人定位集合
///
public List RobotPointList
{
get { return robotPointList; }
set { robotPointList = value; RaisePropertyChanged("RobotPointList"); }
}
private ObservableCollection motionPointList;
///
/// 运动点位集合
///
public ObservableCollection MotionPointList
{
get { return motionPointList; }
set { motionPointList = value; RaisePropertyChanged("MotionPointList"); }
}
///
/// 运行轨迹集合
///
public ObservableCollection MotionTrajectoryList { get; set; }
#region 空跑模式
private bool runningMode;
///
/// 空跑模式
///
public bool RunningMode
{
get { return runningMode; }
set
{
runningMode = value;
this.RaisePropertyChanged("RunningMode");
}
}
#endregion
public MachineModel()
{
RejectRatio = 0;
}
}
}