public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(1, GlobalConsts.CSVCharacter,
                              LoadTypePriority.Mandatory,
                              configSetter: x => x.Enable(CalcOption.TimeOfUsePlot));
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var tou = new TimeOfUse(ccps, fft, cp);
                Logger.Info("Making picture");
                var di  = new DirectoryInfo(cs.DstDir);
                var rfe = cs.GetRfeByFilename("TimeOfUseProfiles.Electricity.csv");
                tou.MakePlot(rfe);
                //OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "TimeOfUseProfiles.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            cs.CleanUp();
            CleanTestBase.RunAutomatically(true);
        }
Ejemplo n.º 2
0
        public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            //ChartLocalizer.ShouldTranslate = true;
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(2, GlobalConsts.CSVCharacter,
                              configSetter: x => x.Enable(CalcOption.ActivationFrequencies));
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var aeupp = new AffordanceTaggingSet(ccps, fft, cp);
                Logger.Debug("Making picture");
                var             di  = new DirectoryInfo(cs.DstDir);
                ResultFileEntry rfe = cs.GetRfeByFilename("AffordanceTaggingSet.Wo bleibt die Zeit.HH1.csv");

                aeupp.MakePlot(rfe);
                Logger.Debug("finished picture");
                //OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "AffordanceTaggingSet.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            Logger.Warning("Open threads for database: " + Connection.ConnectionCount);
            Command.PrintOpenConnections();
            cs.CleanUp();
            CleanTestBase.RunAutomatically(true);
        }
Ejemplo n.º 3
0
        public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(1, GlobalConsts.CSVCharacter,
                              configSetter: x => x.Enable(CalcOption.LocationsFile));
            //cs.Wd.InputDataLogger.AddSaver(new HouseholdKeyLogger(cs.Wd.SqlResultLoggingService));
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                Logger.Info("Making picture");
                var di    = new DirectoryInfo(cs.DstDir);
                var files = FileFinder.GetRecursiveFiles(di, "LocationStatistics.HH1.csv");
                files.Count.Should().BeGreaterOrEqualTo(1);
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var locationStatistics = new LocationStatistics(ccps, fft, cp);
                var rfe = cs.GetRfeByFilename("LocationStatistics.HH1.csv");
                locationStatistics.MakePlot(rfe);
                Logger.Info("finished picture");
                //   OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "LocationStatistics.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            cs.CleanUp();
            CleanTestBase.RunAutomatically(true);
        }
Ejemplo n.º 4
0
        public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(1, GlobalConsts.CSVCharacter,
                              configSetter: x => x.Enable(CalcOption.ActivationFrequencies));
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var afpm = new ActivityPercentage(ccps, fft, cp);
                Logger.Info("Making picture");
                var di  = new DirectoryInfo(cs.DstDir);
                var rfe = cs.GetRfeByFilename("ActivityPercentage.HH1.csv");
                afpm.MakePlot(rfe);
                Logger.Info("finished picture");
                //OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "ActivityPercentage.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(2);
            }
            Logger.Warning("Leftover connections: " + Connection.ConnectionCount);
            cs.CleanUp();

            //CleanTestBase.Run(true);
        }
