示例#1
0
        private void Combo_DataSet_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Combo_DataSet.SelectedItem == null)
            {
                Builder             = null;
                TextBlock_Info.Text = "No selected DataSet";
                return;
            }

            if (Combo_DataSet.SelectedIndex == 0)
            {
                Builder             = null;
                TextBlock_Info.Text = "";
                return;
            }

            Builder = DataSetBuilder.Load(Combo_DataSet.SelectedItem.ToString());

            if (Builder == null)
            {
                Builder             = new DataSetBuilder(Combo_DataSet.SelectedItem.ToString());
                TextBlock_Info.Text = "Format error. Running session will reset the DataSet file.";
                return;
            }

            TextBlock_Info.Text         = Builder.GetInfo();
            Button_StartSession.Content = "Start Session " + (Builder.number_of_completed_sessions + 1);
        }
示例#2
0
        public static DataSet LoadSingleSection(string section_name)
        {
            var builder = DataSetBuilder.Load(section_name);

            return(new DataSet {
                sections = new Section[] { new Section {
                                               name = section_name, data_points = builder.data_points
                                           } }
            });
        }
示例#3
0
        public static DataSet LoadEverything()
        {
            var     section_names = DataSetBuilder.ListDataSetsNames();
            DataSet retval        = new DataSet {
                sections = new Section[section_names.Length]
            };

            for (int i = 0; i < section_names.Length; i++)
            {
                var builder = DataSetBuilder.Load(section_names[i]);
                retval.sections[i] = new Section {
                    name = section_names[i], data_points = builder.data_points
                };
            }

            return(retval);
        }
示例#4
0
        private void UpdateCombobox(object sender, EventArgs args)
        {
            string current_DataSet = Combo_DataSet.SelectedItem?.ToString();

            Combo_DataSet.Items.Clear();
            if (!Directory.Exists(DataSetBuilder.DataSetsFolder))
            {
                Directory.CreateDirectory(DataSetBuilder.DataSetsFolder);
            }

            Combo_DataSet.Items.Add("ALL");

            foreach (var data_set in DataSetBuilder.ListDataSetsNames())
            {
                Combo_DataSet.Items.Add(data_set);
                if (data_set == current_DataSet || Combo_DataSet.Items.Count == 1)
                {
                    Combo_DataSet.SelectedIndex = Combo_DataSet.Items.Count - 1;
                }
            }
        }