Exemplo n.º 1
0
        internal IChartValues Filter(int m, int cutOffFrequency, int windowChoice, int filterChoice)
        {
            DataCapsule   loaded = SerializationLogics.Deserialize();
            List <double> factors, filtered;

            switch (filterChoice)
            {
            case 0:
                factors = FilterLogics.LowFilter(m, loaded.SamplingFrequency / cutOffFrequency);
                break;

            case 1:
                factors = FilterLogics.MediumFilter(FilterLogics.LowFilter(m, (loaded.SamplingFrequency / (loaded.SamplingFrequency / 4.0 - cutOffFrequency))));
                break;

            case 2:
                factors = FilterLogics.HighFilter(FilterLogics.LowFilter(m, (loaded.SamplingFrequency / (loaded.SamplingFrequency / 2.0 - cutOffFrequency))));
                break;

            default:
                throw new Exception("The filter combobox is out of its boundries.");
            }

            switch (windowChoice)
            {
            case 0:
                filtered = factors;
                break;

            case 1:
                filtered = FilterLogics.HammingWindow(factors);
                break;

            case 2:
                filtered = FilterLogics.HanningWindow(factors);
                break;

            case 3:
                filtered = FilterLogics.BlackmanWindow(factors);
                break;

            default:
                throw new Exception("The window combobox is out of its boundries.");
            }

            return(loaded.Weave(filtered).GetValues());
        }
 public void SelectFilterLogic(FilterLogics filterLogic)
 {
     switch(filterLogic)
     {
         case FilterLogics.And:
             UIUtil.DefaultProvider.WaitForDisplayAndClick("crFilters_customFilters_radioAND", LocateBy.Id);
             break;
         case FilterLogics.Or:
             UIUtil.DefaultProvider.WaitForDisplayAndClick("crFilters_customFilters_radioOR", LocateBy.Id);
             break;
         default:
             UIUtil.DefaultProvider.FailTest("No such logic!");
             break;
     }
 }