Esempio n. 1
0
        public void PricePredictionTests()               // Tesztek a fenntartáshoz szükséges költség számításához.
        {
            // Test segédváltozók
            double expectedEdt;
            long   secondsTilMonthsEnd;
            double expectedPrice;

            // Testhez szükséges elemek1
            setupParameters1();

            // várt érték1
            expectedEdt         = ((inAverage - outAverage) / 0.3) * 8 * 1.4;
            secondsTilMonthsEnd = (DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month) - (DateTime.Today.Day - 1)) * 24 * 3600;

            // Elvárt érték1
            expectedPrice = expectedEdt * secondsTilMonthsEnd * 700 / (3.6e+9);

            // Assert1
            Assert.AreEqual((float)expectedPrice, (float)TestService.PricePrediction(TestSettings, InTempList, OutTempList));

            // Testhez szükséges elemek2
            setupParameters2();

            // várt érték2
            expectedEdt         = ((inAverage - outAverage) / 0.25) * 12 * 0.9;
            secondsTilMonthsEnd = (DateTime.DaysInMonth(DateTime.Today.Year, DateTime.Today.Month) - (DateTime.Today.Day - 1)) * 24 * 3600;

            // Elvárt érték2
            expectedPrice = expectedEdt * secondsTilMonthsEnd * 825 / (3.6e+9);

            // Assert2
            Assert.AreEqual((float)expectedPrice, (float)TestService.PricePrediction(TestSettings, InTempList, OutTempList));
        }
Esempio n. 2
0
        private void CalculationTimer_Tick(object sender, EventArgs e)
        {
            var insideTemp = new List <double>();

            foreach (var item in InsideDataList)
            {
                insideTemp.Add(item.Temperature);
            }
            lbAvgInsideTemp.Text = Math.Round(tempService.countAverage(insideTemp)).ToString();

            var outsideTemp = new List <double>();

            foreach (var item in OutsideDataList)
            {
                outsideTemp.Add(item.Temperature);
            }
            lbAvgOutsideTemp.Text = Math.Round(tempService.countAverage(outsideTemp)).ToString();

            lbConsumption.Text          = (tempService.CountConsumption(Settings, insideTemp, outsideTemp) / 1000000).ToString();
            lbEstimatedConsumption.Text = (tempService.EnergyPrediction(Settings, insideTemp, outsideTemp) / 1000000).ToString();

            lbCost.Text          = tempService.CountPrice(Settings, insideTemp, outsideTemp).ToString();
            lbEstimatedCost.Text = tempService.PricePrediction(Settings, insideTemp, outsideTemp).ToString();
        }