예제 #1
0
        /// <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;
        }
예제 #2
0
        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();
        }
예제 #3
0
        private void Initialize()
        {
            _port   = "COM11";
            _data   = new ConsultData(new DataEngine());
            _target = new Consult(_data);

            Log.Instance.NewMessage += new EventHandler <NewMessageEventArgs>(Instance_NewMessage);
        }
예제 #4
0
 public ConsultBase(string port, IConsultData data)
 {
     DataSource         = data;
     base.Port.PortName = port;
     Initialise();
 }
예제 #5
0
 public ConsultBase(IConsultData data)
 {
     _consultData = data;
 }
예제 #6
0
        private void Initialize()
        {
            _port = "COM11";
            _data = new ConsultData(new DataEngine());
            _target = new Consult(_data);

            Log.Instance.NewMessage += new EventHandler<NewMessageEventArgs>(Instance_NewMessage);
        }
예제 #7
0
 public FormSensorSelect(IConsultData data)
 {
     InitializeComponent();
     InitializeCustomControls();
     _data = data;
 }
예제 #8
0
 public FormSensorSelect(IConsultData data)
 {
     InitializeComponent();
     InitializeCustomControls();
     _data = data;
 }
예제 #9
0
 public ConsultProvider(IConsultData data)
     : base(data)
 {
 }
예제 #10
0
 public ConsultProvider(string port, IConsultData data)
     : base(port, data)
 {
 }
예제 #11
0
 public ConsultProvider(IConsultData data)
     : base(data)
 {
 }
예제 #12
0
 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();
 }
예제 #13
0
 public ConsultProvider(string port, IConsultData data)
     : base(port, data)
 {
 }
예제 #14
0
 public ConsultBase(string port, IConsultData data)
 {
     DataSource = data;
     base.Port.PortName = port;
     Initialise ();
 }
예제 #15
0
 public ConsultBase(IConsultData data)
 {
     _consultData = data;
 }