private void cbLiveDisplay_CheckedChanged(object sender, EventArgs e) { try { if (cbLiveDisplay.Checked) { btnTrigger.Enabled = false; _system.SendCommand("SET LIVEIMG.MODE 2"); _system.BeginGetLiveImage( ImageFormat.jpeg, ImageSize.Sixteenth, ImageQuality.Medium, OnLiveImageArrived, null); } else { btnTrigger.Enabled = true; _system.SendCommand("SET LIVEIMG.MODE 0"); } } catch (Exception ex) { MessageBox.Show("Failed to set live image mode: " + ex.ToString()); } }
public void Trigger() { try { _system.SendCommand("TRIGGER ON"); Thread.Sleep(50); _system.SendCommand("TRIGGER OFF"); } catch { } }
public String get(String ipname, int trials, int pause) { String retval = "***"; System.Net.IPAddress ipaddress = System.Net.IPAddress.Parse(ipname); EthSystemConnector conn = new EthSystemConnector(ipaddress); conn.UserName = "******"; DataManSystem dataman = new DataManSystem(conn); int counter = 0; Boolean found = false; while ((found == false) && (counter < trials)) { try { dataman.Connect(); DmccResponse response = dataman.SendCommand("GET RESULT"); retval = response.PayLoad; found = true; } catch (Exception) { System.Threading.Thread.Sleep(pause * 1000); } finally { dataman.Disconnect(); counter++; } } return(retval); }
/// <summary> /// 重复扫码报警处理函数 /// </summary> /// <param name="flag"></param> private void displayAlert(Boolean flag) { if (flag) { this.pic_NG.Visible = true; this.pic_OK.Visible = false; try { dataManSystem.SendCommand("OUTPUT.DATAVALID-FAIL", 100); } catch (Exception) { } } else { this.pic_NG.Visible = false; this.pic_OK.Visible = true; } }