public Dialog_ModifierSetManager(ref ModelRadianceProperties libSource, bool returnSelectedOnly = false) : this() { libSource.FillNulls(); this._returnSelectedOnly = returnSelectedOnly; this._vm = new ModifierSetManagerViewModel(libSource, this); Content = Init(out var gd); this._vm.GridControl = gd; }
public SubModifierSetViewModel(ref ModelRadianceProperties libSource, string cName, Action <HoneybeeSchema.IIDdBase> setAction) : base(setAction) { HoneybeeSchema.Radiance.IModifier c = null; if (!string.IsNullOrEmpty(cName)) { // check in-model lib source before system lib c = libSource.ModifierList.FirstOrDefault(_ => _.Identifier == cName); c = c ?? SystemRadianceLib.ModifierList.FirstOrDefault(_ => _.Identifier == cName); } this.SetPropetyObj(c); _libSource = libSource; }
internal HB.ModelRadianceProperties CheckResources(HB.ModelRadianceProperties libSource) { var eng = new ModelRadianceProperties(); eng.AddModifierSet(this.ModifierSet); var names = this.ModifierSet.GetAllModifiers(); var mods = names.Select(_ => libSource.ModifierList.FirstOrDefault(c => c.Identifier == _)).Where(_ => _ != null); eng.AddModifiers(mods); return(eng.DuplicateModelRadianceProperties()); }
private static void LoadUserRadianceLibraries() { _userModifierSets = new List <Radiance.IBuildingModifierSet>(); _userModifiers = new List <Radiance.IModifier>(); var lib = LoadFromUserLibraryFolder(loadEnergy: false); if (lib.Radiance != null) { var rad = lib.Radiance; _userModifiers = rad.ModifierList.ToList(); _userModifierSets = rad.ModifierSetList.ToList(); _userRadiancelib = rad; } }
public void GlobalModifierSetTest() { var prop = new ModelRadianceProperties(); var global = prop.GlobalModifierSet; Assert.IsTrue(global == GlobalModifierSet.Default); var def = GlobalModifierSet.Default; Assert.IsTrue(def != null); Assert.IsTrue(def.WallSet?.ExteriorModifier != null); Assert.IsTrue(def.FloorSet?.ExteriorModifier != null); Assert.IsTrue(def.FloorSet?.ExteriorModifier != null); Assert.IsTrue(def.RoofCeilingSet?.ExteriorModifier != null); Assert.IsTrue(def.ApertureSet?.OperableModifier != null); Assert.IsTrue(def.DoorSet?.ExteriorModifier != null); Assert.IsTrue(def.ShadeSet?.ExteriorModifier != null); Assert.IsTrue(def.AirBoundaryModifier != null); }