|
|
@ -28,6 +28,7 @@ using HslCommunication.Core;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.ManualControl;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.ManualControl;
|
|
|
|
using DevExpress.Pdf.Native;
|
|
|
|
using DevExpress.Pdf.Native;
|
|
|
|
|
|
|
|
using DevExpress.Utils.Drawing.Helpers;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -44,6 +45,8 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
|
|
private Timer timer;
|
|
|
|
private Timer timer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string AlarmString = "报警信息 ";
|
|
|
|
|
|
|
|
|
|
|
|
//DataTable ParametersWithPCTable = new DataTable();
|
|
|
|
//DataTable ParametersWithPCTable = new DataTable();
|
|
|
|
|
|
|
|
|
|
|
|
//所有Alarm点位
|
|
|
|
//所有Alarm点位
|
|
|
@ -75,6 +78,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
//报警列表控件
|
|
|
|
//报警列表控件
|
|
|
|
private DbMCControl AlarmForm = null;
|
|
|
|
private DbMCControl AlarmForm = null;
|
|
|
|
private MCLabel MCWatchDog;
|
|
|
|
private MCLabel MCWatchDog;
|
|
|
|
|
|
|
|
private HslMoveText AlarmMoveText;
|
|
|
|
|
|
|
|
|
|
|
|
//控件实体类
|
|
|
|
//控件实体类
|
|
|
|
HslLanternAlarmEntity HslAlarmE = new HslLanternAlarmEntity();
|
|
|
|
HslLanternAlarmEntity HslAlarmE = new HslLanternAlarmEntity();
|
|
|
@ -112,6 +116,7 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
DetailE.EMStop = Controls.FirstOrDefault(x => x.Name == "EMStop") as SystemStateShow;
|
|
|
|
DetailE.EMStop = Controls.FirstOrDefault(x => x.Name == "EMStop") as SystemStateShow;
|
|
|
|
|
|
|
|
|
|
|
|
MCWatchDog = Controls.FirstOrDefault(x => x.Name == "MCWatchDog") as MCLabel;
|
|
|
|
MCWatchDog = Controls.FirstOrDefault(x => x.Name == "MCWatchDog") as MCLabel;
|
|
|
|
|
|
|
|
AlarmMoveText = Controls.FirstOrDefault(x => x.Name == "AlarmMoveText") as HslMoveText;
|
|
|
|
|
|
|
|
|
|
|
|
SetAllControls();
|
|
|
|
SetAllControls();
|
|
|
|
|
|
|
|
|
|
|
@ -162,6 +167,9 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
|
|
#region 控件导入
|
|
|
|
#region 控件导入
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 控件实体类导入前端控件
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
private void SetAllControls()
|
|
|
|
private void SetAllControls()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ControlsHelper.ControlImport<HslLanternAlarm>(HslAlarmE, Controls);
|
|
|
|
ControlsHelper.ControlImport<HslLanternAlarm>(HslAlarmE, Controls);
|
|
|
@ -177,8 +185,6 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
ControlsHelper.ControlImport<ThreeWayValve>(ThreeValveE, Controls);
|
|
|
|
ControlsHelper.ControlImport<ThreeWayValve>(ThreeValveE, Controls);
|
|
|
|
ControlsHelper.ControlImport<HslLedDisplay>(LedDisplayE, Controls);
|
|
|
|
ControlsHelper.ControlImport<HslLedDisplay>(LedDisplayE, Controls);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Type ledDisplayType = LedDisplayE.GetType();
|
|
|
|
Type ledDisplayType = LedDisplayE.GetType();
|
|
|
|
PropertyInfo[] properties = ledDisplayType.GetProperties();
|
|
|
|
PropertyInfo[] properties = ledDisplayType.GetProperties();
|
|
|
|
foreach (PropertyInfo sourceProperty in properties)
|
|
|
|
foreach (PropertyInfo sourceProperty in properties)
|
|
|
@ -196,6 +202,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
ledDisplay.DisplayText = "00:00";
|
|
|
|
ledDisplay.DisplayText = "00:00";
|
|
|
|
property.SetValue(LedDisplayE, ledDisplay);
|
|
|
|
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
|
|
|
|
#endregion
|
|
|
@ -553,12 +564,18 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
|
|
TempTable.Rows.Clear();
|
|
|
|
TempTable.Rows.Clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
//string nowtime = DateTime.Now.ToString();
|
|
|
|
//string nowtime = DateTime.Now.ToString();
|
|
|
|
//报警点位遍历
|
|
|
|
//报警点位遍历
|
|
|
|
foreach (DataRow rows in AllAlarmTable.Rows)
|
|
|
|
foreach (DataRow rows in AllAlarmTable.Rows)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ((int)rows["Alarm_Block"] == 2102 && b2[(int)rows["Alarm_Word"]].GetBit((int)rows["Alarm_bit"]) == true)
|
|
|
|
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();
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[1] = rows["Alarm_Cn_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)
|
|
|
|
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();
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[1] = rows["Alarm_Cn_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)
|
|
|
|
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();
|
|
|
|
DataRow dr = TempTable.NewRow();
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[0] = rows["Alarm_Other_Info"];
|
|
|
|
dr[1] = rows["Alarm_Cn_Info"];
|
|
|
|
dr[1] = rows["Alarm_Cn_Info"];
|
|
|
@ -582,6 +607,14 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
TempTable.Rows.Add(dr);
|
|
|
|
TempTable.Rows.Add(dr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string str = sb.ToString();
|
|
|
|
|
|
|
|
str = str.Replace("\r\n", string.Empty);
|
|
|
|
|
|
|
|
if (str != AlarmString)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
AlarmString = str;
|
|
|
|
|
|
|
|
AlarmMoveText.Text = str;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|