public bool PrepareLoadProfileIfNeeded([NotNull] ProviderParameterDto parameters)
        {
            Module.SetPrint(0);
            //var relevantPotentials = _pvPotentials.Where(x => x.HouseGuid == houseComponent.HouseGuid);
            PvSystemEntry entry = (PvSystemEntry)parameters.HouseComponent;
            int           idx   = 0;

            foreach (var area in entry.PVAreas)
            {
                var key    = MakeKeyFromPVArea(area);
                var keystr = key.GetKey();
                //key has been checked in this run
                if (_checkedKeys.Contains(keystr))
                {
                    continue;
                }

                _checkedKeys.Add(keystr);
                bool isInDb = _saveableEntries.CheckForName(keystr, MyLogger);
                if (isInDb)
                {
                    continue;
                }

                Info("Missing pv profile for " + keystr + ", generating...");
                PVSystemSettings pvs = new PVSystemSettings(key, 1, 1, MyLogger, idx++);
                var profile          = pvs.Run(Services.RunningConfig);
                _saveableEntries.AddRow(profile);
                _saveableEntries.SaveDictionaryToDatabase(MyLogger);
            }

            return(true);
        }
示例#2
0
        public void RunPVTest()
        {
            PVSystemKey      key = new PVSystemKey(0, 30, 2050);
            PVSystemSettings pvs = new PVSystemSettings(key, 1, 1, Logger, 1);

            Directory.SetCurrentDirectory(Config.Directories.SamDirectory);
            var pvprofile = pvs.Run(Config);

            Logger.Info("Total Energy: " + pvprofile.EnergySum(), Stage.Testing, "RunPVTest");
        }