首次提交:添加src文件夹代码
This commit is contained in:
35
Cowain.Bake.Common/Models/CommonModel.cs
Normal file
35
Cowain.Bake.Common/Models/CommonModel.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Cowain.Bake.Common.Models
|
||||
{
|
||||
public class ProceParamList
|
||||
{
|
||||
public string ParameterCode { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string TargetValue { get; set; }
|
||||
}
|
||||
public class AddrValue
|
||||
{
|
||||
public string Addr { get; set; }
|
||||
public object Value { get; set; }
|
||||
}
|
||||
public class SignalEvent
|
||||
{
|
||||
public string InfoName { get; set; } //枚举名
|
||||
public string InfoDesc { get; set; } //描述
|
||||
public int DetailNumber { get; set; } //编号
|
||||
public DateTime RecvTime { get; set; }//时间
|
||||
}
|
||||
|
||||
public class SizeAndLocationModel
|
||||
{
|
||||
public double Left { get; set; }
|
||||
public double Top { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
}
|
||||
}
|
||||
296
Cowain.Bake.Common/Models/MESModel.cs
Normal file
296
Cowain.Bake.Common/Models/MESModel.cs
Normal file
@@ -0,0 +1,296 @@
|
||||
using Cowain.Bake.Common.Enums;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Unity;
|
||||
|
||||
namespace Cowain.Bake.Common.Models
|
||||
{
|
||||
public class MESModel
|
||||
{
|
||||
|
||||
//static IUnityContainer _unityContainer;
|
||||
public MESModel(IUnityContainer unityContainer)
|
||||
{
|
||||
//_unityContainer = unityContainer;
|
||||
}
|
||||
public class MesBase
|
||||
{
|
||||
public string Cmd { get; set; }
|
||||
}
|
||||
public class MESReturnCmdModel : MesBase
|
||||
{
|
||||
public MESReturnModelWithKeyFlag Info { get; set; }
|
||||
}
|
||||
public class MESReturnModel
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string ResultFlag { get; set; }
|
||||
public string MOMMessage { get; set; }
|
||||
}
|
||||
public class MESReturnModelWithKeyFlag : MESReturnModel
|
||||
{
|
||||
public string KeyFlag { get; set; }
|
||||
}
|
||||
|
||||
#region 出站
|
||||
public class MESReturnOutputModel : MesBase
|
||||
{
|
||||
public MESReturnCellModel Info { get; set; }
|
||||
}
|
||||
public class MESReturnCellModel : MESReturnModel
|
||||
{
|
||||
public List<CellsMode> Cells { get; set; } = new List<CellsMode>();
|
||||
}
|
||||
public class CellsMode
|
||||
{
|
||||
public string CellNo { get; set; } = "";
|
||||
public string CellInfo { get; set; } = "";
|
||||
}
|
||||
#endregion
|
||||
//每个接口都有Key和设备编号,所以都从这里继承
|
||||
|
||||
public class EqptParameter : MesBase
|
||||
{
|
||||
public EqptParameter()
|
||||
{
|
||||
Cmd = "EqptParameter";
|
||||
}
|
||||
public EqptModel Info { get; set; } = new EqptModel();
|
||||
}
|
||||
|
||||
public class EqptModel
|
||||
{
|
||||
public string Key { get; set; }=Guid.NewGuid().ToString();
|
||||
public string EquipmentCode { get; set; } = "HCHK0010"; //要从数据库中获取
|
||||
}
|
||||
public class EqptAlive : MesBase
|
||||
{
|
||||
public EqptAlive()
|
||||
{
|
||||
Cmd = "EqptAlive";
|
||||
}
|
||||
public EqptAliveModel Info { get; set; } = new EqptAliveModel();
|
||||
}
|
||||
public class EqptAliveModel: EqptModel
|
||||
{
|
||||
public string PPM { get; set; } = ""; //设备PPM(单台设备需要提供的PPM)
|
||||
public List<ModePPMs> PPMs { get; set; } = new List<ModePPMs>(); //2子设备PPM(多台设备共用一个心跳时,需要用这个字段)
|
||||
}
|
||||
|
||||
public class ModePPMs
|
||||
{
|
||||
public string SubEqCode { get; set; } = ""; //子设备编码
|
||||
public string PPM { get; set; } = ""; //设备PPM(单台设备需要提供的PPM
|
||||
}
|
||||
|
||||
|
||||
public class EqptStatus : MesBase
|
||||
{
|
||||
public EqptStatus()
|
||||
{
|
||||
Cmd = "EqptStatus";
|
||||
}
|
||||
public EqptStatusModel Info { get; set; } = new EqptStatusModel();
|
||||
}
|
||||
|
||||
public class EqptStatusModel: EqptModel
|
||||
{
|
||||
public string LocationID { get; set; } = "";
|
||||
public string StatusCode { get; set; } = "";
|
||||
public List<AlerInfoModel> AlertInfo { get; set; } = new List<AlerInfoModel>();
|
||||
}
|
||||
public class AlerInfoModel
|
||||
{
|
||||
public string AlertCode { get; set; } = "";
|
||||
public string AlertMessage { get; set; } = "";
|
||||
}
|
||||
|
||||
public class EqptAlert : MesBase
|
||||
{
|
||||
public EqptAlert()
|
||||
{
|
||||
Cmd = "EqptAlert";
|
||||
}
|
||||
public EqptAlertModel Info { get; set; } = new EqptAlertModel();
|
||||
}
|
||||
|
||||
public class EqptAlertModel: EqptModel
|
||||
{
|
||||
public List<AlertInfoModel> AlertInfo { get; set; } = new List<AlertInfoModel>();
|
||||
}
|
||||
public class AlertInfoModel
|
||||
{
|
||||
public string AlertCode { get; set; } = "";
|
||||
public string AlertReset { get; set; } = "";
|
||||
public string AlertMessage { get; set; } = "";
|
||||
}
|
||||
public class EqptParameterReturnCmd : MesBase
|
||||
{
|
||||
public Data Info { get; set; } = new Data();
|
||||
}
|
||||
|
||||
public class Data : MESReturnModel
|
||||
{
|
||||
public List<EqptParameterModel> ParameterInfo { get; set; } = new List<EqptParameterModel>();
|
||||
|
||||
}
|
||||
public class EqptParameterModel
|
||||
{
|
||||
public string ParameterCode { get; set; } = "";
|
||||
public string ParameterType { get; set; } = "";
|
||||
public string TargetValue { get; set; } = "";
|
||||
public string UOMCode { get; set; } = "";
|
||||
public string UpperLimit { get; set; } = "";
|
||||
public string LowerLimit { get; set; } = "";
|
||||
public string Description { get; set; } = "";
|
||||
}
|
||||
|
||||
public class ParameterChangeCmd : MesBase
|
||||
{
|
||||
public ParameterChangeCmd()
|
||||
{
|
||||
Cmd = "ParameterChange";
|
||||
}
|
||||
public ParameterChange Info { get; set; } = new ParameterChange();
|
||||
|
||||
}
|
||||
public class ParameterChange: EqptModel
|
||||
{
|
||||
public string EmployeeNo { get; set; } = "";
|
||||
public List<EqptParameterModel> ParameterInfo { get; set; } = new List<EqptParameterModel>();
|
||||
}
|
||||
|
||||
|
||||
public class EqptRunCmd : MesBase
|
||||
{
|
||||
public EqptRunCmd()
|
||||
{
|
||||
Cmd = "EqptRun";
|
||||
}
|
||||
public EqptRun Info { get; set; } = new EqptRun();
|
||||
}
|
||||
|
||||
public class EqptRun: EqptModel
|
||||
{
|
||||
public string EmployeeNo { get; set; } = "";
|
||||
public string Password { get; set; } = "";
|
||||
public string EquipmentModel { get; set; } = "";
|
||||
}
|
||||
//7. 16.电芯状态获取
|
||||
public class CellStateCmd : MesBase
|
||||
{
|
||||
public CellStateCmd()
|
||||
{
|
||||
Cmd = "CellState";
|
||||
}
|
||||
public CellState Info { get; set; } = new CellState();
|
||||
}
|
||||
public class CellState: EqptModel
|
||||
{
|
||||
public string CellNo { get; set; } = "";
|
||||
}
|
||||
public class BakingInputCmd : MesBase
|
||||
{
|
||||
public BakingInputCmd()
|
||||
{
|
||||
Cmd = "BakingInput";
|
||||
}
|
||||
public BakingInput Info { get; set; } = new BakingInput();
|
||||
}
|
||||
|
||||
public class BakingInput : EqptModel
|
||||
{
|
||||
public string TrayNo { get; set; } = "";
|
||||
public string RecipeName { get; set; } = "";
|
||||
public string LocationID { get; set; } = "";
|
||||
public List<CellModel> Cells { get; set; } = new List<CellModel>(); //是电芯组
|
||||
}
|
||||
public class CellModel
|
||||
{
|
||||
public string CellNo { get; set; } = ""; //电芯号 电芯号才是具体的电芯条码
|
||||
}
|
||||
public class BakingParameterCmd : MesBase
|
||||
{
|
||||
public BakingParameterCmd()
|
||||
{
|
||||
Cmd = "BakingParameter";
|
||||
}
|
||||
|
||||
public BakingParameter Info { get; set; } = new BakingParameter();
|
||||
}
|
||||
|
||||
public class BakingParameter:EqptModel
|
||||
{
|
||||
public string LocationID { get; set; } = "";
|
||||
public string LocalTime { get; set; } = "";
|
||||
public List<ProcessData> ParameterInfo { get; set; } = new List<ProcessData>();
|
||||
}
|
||||
|
||||
public class ProcessData : EqptParameterModel
|
||||
{
|
||||
public string Value { get; set; } = "";
|
||||
}
|
||||
public class CellOutputCmd : MesBase
|
||||
{
|
||||
public CellOutputCmd()
|
||||
{
|
||||
Cmd = "CellOutput";
|
||||
}
|
||||
public InfoModel Info { get; set; } = new InfoModel();
|
||||
}
|
||||
|
||||
public class InfoModel : EqptModel
|
||||
{
|
||||
public CellsModel Cells { get; set; } = new CellsModel();
|
||||
}
|
||||
|
||||
public class CellsModel
|
||||
{
|
||||
public string CellNo { get; set; } = "";
|
||||
public string PassFlag { get; set; } = "";
|
||||
public string NGCode { get; set; } = "";
|
||||
public string NGMessage { get; set; } = "";
|
||||
|
||||
public List<ParametersModel> Parameters { get; set; } = new List<ParametersModel>();
|
||||
public List<MaterialInfoModel> MaterialInfo { get; set; } = new List<MaterialInfoModel>();
|
||||
}
|
||||
public class MaterialInfoModel
|
||||
{
|
||||
public string MaterialCode { get; set; } = "";
|
||||
public string MaterialLoc { get; set; } = "";
|
||||
public string Quantity { get; set; } = "";
|
||||
}
|
||||
public class ParametersModel
|
||||
{
|
||||
public string ParameterCode { get; set; } = "";
|
||||
public string ParameterDesc { get; set; } = "";
|
||||
public string Value { get; set; } = "";
|
||||
public string UpperLimit { get; set; } = "";
|
||||
public string LowerLimit { get; set; } = "";
|
||||
public string TargetValue { get; set; } = "";
|
||||
public string ParameterResult { get; set; } = "";
|
||||
}
|
||||
public class BakingOutputCmd : MesBase
|
||||
{
|
||||
public BakingOutputCmd()
|
||||
{
|
||||
Cmd = "BakingOutput";
|
||||
}
|
||||
public BakingOutput Info { get; set; } = new BakingOutput();
|
||||
}
|
||||
public class BakingOutput : EqptModel
|
||||
{
|
||||
public string TrayNo { get; set; } = "";
|
||||
public string LocationID { get; set; } = "";
|
||||
public string OutFlag { get; set; } = "";// 是否出站(Y或空表示出站,N单纯的上传水含量数据)
|
||||
//public string Passflag { get; set; }
|
||||
//public string NGCode { get; set; }
|
||||
public List<CellModel> Cells { get; set; } = new List<CellModel>();
|
||||
public List<ParametersModel> Parameters { get; set; } = new List<ParametersModel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
102
Cowain.Bake.Common/Models/VarValue.cs
Normal file
102
Cowain.Bake.Common/Models/VarValue.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Cowain.Bake.Common.Models
|
||||
{
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4)]
|
||||
public class VarValue
|
||||
{
|
||||
// Fields
|
||||
[FieldOffset(0)]
|
||||
public bool Boolean;
|
||||
[FieldOffset(0)]
|
||||
public byte Byte;
|
||||
[FieldOffset(0)]
|
||||
public short Int16;
|
||||
[FieldOffset(0)]
|
||||
public ushort UInt16;
|
||||
[FieldOffset(0)]
|
||||
public int Int32;
|
||||
[FieldOffset(0)]
|
||||
public uint UInt32;
|
||||
[FieldOffset(0)]
|
||||
public float Single;
|
||||
|
||||
public string GetValue(string tp)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tp))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else if (tp == "BOOL")
|
||||
{
|
||||
return this.Boolean == true ? "TRUE" : "FALSE";
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.Int32.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (obj == null)
|
||||
return false;
|
||||
Type type = obj.GetType();
|
||||
if (type == typeof(VarValue))
|
||||
return this.Int32 == ((VarValue)obj).Int32;
|
||||
else
|
||||
{
|
||||
if (type == typeof(int))
|
||||
return this.Int32 == (int)obj;
|
||||
if (type == typeof(uint))
|
||||
return this.UInt32 == (uint)obj;
|
||||
if (type == typeof(short))
|
||||
return this.Int16 == (short)obj;
|
||||
if (type == typeof(ushort))
|
||||
return this.UInt16 == (ushort)obj;
|
||||
if (type == typeof(byte))
|
||||
return this.Byte == (byte)obj;
|
||||
if (type == typeof(bool))
|
||||
return this.Boolean == (bool)obj;
|
||||
if (type == typeof(float))
|
||||
return this.Single == (float)obj;
|
||||
if (type == typeof(string))
|
||||
return this.ToString() == obj.ToString();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Int32.GetHashCode();
|
||||
}
|
||||
public static bool Equals(VarValue a, VarValue b)
|
||||
{
|
||||
|
||||
if (a == null || b == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a.Int32 != b.Int32)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Int32.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user