Пример #1
0
        public void FindEcuList()
        {
            comboECU.ItemsSource = null;
            Global.EcuList.Items.Clear();

            foreach (byte i in Global.diag.ReadDiagID())
            {
                if (!Global.EcuList.Items.Exists((ecu) => (ecu.Address == i)) && (i > 0))
                {
                    Global.EcuList.Items.Add(EcuList.CreateEcu(i));
                }
            }

            comboECU.ItemsSource = Global.EcuList.Items.Select((ecu) => { return(new StringBuilder(Enum.GetName(typeof(EcuModelId), ecu.ModelId) + "\t(" + ecu.Address.ToString() + ")").ToString()); });

            if (comboECU.Items.Count > 0)
            {
                comboECU.SelectedIndex = 0;
            }
        }
Пример #2
0
 static Global()
 {
     EcuList     = new EcuList();
     BackHistory = new Stack <Control>();
 }