Пример #1
0
        private void calculateIndirectMetric(String metric_name, List<String> submetrics_names)
        {
            Metric result_metric = new Metric(metric_name, metric_name, true);

            foreach (String submetric_name in submetrics_names)
            {
                Metric submetric = metrics[submetric_name];
                result_metric = result_metric + submetric;
            }

            metrics.Add(metric_name, result_metric);
        }
Пример #2
0
        public static Metric operator +(Metric c1, Metric c2)
        {
            Metric res = new Metric(c1.name, c1.class_code, c1.left_T_side);

            if (c1.years_data.Count == 0)
            {
                res.years_data = c2.years_data;
            }
            else
            {
                for (int i = 0; i < c1.years_data.Count && i < c2.years_data.Count; i++)
                {
                    if (c1.years_data[i].year == c2.years_data[i].year)
                        res.years_data.Add(c1.years_data[i] + c2.years_data[i]);
                }
            }
            return res;
        }