public static void AddSchedule(this ModelEnergyProperties modelEnergyCollection, IDdEnergyBaseModel schedule) { modelEnergyCollection.Schedules = modelEnergyCollection.Schedules ?? new List <AnyOf <ScheduleRulesetAbridged, ScheduleFixedIntervalAbridged, ScheduleRuleset, ScheduleFixedInterval> >(); var exist = modelEnergyCollection.Schedules.OfType <IIDdBase>().Any(_ => _.Identifier == schedule.Identifier); if (exist) { return; } switch (schedule) { case ScheduleRulesetAbridged em: modelEnergyCollection.Schedules.Add(em); break; case ScheduleFixedIntervalAbridged em: modelEnergyCollection.Schedules.Add(em); break; case ScheduleRuleset em: modelEnergyCollection.Schedules.Add(em); break; case ScheduleFixedInterval em: modelEnergyCollection.Schedules.Add(em); break; default: throw new ArgumentException($"{schedule.GetType()}({schedule.Identifier}) is not added to model"); } }
public static void AddConstructionSet(this ModelEnergyProperties modelEnergyCollection, IBuildingConstructionset constructionset) { modelEnergyCollection.ConstructionSets = modelEnergyCollection.ConstructionSets ?? new List <AnyOf <ConstructionSetAbridged, ConstructionSet> >(); var exist = modelEnergyCollection.ConstructionSets.OfType <IIDdBase>().Any(_ => _.Identifier == constructionset.Identifier); if (exist) { return; } switch (constructionset) { case ConstructionSetAbridged em: modelEnergyCollection.ConstructionSets.Add(em); break; case ConstructionSet em: modelEnergyCollection.ConstructionSets.Add(em); break; default: throw new ArgumentException($"{constructionset.GetType()}({constructionset.Identifier}) is not added to model"); } }
public static void AddConstructions(this ModelEnergyProperties modelEnergyCollection, List <IConstruction> constructions) { if (constructions == null) { return; } foreach (var item in constructions) { modelEnergyCollection.AddConstruction(item); } }
public static void AddMaterials(this ModelEnergyProperties modelEnergyCollection, List <IMaterial> materials) { if (materials == null) { return; } foreach (var item in materials) { modelEnergyCollection.AddMaterial(item); } }
public static void AddHVACs(this ModelEnergyProperties modelEnergyCollection, List <IHvac> havcs) { if (havcs == null) { return; } foreach (var item in havcs) { modelEnergyCollection.AddHVAC(item); } }
public SHWManagerViewModel(HB.ModelEnergyProperties libSource, Control control = default, Func <string> roomIDPicker = default) : base(control) { AmbientCoffConditionRoomPicker = roomIDPicker; _modelEnergyProperties = libSource; this._userData = libSource.Shws.Select(_ => new SHWViewData(_)).ToList(); this._systemData = SystemEnergyLib.Shws.Select(_ => new SHWViewData(_)).ToList(); this._allData = _userData.Concat(_systemData).Distinct(_viewDataComparer).ToList(); ResetDataCollection(); }
/// <summary> /// Initializes a new instance of the <see cref="ModelProperties" /> class. /// </summary> /// <param name="energy">energy.</param> /// <param name="radiance">radiance.</param> public ModelProperties ( // Required parameters ModelEnergyProperties energy = default, ModelRadianceProperties radiance = default // Optional parameters ) : base() // BaseClass { this.Energy = energy; this.Radiance = radiance; // Set non-required readonly properties with defaultValue this.Type = "ModelProperties"; }
public static void AddMaterial(this ModelEnergyProperties modelEnergyCollection, IMaterial material) { modelEnergyCollection.Materials = modelEnergyCollection.Materials ?? new List <AnyOf <EnergyMaterial, EnergyMaterialNoMass, EnergyWindowMaterialGas, EnergyWindowMaterialGasCustom, EnergyWindowMaterialGasMixture, EnergyWindowMaterialSimpleGlazSys, EnergyWindowMaterialBlind, EnergyWindowMaterialGlazing, EnergyWindowMaterialShade> >(); var exist = modelEnergyCollection.Materials.OfType <IMaterial>().Any(_ => _.Identifier == material.Identifier); if (exist) { return; } switch (material) { case EnergyMaterial em: modelEnergyCollection.Materials.Add(em); break; case EnergyMaterialNoMass em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialBlind em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialGas em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialGasCustom em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialGasMixture em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialGlazing em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialShade em: modelEnergyCollection.Materials.Add(em); break; case EnergyWindowMaterialSimpleGlazSys em: modelEnergyCollection.Materials.Add(em); break; default: throw new ArgumentException($"{material.GetType()}({material.Identifier}) is not added to model"); } }
public void MergeWith(ModelEnergyProperties other) { if (other == null) { return; } this.AddMaterials(other.MaterialList); this.AddConstructions(other.ConstructionList); this.AddConstructionSets(other.ConstructionSetList); this.AddHVACs(other.HVACList); this.AddSchedules(other.ScheduleList); this.AddScheduleTypeLimits(other.ScheduleTypeLimits); this.AddProgramTypes(other.ProgramTypeList); }
public static void AddConstruction(this ModelEnergyProperties modelEnergyCollection, IConstruction construction) { modelEnergyCollection.Constructions = modelEnergyCollection.Constructions ?? new List <AnyOf <OpaqueConstructionAbridged, WindowConstructionAbridged, WindowConstructionShadeAbridged, AirBoundaryConstructionAbridged, OpaqueConstruction, WindowConstruction, WindowConstructionShade, AirBoundaryConstruction, ShadeConstruction> >(); var exist = modelEnergyCollection.Constructions.OfType <IConstruction>().Any(_ => _.Identifier == construction.Identifier); if (exist) { return; } switch (construction) { case OpaqueConstruction em: modelEnergyCollection.Constructions.Add(em); break; case OpaqueConstructionAbridged em: modelEnergyCollection.Constructions.Add(em); break; case WindowConstruction em: modelEnergyCollection.Constructions.Add(em); break; case WindowConstructionAbridged em: modelEnergyCollection.Constructions.Add(em); break; case ShadeConstruction em: modelEnergyCollection.Constructions.Add(em); break; case AirBoundaryConstruction em: modelEnergyCollection.Constructions.Add(em); break; case AirBoundaryConstructionAbridged em: modelEnergyCollection.Constructions.Add(em); break; default: throw new ArgumentException($"{construction.GetType()}({construction.Identifier}) is not added to model"); } }