Example #1
0
        private void AddNewOutput(OutputGroup outGroup, Output output)
        {
            Output o = new Output(output);

            o.Calculators = new List <Calculator1>();
            if (output.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, output.Calculators, o.Calculators);
            }
            o.Outputs = new List <Extensions.Output>();
            if (output.Outputs != null)
            {
                foreach (Output outputseries in output.Outputs)
                {
                    Output outputseries2 = new Output(outputseries);
                    outputseries2.Calculators = new List <Calculator1>();
                    if (outputseries.Calculators != null)
                    {
                        ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, outputseries.Calculators, outputseries2.Calculators);
                    }
                    o.Outputs.Add(outputseries2);
                }
            }
            outGroup.Outputs.Add(o);
        }
Example #2
0
        private void AddNewInput(InputGroup inGroup, Input input)
        {
            Input i = new Input(input);

            i.Calculators = new List <Calculator1>();
            if (input.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, input.Calculators, i.Calculators);
            }
            i.Inputs = new List <Extensions.Input>();
            if (input.Inputs != null)
            {
                foreach (Input inputseries in input.Inputs)
                {
                    Input inputseries2 = new Input(inputseries);
                    inputseries2.Calculators = new List <Calculator1>();
                    if (inputseries.Calculators != null)
                    {
                        ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, inputseries.Calculators, inputseries2.Calculators);
                    }
                    i.Inputs.Add(inputseries2);
                }
            }
            inGroup.Inputs.Add(i);
        }
Example #3
0
        private void AddNewOutcomeToCollection(Outcome oc, List <Outcome> outcomes)
        {
            Outcome outcome = new Outcome(this.GCCalculatorParams, oc);

            outcome.Calculators = new List <Calculator1>();
            if (oc.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, oc.Calculators, outcome.Calculators);
            }
            outcome.Outputs = new List <Extensions.Output>();
            if (oc.Outputs != null)
            {
                foreach (Output output in oc.Outputs)
                {
                    Output o = new Output(output);
                    o.Calculators = new List <Calculator1>();
                    if (output.Calculators != null)
                    {
                        ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, output.Calculators, o.Calculators);
                    }
                    outcome.Outputs.Add(o);
                }
            }
            outcomes.Add(outcome);
        }
Example #4
0
        private void AddNewOCToCollection(OperationComponent opComp, List <OperationComponent> ocs)
        {
            OperationComponent oc = new OperationComponent(this.GCCalculatorParams, opComp);

            oc.Calculators = new List <Calculator1>();
            if (opComp.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, opComp.Calculators, oc.Calculators);
            }
            oc.Inputs = new List <Extensions.Input>();
            if (opComp.Inputs != null)
            {
                foreach (Input input in opComp.Inputs)
                {
                    Input i = new Input(input);
                    i.Calculators = new List <Calculator1>();
                    if (input.Calculators != null)
                    {
                        ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, input.Calculators, i.Calculators);
                    }
                    oc.Inputs.Add(i);
                }
            }
            ocs.Add(oc);
        }
Example #5
0
        private void AddNewTPToCollection(TimePeriod timeP, List <TimePeriod> tps)
        {
            TimePeriod tp = new TimePeriod(timeP);

            tp.Calculators = new List <Calculator1>();
            if (timeP.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, timeP.Calculators, tp.Calculators);
            }
            //calculators start with inputs and outputs
            tp.OperationComponents = new List <Extensions.OperationComponent>();
            if (timeP.OperationComponents != null)
            {
                foreach (OperationComponent oc in timeP.OperationComponents)
                {
                    AddNewOCToCollection(oc, tp.OperationComponents);
                }
            }
            tp.Outcomes = new List <Extensions.Outcome>();
            if (timeP.Outcomes != null)
            {
                foreach (Outcome outcome in timeP.Outcomes)
                {
                    AddNewOutcomeToCollection(outcome, tp.Outcomes);
                }
            }
            tps.Add(tp);
        }
Example #6
0
        private void AddNewBudgetToCollection(BudgetInvestment budI, List <BudgetInvestment> bis)
        {
            BudgetInvestment bi = new BudgetInvestment(this.GCCalculatorParams, budI);

            bi.Calculators = new List <Calculator1>();
            if (budI.Calculators != null)
            {
                ME2AnalyzerHelper.CopyStockCalculator(this.GCCalculatorParams, budI.Calculators, bi.Calculators);
            }
            //calculators start with inputs and outputs
            bi.TimePeriods = new List <Extensions.TimePeriod>();
            if (budI.TimePeriods != null)
            {
                foreach (TimePeriod tp in budI.TimePeriods)
                {
                    AddNewTPToCollection(tp, bi.TimePeriods);
                }
            }
            bis.Add(bi);
        }