后台运行

master
nodyang 1 year ago
parent acebd40093
commit 94101f3a1d

@ -30,6 +30,13 @@ namespace Mesnac.Action.ChemicalWeighing.Test
{
public class TestAction : DatabaseAction, IAction
{
public void timer1EventProcessor(object source, EventArgs e)
{
this.startdate.MCValue = DateTime.Now.ToString();
}
IBaseControl startdate;
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime); //必须调用
@ -52,11 +59,16 @@ namespace Mesnac.Action.ChemicalWeighing.Test
var ss2s = BasePlcHelper.Instance.PlcReadByRunName("BU1BLT01_Set", out ssss);
FrmWeiRecipeDataAdd Form = new FrmWeiRecipeDataAdd(1);
Form.Show();
List<DbMCControl> mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.None);//获取所有待初始化控件
startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "MCLabel153".ToLower()).FirstOrDefault().BaseControl;
Timer timer1 = new Timer();
timer1.Interval = 1000;
timer1.Enabled = true;
timer1.Tick += new EventHandler(timer1EventProcessor);//添加事件
//ParametersWithPc.B1.FirstWord 256 768

@ -1,3 +1,3 @@
<DataSources>
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="192.168.1.19" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
<DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="127.0.0.1" UserName="sa" Password="123456" DataBase="CWSSHG" ConnectionTimeout="5" DriverAssembly="ICSharpCode.Data.SQLServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" DriverClass="ICSharpCode.Data.Core.DatabaseDrivers.SQLServer.SQLServerDatabaseDriver" DataSourceClass="ICSharpCode.Data.Core.DatabaseObjects.Database" />
</DataSources>

@ -13,7 +13,7 @@
</Connection>
</Main>
<Group>
<Group name="B1" block="2107" start="0" len="1032" access="ReadWrite" remark="ParametersWithPc" isautoread="True">
<Group name="B1" block="2107" start="0" len="1032" access="ReadWrite" remark="ParametersWithPc" isautoread="False">
<Data>
<Data name="FirstWord" runname="FirstWord" start="0" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="FirstWord" />
<Data name="WatchDog" runname="WatchDog" start="1" len="1" method="Default_ShortDiv()" max="" issave="False" subtractor="" remark="系统通用参数" />
@ -772,8 +772,6 @@
<Data name="AS7GET02" runname="AS1GET02" start="1029" len="1" method="Default_Bit(1,1)" max="" issave="False" subtractor="" remark="" />
<Data name="AS8GET01" runname="AS1GET01" start="1029" len="1" method="Default_Bit(2,1)" max="" issave="False" subtractor="" remark="" />
<Data name="AS8GET02" runname="AS8GET02" start="1029" len="1" method="Default_Bit(3,1)" max="" issave="False" subtractor="" remark="" />
<Data name="lowLevel_D1" runname="lowLevel_D1" start="1030" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="日罐 A 低料位" />
<Data name="highLevel_D1" runname="highLevel_D1" start="1030" len="1" method="Default_Bit(1,1)" max="" issave="False" subtractor="" remark="日罐 A 高料位" />
<Data name="lowLevel_D2" runname="lowLevel_D2" start="1030" len="1" method="Default_Bit(2,1)" max="" issave="False" subtractor="" remark="日罐 B 低料位" />
@ -798,8 +796,6 @@
<Data name="highLevel_D11" runname="highLevel_D11" start="1031" len="1" method="Default_Bit(5,1)" max="" issave="False" subtractor="" remark="日罐 K 高料位" />
<Data name="lowLevel_D12" runname="lowLevel_D12" start="1031" len="1" method="Default_Bit(6,1)" max="" issave="False" subtractor="" remark="日罐 L 低料位" />
<Data name="highLevel_D12" runname="highLevel_D12" start="1031" len="1" method="Default_Bit(7,1)" max="" issave="False" subtractor="" remark="日罐 L 高料位" />
</Data>
</Group>
<Group name="reportDataToPC" block="2106" start="0" len="2824" access="ReadWrite" remark="reportDataToPC" isautoread="False">
@ -3962,7 +3958,7 @@
<Data name="WeterM8Step9_Tolerance" runname="WeterM8Step9_Tolerance" start="1787" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="设定公差" />
</Data>
</Group>
<Group name="DB2102-valveInitDB" block="2102" start="0" len="99" access="ReadWrite" remark="valveInitDB" isautoread="True">
<Group name="DB2102-valveInitDB" block="2102" start="0" len="99" access="ReadWrite" remark="valveInitDB" isautoread="False">
<Data>
<Data name="BU1ASF01_ManualMode" runname="BU1ASF01_ManualMode" start="0" len="1" method="Default_Bit(0,1)" max="" issave="True" subtractor="" remark="手动模式" />
<Data name="BU1ASF01_AutoMode" runname="BU1ASF01_AutoMode" start="0" len="1" method="Default_Bit(1,1)" max="" issave="True" subtractor="" remark="自动模式" />
@ -5295,7 +5291,7 @@
<Data name="BUWeter8_P" runname="BUWeter8_P" start="98" len="1" method="Default_Bit(12,1)" max="" issave="True" subtractor="" remark="状态态志" />
</Data>
</Group>
<Group name="DB2103-motorInitDB" block="2103" start="0" len="209" access="ReadWrite" remark="motorInitDB" isautoread="True">
<Group name="DB2103-motorInitDB" block="2103" start="0" len="209" access="ReadWrite" remark="motorInitDB" isautoread="False">
<Data>
<Data name="DM1ASI01_ManualMode" runname="DM1ASI01_ManualMode" start="0" len="1" method="Default_Bit(0,1)" max="" issave="True" subtractor="" remark="手动模式" />
<Data name="DM1ASI01_AutoMode" runname="DM1ASI01_AutoMode" start="0" len="1" method="Default_Bit(1,1)" max="" issave="True" subtractor="" remark="自动模式" />

@ -736,7 +736,7 @@
<Property name="Size">1769, 1061</Property>
</Object>
<Property name="LoadActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHM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ye656qX5L2TBgcAAAAM5by55Ye656qX5L2TCw==</Binary>
</Property>
<Property name="ActivatedActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>

Loading…
Cancel
Save