예제 #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>();
 }