コード例 #1
0
        public MinAverageMaxValueAnalyzer()
            : base()
        {
            #region Create parameters
            Parameters.Add(new ScopeTreeLookupParameter <DoubleValue>("Value", "The value contained in the scope tree which should be analyzed."));
            Parameters.Add(new ValueLookupParameter <DoubleValue>("MinValue", "The minimum of the value."));
            Parameters.Add(new ValueParameter <BoolValue>("CollectMinValueInResults", "Determines if the minimum of the value should also be stored in the results.", new BoolValue(true)));
            Parameters.Add(new ValueLookupParameter <DoubleValue>("AverageValue", "The average of the value."));
            Parameters.Add(new ValueParameter <BoolValue>("CollectAverageValueInResults", "Determines if the average of the value should also be stored in the results.", new BoolValue(true)));
            Parameters.Add(new ValueLookupParameter <DoubleValue>("MaxValue", "The maximum of the value."));
            Parameters.Add(new ValueParameter <BoolValue>("CollectMaxValueInResults", "Determines if the maximum of the value should also be stored in the results.", new BoolValue(true)));
            Parameters.Add(new ValueLookupParameter <DataTable>("Values", "The data table to store the minimum, average and maximum of the value."));
            Parameters.Add(new ValueLookupParameter <VariableCollection>("Results", "The results collection where the analysis values should be stored."));
            #endregion

            #region Create operators
            MinAverageMaxValueCalculator minAverageMaxValueCalculator = new MinAverageMaxValueCalculator();
            DataTableValuesCollector     dataTableValuesCollector     = new DataTableValuesCollector();
            resultsCollector = new ResultsCollector();

            minAverageMaxValueCalculator.AverageValueParameter.ActualName = AverageValueParameter.Name;
            minAverageMaxValueCalculator.MaxValueParameter.ActualName     = MaxValueParameter.Name;
            minAverageMaxValueCalculator.MinValueParameter.ActualName     = MinValueParameter.Name;
            minAverageMaxValueCalculator.ValueParameter.ActualName        = ValueParameter.Name;
            minAverageMaxValueCalculator.ValueParameter.Depth             = ValueParameter.Depth;

            dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("MinValue", null, MinValueParameter.Name));
            dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("AverageValue", null, AverageValueParameter.Name));
            dataTableValuesCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("MaxValue", null, MaxValueParameter.Name));
            dataTableValuesCollector.DataTableParameter.ActualName = ValuesParameter.Name;

            if (CollectMinValueInResults.Value)
            {
                resultsCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("MinValue", null, MinValueParameter.Name));
            }
            if (CollectAverageValueInResults.Value)
            {
                resultsCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("AverageValue", null, AverageValueParameter.Name));
            }
            if (CollectMaxValueInResults.Value)
            {
                resultsCollector.CollectedValues.Add(new LookupParameter <DoubleValue>("MaxValue", null, MaxValueParameter.Name));
            }
            resultsCollector.CollectedValues.Add(new LookupParameter <DataTable>(ValuesParameter.Name));
            resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
            #endregion

            #region Create operator graph
            OperatorGraph.InitialOperator          = minAverageMaxValueCalculator;
            minAverageMaxValueCalculator.Successor = dataTableValuesCollector;
            dataTableValuesCollector.Successor     = resultsCollector;
            resultsCollector.Successor             = null;
            #endregion

            RegisterEventHandlers();
        }
コード例 #2
0
 private MinAverageMaxValueCalculator(MinAverageMaxValueCalculator original, Cloner cloner) : base(original, cloner) { }
コード例 #3
0
 private MinAverageMaxValueCalculator(MinAverageMaxValueCalculator original, Cloner cloner) : base(original, cloner)
 {
 }
コード例 #4
0
    public MinAverageMaxValueAnalyzer()
      : base() {
      #region Create parameters
      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Value", "The value contained in the scope tree which should be analyzed."));
      Parameters.Add(new ValueLookupParameter<DoubleValue>("MinValue", "The minimum of the value."));
      Parameters.Add(new ValueParameter<BoolValue>("CollectMinValueInResults", "Determines if the minimum of the value should also be stored in the results.", new BoolValue(true)));
      Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageValue", "The average of the value."));
      Parameters.Add(new ValueParameter<BoolValue>("CollectAverageValueInResults", "Determines if the average of the value should also be stored in the results.", new BoolValue(true)));
      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaxValue", "The maximum of the value."));
      Parameters.Add(new ValueParameter<BoolValue>("CollectMaxValueInResults", "Determines if the maximum of the value should also be stored in the results.", new BoolValue(true)));
      Parameters.Add(new ValueLookupParameter<DataTable>("Values", "The data table to store the minimum, average and maximum of the value."));
      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The results collection where the analysis values should be stored."));
      #endregion

      #region Create operators
      MinAverageMaxValueCalculator minAverageMaxValueCalculator = new MinAverageMaxValueCalculator();
      DataTableValuesCollector dataTableValuesCollector = new DataTableValuesCollector();
      resultsCollector = new ResultsCollector();

      minAverageMaxValueCalculator.AverageValueParameter.ActualName = AverageValueParameter.Name;
      minAverageMaxValueCalculator.MaxValueParameter.ActualName = MaxValueParameter.Name;
      minAverageMaxValueCalculator.MinValueParameter.ActualName = MinValueParameter.Name;
      minAverageMaxValueCalculator.ValueParameter.ActualName = ValueParameter.Name;
      minAverageMaxValueCalculator.ValueParameter.Depth = ValueParameter.Depth;

      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name));
      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name));
      dataTableValuesCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name));
      dataTableValuesCollector.DataTableParameter.ActualName = ValuesParameter.Name;

      if (CollectMinValueInResults.Value)
        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MinValue", null, MinValueParameter.Name));
      if (CollectAverageValueInResults.Value)
        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("AverageValue", null, AverageValueParameter.Name));
      if (CollectMaxValueInResults.Value)
        resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("MaxValue", null, MaxValueParameter.Name));
      resultsCollector.CollectedValues.Add(new LookupParameter<DataTable>(ValuesParameter.Name));
      resultsCollector.ResultsParameter.ActualName = ResultsParameter.Name;
      #endregion

      #region Create operator graph
      OperatorGraph.InitialOperator = minAverageMaxValueCalculator;
      minAverageMaxValueCalculator.Successor = dataTableValuesCollector;
      dataTableValuesCollector.Successor = resultsCollector;
      resultsCollector.Successor = null;
      #endregion

      RegisterEventHandlers();
    }