public ProviderParameterDto([NotNull] IHouseComponent houseComponent, [NotNull] string lpgDirectoryInfo, [NotNull] HouseComponentRo houseComponentResultObject) { HouseComponent = houseComponent; LPGDirectoryInfo = lpgDirectoryInfo; HouseComponentResultObject = houseComponentResultObject; }
public bool IsCorrectProvider([NotNull] IHouseComponent houseComponent) { if (houseComponent.HouseComponentType == HouseComponentType.Infrastructure) { return(true); } return(false); }
public bool IsCorrectProvider([NotNull] IHouseComponent houseComponent) { if (houseComponent.HouseComponentType == HouseComponentType.Photovoltaik) { return(true); } return(false); }
public bool IsCorrectProvider([NotNull] IHouseComponent houseComponent) { if (houseComponent.HouseComponentType == HouseComponentType.OutboundElectricCommuter) { return(true); } return(false); }
public ILoadProfileProvider GetCorrectProvider([NotNull] IHouseComponent houseComponent) { var providers = Providers.Where(x => x.IsCorrectProvider(houseComponent)).ToList(); if (providers.Count != 1) { throw new FlaException("Not exactly one provider found for " + houseComponent.HouseComponentType + " : " + string.Join(",", providers.Select(x => x.Name))); } return(providers[0]); }
public bool IsCorrectProvider([NotNull] IHouseComponent houseComponent) { if (houseComponent.HouseComponentType == HouseComponentType.BusinessNoLastgangLowVoltage) { return(true); } if (houseComponent.HouseComponentType == HouseComponentType.BusinessNoLastgangHighVoltage) { return(true); } return(false); }
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Local private static void CheckProfileIntegrity([CanBeNull] Prosumer p, [NotNull] ILoadProfileProvider provider, [NotNull] IHouseComponent consumer, [NotNull][ItemNotNull] HashSet <string> validHouseGuids) { if (p == null) { throw new FlaException("Provider " + provider.Name + " returned null"); } if (!validHouseGuids.Contains(p.HouseGuid)) { throw new FlaException("Prosumer returned and invalid house guid"); } var profile = p.Profile; if (profile == null) { throw new FlaException("Invalid profile generation in provider " + provider.Name + ". Profile was null. House component was : " + consumer.HouseComponentType); } if (consumer.EffectiveEnergyDemand > 0 && Math.Abs(consumer.EffectiveEnergyDemand) < 0.00001) { throw new FlaException("Energy demand was not correctly initalized for " + consumer.Name + " (" + consumer.GetType().FullName + ")"); } if (profile.Values.Count != 35040) { throw new FlaException("Not a yearly profile form provider " + provider.Name + ". Profile count was " + profile.Values.Count); } if (profile.Values.Any(x => double.IsNaN(x))) { throw new FlaException("Profile contained NAN from provider " + provider.Name + " for customer " + consumer.Name); } if (p.TrafoKreis == null) { throw new FlaException("Trafokreis not set by " + provider.Name + " for customer " + consumer.Name); } if (p.ProviderName == null) { throw new FlaException("Trafokreis not set by " + provider.Name + " for customer " + consumer.Name); } }
public Screw(IHouseComponent parent) // a screw can be part of any component : base(parent) { }
protected void AddChild(IHouseComponent component) { _children.Add(component); }
protected HouseComponentBase(IHouseComponent parent) { Parent = parent; }
public void AddHouseComponent([NotNull] House house, [NotNull] Hausanschluss hausanschluss, [NotNull] IHouseComponent component) { string houseName = house.ComplexName; string hausanschlussGuid = hausanschluss.Guid; string name = component.Name; var housecomponenetType = component.HouseComponentType; double lowVoltageEnergy = component.LocalnetLowVoltageYearlyTotalElectricityUse; double highVoltageEnergy = component.LocalnetHighVoltageYearlyTotalElectricityUse; const string processingStatus = "unkown;"; var houseRo = Houses.Single(x => x.HouseName == houseName); var hausanschlussRo = houseRo.HausAnschlussList.Single(x => x.HausanschlussGuid == hausanschlussGuid); HouseComponentRo hc = new HouseComponentRo( name, housecomponenetType.ToString(), lowVoltageEnergy, highVoltageEnergy, processingStatus, JsonConvert.SerializeObject(component.OriginalISNs, Formatting.Indented), component.Standort, component.EffectiveEnergyDemand); hausanschlussRo.HouseComponents.Add(hc); _houseComponenetsRosByComponent.Add(component, hc); }
public HouseComponentRo this[[NotNull] IHouseComponent key] => _houseComponenetsRosByComponent[key];
public HouseComponentEntry([NotNull] IHouseComponent component, [NotNull] Hausanschluss hausanschluss, [NotNull] House house) { Component = component; Hausanschluss = hausanschluss; House = house; }