Beispiel #1
0
        private void TrafficLight_Shown(object sender, EventArgs e)
        {
            var parameters = TrainData.nameParameter.Values.Where(o => o.StartsWith("Def")).ToArray();

            foreach (var parameter in parameters)
            {
                parameterCondition.Items.Add(XMLWork.FindNameWithScada(parameter, Properties.Settings.Default.Languages));
            }
            if (parameterCondition.Items.Count == 0)
            {
                MessageBox.Show(Localization.MyStrings.WithoutDefect);
            }
            if (parameterCondition.Items.Count != 0)
            {
                parameterCondition.SelectedIndex = 0;
            }
            if (ListAdd.Items.Count != 0)
            {
                ListAdd.SelectedIndex = 0;
            }
            if (ListDelete.Items.Count != 0)
            {
                ListDelete.SelectedIndex = 0;
            }
            if (ListAddError.Items.Count != 0)
            {
                ListAddError.SelectedIndex = 0;
            }
            if (ListDeleteError.Items.Count != 0)
            {
                ListDeleteError.SelectedIndex = 0;
            }
        }
Beispiel #2
0
 private void NormalDistribution_Shown(object sender, EventArgs e)
 {
     name_parametrs = TrainData.nameParameter.Values.Where(o => o.StartsWith("Def")).ToList();// || o.StartsWith("OPC")).ToList();
     ListParam.Items.Clear();
     foreach (var item in name_parametrs)
     {
         ListParam.Items.Add(XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages));
     }
 }
Beispiel #3
0
        void ShowProcessParameters()
        {
            string[] input, quality;
            input   = _inputParams.Select(item => XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages)).ToArray();
            quality = _qualityParams.Select(item => XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages)).ToArray();

            comboBoxInputParams.Items.Clear();
            comboBoxInputParams.Items.AddRange(input);
            comboBoxInputParams.SelectedIndex = 0;
            comboBoxQualityParams.Items.Clear();
            comboBoxQualityParams.Items.AddRange(quality);
            comboBoxQualityParams.SelectedIndex = 0;
        }
Beispiel #4
0
        public Kohonen()
        {
            if (!string.IsNullOrEmpty(Properties.Settings.Default.Languages))
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture =
                    System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Languages);
                System.Threading.Thread.CurrentThread.CurrentCulture =
                    System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Languages);
            }
            InitializeComponent();
            ListAdd.Items.Clear();
            ListDelete.Items.Clear();
            List <int> keys = new List <int>();
            Dictionary <int, decimal> firstRow = TrainData.Train.First().Input;

            foreach (OneRow data in TrainData.Train)
            {
                foreach (var item in data.Input)
                {
                    if (keys.Contains(item.Key))
                    {
                        continue;
                    }
                    if (item.Key != firstRow[item.Key])
                    {
                        keys.Add(item.Key);
                    }
                }
                break;
            }
            var parameters = TrainData.nameParameter.Values.Where(o => o.StartsWith("Def")).ToArray();

            foreach (var parameter1 in parameters)
            {
                ListAdd.Items.Add(XMLWork.FindNameWithScada(parameter1, Properties.Settings.Default.Languages));
            }
            foreach (int key in keys)
            {
                ListAdd.Items.Add(XMLWork.FindNameWithID(key, Properties.Settings.Default.Languages));
            }
            if (ListAdd.Items.Count != 0)
            {
                ListAdd.SelectedIndex = 0;
            }
            if (ListDelete.Items.Count != 0)
            {
                ListDelete.SelectedIndex = 0;
            }
        }
Beispiel #5
0
 void ShowParametersOnPage3()
 {
     if (checkedListBoxInputParametersToCheckPage3.SelectedItems.Count != 0)
     {
         return;
     }
     string[] input, quality;
     input   = _inputParams.Select(item => XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages)).ToArray();
     quality = _qualityParams.Select(item => XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages)).ToArray();
     comboBoxQualityParametersPage3.Items.Clear();
     comboBoxQualityParametersPage3.Items.AddRange(quality);
     comboBoxQualityParametersPage3.SelectedIndex = 0;
     checkedListBoxInputParametersToCheckPage3.Items.Clear();
     checkedListBoxInputParametersToCheckPage3.Items.AddRange(input);
 }
