Exemple #1
0
 private void btnDisconnect_Click(object sender, EventArgs e)
 {
     R2k.deviceDisconnect();
     R2k.deviceUnInit();
     labelVersion.Text        = "";
     btnConnect.Enabled       = true;
     btnDisconnect.Enabled    = false;
     btnStartReadData.Enabled = false;
     btnStopReadData.Enabled  = false;
     bConnected = false;
 }
Exemple #2
0
 // 委托执行的连接函数,成功后修改标志并停止定时器
 private void ConnectDevice(byte[] ip, int CommPort, uint PortOrBaudRate)
 {
     if (0 != R2k.deviceInit(ip, CommPort, PortOrBaudRate))
     {
         labelVersion.Text = rm.GetString("strMsgInitFailure");
         return;
     }
     if (0 != R2k.deviceConnect())
     {
         return;
     }
     byte[] version = new byte[32];
     R2k.GetDevVersion(version);
     labelVersion.Text        = "Version:" + Encoding.Default.GetString(version);
     btnConnect.Enabled       = false;
     btnDisconnect.Enabled    = true;
     btnStartReadData.Enabled = true;
     bConnected = true;
     timerConnect.Stop();// 连接成功,结束定时器
 }
Exemple #3
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     R2k.BeginMultiInv(f);
     btnStopReadData.Enabled  = true;
     btnStartReadData.Enabled = false;
 }
Exemple #4
0
 private void btnStop_Click(object sender, EventArgs e)
 {
     R2k.StopInv();
     btnStartReadData.Enabled = true;
     btnStopReadData.Enabled  = false;
 }
Exemple #5
0
 private void btnInvokeOnce_Click(object sender, EventArgs e)
 {
     R2k.BeginOnceInv(f);
 }