private CalcAirConditioningDto MakeAirConditioning([NotNull] TemperatureProfile temperatureProfile, [NotNull] HouseType houseType, [NotNull] HouseholdKey householdKey, [CanBeNull] out CalcLocationDto airConditioningLocation) { var coolingParameter = MakeCoolingParameters(temperatureProfile, houseType); if (coolingParameter == null) { airConditioningLocation = null; return(null); } var degreeHourDict = new List <CalcDegreeHourDto>(); foreach (var degreeHour in coolingParameter.DegreeHours) { var cdd = new CalcDegreeHourDto(degreeHour.Date.Year, degreeHour.Date.Month, degreeHour.Date.Day, degreeHour.Date.Hour, degreeHour.CoolingAmount); degreeHourDict.Add(cdd); } CalcLoadTypeDto lt = _ltDict.GetLoadtypeDtoByLoadType(coolingParameter.CoolingLoadType); var cdl = new CalcDeviceLoadDto(coolingParameter.CoolingLoadType.Name, -1, lt.Name, lt.Guid, coolingParameter.YearlyConsumption, 0, Guid.NewGuid().ToStrGuid(), 1); var cdls = new List <CalcDeviceLoadDto> { cdl }; airConditioningLocation = new CalcLocationDto("Air Conditioning", -100, Guid.NewGuid().ToStrGuid()); var csh = new CalcAirConditioningDto("Air Conditioning", -1, cdls, degreeHourDict, householdKey, airConditioningLocation.Name, airConditioningLocation.Guid, Guid.NewGuid().ToStrGuid()); return(csh); }
private static CalcSpaceHeatingDto MakeSpaceHeatingDto([NotNull] HeatingParameter heatingparameter, [NotNull] CalcLoadTypeDtoDictionary ltDict, [NotNull] HouseholdKey householdKey, [CanBeNull] out CalcLocationDto heatingLocation) //, List<CalcDeviceTaggingSet> taggingSets) { if (!ltDict.SimulateLoadtype(heatingparameter.HeatingLoadType)) { heatingLocation = null; return(null); } var degreeDayDict = new List <CalcDegreeDayDto>(); foreach (var degreeDay in heatingparameter.DegreeDays) { var cdd = new CalcDegreeDayDto(degreeDay.Date.Year, degreeDay.Date.Month, degreeDay.Date.Day, degreeDay.HeatingAmount); degreeDayDict.Add(cdd); } var lt = ltDict.GetLoadtypeDtoByLoadType(heatingparameter.HeatingLoadType); var cdl = new CalcDeviceLoadDto(heatingparameter.HeatingLoadType.Name, -1, lt.Name, lt.Guid, heatingparameter.YearlyConsumption, 0, Guid.NewGuid().ToStrGuid(), 1); var cdls = new List <CalcDeviceLoadDto> { cdl }; heatingLocation = new CalcLocationDto("Space Heating Location", -102, Guid.NewGuid().ToStrGuid()); var csh = new CalcSpaceHeatingDto("Space Heating", -1, cdls, degreeDayDict, householdKey, heatingLocation.Name, heatingLocation.Guid, Guid.NewGuid().ToStrGuid()); //foreach (var calcDeviceTaggingSet in taggingSets) { //calcDeviceTaggingSet.AddTag("Space Heating","House Device"); //} return(csh); }
public static List <CalcDeviceLoadDto> MakeCalcDeviceLoads([NotNull] RealDevice device, [NotNull] CalcLoadTypeDtoDictionary ltdtodict) { var deviceLoads = new List <CalcDeviceLoadDto>(); foreach (var realDeviceLoadType in device.Loads) { if (realDeviceLoadType.LoadType == null) { throw new LPGException("Loadtype was null"); } if (ltdtodict.SimulateLoadtype(realDeviceLoadType.LoadType)) { var cdl = new CalcDeviceLoadDto(realDeviceLoadType.Name, realDeviceLoadType.IntID, ltdtodict.Ltdtodict[realDeviceLoadType.LoadType].Name, ltdtodict.Ltdtodict[realDeviceLoadType.LoadType].Guid, realDeviceLoadType.AverageYearlyConsumption, realDeviceLoadType.StandardDeviation, Guid.NewGuid().ToStrGuid(), realDeviceLoadType.MaxPower); deviceLoads.Add(cdl); } } return(deviceLoads); }