读取报表 和消除报警

dep
我叫锄头 12 months ago
parent 5353c33893
commit 249eb1e1bc

@ -43,6 +43,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
private byte WetChoose3;
private byte WetChoose4;
/// <summary>
/// 取消报警按钮
/// </summary>
MCButton EliAlarms;
#region 控件属性定义
MCButton StartMetage1;
@ -166,6 +171,9 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
McControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件
_McControllist = GetAllDbMCControlsByOption(DbOptionTypes.Modify);//获取所有待初始化控件
EliAlarms = GetButtonControl("EliAlarms");
StartMetage1 = GetButtonControl("StartMetage1");
StopMetage1 = GetButtonControl("StopMetage1");
StartMetage2 = GetButtonControl("StartMetage2");
@ -358,6 +366,15 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
DB2119Helper DB2119 = new DB2119Helper();
#region 消除报警
if (EliAlarms == runtime.Sender)
{
PlcControl("DB2107.10.7", true);
Thread.Sleep(2000);
PlcControl("DB2107.10.7", false);
}
#endregion
#region 水称称量按钮
if (StartMetage1 == runtime.Sender)

@ -31,27 +31,27 @@ namespace Mesnac.Action.ChemicalWeighing.Report
{
LoggingService<ReportReadDb>.InfoFormatted("干混机1读取报表");
InsertD(1);
PlcConnect.Instance.Write("DB2017.5.6", false);
PlcConnect.Instance.Write("DB2107.5.6", false);
}
if (normal.RdyRpt_D2)
{
LoggingService<ReportReadDb>.InfoFormatted("干混机2读取报表");
InsertD(2);
PlcConnect.Instance.Write("DB2017.5.7", false);
PlcConnect.Instance.Write("DB2107.5.7", false);
}
if (normal.RdyRpt_D3)
{
LoggingService<ReportReadDb>.InfoFormatted("干混机3读取报表");
InsertD(3);
PlcConnect.Instance.Write("DB2017.6.0", false);
PlcConnect.Instance.Write("DB2107.6.0", false);
}
if (normal.RdyRpt_D4)
{
LoggingService<ReportReadDb>.InfoFormatted("干混机4读取报表");
InsertD(4);
PlcConnect.Instance.Write("DB2017.6.1", false);
PlcConnect.Instance.Write("DB2107.6.1", false);
}
//InsertG
@ -60,34 +60,34 @@ namespace Mesnac.Action.ChemicalWeighing.Report
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机1读取报表");
InsertG(1);
PlcConnect.Instance.Write("DB2017.6.2", false);
PlcConnect.Instance.Write("DB2107.6.2", false);
}
if (normal.RdyRpt_G2)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机2读取报表");
InsertG(2);
PlcConnect.Instance.Write("DB2017.6.3", false);
PlcConnect.Instance.Write("DB2107.6.3", false);
}
if (normal.RdyRpt_G3)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机3读取报表");
InsertG(3);
PlcConnect.Instance.Write("DB2017.6.4", false);
PlcConnect.Instance.Write("DB2107.6.4", false);
}
if (normal.RdyRpt_G4)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机4读取报表");
InsertG(4);
PlcConnect.Instance.Write("DB2017.6.5", false);
PlcConnect.Instance.Write("DB2107.6.5", false);
}
if (normal.RdyRpt_G5)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机5读取报表");
InsertG(5);
PlcConnect.Instance.Write("DB2017.6.6", false);
PlcConnect.Instance.Write("DB2107.6.6", false);
}
@ -95,56 +95,56 @@ namespace Mesnac.Action.ChemicalWeighing.Report
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机6读取报表");
InsertG(6);
PlcConnect.Instance.Write("DB2017.6.7", false);
PlcConnect.Instance.Write("DB2107.6.7", false);
}
if (normal.RdyRpt_G7)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机7读取报表");
InsertG(7);
PlcConnect.Instance.Write("DB2017.7.0", false);
PlcConnect.Instance.Write("DB2107.7.0", false);
}
if (normal.RdyRpt_G8)
{
LoggingService<ReportReadDb>.InfoFormatted("糊化机8读取报表");
InsertG(8);
PlcConnect.Instance.Write("DB2017.7.1", false);
PlcConnect.Instance.Write("DB2107.7.1", false);
}
if (normal.RdyRpt_M1)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机1读取报表");
InsertM(1);
PlcConnect.Instance.Write("DB2017.7.2", false);
PlcConnect.Instance.Write("DB2107.7.2", false);
}
if (normal.RdyRpt_M2)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机2读取报表");
InsertM(2);
PlcConnect.Instance.Write("DB2017.7.3", false);
PlcConnect.Instance.Write("DB2107.7.3", false);
}
if (normal.RdyRpt_M3)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机3读取报表");
InsertM(3);
PlcConnect.Instance.Write("DB2017.7.4", false);
PlcConnect.Instance.Write("DB2107.7.4", false);
}
if (normal.RdyRpt_M4)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机4读取报表");
InsertM(4);
PlcConnect.Instance.Write("DB2017.7.5", false);
PlcConnect.Instance.Write("DB2107.7.5", false);
}
if (normal.RdyRpt_M5)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机5读取报表");
InsertM(5);
PlcConnect.Instance.Write("DB2017.7.6", false);
PlcConnect.Instance.Write("DB2107.7.6", false);
}
@ -152,21 +152,21 @@ namespace Mesnac.Action.ChemicalWeighing.Report
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机6读取报表");
InsertM(6);
PlcConnect.Instance.Write("DB2017.7.7", false);
PlcConnect.Instance.Write("DB2107.7.7", false);
}
if (normal.RdyRpt_M7)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机7读取报表");
InsertM(7);
PlcConnect.Instance.Write("DB2017.8.0", false);
PlcConnect.Instance.Write("DB2107.8.0", false);
}
if (normal.RdyRpt_M8)
{
LoggingService<ReportReadDb>.InfoFormatted("湿混机8读取报表");
InsertM(8);
PlcConnect.Instance.Write("DB2017.8.1", false);
PlcConnect.Instance.Write("DB2107.8.1", false);
}
}

