Esempio n. 1
0
        //income processing
        protected override IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager)
        {
            var lastIncome = 0.0;
            var incomes    = new List <DayIncomeObject>();

            var startTime = UnixTimeHelper.GetCurrentDay();

            while (true)
            {
                var rawIncome = incomeManager.GetRow(startTime);
                var income    = new DayIncomeObject(rawIncome.time, rawIncome.value);
                if (income.time == 0)
                {
                    break;
                }

                if (lastIncome > 0)
                {
                    income.value = lastIncome - income.value;
                    incomes.Add(income);
                    lastIncome -= income.value;
                }
                else
                {
                    lastIncome = income.value;
                }

                startTime -= 86400;
            }

            incomes.Reverse();
            return(incomes.ToArray());
        }
Esempio n. 2
0
        public void Update()
        {
            var rawIncomes = GetRawData();
            var manager    = new RawIncomeManager(rawIncomes);

            dayIncomes      = ConvertRawData(manager);
            this.rawIncomes = rawIncomes.ToArray();
        }
Esempio n. 3
0
 protected override IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager)
 {
     return(new DayIncomeObject[0]);
 }
Esempio n. 4
0
 public PredictionObject(DayIncomeManager manager, RawIncomeManager rawManager)
 {
     this.manager    = manager;
     this.rawManager = rawManager;
 }
Esempio n. 5
0
 public StatisticObject(DayIncomeManager manager, RawIncomeManager rawManager)
 {
     this.manager    = manager;
     this.rawManager = rawManager;
 }
Esempio n. 6
0
 protected abstract IEnumerable <DayIncomeObject> ConvertRawData(RawIncomeManager incomeManager);