Beispiel #6
0
        private void RegressionAnalysisNew_Shown(object sender, EventArgs e)
        {
            _qualityParams = TrainData.nameParameter.Values.Where(o => o.StartsWith("Def")).ToArray();
            _inputParams   = TrainData.nameParameter.Values.Where(o => o.StartsWith("OPC")).ToArray();

            comboBoxInputParams.Items.Clear();
            comboBoxQualityParams.Items.Clear();
            foreach (var qualityParam in _qualityParams)
            {
                comboBoxQualityParams.Items.Add(XMLWork.FindNameWithScada(qualityParam, Properties.Settings.Default.Languages));
            }
            foreach (var inputParam in _inputParams)
            {
                comboBoxInputParams.Items.Add(XMLWork.FindNameWithScada(inputParam, Properties.Settings.Default.Languages));
            }
            comboBoxInputParams.SelectedIndex = comboBoxQualityParams.SelectedIndex = 0;
        }
Beispiel #7
0
        public Diagramm(List <DM.DecisionTree.TreeNode> rndForests)
        {
            if (!string.IsNullOrEmpty(Properties.Settings.Default.Languages))
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture =
                    System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Languages);
                System.Threading.Thread.CurrentThread.CurrentCulture =
                    System.Globalization.CultureInfo.GetCultureInfo(Properties.Settings.Default.Languages);
            }
            InitializeComponent();
            TrainData.GetData();
            List <string>            dictForestsSort = new List <string>();
            List <string>            secForestsSort  = new List <string>();
            Dictionary <string, int> dictForests     = new Dictionary <string, int>();
            Dictionary <string, int> secondForests   = new Dictionary <string, int>();

            foreach (DM.DecisionTree.TreeNode rndForest in rndForests)
            {
                if (!dictForests.ContainsKey(rndForest.attributeName))
                {
                    dictForests.Add(rndForest.attributeName, 1);
                }
                else
                {
                    dictForests[rndForest.attributeName]++;
                }
            }
            dictForestsSort = dictForests.Keys.ToList();

            InsertionSort(dictForestsSort, dictForests);


            this.chart1.Series.Clear();
            this.chart1.Titles.Clear();


            // Set palette.
            this.chart1.Palette = ChartColorPalette.SeaGreen;

            // Set title.
            this.chart1.Titles.Add("1st Node");
            double numberOfParameters = 1.0;

            foreach (var item in dictForestsSort)
            {
                //TODO Russian name
                if ((item != "False") && (item != "True"))
                {
                    var name = TrainData.nameParameter.SingleOrDefault(parameter => parameter.Value == item).Value;
                    // Add series.

                    Series series = this.chart1.Series.Add(XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages));
                    // Add point.
                    //series.Points.Add(Convert.ToDouble(item.Value));
                    series.Points.Add(dictForests[item]);
                }
            }

            foreach (var rndForest in rndForests)
            {
                foreach (var treeNode in rndForest.MChilds)
                {
                    if ((treeNode != null) && (treeNode.attributeName != "False") && ((treeNode.attributeName != "True")))
                    {
                        if (!secondForests.ContainsKey(treeNode.attributeName))
                        {
                            secondForests.Add(treeNode.attributeName, 1);
                        }
                        else
                        {
                            secondForests[treeNode.attributeName]++;
                        }
                    }
                }
            }

            secForestsSort = secondForests.Keys.ToList();
            InsertionSort(secForestsSort, secondForests);
            this.chart2.Series.Clear();
            this.chart2.Titles.Clear();


            // Set palette.
            this.chart2.Palette = ChartColorPalette.SeaGreen;

            // Set title.
            this.chart2.Titles.Add("2nd Node");

            foreach (var item in secForestsSort)
            {
                //TODO Russian name
                var name = TrainData.nameParameter.Single(parameter => parameter.Value == item).Value;
                // Add series.
                Series series = this.chart2.Series.Add(XMLWork.FindNameWithScada(item, Properties.Settings.Default.Languages));
                // Add point.
                series.Points.Add(secondForests[item]);
            }
        }