/// <summary> /// Процедура обработки нажатий на DropDownItems меню mnuConsultMode /// </summary> private void mnuConsultMode_Click(object sender, EventArgs e) { ToolStripMenuItem mnuClicked = sender as ToolStripMenuItem; if (mnuClicked == null) { return; } IConsultData current = _consult == null ? null : _consult.DataSource; IConsultData clicked = _consltDataList[mnuClicked.Text]; mnuClicked.Checked = true; mnuConsultMode.Text = mnuConsultMode.Tag + " [" + mnuClicked.Text + "]"; //Если ничего выбрано небыло, то на этом все. if (current == null || current == clicked) { return; } _consult.DataSource = clicked; //Тип диагностики сменился string currentTxt = current.ToString(); ToolStripMenuItem mnuCurrent = mnuConsultMode.DropDownItems[currentTxt] as ToolStripMenuItem; if (mnuCurrent == null) { return; } mnuCurrent.Checked = false; }
internal void SelfTest(IConsultData data) { // Sensors _log.WriteEntry(this, "Begin selftest SENSORS", EventEntryType.Debug); SensorMonitoringParams sensMon; foreach (ConsultSensor i in data.AllSensors) { sensMon = new SensorMonitoringParams(this); sensMon.Add(i); byte[] cmd = sensMon.GetCommandToECU().ToArray(); try { SendCommand(cmd, ECUConst.ECU_REG_READ_CMD); data.ValidateSensor(i); string msg = String.Format("Sensor '{0}' [{1}] valid", i._name, BitConverter.ToString(i._registers)); _log.WriteEntry(this, msg, EventEntryType.Debug); } catch (NotSupportedException) { string msg = String.Format("Sensor '{0}' [{1}] is NOT supported", i._name, BitConverter.ToString(i._registers)); _log.WriteEntry(this, msg, EventEntryType.Debug); } catch (Exception ex) { _log.WriteEntry(this, ex); } } ECUFrameStop(); }
private void Initialize() { _port = "COM11"; _data = new ConsultData(new DataEngine()); _target = new Consult(_data); Log.Instance.NewMessage += new EventHandler <NewMessageEventArgs>(Instance_NewMessage); }
public ConsultBase(string port, IConsultData data) { DataSource = data; base.Port.PortName = port; Initialise(); }
public ConsultBase(IConsultData data) { _consultData = data; }
private void Initialize() { _port = "COM11"; _data = new ConsultData(new DataEngine()); _target = new Consult(_data); Log.Instance.NewMessage += new EventHandler<NewMessageEventArgs>(Instance_NewMessage); }
public FormSensorSelect(IConsultData data) { InitializeComponent(); InitializeCustomControls(); _data = data; }
public ConsultProvider(IConsultData data) : base(data) { }
public ConsultProvider(string port, IConsultData data) : base(port, data) { }
public ConsultBase(string port, IConsultData data) { DataSource = data; base.Port.PortName = port; Initialise (); }