public CalcDeviceFactory([NotNull] CalcLoadTypeDictionary loadTypeDictionary,
                          [NotNull] AvailabilityDtoRepository availabilityDtoRepository,
                          [NotNull] CalcVariableRepository calcVariableRepository, CalcRepo calcRepo)
 {
     _loadTypeDictionary        = loadTypeDictionary;
     _availabilityDtoRepository = availabilityDtoRepository;
     _calcVariableRepository    = calcVariableRepository;
     _calcRepo = calcRepo;
 }
示例#2
0
 public CalcAffordanceFactory([NotNull] CalcLoadTypeDictionary loadTypeDictionary,
                              [NotNull] AvailabilityDtoRepository availabilityDtoRepository,
                              CalcRepo calcRepo
                              //[NotNull] CalcVariableDtoFactory variableRepository
                              )
 {
     _loadTypeDictionary        = loadTypeDictionary;
     _availabilityDtoRepository = availabilityDtoRepository;
     _calcRepo = calcRepo;
     //_variableRepository = variableRepository;
 }
 public CalcHouseFactory([NotNull] CalcLoadTypeDictionary ltDict,
                         [NotNull] CalcModularHouseholdFactory cmhf,
                         [NotNull] AvailabilityDtoRepository availabilityDtoRepository,
                         [NotNull] CalcVariableRepository variableRepository,
                         [NotNull] CalcDeviceTaggingSets calcDeviceTaggingSets,
                         CalcRepo calcRepo)
 {
     _ltDict = ltDict;
     _cmhf   = cmhf;
     _availabilityDtoRepository = availabilityDtoRepository;
     _variableRepository        = variableRepository;
     _calcDeviceTaggingSets     = calcDeviceTaggingSets;
     _calcRepo = calcRepo;
 }
        public void MakeCalcDevices([NotNull][ItemNotNull] List <CalcLocation> locs, [NotNull][ItemNotNull] List <CalcDeviceDto> calcDeviceDtos,
                                    [ItemNotNull][NotNull] List <CalcDevice> calcDevices,
                                    [NotNull] HouseholdKey householdKey, [NotNull] CalcLoadTypeDictionary calcLoadTypeDictionary, CalcRepo calcRepo)
        {
            foreach (var cdd in calcDeviceDtos)
            {
                var cloc = locs.First(x => x.Guid == cdd.LocationGuid);
                // ggf dev category in dev umwandeln
                var deviceLoads = MakeCalcDeviceLoads(cdd, calcLoadTypeDictionary);

                var cdev = new CalcDevice(deviceLoads,
                                          cloc,
                                          cdd, calcRepo);

                cloc.Devices.Add(cdev);
                calcDevices.Add(cdev);
            }
        }
        //private readonly CalcVariableDtoFactory _variableDtoFactory;

        public CalcModularHouseholdFactory([NotNull] CalcLoadTypeDictionary ltDict,
                                           [NotNull] CalcLocationFactory clf,
                                           [NotNull] CalcPersonFactory cpf,
                                           [NotNull] CalcDeviceFactory cdf,
                                           [NotNull] CalcAffordanceFactory caf,
                                           [NotNull] CalcTransportationFactory ctf,
                                           [NotNull] CalcVariableRepository variableRepository,
                                           CalcRepo calcRepo
                                           )
        {
            _ltDict = ltDict;
            _clf    = clf;
            _cpf    = cpf;
            _cdf    = cdf;
            _caf    = caf;
            _ctf    = ctf;
            _calcVariableRepository = variableRepository;
            _calcRepo = calcRepo;
        }
        public static List <CalcDeviceLoad> MakeCalcDeviceLoads([NotNull] CalcDeviceDto device,
                                                                [NotNull] CalcLoadTypeDictionary calcLoadTypeDictionary)
        {
            var deviceLoads = new List <CalcDeviceLoad>();

            foreach (var ltdto in device.Loads)
            {
                if (calcLoadTypeDictionary.SimulateLoadtype(ltdto.LoadTypeGuid))
                {
                    var lt  = calcLoadTypeDictionary.GetLoadtypeByGuid(ltdto.LoadTypeGuid);
                    var cdl = new CalcDeviceLoad(ltdto.Name,
                                                 ltdto.MaxPower, lt,
                                                 ltdto.AverageYearlyConsumption, ltdto.PowerStandardDeviation);
                    deviceLoads.Add(cdl);
                }
            }

            return(deviceLoads);
        }
示例#7
0
        private List <CalcSite> MakeCalcSites([NotNull] CalcHouseholdDto household, [NotNull]
                                              DtoCalcLocationDict locDict, [NotNull] CalcLoadTypeDictionary ltDict,
                                              [NotNull] TransportationHandler th
                                              )
        {
            List <CalcSite> sites = new List <CalcSite>();

            //Dictionary<string, CalcSite> siteDictByGuid = new Dictionary<string, CalcSite>();
            if (household.CalcSites == null)
            {
                throw new LPGException("CalcSites was null"); //for the bug in the null checking
            }

            foreach (var siteDto in household.CalcSites)
            {
                var calcSite = new CalcSite(siteDto.Name, siteDto.Guid, household.HouseholdKey);
                sites.Add(calcSite);
                //siteDictByGuid.Add(siteDto.Guid, calcSite);
                foreach (var locGuid in siteDto.LocationGuid)
                {
                    CalcLocation calcLoc = locDict.GetCalcLocationByGuid(locGuid);
                    calcLoc.CalcSite = calcSite;
                    calcSite.Locations.Add(calcLoc);
                }

                foreach (var chargingStation in siteDto.ChargingStations)
                {
                    var gridLt = ltDict.GetLoadtypeByGuid(chargingStation.GridChargingLoadType.Guid);
                    var carLt  = ltDict.GetLoadtypeByGuid(chargingStation.CarChargingLoadType.Guid);
                    var cat    = th.GetCategory(chargingStation.DeviceCategory);
                    calcSite.AddChargingStation(gridLt, cat, chargingStation.MaxChargingPower,
                                                carLt, _calcRepo);
                }
            }
            return(sites);
        }
示例#8
0
 public CalcTransportationFactory([NotNull] CalcLoadTypeDictionary loadTypeDict,
                                  CalcRepo calcRepo)
 {
     _loadTypeDict = loadTypeDict;
     _calcRepo     = calcRepo;
 }
示例#9
0
 public CalcLocationFactory([NotNull] CalcLoadTypeDictionary calcLoadTypeDict, CalcRepo calcRepo
                            )
 {
     _calcLoadTypeDict = calcLoadTypeDict;
     _calcRepo         = calcRepo;
 }