From 7721798f73fbf63b983533a9101206a3e13d0185 Mon Sep 17 00:00:00 2001 From: Tristan Gerrish Date: Tue, 29 Nov 2022 13:22:07 +0000 Subject: [PATCH] Added LBT 5.3 converter methods --- BHoMUpgrader60/Converter.cs | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/BHoMUpgrader60/Converter.cs b/BHoMUpgrader60/Converter.cs index 80d759e..b14876b 100644 --- a/BHoMUpgrader60/Converter.cs +++ b/BHoMUpgrader60/Converter.cs @@ -40,6 +40,8 @@ public Converter() : base() PreviousVersion = "5.3"; ToNewObject.Add("BH.oM.Adapters.Revit.RevitMaterialTakeOff", UpgradeRevitMaterialTakeoff); + ToNewObject.Add("BH.oM.LadybugTools.ExternalComfortShelter", UpgradeShelter); + ToNewObject.Add("BH.oM.LadybugTools.ExternalComfortTypology", UpgradeTypology); } /***************************************************/ @@ -96,5 +98,41 @@ public static Dictionary UpgradeRevitMaterialTakeoff(Dictionary< } /***************************************************/ + + public static Dictionary UpgradeShelter(Dictionary oldVersion) + { + Dictionary newVersion = new Dictionary(); + newVersion["_t"] = "BH.oM.LadybugTools.Shelter"; + + newVersion["WindPorosity"] = oldVersion["Porosity"]; + newVersion["RadiationPorosity"] = oldVersion["Porosity"]; + newVersion["AzimuthRange"] = new List() { + (double)oldVersion["StartAzimuth"], + (double)oldVersion["EndAzimuth"] + }; + newVersion["AltitudeRange"] = new List() { + (double)oldVersion["StartAltitude"], + (double)oldVersion["EndAltitude"] + }; + + return newVersion; + } + + /***************************************************/ + + public static Dictionary UpgradeTypology(Dictionary oldVersion) + { + Dictionary newVersion = new Dictionary(); + newVersion["_t"] = "BH.oM.LadybugTools.Typology"; + + newVersion["Name"] = oldVersion["Name"]; + newVersion["Shelters"] = oldVersion["Shelters"]; + newVersion["EvaporativeCoolingEffectiveness"] = oldVersion["EvaporativeCoolingEffectiveness"]; + newVersion["WindSpeedAdjustment"] = 0; + + return newVersion; + } + + /***************************************************/ } }