Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions BHoMUpgrader60/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/***************************************************/
Expand Down Expand Up @@ -96,5 +98,41 @@ public static Dictionary<string, object> UpgradeRevitMaterialTakeoff(Dictionary<
}

/***************************************************/

public static Dictionary<string, object> UpgradeShelter(Dictionary<string, object> oldVersion)
{
Dictionary<string, object> newVersion = new Dictionary<string, object>();
newVersion["_t"] = "BH.oM.LadybugTools.Shelter";

newVersion["WindPorosity"] = oldVersion["Porosity"];
newVersion["RadiationPorosity"] = oldVersion["Porosity"];
newVersion["AzimuthRange"] = new List<double>() {
(double)oldVersion["StartAzimuth"],
(double)oldVersion["EndAzimuth"]
};
newVersion["AltitudeRange"] = new List<double>() {
(double)oldVersion["StartAltitude"],
(double)oldVersion["EndAltitude"]
};

return newVersion;
}

/***************************************************/

public static Dictionary<string, object> UpgradeTypology(Dictionary<string, object> oldVersion)
{
Dictionary<string, object> newVersion = new Dictionary<string, object>();
newVersion["_t"] = "BH.oM.LadybugTools.Typology";

newVersion["Name"] = oldVersion["Name"];
newVersion["Shelters"] = oldVersion["Shelters"];
newVersion["EvaporativeCoolingEffectiveness"] = oldVersion["EvaporativeCoolingEffectiveness"];
newVersion["WindSpeedAdjustment"] = 0;

return newVersion;
}

/***************************************************/
}
}