Пример #1
0
        private void OnUpdatedList()
        {
            EventHandler <TemperatureProfileEventArgs> handler = TemperatureProfileUpdated;

            if (handler != null)
            {
                TemperatureProfileEventArgs e = new TemperatureProfileEventArgs();
                e.lst = temperatureProfilesList;
                handler(this, e);
            }
        }
        private void Controller_TemperatureProfileUpdated(object sender, TemperatureProfileEventArgs e)
        {
            int index = lstProfiles.SelectedIndex;

            lstProfiles.Items.Clear();
            for (int i = 0; i < e.lst.Count(); i++)
            {
                lstProfiles.Items.Add(e.lst.ElementAt(i).fullName());
            }
            lstProfiles.SelectedIndex = index;

            chrtTemperatureProfile.Series[0].Points.Clear();
            double[,] prof = controller.getTotalProfile();
            for (int i = 0; i < prof.GetLength(0); i++)
            {
                chrtTemperatureProfile.Series[0].Points.AddXY(prof[i, 0], prof[i, 1]);
            }
        }