public void RefreshDiagnosticData() { lblMilStatus.Text = "OFF"; picMIL.Image = picMilOff.Image; lblTotalCodes.Text = "0"; richTextDTC.Text = ""; richTextPending.Text = ""; if (!m_obdInterface.ConnectedStatus) { m_obdInterface.GetLogger().TraceError("DTC Form, Attempted refresh without vehicle connection."); MessageBox.Show("必须首先与车辆进行连接,才能进行后续操作!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { ReadCodes(); RefreshDisplay(); } }
private void btnRefresh_Click(object sender, EventArgs e) { if (m_obdInterface.ConnectedStatus) { btnRefresh.Enabled = false; btnCancel.Enabled = true; m_KeepReading = true; m_FrameNumber = Convert.ToInt32(numFrame.Value); Task.Factory.StartNew(ReadFreezeFrameData); } else { m_obdInterface.GetLogger().TraceError("Freeze Frame Form, Attempted to refresh without vehicle connection."); MessageBox.Show( "必须先与车辆进行连接,才能进行后续操作", "出错", MessageBoxButtons.OK, MessageBoxIcon.Exclamation ); } }
private void btnUpdate_Click(object sender, EventArgs e) { if (!m_obdInterface.ConnectedStatus) { m_obdInterface.GetLogger().TraceError("Test Form, Attempted refresh without vehicle connection."); MessageBox.Show("必须首先与车辆进行连接,才能进行后续操作!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { btnUpdate.Enabled = false; UpdateTests(); btnUpdate.Enabled = true; } }
private void MainForm_Load(object sender, EventArgs e) { if (!m_obdInterface.LoadParameters(".\\configs\\generic.csv")) { m_obdInterface.GetLogger().TraceError("Failed to load generic parameter definitions!"); MessageBox.Show("加载generic.csv配置文件失败!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } if (m_obdInterface.LoadDTCDefinitions(".\\configs\\dtc.xml") == 0) { m_obdInterface.GetLogger().TraceError("Failed to load DTC definitions!"); MessageBox.Show("加载dtc.xml配置文件失败!", "出错", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }