// Handles the "Start Listening"-buttom click event private void btnStart_Click(object sender, EventArgs e) { InitChart(); // 声明新对象时,初始化其画图组件 PartialData = string.Empty; _spManager.StartListening(); _spManager.Send("12\r"); // 开始电压测量 }
/* * Handles the "Send"-buttom click event * @param sender - contains a reference to the control/object that raised the event. * @param e - contains the event data. */ private void btnSend_Click(object sender, EventArgs e) { _spManager.Send(tbDataTransmit.Text); }