|
|
|
@ -28,6 +28,7 @@ using HslCommunication.Core;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.ManualControl;
|
|
|
|
|
using DevExpress.Pdf.Native;
|
|
|
|
|
using DevExpress.Utils.Drawing.Helpers;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
{
|
|
|
|
@ -44,6 +45,8 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
private Timer timer;
|
|
|
|
|
|
|
|
|
|
private string AlarmString = "报警信息 ";
|
|
|
|
|
|
|
|
|
|
//DataTable ParametersWithPCTable = new DataTable();
|
|
|
|
|
|
|
|
|
|
//所有Alarm点位
|
|
|
|
@ -75,6 +78,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
//报警列表控件
|
|
|
|
|
private DbMCControl AlarmForm = null;
|
|
|
|
|
private MCLabel MCWatchDog;
|
|
|
|
|
private HslMoveText AlarmMoveText;
|
|
|
|
|
|
|
|
|
|
//控件实体类
|
|
|
|
|
HslLanternAlarmEntity HslAlarmE = new HslLanternAlarmEntity();
|
|
|
|
@ -112,6 +116,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
DetailE.EMStop = Controls.FirstOrDefault(x => x.Name == "EMStop") as SystemStateShow;
|
|
|
|
|
|
|
|
|
|
MCWatchDog = Controls.FirstOrDefault(x => x.Name == "MCWatchDog") as MCLabel;
|
|
|
|
|
AlarmMoveText = Controls.FirstOrDefault(x => x.Name == "AlarmMoveText") as HslMoveText;
|
|
|
|
|
|
|
|
|
|
SetAllControls();
|
|
|
|
|
|
|
|
|
@ -162,6 +167,9 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
#region 控件导入
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 控件实体类导入前端控件
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void SetAllControls()
|
|
|
|
|
{
|
|
|
|
|
ControlsHelper.ControlImport<HslLanternAlarm>(HslAlarmE, Controls);
|
|
|
|
@ -177,8 +185,6 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
ControlsHelper.ControlImport<ThreeWayValve>(ThreeValveE, Controls);
|
|
|
|
|
ControlsHelper.ControlImport<HslLedDisplay>(LedDisplayE, Controls);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Type ledDisplayType = LedDisplayE.GetType();
|
|
|
|
|
PropertyInfo[] properties = ledDisplayType.GetProperties();
|
|
|
|
|
foreach (PropertyInfo sourceProperty in properties)
|
|
|
|
@ -196,6 +202,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
ledDisplay.DisplayText = "00:00";
|
|
|
|
|
property.SetValue(LedDisplayE, ledDisplay);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.AlarmMoveText.Font = new Font("宋体", 15f, FontStyle.Regular, GraphicsUnit.Point, 134);
|
|
|
|
|
this.AlarmMoveText.ForeColor = Color.White;
|
|
|
|
|
this.AlarmMoveText.MoveSpeed = 10f;
|
|
|
|
|
this.AlarmMoveText.Text = AlarmString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -553,12 +564,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
TempTable.Rows.Clear();
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
//string nowtime = DateTime.Now.ToString();
|
|
|
|
|
//报警点位遍历
|
|
|
|
|
foreach (DataRow rows in AllAlarmTable.Rows)
|
|
|
|
|
{
|
|
|
|
|
if ((int)rows["Alarm_Block"] == 2102 && b2[(int)rows["Alarm_Word"]].GetBit((int)rows["Alarm_bit"]) == true)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(rows["Alarm_Other_Info"].ToString());
|
|
|
|
|
sb.Append(" ");
|
|
|
|
|
sb.Append(rows["Alarm_Cn_Info"].ToString());
|
|
|
|
|
sb.Append(@" \ ");
|
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
|
dr[1] = rows["Alarm_Cn_Info"];
|
|
|
|
@ -567,6 +584,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
}
|
|
|
|
|
else if ((int)rows["Alarm_Block"] == 2107 && b7[(int)rows["Alarm_Word"]].GetBit((int)rows["Alarm_bit"]) == true)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(rows["Alarm_Other_Info"].ToString());
|
|
|
|
|
sb.Append(" ");
|
|
|
|
|
sb.Append(rows["Alarm_Cn_Info"].ToString());
|
|
|
|
|
sb.Append(@" \ ");
|
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
|
dr[1] = rows["Alarm_Cn_Info"];
|
|
|
|
@ -575,6 +596,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
}
|
|
|
|
|
else if ((int)rows["Alarm_Block"] == 2103 && b3[(int)rows["Alarm_Word"]].GetBit((int)rows["Alarm_bit"]) == true)
|
|
|
|
|
{
|
|
|
|
|
sb.Append(rows["Alarm_Other_Info"].ToString());
|
|
|
|
|
sb.Append(" ");
|
|
|
|
|
sb.Append(rows["Alarm_Cn_Info"].ToString());
|
|
|
|
|
sb.Append(@" \ ");
|
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
|
dr[1] = rows["Alarm_Cn_Info"];
|
|
|
|
@ -582,6 +607,14 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
TempTable.Rows.Add(dr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string str = sb.ToString();
|
|
|
|
|
str = str.Replace("\r\n", string.Empty);
|
|
|
|
|
if (str != AlarmString)
|
|
|
|
|
{
|
|
|
|
|
AlarmString = str;
|
|
|
|
|
AlarmMoveText.Text = str;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -1068,7 +1101,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
PlcReadTemp.DM2DSF01L_Set = false;
|
|
|
|
|
PlcReadTemp.DM2DSF01R_Set = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@ -1377,7 +1410,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
//yang 4特殊处理下 采用2107
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!PlcReadTemp.DM2DSF01L_Set&& !PlcReadTemp.DM2DSF01L_Set)
|
|
|
|
|
if (!PlcReadTemp.DM2DSF01L_Set && !PlcReadTemp.DM2DSF01L_Set)
|
|
|
|
|
{
|
|
|
|
|
PlcReadTemp.ValueWeight4 = 0;
|
|
|
|
|
}
|
|
|
|
@ -1700,7 +1733,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
/// </summary>
|
|
|
|
|
private string DryStepConvert(int code)
|
|
|
|
|
{
|
|
|
|
|
switch(code)
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case 1: return "加粉料";
|
|
|
|
|
case 4: return "时间控制";
|
|
|
|
@ -1895,11 +1928,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
}
|
|
|
|
|
public void SetMCLabel(MCLabel obj, bool state, int flag)
|
|
|
|
|
{
|
|
|
|
|
if(flag == 1)
|
|
|
|
|
if (flag == 1)
|
|
|
|
|
{
|
|
|
|
|
obj.Text = state ? "自动" : "手动";
|
|
|
|
|
}
|
|
|
|
|
else if(flag == 2)
|
|
|
|
|
else if (flag == 2)
|
|
|
|
|
{
|
|
|
|
|
obj.Text = state ? "开启" : "关闭";
|
|
|
|
|
}
|
|
|
|
|