Esempio n. 1
0
        private CombineDataKey GetDataCombineGroupKey(Combine2DDimensionGroupingDefinition combineGroupingDefinition,
                                                      TransactionInfo data)
        {
            CombineDataKey combineDataKey = new CombineDataKey()
            {
                XKey = GetDataGroupKey(combineGroupingDefinition.XDefinition, data),
                YKey = GetDataGroupKey(combineGroupingDefinition.YDefinition, data),
            };

            return(combineDataKey);
        }
 public CombineDataResult(CombineDataKey key,
                          List <CalculateDefinition> listCalculateDefinition)
 {
     Key       = key;
     _listData = new List <TransactionInfo>();
     _listCalculateDefinition = listCalculateDefinition;
     _sumValues = new Dictionary <CalculateDefinition, double>();
     foreach (var calculateDefinition in listCalculateDefinition)
     {
         _sumValues.Add(calculateDefinition, 0.0);
     }
 }
 public CombineDataResult(CombineDataKey key,
     List<CalculateDefinition> listCalculateDefinition)
 {
     Key = key;
     _listData = new List<TransactionInfo>();
     _listCalculateDefinition = listCalculateDefinition;
     _sumValues = new Dictionary<CalculateDefinition, double>();
     foreach (var calculateDefinition in listCalculateDefinition)
     {
         _sumValues.Add(calculateDefinition, 0.0);
     }
 }
Esempio n. 4
0
        public void AnalyzeData()
        {
            _logger.DebugFormat("Start Analyze Data");

            _dDimensionGroupingDefinitions = new Dictionary <string, Combine2DDimensionGroupingDefinition>();
            _keyDictionary  = new Dictionary <string, CombineDataKey>();
            _dataDictionary = new Dictionary <CombineDataKey, CombineDataResult>();

            LoopGroupDefinitionX(_dDimensionGroupingDefinitions, this.GroupingX, this.GroupingY);

            foreach (var dataItem in this.Data)
            {
                bool checkOk = true;
                if (DataFiltering != null)
                {
                    checkOk = DataFiltering.PerformCheck(dataItem);
                }

                if (checkOk)
                {
                    foreach (var combineGroupingDefinition in _dDimensionGroupingDefinitions.Values)
                    {
                        CombineDataKey combineDataKey = this.GetDataCombineGroupKey(combineGroupingDefinition, dataItem);
                        if (_keyDictionary.ContainsKey(combineDataKey.CombineKey) == false)
                        {
                            _keyDictionary.Add(combineDataKey.CombineKey, combineDataKey);
                        }
                        else
                        {
                            combineDataKey = _keyDictionary[combineDataKey.CombineKey];
                        }

                        CombineDataResult dataResult = null;
                        if (_dataDictionary.TryGetValue(combineDataKey, out dataResult) == false)
                        {
                            dataResult = new CombineDataResult(combineDataKey, this.CalculateDefinitions);
                            _dataDictionary.Add(combineDataKey, dataResult);
                        }
                        dataResult.AddData(dataItem);
                    }
                }
            }

            _logger.DebugFormat("Finish Analyze Data");
        }
        private CombineDataKey GetDataCombineGroupKey(Combine2DDimensionGroupingDefinition combineGroupingDefinition,
                                       TransactionInfo data)
        {
            CombineDataKey combineDataKey = new CombineDataKey()
            {
                XKey = GetDataGroupKey(combineGroupingDefinition.XDefinition, data),
                YKey = GetDataGroupKey(combineGroupingDefinition.YDefinition, data),
            };

            return combineDataKey;
        }