394 lines
8.8 KiB
C#
394 lines
8.8 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// 机种类
|
|
/// </summary>
|
|
public class MachineModel : NotificationObject
|
|
{
|
|
/// <summary>
|
|
/// ID
|
|
/// </summary>
|
|
public int ID { get; set; }
|
|
|
|
private string machineName;
|
|
/// <summary>
|
|
/// 机种名称
|
|
/// </summary>
|
|
public string MachineName
|
|
{
|
|
get { return machineName; }
|
|
set
|
|
{
|
|
machineName = value;
|
|
this.RaisePropertyChanged("MachineName");
|
|
}
|
|
}
|
|
|
|
private DateTime addTime;
|
|
/// <summary>
|
|
/// 添加时间
|
|
/// </summary>
|
|
public DateTime AddTime
|
|
{
|
|
get { return addTime; }
|
|
set
|
|
{
|
|
addTime = value;
|
|
this.RaisePropertyChanged("AddTime");
|
|
}
|
|
}
|
|
|
|
private bool enableS;
|
|
/// <summary>
|
|
/// 是否启用
|
|
/// </summary>
|
|
public bool EnableS
|
|
{
|
|
get { return enableS; }
|
|
set
|
|
{
|
|
enableS = value;
|
|
this.RaisePropertyChanged("EnableS");
|
|
}
|
|
}
|
|
|
|
private long productionTime;
|
|
/// <summary>
|
|
/// 此机种生产时间
|
|
/// </summary>
|
|
public long ProductionTime
|
|
{
|
|
get { return productionTime; }
|
|
set
|
|
{
|
|
productionTime = value;
|
|
RunSpan = new TimeSpan(value);
|
|
}
|
|
}
|
|
|
|
private int quantitys;
|
|
/// <summary>
|
|
/// 生产数量(投入数量)
|
|
/// </summary>
|
|
public int Quantitys
|
|
{
|
|
get { return quantitys; }
|
|
set
|
|
{
|
|
quantitys = value;
|
|
try
|
|
{
|
|
RejectRatio = Math.Round(((decimal)Produce / value), 4);
|
|
}
|
|
catch
|
|
{
|
|
|
|
}
|
|
|
|
this.RaisePropertyChanged("Quantitys");
|
|
}
|
|
}
|
|
|
|
private int produce;
|
|
/// <summary>
|
|
/// 产出数量
|
|
/// </summary>
|
|
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;
|
|
/// <summary>
|
|
/// 产出不良
|
|
/// </summary>
|
|
public int ProduceBads
|
|
{
|
|
get { return produceBads; }
|
|
set
|
|
{
|
|
produceBads = value;
|
|
this.RaisePropertyChanged("ProduceBads");
|
|
}
|
|
}
|
|
|
|
private decimal rejectRatio;
|
|
/// <summary>
|
|
/// 良率
|
|
/// </summary>
|
|
public decimal RejectRatio
|
|
{
|
|
get { return rejectRatio; }
|
|
set
|
|
{
|
|
rejectRatio = value;
|
|
|
|
this.RaisePropertyChanged("RejectRatio");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 此机种生产的时间间隔
|
|
/// </summary>
|
|
public TimeSpan RunSpan { get; set; }
|
|
|
|
|
|
private int capacity;
|
|
/// <summary>
|
|
/// 产能
|
|
/// </summary>
|
|
public int Capacity
|
|
{
|
|
get { return capacity; }
|
|
set
|
|
{
|
|
capacity = value;
|
|
this.RaisePropertyChanged("Capacity");
|
|
}
|
|
}
|
|
|
|
|
|
private int coloumsNumber;
|
|
/// <summary>
|
|
/// 料盘列数
|
|
/// </summary>
|
|
public int ColoumsNumber
|
|
{
|
|
get { return coloumsNumber; }
|
|
set
|
|
{
|
|
coloumsNumber = value;
|
|
this.RaisePropertyChanged("ColoumsNumber");
|
|
}
|
|
}
|
|
|
|
private int rowsNumber;
|
|
/// <summary>
|
|
/// 料盘行数
|
|
/// </summary>
|
|
public int RowsNumber
|
|
{
|
|
get { return rowsNumber; }
|
|
set
|
|
{
|
|
rowsNumber = value;
|
|
this.RaisePropertyChanged("RowsNumber");
|
|
}
|
|
}
|
|
|
|
|
|
private int pictureColoumns;
|
|
/// <summary>
|
|
/// 料盘镜像列数
|
|
/// </summary>
|
|
public int PictureColoumns
|
|
{
|
|
get { return pictureColoumns; }
|
|
set
|
|
{
|
|
pictureColoumns = value;
|
|
this.RaisePropertyChanged("PictureColoumns");
|
|
}
|
|
}
|
|
|
|
private int pictureRows;
|
|
/// <summary>
|
|
/// 料盘镜像行数
|
|
/// </summary>
|
|
public int PictureRows
|
|
{
|
|
get { return pictureRows; }
|
|
set { pictureRows = value; this.RaisePropertyChanged("PictureRows"); }
|
|
}
|
|
|
|
private bool wherePicture;
|
|
/// <summary>
|
|
/// 是否有镜像
|
|
/// </summary>
|
|
public bool WherePicture
|
|
{
|
|
get { return wherePicture; }
|
|
set { wherePicture = value; this.RaisePropertyChanged("WherePicture"); }
|
|
}
|
|
|
|
|
|
|
|
private string cellJson;
|
|
/// <summary>
|
|
/// 格子产品 Json字符
|
|
/// </summary>
|
|
public string CellJson
|
|
{
|
|
get { return cellJson; }
|
|
set
|
|
{
|
|
cellJson = value;
|
|
RaisePropertyChanged("CellJson");
|
|
}
|
|
}
|
|
|
|
|
|
private string jxCellJson;
|
|
/// <summary>
|
|
/// 镜像格子产品Json字符
|
|
/// </summary>
|
|
public string JxCellJson
|
|
{
|
|
get { return jxCellJson; }
|
|
set
|
|
{
|
|
jxCellJson = value;
|
|
RaisePropertyChanged("JxCellJson");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private int hanxiCount;
|
|
/// <summary>
|
|
/// 焊锡次数
|
|
/// </summary>
|
|
public int HanxiCount
|
|
{
|
|
get { return hanxiCount; }
|
|
set { hanxiCount = value;
|
|
RaisePropertyChanged("HanxiCount");
|
|
}
|
|
}
|
|
|
|
private int qingjieTime;
|
|
/// <summary>
|
|
/// 清洁时间
|
|
/// </summary>
|
|
public int QingjieTime
|
|
{
|
|
get { return qingjieTime; }
|
|
set { qingjieTime = value; RaisePropertyChanged("QingjieTime"); }
|
|
|
|
|
|
}
|
|
|
|
|
|
private int hanxiTime;
|
|
/// <summary>
|
|
/// 焊锡时间
|
|
/// </summary>
|
|
public int HanxiTime
|
|
{
|
|
get { return hanxiTime; }
|
|
set { hanxiTime = value; RaisePropertyChanged("HanxiTime"); }
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<RobotPoint> robotPointList;
|
|
/// <summary>
|
|
/// 机器人定位集合
|
|
/// </summary>
|
|
public List<RobotPoint> RobotPointList
|
|
{
|
|
get { return robotPointList; }
|
|
set { robotPointList = value; RaisePropertyChanged("RobotPointList"); }
|
|
}
|
|
|
|
private ObservableCollection<MotionPointModel> motionPointList;
|
|
/// <summary>
|
|
/// 运动点位集合
|
|
/// </summary>
|
|
public ObservableCollection<MotionPointModel> MotionPointList
|
|
{
|
|
get { return motionPointList; }
|
|
set { motionPointList = value; RaisePropertyChanged("MotionPointList"); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// 运行轨迹集合
|
|
/// </summary>
|
|
public ObservableCollection<MotionTrajectoryModel> MotionTrajectoryList { get; set; }
|
|
|
|
|
|
|
|
#region 空跑模式
|
|
private bool runningMode;
|
|
|
|
/// <summary>
|
|
/// 空跑模式
|
|
/// </summary>
|
|
public bool RunningMode
|
|
{
|
|
get { return runningMode; }
|
|
set
|
|
{
|
|
runningMode = value;
|
|
this.RaisePropertyChanged("RunningMode");
|
|
}
|
|
}
|
|
|
|
public Qita MyQita { get; set; }
|
|
#endregion
|
|
|
|
|
|
|
|
public MachineModel()
|
|
{
|
|
RejectRatio = 1;
|
|
}
|
|
|
|
|
|
|
|
}
|
|
public class Qita : NotificationObject
|
|
{
|
|
private double _XiaYa;
|
|
public double XiaYa
|
|
{
|
|
get { return _XiaYa; }
|
|
set
|
|
{
|
|
_XiaYa = value;
|
|
this.RaisePropertyChanged("XiaYa");
|
|
}
|
|
}
|
|
private bool _DanJi;
|
|
public bool DanJi
|
|
{
|
|
get { return _DanJi; }
|
|
set
|
|
{
|
|
_DanJi = value;
|
|
this.RaisePropertyChanged("DanJi");
|
|
}
|
|
}
|
|
}
|
|
}
|