TFLH/Model/StandModel.cs
2026-08-06 09:50:46 +08:00

538 lines
13 KiB
C#

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