add - Timer部分引入

master
wangsr 1 year ago
parent b43b08586a
commit bcdede6928

@ -28,6 +28,7 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
this.groupBox1 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label12 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label();
@ -86,6 +87,7 @@
this.AutoMode_D = new System.Windows.Forms.Label(); this.AutoMode_D = new System.Windows.Forms.Label();
this.DmChange_S = new System.Windows.Forms.ListBox(); this.DmChange_S = new System.Windows.Forms.ListBox();
this.DmChange_D = new System.Windows.Forms.ListBox(); this.DmChange_D = new System.Windows.Forms.ListBox();
this.ValueTimer = new System.Windows.Forms.Timer(this.components);
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -747,6 +749,12 @@
this.DmChange_D.TabIndex = 3; this.DmChange_D.TabIndex = 3;
this.DmChange_D.SelectedIndexChanged += new System.EventHandler(this.DmChange_D_SelectedIndexChanged); this.DmChange_D.SelectedIndexChanged += new System.EventHandler(this.DmChange_D_SelectedIndexChanged);
// //
// ValueTimer
//
this.ValueTimer.Enabled = true;
this.ValueTimer.Interval = 1000;
this.ValueTimer.Tick += new System.EventHandler(this.ValueTimer_Tick);
//
// ValveStateMonitor // ValveStateMonitor
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -826,5 +834,6 @@
private System.Windows.Forms.Label label27; private System.Windows.Forms.Label label27;
private System.Windows.Forms.ListBox DmChange_S; private System.Windows.Forms.ListBox DmChange_S;
private System.Windows.Forms.ListBox DmChange_D; private System.Windows.Forms.ListBox DmChange_D;
private System.Windows.Forms.Timer ValueTimer;
} }
} }

@ -16,11 +16,22 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ValveStateMoni
{ {
string DmName_S = "BU3DBT06"; string DmName_S = "BU3DBT06";
string DmName_D = "DV1PCP01"; string DmName_D = "DV1PCP01";
public ValveStateMonitor() public ValveStateMonitor()
{ {
InitializeComponent(); InitializeComponent();
} }
private void ValueTimer_Tick(object sender, EventArgs e)
{
StateMonitor_D(DmName_D);
StateMonitor_S(DmName_S);
}
private void DmChange_S_SelectedIndexChanged(object sender, EventArgs e) private void DmChange_S_SelectedIndexChanged(object sender, EventArgs e)
{ {
DmName_S = dmNameValue[DmChange_S.Text]; DmName_S = dmNameValue[DmChange_S.Text];
@ -171,5 +182,7 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.ValveStateMoni
{ {
return GetDataNameValue(dmName, dmValue).NowValue.ToString(); return GetDataNameValue(dmName, dmValue).NowValue.ToString();
} }
} }
} }

@ -117,4 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="ValueTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>

@ -1,3 +1,3 @@
<DataSources> <DataSources>
<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" /> <DataSourceItem Name="DataSource1" Driver="MS SQL Server" Server="192.168.0.125" 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> </DataSources>
Loading…
Cancel
Save