using Community;
using Model.HSL;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Model
{
///
/// 站别模型
///
public class StandModel : NotificationObject
{
#region 基本信息
public int ID { get; set; }
///
/// 上级ID
///
public int ParentID { get; set; }
#region 站别名称
private string standName;
///
/// 站别名称
///
public string StandName
{
get { return standName; }
set
{
standName = value;
RaisePropertyChanged("StandName");
}
}
#endregion
#region 简码
private string shortCode;
///
/// 简码
///
public string ShortCode
{
get { return shortCode; }
set
{
shortCode = value;
RaisePropertyChanged("ShortCode");
}
}
#endregion
#region 工位
private string stationNo;
///
/// 工位
///
public string StationNo
{
get { return stationNo; }
set
{
stationNo = value;
RaisePropertyChanged("StationNo");
}
}
#endregion
#region 上一站工位号
private string stationUpNo;
///
/// 上一站工位号
///
public string StationUpNo
{
get { return stationUpNo; }
set
{
stationUpNo = value;
RaisePropertyChanged("StationUpNo");
}
}
#endregion
#region 产品特性1
private string property_code1;
///
/// 产品特性1
///
public string Property_code1
{
get { return property_code1; }
set
{
property_code1 = value;
RaisePropertyChanged("Property_code1");
}
}
#endregion
#region 产品特性2
private string property_code2;
///
/// 产品特性2
///
public string Property_code2
{
get { return property_code2; }
set
{
property_code2 = value;
RaisePropertyChanged("Property_code2");
}
}
#endregion
#region 产品特性3
private string property_code3;
///
/// 产品特性3
///
public string Property_code3
{
get { return property_code3; }
set
{
property_code3 = value;
RaisePropertyChanged("Property_code3");
}
}
#endregion
#region 产品特性4
private string property_code4;
///
/// 产品特性4
///
public string Property_code4
{
get { return property_code4; }
set
{
property_code4 = value;
RaisePropertyChanged("Property_code4");
}
}
#endregion
#region 机台编号
private string machineNumber;
///
/// 机台编号
///
public string MachineNumber
{
get { return machineNumber; }
set
{
machineNumber = value;
RaisePropertyChanged("MachineNumber");
}
}
#endregion
#region 站别类型 预留
private int standType;
///
/// 站别类型 预留
///
public int StandType
{
get { return standType; }
set
{
standType = value;
RaisePropertyChanged("StandType");
}
}
#endregion
#region PLCID
private int plcID;
///
/// PLCID
///
public int PlcID
{
get { return plcID; }
set
{
plcID = value;
RaisePropertyChanged("PlcID");
}
}
#endregion
#region 设备1 ID
private int deviceID1;
///
/// 设备1 ID
///
public int DeviceID1
{
get { return deviceID1; }
set
{
deviceID1 = value;
RaisePropertyChanged("DeviceID1");
}
}
#endregion
#region 设备2 ID
private int deviceID2;
///
/// 设备2 ID
///
public int DeviceID2
{
get { return deviceID2; }
set
{
deviceID2 = value;
RaisePropertyChanged("DeviceID2");
}
}
#endregion
#region 设备3 ID
private int deviceID3;
///
/// 设备3 ID
///
public int DeviceID3
{
get { return deviceID3; }
set
{
deviceID3 = value;
RaisePropertyChanged("DeviceID3");
}
}
#endregion
#region 启用
private bool enableing;
///
/// 启用
///
public bool Enableing
{
get { return enableing; }
set
{
enableing = value;
if (!value)
{
VisibilitySoft = Visibility.Collapsed;
}
else
{
VisibilitySoft = Visibility.Visible;
}
RaisePropertyChanged("Enableing");
}
}
#endregion
#endregion
#region 站别是否可见
private Visibility visibilitySoft;
///
/// 站别是否可见
///
public Visibility VisibilitySoft
{
get { return visibilitySoft; }
set
{
visibilitySoft = value;
RaisePropertyChanged("VisibilitySoft");
}
}
#endregion
#region 构造函数
///
/// 构造函数
///
public StandModel()
{
StandState = new ShowInfo() { StatuInfo = "未知", StatusForeground = ColorStr.White, StatusBackground = ColorStr.Gray };
}
#endregion
#region 站别状态
private ShowInfo standState;
///
/// 站别状态
///
public ShowInfo StandState
{
get { return standState; }
set
{
standState = value;
RaisePropertyChanged("StandState");
}
}
#endregion
}
///
/// 视觉结果
///
public class VisionRes
{
public string sn { get; set; }
public string sta_l { get; set; }
public bool res { get; set; }
///
/// A值
///
public double A_value { get; set; }
///
/// A最大值
///
public double Amax_value { get; set; }
///
/// A最小值
///
public double Amin_value { get; set; }
///
/// B值
///
public double B_value { get; set; }
public double Bmax_value { get; set; }
public double Bmin_value { get; set; }
///
/// C值
///
public double C_value { get; set; }
public double Cmax_value { get; set; }
public double Cmin_value { get; set; }
///
/// D值
///
public double D_value { get; set; }
public double Dmax_value { get; set; }
public double Dmin_value { get; set; }
///
/// A平行度
///
public double A_DepthValue { get; set; }
///
/// B平行度
///
public double B_DepthValue { get; set; }
///
/// C平行度
///
public double C_DepthValue { get; set; }
///
/// D平行度
///
public double D_DepthValue { get; set; }
public VisionRes()
{
sn = "";
sta_l = "";
}
}
///
/// 站别对应的PLC信息
///
public class PCtoPLC : NotificationObject
{
private string nameStr;
///
/// 名称
///
public string NameStr
{
get { return nameStr; }
set { nameStr = value; RaisePropertyChanged("NameStr"); }
}
///
/// 指令地址
///
public string CmdAddress { get; set; }
///
/// 流水号地址1
///
public string StreamAddress1 { get; set; }
///
/// 流水号地址2
///
public string StreamAddress2 { get; set; }
///
/// 流水号3
///
public string StreamAddress3 { get; set; }
///
/// 流水号4
///
public string StreamAddress4 { get; set; }
///
/// 流水号5
///
public string StreamAddress5 { get; set; }
///
/// 流水号6
///
public string StreamAddress6 { get; set; }
///
/// 指令
///
public int Cmd { get; set; }
///
/// 指令的副本
///
public int CmdTemp { get; set; }
///
/// 流水号1
///
public int StreamNumber1 { get; set; }
///
/// 流水号2
///
public int StreamNumber2 { get; set; }
/////
///// 点胶1速度
/////
//public int DianjiaoSpeed1 { get; set; }
/////
///// 点胶1时间
/////
//public int DianjiaoTime1 { get; set; }
/////
///// 点胶1气压
/////
//public int DianjiaoQiYa1 { get; set; }
/////
///// 点胶1速度
/////
//public int DianjiaoSpeed2 { get; set; }
/////
///// 点胶1时间
/////
//public int DianjiaoTime2 { get; set; }
/////
///// 点胶1气压
/////
//public int DianjiaoQiYa2 { get; set; }
private VehicleModel vehicle1;
///
/// 载具或产品 1
///
public VehicleModel Vehicle1
{
get { return vehicle1; }
set { vehicle1 = value == null ? new VehicleModel() : value; }
}
private VehicleModel vehicle2;
///
/// 载具或产品 2
///
public VehicleModel Vehicle2
{
get { return vehicle2; }
set { vehicle2 = value == null ? new VehicleModel() : value; }
}
///
/// 运行步骤
///
public GengralProcessEnum RunStep { get; set; }
///
/// 运行临时时间
///
public DateTime TimeTemp { get; set; }
///
/// 发给PLC的指令
///
public short ToPLC { get; set; }
private ShowInfo runState;
///
/// 运行状态
///
public ShowInfo RunState
{
get { return runState; }
set { runState = value; RaisePropertyChanged("RunState"); }
}
public PCtoPLC()
{
RunState = new ShowInfo() { StatuInfo = "待运行", StatusBackground = ColorStr.Gray };
}
}
}