Ejemplo n.º 5
0
        public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(2, GlobalConsts.CSVCharacter, LoadTypePriority.Mandatory,
                              configSetter: x =>
            {
                x.Enable(CalcOption.DeviceProfilesIndividualHouseholds);
                x.Enable(CalcOption.HouseholdContents);
                x.SelectedEnergyIntensity = EnergyIntensityType.EnergySavingPreferMeasured;
                x.EndDateDateTime         = new DateTime(2012, 12, 31);
            }, energyIntensity: EnergyIntensityType.EnergySavingPreferMeasured);
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                DeviceProfiles.DaysToMake = 365;
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var calcParameters = new CalcParameterLogger(cs.Wd.SqlResultLoggingService).Load();
                var aeupp          = new DeviceProfiles(ccps, fft, cp, cs.Wd.SqlResultLoggingService, calcParameters);
                Logger.Info("Making picture");
                var di  = new DirectoryInfo(cs.DstDir);
                var rfe = cs.GetRfeByFilename("DeviceProfiles.Electricity.csv");
                aeupp.MakePlot(rfe);
                Logger.Info("finished picture");
                var imagefiles = FileFinder.GetRecursiveFiles(di, "DeviceProfiles.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            cs.CleanUp();
            CleanTestBase.RunAutomatically(true);
        }
        public FileFactoryAndTracker GetFileTracker()
        {
            if (Wd == null)
            {
                throw new LPGException("_wd was null");
            }
            var fft = new FileFactoryAndTracker(Wd.WorkingDirectory, "OxyplotTest", Wd.InputDataLogger);

            fft.ReadExistingFilesFromSql();
            return(fft);
        }
Ejemplo n.º 7
0
        public void MakePlotTest()
        {
            CleanTestBase.RunAutomatically(false);
            Config.MakePDFCharts = false;
            //ChartLocalizer.ShouldTranslate = false;
            var cs  = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());
            var rep = cs.StartHousehold(2, GlobalConsts.CSVCharacter,
                                        configSetter: x =>
            {
                x.Enable(CalcOption.AffordanceEnergyUse);
                x.Enable(CalcOption.HouseSumProfilesFromDetailedDats);
                x.Enable(CalcOption.DeviceProfilesIndividualHouseholds);
            });

            if (rep == null)
            {
                throw new LPGException("Failed to simulate");
            }

            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                ChartCreationParameters ccps = new ChartCreationParameters(144, 4000, 2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                CalculationProfiler     cp   = new CalculationProfiler();

                var affordanceEnergyUsePerPerson = new AffordanceEnergyUsePerPerson(ccps, fft, cp, rep);
                Logger.Info("Making picture");
                var di = new DirectoryInfo(cs.DstDir);
                //var rfe = cs.GetRfeByFilename("AffordanceEnergyUsePerPerson.HH1.Electricity.csv");
                var keys = rep.HouseholdKeys;
                rep.FindTableByKey(ResultTableID.AffordanceEnergyUse, keys[1].HHKey);
                affordanceEnergyUsePerPerson.MakePlot(keys[1]);
                Logger.Info("finished picture");
                //OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "AffordanceEnergyUsePerPerson.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            cs.CleanUp();
            //CleanTestBase.Run(true);
        }
Ejemplo n.º 8
0
        public void MakePlotTest()
        {
            var cs = new OxyCalculationSetup(Utili.GetCurrentMethodAndClass());

            cs.StartHousehold(1, GlobalConsts.CSVCharacter,
                              configSetter: x => x.Enable(CalcOption.TotalsPerDevice));
            using (FileFactoryAndTracker fft = new FileFactoryAndTracker(cs.DstDir, "1", cs.Wd.InputDataLogger))
            {
                fft.ReadExistingFilesFromSql();
                CalculationProfiler     cp   = new CalculationProfiler();
                ChartCreationParameters ccps = new ChartCreationParameters(300, 4000,
                                                                           2500, false, GlobalConsts.CSVCharacter, new DirectoryInfo(cs.DstDir));
                var aeupp = new DeviceSums(ccps, fft, cp);
                Logger.Info("Making picture");
                var di  = new DirectoryInfo(cs.DstDir);
                var rfe = cs.GetRfeByFilename("DeviceSums.Electricity.csv");
                aeupp.MakePlot(rfe);
                Logger.Info("finished picture");
                //OxyCalculationSetup.CopyImage(resultFileEntries[0].FullFileName);
                var imagefiles = FileFinder.GetRecursiveFiles(di, "DeviceSums.Electricity.*.png");
                imagefiles.Count.Should().BeGreaterOrEqualTo(1);
            }
            cs.CleanUp();
        }