|
|
using System;
|
|
|
using System.Reflection;
|
|
|
using System.Text;
|
|
|
using Mesnac.Action.Base;
|
|
|
using Mesnac.Codd.Session;
|
|
|
using Mesnac.Equips;
|
|
|
using System.Data;
|
|
|
|
|
|
namespace Mesnac.Action.Compressor
|
|
|
{
|
|
|
public class PlcData
|
|
|
{
|
|
|
#region 基本设置
|
|
|
|
|
|
/// <summary>
|
|
|
/// PLC数据键值类
|
|
|
/// </summary>
|
|
|
public class DataKeyValue
|
|
|
{
|
|
|
public class Value
|
|
|
{
|
|
|
private object value = null;
|
|
|
public Value(object obj)
|
|
|
{
|
|
|
this.value = obj;
|
|
|
}
|
|
|
public object ToObject()
|
|
|
{
|
|
|
return this.value;
|
|
|
}
|
|
|
public int ToInt(int defaultValue)
|
|
|
{
|
|
|
int iResult = defaultValue;
|
|
|
if (this.value != null
|
|
|
&& this.value != DBNull.Value
|
|
|
&& int.TryParse(this.value.ToString(), out iResult)
|
|
|
)
|
|
|
{
|
|
|
return iResult;
|
|
|
}
|
|
|
return defaultValue;
|
|
|
}
|
|
|
public int ToInt()
|
|
|
{
|
|
|
return ToInt(0);
|
|
|
}
|
|
|
public DateTime ToDateTime(DateTime defaultValue)
|
|
|
{
|
|
|
DateTime iResult = defaultValue;
|
|
|
if (this.value != null
|
|
|
&& this.value != DBNull.Value
|
|
|
&& DateTime.TryParse(this.value.ToString(), out iResult)
|
|
|
)
|
|
|
{
|
|
|
return iResult;
|
|
|
}
|
|
|
return defaultValue;
|
|
|
}
|
|
|
public DateTime ToDateTime()
|
|
|
{
|
|
|
return ToDateTime(DateTime.Now);
|
|
|
}
|
|
|
public double ToDouble(double defaultValue)
|
|
|
{
|
|
|
double iResult = defaultValue;
|
|
|
if (this.value != null
|
|
|
&& this.value != DBNull.Value
|
|
|
&& double.TryParse(this.value.ToString(), out iResult)
|
|
|
)
|
|
|
{
|
|
|
return iResult;
|
|
|
}
|
|
|
return defaultValue;
|
|
|
}
|
|
|
public double ToDouble()
|
|
|
{
|
|
|
return ToDouble(0.0);
|
|
|
}
|
|
|
public string ToString(string defaultValue)
|
|
|
{
|
|
|
string iResult = defaultValue;
|
|
|
if (this.value != null
|
|
|
&& this.value != DBNull.Value
|
|
|
)
|
|
|
{
|
|
|
return this.value.ToString();
|
|
|
}
|
|
|
return defaultValue;
|
|
|
}
|
|
|
public override string ToString()
|
|
|
{
|
|
|
return ToString(string.Empty);
|
|
|
}
|
|
|
}
|
|
|
private void Ini()
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
//if (data.KeyName.Equals(this.FieldKey, StringComparison.CurrentCultureIgnoreCase))
|
|
|
if (data.KeyName==this.FieldKey)
|
|
|
{
|
|
|
this.EquipKey = data.KeyName;
|
|
|
this.EquipRunName = data.RunName;
|
|
|
this.EquipData = data;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private Value getLastVauebeforeMath()
|
|
|
{
|
|
|
Value Result = null;
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.KeyName == this.EquipKey)
|
|
|
{
|
|
|
return new Value(data.LastBeforeMathValue[0]);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return Result;
|
|
|
}
|
|
|
private Value getLastValue()
|
|
|
{
|
|
|
Value Result = null;
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.KeyName == this.EquipKey)
|
|
|
{
|
|
|
return new Value(data.Value);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return Result;
|
|
|
}
|
|
|
private Value getNowValue()
|
|
|
{
|
|
|
Value Result = null;
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.KeyName == this.EquipKey)
|
|
|
{
|
|
|
return new Value(equip.ReadData(data));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return Result;
|
|
|
}
|
|
|
|
|
|
public DataKeyValue(string name)
|
|
|
{
|
|
|
this.Name = name;
|
|
|
this.FieldKey = name;
|
|
|
this.Ini();
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 配置名称 = 配置key值
|
|
|
/// </summary>
|
|
|
public string Name { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 配置key值
|
|
|
/// </summary>
|
|
|
public string FieldKey { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 设备设置值
|
|
|
/// </summary>
|
|
|
public string EquipKey { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 设备设置值
|
|
|
/// </summary>
|
|
|
public string EquipRunName { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 设备设置值
|
|
|
/// </summary>
|
|
|
public Mesnac.Equips.BaseInfo.Data EquipData { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 说明
|
|
|
/// </summary>
|
|
|
public string Remark { get; private set; }
|
|
|
private Value setLastValue = null;
|
|
|
/// <summary>
|
|
|
/// 上一次读取的值
|
|
|
/// </summary>
|
|
|
public Value LastValue
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
Value value = this.getLastValue();
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = this.getNowValue();
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = setLastValue;
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = new Value(null);
|
|
|
}
|
|
|
setLastValue = value;
|
|
|
return setLastValue;
|
|
|
}
|
|
|
set
|
|
|
{
|
|
|
this.setLastValue = value;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
private Value _setLastValueBeforeMath;
|
|
|
public Value LastValuebeforeMath
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
Value value = this.getLastVauebeforeMath();
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = this.getNowValue();
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = _setLastValueBeforeMath;
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = new Value(null);
|
|
|
}
|
|
|
_setLastValueBeforeMath = value;
|
|
|
return _setLastValueBeforeMath;
|
|
|
}
|
|
|
set
|
|
|
{
|
|
|
this._setLastValueBeforeMath = value;
|
|
|
}
|
|
|
}
|
|
|
private Value setNowValue = null;
|
|
|
/// <summary>
|
|
|
/// 读取当前值
|
|
|
/// </summary>
|
|
|
public Value NowValue
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
Value value = this.getNowValue();
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = setNowValue;
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = setLastValue;
|
|
|
}
|
|
|
if (value == null)
|
|
|
{
|
|
|
value = new Value(null);
|
|
|
}
|
|
|
setNowValue = value;
|
|
|
return setNowValue;
|
|
|
}
|
|
|
set
|
|
|
{
|
|
|
this.setNowValue = value;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 单例模式
|
|
|
private static PlcData _this;
|
|
|
public static PlcData Instance
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
if (null == _this)
|
|
|
_this = new PlcData();
|
|
|
return _this;
|
|
|
}
|
|
|
}
|
|
|
private PlcData()
|
|
|
{
|
|
|
foreach (PropertyInfo pi in this.GetType().GetProperties())
|
|
|
{
|
|
|
if (pi.PropertyType == typeof(DataKeyValue))
|
|
|
{
|
|
|
DataKeyValue data = new DataKeyValue(pi.Name);
|
|
|
pi.SetValue(this, data, null);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region GetDataKeyValue
|
|
|
public DataKeyValue GetDataKeyValue(string key)
|
|
|
{
|
|
|
foreach (PropertyInfo pi in this.GetType().GetProperties())
|
|
|
{
|
|
|
if (pi.PropertyType == typeof(DataKeyValue))
|
|
|
{
|
|
|
DataKeyValue data = (DataKeyValue)pi.GetValue(this, null);
|
|
|
if (data.FieldKey.ToLower() == key.ToLower())
|
|
|
{
|
|
|
return data;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 向PLC变量中写入值,并不真正下传至PLC
|
|
|
|
|
|
/// <summary>
|
|
|
/// 向PLC变量中写入值,并不真正下传至PLC
|
|
|
/// </summary>
|
|
|
/// <param name="equipKey"></param>
|
|
|
/// <param name="runName"></param>
|
|
|
/// <param name="shifting"></param>
|
|
|
/// <param name="dataValue"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool PlcVarWrite(string equipKey, string runName, int shifting, object dataValue)
|
|
|
{
|
|
|
BaseAction action = new BaseAction();
|
|
|
StringBuilder log = new StringBuilder();
|
|
|
try
|
|
|
{
|
|
|
//log.Append("equipKey=[").Append(equipKey).Append("]runName=[").Append(runName);
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Write ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.KeyName == equipKey || (!String.IsNullOrEmpty(data.RunName) && data.RunName == runName))
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
data.Value = dataValue;
|
|
|
return true;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ICSharpCode.Core.LoggingService.Error(ex.Message);
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//log.Append("]No Find");
|
|
|
return false;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ICSharpCode.Core.LoggingService.Error("写入PLC变量值失败:" + ex.Message, ex);
|
|
|
return false;
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
|
//if (log.Length > "equipKey=[]runName=[]No Find".Length)
|
|
|
//{
|
|
|
// action.LogDebug(log.AppendLine("...").ToString());
|
|
|
//}
|
|
|
}
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 向PLC变量中写入值,并不真正下传至PLC
|
|
|
/// </summary>
|
|
|
/// <param name="equipKey"></param>
|
|
|
/// <param name="shifting"></param>
|
|
|
/// <param name="dataValue"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool PlcVarWriteByDataKey(string equipKey, int shifting, object dataValue)
|
|
|
{
|
|
|
return PlcVarWrite(equipKey, string.Empty, shifting, dataValue);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 向PLC变量中写入值,并不真正下传至PLC
|
|
|
/// </summary>
|
|
|
/// <param name="dataKey"></param>
|
|
|
/// <param name="shifting"></param>
|
|
|
/// <param name="dataValue"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool PlcVarWriteByDataKey(DataKeyValue dataKey, int shifting, object dataValue)
|
|
|
{
|
|
|
return PlcVarWriteByDataKey(dataKey.EquipKey, shifting, dataValue);
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 向PLC变量中写入值,并不真正下传至PLC
|
|
|
/// </summary>
|
|
|
/// <param name="dataKey"></param>
|
|
|
/// <param name="dataValue"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool PlcVarWriteByDataKey(DataKeyValue dataKey, object dataValue)
|
|
|
{
|
|
|
return PlcVarWriteByDataKey(dataKey, 0, dataValue);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region PlcWrite
|
|
|
private bool PlcWrite(string equipKey, string runName, int shifting, object[] dataValue, params bool[] isOutFlag)
|
|
|
{
|
|
|
BaseAction action = new BaseAction();
|
|
|
StringBuilder log = new StringBuilder();
|
|
|
try
|
|
|
{
|
|
|
log.Append("equipKey=[").Append(equipKey).Append("]runName=[").Append(runName);
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Write ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
//if (data.KeyName == equipKey || data.RunName == runName)
|
|
|
//if (data.KeyName == equipKey)
|
|
|
if (data.KeyName == equipKey || (!String.IsNullOrEmpty(data.RunName) && data.RunName == runName))
|
|
|
{
|
|
|
int block = 0;
|
|
|
if (int.TryParse(group.Block.ToString(), out block))
|
|
|
{
|
|
|
log.Append("]shifting=[").Append((group.Start + data.Start + shifting).ToString());
|
|
|
log.Append("]dataLen=[").Append(dataValue.Length);
|
|
|
log.Append("]Find Result=");
|
|
|
foreach (object v in dataValue)
|
|
|
{
|
|
|
log.Append(v + ",");
|
|
|
}
|
|
|
if (equip.Write(block, group.Start + data.Start + shifting, dataValue))
|
|
|
{
|
|
|
log.Append("[true]");
|
|
|
return true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
log.Append("[false]");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
log.Append("]No Find");
|
|
|
return false;
|
|
|
}
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
ICSharpCode.Core.LoggingService.Error("下传PLC失败:" + ex.Message, ex);
|
|
|
return false;
|
|
|
}
|
|
|
finally
|
|
|
{
|
|
|
if (isOutFlag.Length == 0 || isOutFlag[0] == true)
|
|
|
{
|
|
|
if (log.Length > "equipKey=[]runName=[]No Find".Length)
|
|
|
{
|
|
|
action.LogDebug(log.AppendLine("...").ToString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
public bool PlcWriteByRunName(string runName, int shifting, object[] dataValue)
|
|
|
{
|
|
|
return PlcWrite(string.Empty, runName, shifting, dataValue);
|
|
|
}
|
|
|
public bool PlcWriteByRunName(string runName, object[] dataValue)
|
|
|
{
|
|
|
return PlcWriteByRunName(runName, 0, dataValue);
|
|
|
}
|
|
|
public bool PlcWriteByEquipKey(string equipKey, int shifting, object[] dataValue)
|
|
|
{
|
|
|
return PlcWrite(equipKey, string.Empty, shifting, dataValue);
|
|
|
}
|
|
|
public bool PlcWriteByEquipKey(string equipKey, object[] dataValue)
|
|
|
{
|
|
|
return PlcWriteByEquipKey(equipKey, 0, dataValue);
|
|
|
}
|
|
|
public bool PlcWriteByDataKey(DataKeyValue dataKey, int shifting, object[] dataValue)
|
|
|
{
|
|
|
return PlcWriteByEquipKey(dataKey.EquipKey, shifting, dataValue);
|
|
|
}
|
|
|
public bool PlcWriteByDataKey(DataKeyValue dataKey, object[] dataValue)
|
|
|
{
|
|
|
return PlcWriteByDataKey(dataKey, 0, dataValue);
|
|
|
}
|
|
|
//增加是否输出日志
|
|
|
public bool PlcWriteByEquipKey(string equipKey, int shifting, object[] dataValue, bool isOutLog)
|
|
|
{
|
|
|
return PlcWrite(equipKey, string.Empty, shifting, dataValue, isOutLog);
|
|
|
}
|
|
|
//增加是否输出日志
|
|
|
public bool PlcWriteByDataKey(DataKeyValue dataKey, int shifting, object[] dataValue, bool isOutLog)
|
|
|
{
|
|
|
return PlcWriteByEquipKey(dataKey.EquipKey, shifting, dataValue, isOutLog);
|
|
|
}
|
|
|
//增加是否输出日志
|
|
|
public bool PlcWriteByDataKey(DataKeyValue dataKey, object[] dataValue, bool isOutLog)
|
|
|
{
|
|
|
return PlcWriteByDataKey(dataKey, 0, dataValue, isOutLog);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 从PLC中读取原始数据的方法
|
|
|
|
|
|
/// <summary>
|
|
|
/// 从PLC中读取原始数据
|
|
|
/// </summary>
|
|
|
/// <param name="equipKey">要读取的设备名称</param>
|
|
|
/// <param name="dataValue">从PLC读取的值</param>
|
|
|
/// <returns>成功返回true,失败返回false</returns>
|
|
|
public bool PlcRead(string equipKey, out int[] dataValue)
|
|
|
{
|
|
|
dataValue = new int[0];
|
|
|
int onelen = 100;
|
|
|
int shifting = 0;
|
|
|
bool result = false;
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.KeyName == equipKey)
|
|
|
{
|
|
|
dataValue = new int[data.Len];
|
|
|
while (true)
|
|
|
{
|
|
|
#region 本次读取长度 readlen
|
|
|
int readlen = 0;
|
|
|
if (data.Len - shifting > onelen)
|
|
|
{
|
|
|
readlen = onelen;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
readlen = data.Len - shifting;
|
|
|
}
|
|
|
if (readlen <= 0)
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
#endregion
|
|
|
#region 读取数据
|
|
|
object[] buff;
|
|
|
if (equip.Read(group.Block, group.Start + data.Start + shifting, readlen, out buff))
|
|
|
{
|
|
|
for (int i = 0; i < buff.Length; i++)
|
|
|
{
|
|
|
int ivalue = 0;
|
|
|
if (buff[i] != null && buff[i] != DBNull.Value
|
|
|
&& int.TryParse(buff[i].ToString(), out ivalue))
|
|
|
{
|
|
|
dataValue[shifting + i] = ivalue;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
dataValue[shifting + i] = 0;
|
|
|
}
|
|
|
}
|
|
|
shifting += readlen;
|
|
|
result = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
if (buff.Length == 0)
|
|
|
{
|
|
|
break;
|
|
|
}
|
|
|
#endregion
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 从PLC中读取原始数据
|
|
|
/// </summary>
|
|
|
/// <param name="dataKey"></param>
|
|
|
/// <param name="dataValue"></param>
|
|
|
/// <returns></returns>
|
|
|
public bool PlcRead(DataKeyValue dataKey, out int[] dataValue)
|
|
|
{
|
|
|
return PlcRead(dataKey.EquipKey, out dataValue);
|
|
|
}
|
|
|
|
|
|
|
|
|
public object PlcLastValueRead(string equipKey)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.Name == equipKey)
|
|
|
{
|
|
|
return data.Value;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
/// 读取设备数据
|
|
|
/// </summary>
|
|
|
/// <param name="equipKey">设备名称</param>
|
|
|
/// <param name="dataValue">读取的设备值</param>
|
|
|
/// <returns>读取成功返回true,失败返回false</returns>
|
|
|
public bool PlcLastValueRead(string equipKey, out int[] dataValue)
|
|
|
{
|
|
|
dataValue = new int[0];
|
|
|
foreach (Mesnac.Equips.BaseEquip equip in Factory.Instance.AllEquips.Values)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Group group in equip.Group.Values)
|
|
|
{
|
|
|
if (group.Access == System.IO.FileAccess.Read ||
|
|
|
group.Access == System.IO.FileAccess.ReadWrite)
|
|
|
{
|
|
|
foreach (Mesnac.Equips.BaseInfo.Data data in group.Data.Values)
|
|
|
{
|
|
|
if (data.Name == equipKey)
|
|
|
{
|
|
|
object ovalue = data.Value;
|
|
|
try
|
|
|
{
|
|
|
if (ovalue is object[])
|
|
|
{
|
|
|
object[] ovalues = ovalue as object[];
|
|
|
dataValue = new int[ovalues.Length];
|
|
|
for (int i=0;i<ovalues.Length;i++)
|
|
|
{
|
|
|
object obj = ovalues[i];
|
|
|
int ivalue = 0;
|
|
|
|
|
|
if (obj != null && obj != DBNull.Value && int.TryParse(obj.ToString(), out ivalue))
|
|
|
{
|
|
|
dataValue[i] = ivalue;
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
else if (ovalue != null && ovalue != DBNull.Value)
|
|
|
{
|
|
|
dataValue = new int[1];
|
|
|
int ivalue = 0;
|
|
|
if (int.TryParse(ovalue.ToString(), out ivalue))
|
|
|
{
|
|
|
dataValue[0] = ivalue;
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
catch(Exception ex)
|
|
|
{
|
|
|
ICSharpCode.Core.LoggingService.Error("获取PLC设备[" + equipKey + "]数据失败:" + ex.Message, ex);
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region DataWrite
|
|
|
|
|
|
#region 基本函数
|
|
|
/// <summary>
|
|
|
/// 获取本地连接
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
private DbHelper getLocalHelper()
|
|
|
{
|
|
|
return new DatabaseAction().NewDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region 基本类型
|
|
|
public class DataInfo
|
|
|
{
|
|
|
public string PlcSchemaField { get; set; }
|
|
|
public string EquipRunName { get; set; }
|
|
|
public object PlcDataValue { get; set; }
|
|
|
}
|
|
|
#endregion
|
|
|
|
|
|
#region PLCData表写入操作
|
|
|
|
|
|
public bool DataWrite(string dataKey, string equipKey, int shifting, object[] dataValue)
|
|
|
{
|
|
|
if (string.IsNullOrWhiteSpace(dataKey))
|
|
|
{
|
|
|
dataKey = equipKey;
|
|
|
}
|
|
|
if (string.IsNullOrWhiteSpace(equipKey))
|
|
|
{
|
|
|
equipKey = dataKey;
|
|
|
}
|
|
|
DbHelper dbHelper = getLocalHelper();
|
|
|
dbHelper.CommandType = System.Data.CommandType.Text;
|
|
|
dbHelper.ClearParameter();
|
|
|
#region 基于SQL2008语法,不适合SQL2000
|
|
|
//StringBuilder sqlstr = new StringBuilder("INSERT INTO dbo.PlcData (PlcSchemaField ,EquipRunName ,PlcDataValue ,PlcDataIndex,PlcDownState) VALUES ");
|
|
|
//for (int i = 0; i < dataValue.Length; i++)
|
|
|
//{
|
|
|
// object obj = dataValue[i];
|
|
|
// if (obj == null || obj == DBNull.Value)
|
|
|
// {
|
|
|
// obj = string.Empty;
|
|
|
// }
|
|
|
// string key1 = "@PlcSchemaField" + i.ToString();
|
|
|
// string key2 = "@EquipRunName" + i.ToString();
|
|
|
// string key3 = "@PlcDataValue" + i.ToString();
|
|
|
// string key4 = "@PlcDataIndex" + i.ToString();
|
|
|
// sqlstr.Append(" (").Append(key1).Append(",").Append(key2).Append(",").Append(key3).Append(",").Append(key4).Append(",0)");
|
|
|
// if (i < dataValue.Length - 1)
|
|
|
// {
|
|
|
// sqlstr.AppendLine(",");
|
|
|
// }
|
|
|
// if (obj is DataInfo)
|
|
|
// {
|
|
|
// DataInfo data = obj as DataInfo;
|
|
|
// dbHelper.AddParameter(key1, string.IsNullOrWhiteSpace(data.PlcSchemaField) ? dataKey : data.PlcSchemaField);
|
|
|
// dbHelper.AddParameter(key2, string.IsNullOrWhiteSpace(data.EquipRunName) ? equipKey : data.EquipRunName);
|
|
|
// dbHelper.AddParameter(key3, data.PlcDataValue == null ? 0 : data.PlcDataValue);
|
|
|
// dbHelper.AddParameter(key4, (shifting + i).ToString());
|
|
|
// }
|
|
|
// else
|
|
|
// {
|
|
|
// dbHelper.AddParameter(key1, dataKey);
|
|
|
// dbHelper.AddParameter(key2, equipKey);
|
|
|
// dbHelper.AddParameter(key3, obj);
|
|
|
// dbHelper.AddParameter(key4, (shifting + i).ToString());
|
|
|
// }
|
|
|
//} //插入语句
|
|
|
#endregion
|
|
|
|
|
|
#region 支持SQL2000
|
|
|
|
|
|
StringBuilder sqlstr = new StringBuilder("INSERT INTO dbo.PlcData (PlcSchemaField ,EquipRunName ,PlcDataValue ,PlcDataIndex,PlcDownState) ");
|
|
|
for (int i = 0; i < dataValue.Length; i++)
|
|
|
{
|
|
|
object obj = dataValue[i];
|
|
|
if (obj == null || obj == DBNull.Value)
|
|
|
{
|
|
|
obj = string.Empty;
|
|
|
}
|
|
|
string key1 = "@PlcSchemaField" + i.ToString();
|
|
|
string key2 = "@EquipRunName" + i.ToString();
|
|
|
string key3 = "@PlcDataValue" + i.ToString();
|
|
|
string key4 = "@PlcDataIndex" + i.ToString();
|
|
|
sqlstr.Append(" (select ").Append(key1).Append(" as PlcSchemaField").Append(",").Append(key2).Append(" as EquipRunName").Append(",").Append(key3).Append(" as PlcDataValue").Append(",").Append(key4).Append(" as PlcDataIndex").Append(",0 as PlcDownState)");
|
|
|
if (i < dataValue.Length - 1)
|
|
|
{
|
|
|
sqlstr.AppendLine("union all");
|
|
|
}
|
|
|
if (obj is DataInfo)
|
|
|
{
|
|
|
DataInfo data = obj as DataInfo;
|
|
|
dbHelper.AddParameter(key1, string.IsNullOrWhiteSpace(data.PlcSchemaField) ? dataKey : data.PlcSchemaField);
|
|
|
dbHelper.AddParameter(key2, string.IsNullOrWhiteSpace(data.EquipRunName) ? equipKey : data.EquipRunName);
|
|
|
dbHelper.AddParameter(key3, data.PlcDataValue == null ? 0 : data.PlcDataValue);
|
|
|
dbHelper.AddParameter(key4, (shifting + i).ToString());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
dbHelper.AddParameter(key1, dataKey);
|
|
|
dbHelper.AddParameter(key2, equipKey);
|
|
|
dbHelper.AddParameter(key3, obj);
|
|
|
dbHelper.AddParameter(key4, (shifting + i).ToString());
|
|
|
}
|
|
|
} //插入语句
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
dbHelper.CommandText = sqlstr.ToString();
|
|
|
dbHelper.ExecuteNonQuery();
|
|
|
return true;
|
|
|
}
|
|
|
public bool DataWrite(string dataKey, string equipKey, object[] dataValue)
|
|
|
{
|
|
|
return DataWrite(dataKey, equipKey, 0, dataValue);
|
|
|
}
|
|
|
public bool DataWrite(string equipKey, object[] dataValue)
|
|
|
{
|
|
|
return DataWrite(equipKey, equipKey, 0, dataValue);
|
|
|
}
|
|
|
public bool DataWrite(DataKeyValue dataKey, int shifting, object[] dataValue)
|
|
|
{
|
|
|
return DataWrite(dataKey.Name, dataKey.EquipRunName, shifting, dataValue);
|
|
|
}
|
|
|
public bool DataWrite(DataKeyValue dataKey, object[] dataValue)
|
|
|
{
|
|
|
return DataWrite(dataKey, 0, dataValue);
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
|
/// <summary>
|
|
|
/// 计划完成数量
|
|
|
/// </summary>
|
|
|
public DataKeyValue MixingFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 计划完成数量设定(需配置)
|
|
|
/// </summary>
|
|
|
public DataKeyValue MixingFinishedCountReset { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 胶料称量完成数量
|
|
|
/// </summary>
|
|
|
public DataKeyValue PloyFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 炭黑称量完成数量
|
|
|
/// </summary>
|
|
|
public DataKeyValue CarbonFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 粉料称量完成数
|
|
|
/// </summary>
|
|
|
public DataKeyValue PowderFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 油称量完成数量
|
|
|
/// </summary>
|
|
|
public DataKeyValue OilFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 油2称量完成数量
|
|
|
/// </summary>
|
|
|
public DataKeyValue Oil2FinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 小料称量完成数量(需配置1)///地址待定 可能是10->99
|
|
|
/// </summary>
|
|
|
public DataKeyValue XiaoLiaoFinishedCount { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 小料完成数修改(需配置1)///修改完成次数标志 地址待定
|
|
|
/// </summary>
|
|
|
public DataKeyValue XiaoLiaoCountChange { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 强制输送(需配置1) ///作废 31->254
|
|
|
/// </summary>
|
|
|
public DataKeyValue CoerceDownload { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 大罐物料(需配置1)///输送下传 输送设置参数 31->250
|
|
|
/// </summary>
|
|
|
public DataKeyValue BigJarMaterial { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼时间
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingTime { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼温度
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingTemp { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼功率
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingPower { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼能量
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingEnergy { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼压力
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingPressureRam { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼转子转速
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingSpeedRotor { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼上顶栓位置(需配置1) ///已经不用了
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixingHoopPerstion { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 当前密炼电流
|
|
|
/// </summary>
|
|
|
public DataKeyValue CurrentMixerCurrent { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 密炼机本控
|
|
|
/// </summary>
|
|
|
public DataKeyValue MixerAuto { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 密炼机故障
|
|
|
/// </summary>
|
|
|
public DataKeyValue MixerNormal { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 炭黑称故障
|
|
|
/// </summary>
|
|
|
public DataKeyValue CarbonNormal { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 炭黑称自动手动
|
|
|
/// </summary>
|
|
|
public DataKeyValue CarbonAuto { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 油称故障
|
|
|
/// </summary>
|
|
|
public DataKeyValue OilNormal { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 油称自动手动
|
|
|
/// </summary>
|
|
|
public DataKeyValue OilAuto { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 粉料秤故障
|
|
|
/// </summary>
|
|
|
public DataKeyValue FenLiaoNormal { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 粉料秤自动手动
|
|
|
/// </summary>
|
|
|
public DataKeyValue FenLiaoAuto { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 密炼设定次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue RecipeSetNumber { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 计划停止
|
|
|
/// </summary>
|
|
|
public DataKeyValue StopPlan { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量设定次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue WeightSetNumber { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 开始密炼
|
|
|
/// </summary>
|
|
|
public DataKeyValue StartMix { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 开始称量
|
|
|
/// </summary>
|
|
|
public DataKeyValue StartWeight { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 终止密炼
|
|
|
/// </summary>
|
|
|
public DataKeyValue AbortMixing { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 终止称量
|
|
|
/// </summary>
|
|
|
public DataKeyValue AbortWeight { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 密炼机有料 100->110
|
|
|
/// </summary>
|
|
|
public DataKeyValue HasMaterial { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 系统复位
|
|
|
/// </summary>
|
|
|
public DataKeyValue SysReset { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 下位机报表处理标志、存盘标志、完成一车复位
|
|
|
/// </summary>
|
|
|
public DataKeyValue FinishedBatch { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 完成一车复位 等同 FinishedBatch
|
|
|
/// </summary>
|
|
|
//public DataKeyValue FinishedOneReset { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 密炼开始时间
|
|
|
/// </summary>
|
|
|
public DataKeyValue MixingStartTime { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 胶料称允许送料标志(用于锁秤判断)
|
|
|
/// </summary>
|
|
|
public DataKeyValue RubSL { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 胶料秤传送控制(胶料称送料标志的下一个地址字),用于胶料称解锁
|
|
|
/// </summary>
|
|
|
public DataKeyValue RubShusong { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 每车基本信息存盘
|
|
|
/// </summary>
|
|
|
public DataKeyValue SaveDataPerLot { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-慢称
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_MC { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-提前量
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_TQ { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-调整值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_TZ { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-点动值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_DD { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-高速称量速率
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_HS { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-炭黑-慢速称量速率
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_TanHei_LS { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油1-慢称
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_MC1 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油1-提前量
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_TQ1 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油1-调整值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_TZ1 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油1-点动值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_DD1 { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油2-慢称
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_MC2 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油2-提前量
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_TQ2 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油2-调整值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_TZ2 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-油2-点动值
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_You_DD2 { get; private set; }
|
|
|
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-慢称(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FenLiao_MC { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-提前量(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FenLiao_TQ { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-调整值(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FenLiao_TZ { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-点动值(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FenLiao_DD { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-高速称量速率(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FeiLiao_HS { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 称量物料参数-粉料-慢速称量速率(需配置1)///未用
|
|
|
/// </summary>
|
|
|
public DataKeyValue CLWLCS_FeiLiao_LS { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 系统报警1
|
|
|
/// </summary>
|
|
|
public DataKeyValue AlarmData1 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 系统报警2
|
|
|
/// </summary>
|
|
|
public DataKeyValue AlarmData2 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 系统报警3
|
|
|
/// </summary>
|
|
|
public DataKeyValue AlarmData3 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 系统报警4
|
|
|
/// </summary>
|
|
|
public DataKeyValue AlarmData4 { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 胶料秤、手动互转,1:手动>>自动;0:自动>>手动
|
|
|
/// </summary>
|
|
|
public DataKeyValue PloyAuto { get; private set; }
|
|
|
|
|
|
public DataKeyValue SaveDataCB { get; private set; }
|
|
|
|
|
|
public DataKeyValue SaveMixingData { get; private set; }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 修改完成数的相关属性
|
|
|
|
|
|
/// <summary>
|
|
|
/// 修改胶料完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyPloyDoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改小料完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyDrugDoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改炭黑完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyCBDoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改油1完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyOil1DoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改油2完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyOil2DoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改粉料完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyPowderDoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改密炼完成次数
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyMixDoneNum { get; private set; }
|
|
|
/// <summary>
|
|
|
/// 修改密炼完成次数标志
|
|
|
/// </summary>
|
|
|
public DataKeyValue ModifyMixDoneNumFlag { get; private set; }
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 胶料称称量画面和混炼画面用到的属性
|
|
|
|
|
|
/// <summary>
|
|
|
/// 胶料称量画面-配方名称(需配置)
|
|
|
/// </summary>
|
|
|
public DataKeyValue JLCLHM_RecipMixingName { get; set; }
|
|
|
/// <summary>
|
|
|
/// 胶料称量画面-小料列表
|
|
|
/// </summary>
|
|
|
public DataKeyValue JLCLHM_SmallMaterialList { get; set; }
|
|
|
/// <summary>
|
|
|
/// 胶料称量画面-条码物料列表
|
|
|
/// </summary>
|
|
|
public DataKeyValue JLCLHM_BarcodeMaterialList { get; set; }
|
|
|
/// <summary>
|
|
|
/// 胶料列表
|
|
|
/// </summary>
|
|
|
public DataKeyValue JLCLHM_plyList { get; set; }
|
|
|
/// <summary>
|
|
|
/// 网络状态(需配置)
|
|
|
/// </summary>
|
|
|
public DataKeyValue JLCLHM_netType { get; set; }
|
|
|
/// <summary>
|
|
|
/// 称量信息列表
|
|
|
/// </summary>
|
|
|
public DataKeyValue RecipeCache_WeightListTable { get; set; }
|
|
|
/// <summary>
|
|
|
/// 控件报警信息
|
|
|
/// </summary>
|
|
|
public DataKeyValue ContorlAlarmInfo { get; set; }
|
|
|
/// <summary>
|
|
|
/// 条码扫描报警信息
|
|
|
/// </summary>
|
|
|
public DataKeyValue ScanBarcodeAlarmInfo { get; set; }
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
#region 循环配方所有数据
|
|
|
|
|
|
public DataKeyValue AllRecipeData23 { get; private set; }
|
|
|
|
|
|
public DataKeyValue AllRecipeData24 { get; private set; }
|
|
|
#endregion
|
|
|
}
|
|
|
|
|
|
}
|