Exemplo n.º 1
0
        public int ResetFactors(String measureName, String metricName)
        {
            int factorCount = 0;

            // Clear the Factor Table
            ConfigFactorTable.Clear();

            // Find the factor labels needed for the selected display
            if (CurConfigDisplay.Display == null)
            {
                return(-1);
            }

            foreach (DisplayFactorLabel displayFactorLabels in CurConfigDisplay.Display.DisplayFactorLabels)
            {
                FactorItem factorItem = new FactorItem();
                factorItem.DisplayFactorLabel = "Factor " + displayFactorLabels.FactorPos.ToString() + " (" + displayFactorLabels.Label + ")";
                factorItem.FactorPos          = displayFactorLabels.FactorPos;

                factorItem.FactorNames = new ObservableCollection <string>();
                factorItem.FactorNames.Add("Click here to select");

                foreach (ExperimentMeasure expMeasure in ConfigMeasuresTable)
                {
                    if ((expMeasure.Measure.Category.CompareTo(measureName) == 0) &&
                        (expMeasure.Measure.SubCategory.CompareTo("Metric") != 0))
                    {
                        if (!factorItem.FactorNames.Contains(expMeasure.Measure.SubCategory))
                        {
                            factorItem.FactorNames.Add(expMeasure.Measure.SubCategory);
                        }
                    }
                }

                if (factorItem.FactorNames.Count == 1)
                {
                    factorItem.FactorNames.Clear();
                }

                ConfigFactorTable.Add(factorItem);
                factorCount++;
            }

            OnPropertyChanged("ConfigFactorTable");

            return(factorCount);
        }
Exemplo n.º 2
0
        public int ResetFactors(String measureName, String metricName)
        {
            int factorCount = 0;

            // Clear the Factor Table
            ConfigFactorTable.Clear();

            // Find the factor labels needed for the selected display
            if (CurConfigDisplay.Display == null)
            {
                return - 1;
            }

            foreach (DisplayFactorLabel displayFactorLabels in CurConfigDisplay.Display.DisplayFactorLabels)
            {
                FactorItem factorItem = new FactorItem();
                factorItem.DisplayFactorLabel = "Factor " + displayFactorLabels.FactorPos.ToString() + " (" + displayFactorLabels.Label + ")";
                factorItem.FactorPos = displayFactorLabels.FactorPos;

                factorItem.FactorNames = new ObservableCollection<string>();
                factorItem.FactorNames.Add("Click here to select");

                foreach (ExperimentMeasure expMeasure in ConfigMeasuresTable)
                {
                    if ((expMeasure.Measure.Category.CompareTo(measureName) == 0) &&
                        (expMeasure.Measure.SubCategory.CompareTo("Metric") != 0))
                    {
                        if (!factorItem.FactorNames.Contains(expMeasure.Measure.SubCategory))
                        {
                            factorItem.FactorNames.Add(expMeasure.Measure.SubCategory);
                        }
                    }
                }

                if (factorItem.FactorNames.Count == 1)
                {
                    factorItem.FactorNames.Clear();
                }

                ConfigFactorTable.Add(factorItem);
                factorCount++;
            }

            OnPropertyChanged("ConfigFactorTable");

            return factorCount;
        }