@ -19,6 +19,7 @@ using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjReport.OpenDoor;
using Mesnac.Action.ChemicalWeighing.MinAn;
using Mesnac.Action.ChemicalWeighing.Report;
using Mesnac.Action.ChemicalWeighing.RgvPlc;
using Mesnac.Basic;
using Mesnac.Codd.Session;
@ -41,7 +42,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
public void theout(object source, EventArgs e)
{
mCButton.Text = DateTime.Now.ToString();
ReportReadDb.Read();
}
@ -51,7 +52,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test
var allDb=GetAllControls();
mCButton = allDb.FirstOrDefault(x => x.Name == "MCButton1") as MCButton;
System.Timers.Timer t = new System.Timers.Timer(1000);//实例化Timer类设置间隔时间为10000毫秒
System.Timers.Timer t = new System.Timers.Timer(5000);//实例化Timer类设置间隔时间为10000毫秒
t.Elapsed += new System.Timers.ElapsedEventHandler(theout);//到达时间的时候执行事件;
t.AutoReset = true;//设置是执行一次false还是一直执行(true)
t.Enabled = true;//是否执行System.Timers.Timer.Elapsed事件

@ -1,5 +1,29 @@
<Object type="Mesnac.Gui.Common.FrmRunTemplate, Mesnac.Gui.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ManualWaterControl" children="Controls">
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="EliAlarms" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAACAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDhBNkE3NzM4OTg2NDRFQjlBQ0FGQkRDOEZENjZERjNDBgYAAAAM5oyJ6ZKu5LqL5Lu2BgcAAAAM5oyJ6ZKu5LqL5Lu2Cw==</Binary>
</Property>
<Property name="MCKey">EliAlarms</Property>
<Property name="MCDataSourceID" />
<Property name="IsDbControl">False</Property>
<Property name="InitDataSource" />
<Property name="ActionDataSource" />
<Property name="BindDataSource" />
<Property name="DbOptionType">Query</Property>
<Property name="MCVisible">True</Property>
<Property name="MCEnabled">True</Property>
<Property name="MCPurview">False</Property>
<Property name="Format" />
<Property name="TextName" />
<Property name="NewFillColor">Red</Property>
<Property name="OldFillColor">DarkGray</Property>
<Property name="Text">消除报警</Property>
<Property name="Location">702, 262</Property>
<Property name="Name">EliAlarms</Property>
<Property name="Size">148, 44</Property>
<Property name="TabIndex">30</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.HslSwitch, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="HslSwitch2" children="Controls">
<Property name="Location">777, 432</Property>
<Property name="Name">HslSwitch2</Property>

Loading…
Cancel
Save