private void TimerCycle_Tick(object sender, EventArgs e) { if (userSerial.IsOpen && this.Enabled) { if (userSerial.sendCommand(cycleFuntion)) { setTestConloseText(cycleFuntion, TestStatus.Start); } } else { timerCycle.Stop(); } }
private void FormHome_ResetClick(object sender, EventArgs e) { if (MessageBox.Show(this, "Want to reset device?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { userSerial.sendWakeup(); Thread.Sleep(50); userSerial.sendCommand((byte)FuntionCode.DeviceReset); DeviceConnectStatus = DeviceConnectEnum.Diconnect; } }
private void btnsaveFlash_Click(object sender, EventArgs e) { userSerial.sendCommand((byte)FuntionCode.FlashSaved); formProcess = new FormProcess("Save setting to flash!"); DialogResult res = formProcess.ShowDialog(); if (res == DialogResult.No) { configItemSerialID.setMessage("Save setting Timeout!", ConfigMessageIconEnum.Error); } }