frmgroupstatus.cs

来自「OPC CLIENT开发包」· CS 代码 · 共 46 行

CS
46
字号
internal partial class frmGroupStatus : System.Windows.Forms.Form
{
	public int TimeBias;
	public int UpdateRate;
	public int LCID;
	public int Active;
	public float DeadBand;
	public string frmGroupName;

	private void CancelButton_Renamed_Click(object eventSender, System.EventArgs eventArgs)
	{
		this.Close();
	}

	private void frmGroupStatus_Load(object eventSender, System.EventArgs eventArgs)
	{
		GetStat();
	}
	private void GetStat()
	{
        if (YFOPCSDK.OPC_GetGroupStat(Module1.ServerHandle, Module1.GroupHandle, ref UpdateRate, ref Active, ref TimeBias, ref DeadBand, ref LCID)!=0)
		{
			Text1.Text = frmGroupName;
			if (Active == 0) Check1.CheckState = System.Windows.Forms.CheckState.Unchecked; 			else Check1.CheckState = System.Windows.Forms.CheckState.Checked; 
			Text2.Text = UpdateRate.ToString();
			Text3.Text = DeadBand.ToString();
			Text4.Text = TimeBias.ToString();
		}
	}
	private void OKButton_Click(object eventSender, System.EventArgs eventArgs)
	{
        this.DialogResult = System.Windows.Forms.DialogResult.OK;
		frmGroupName = Text1.Text;
		UpdateRate = int.Parse(Text2.Text);
		TimeBias = int.Parse(Text4.Text);
		LCID = 0;
		DeadBand = 0;
		if (Check1.CheckState == 0) 
            Active = 0; 
        else 
            Active = 1; 
		this.Close();
	}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?