From 148a6bd40c7b3c93dabce03403f08e8cecdb89d2 Mon Sep 17 00:00:00 2001 From: lorinczandrea Date: Thu, 13 Jun 2024 20:43:57 +0200 Subject: [PATCH] :up: update country codes --- FemDesign.Core/Model/CountryEnum.cs | 45 +++++++++++++------ .../Deconstruct/ModelDeconstruct.cs | 2 +- .../LoadCategoryDatabaseDefault.cs | 2 +- .../Loads/Load groups/LoadGroupToLoadComb.cs | 2 +- .../Materials/MaterialDatabase.cs | 6 +-- FemDesign.Grasshopper/Model/ModelConstruct.cs | 2 +- 6 files changed, 38 insertions(+), 21 deletions(-) diff --git a/FemDesign.Core/Model/CountryEnum.cs b/FemDesign.Core/Model/CountryEnum.cs index ac8f2b7ea..2170042c1 100644 --- a/FemDesign.Core/Model/CountryEnum.cs +++ b/FemDesign.Core/Model/CountryEnum.cs @@ -13,6 +13,13 @@ namespace FemDesign /// public enum Country { + /// + /// Belgian annex + /// + [Parseable("B", "b", "belgium", "Belgium", "belgian", "Belgian")] + [XmlEnum("B")] + B, + /// /// Unspecified/Common annex /// @@ -23,55 +30,63 @@ public enum Country /// /// German annex /// - [Parseable("D", "d", "germany", "Germany")] + [Parseable("D", "d", "germany", "Germany", "german", "German")] [XmlEnum("D")] D, /// /// Danish annex /// - [Parseable("DK", "dk", "denmark", "Denmark")] + [Parseable("DK", "dk", "denmark", "Denmark", "danish", "Danish")] [XmlEnum("DK")] DK, + /// + /// Spanish annex + /// + [Parseable("E", "e", "spain", "Spain", "spanish", "Spanish")] + [XmlEnum("E")] + E, + /// /// Estonian annex /// - [Parseable("EST", "est", "estonia", "Estonia")] + [Parseable("EST", "est", "estonia", "Estonia", "estonian", "Estonian")] [XmlEnum("EST")] EST, + /// /// Finnish annex /// - [Parseable("FIN", "fin", "finland", "Finland")] + [Parseable("FIN", "fin", "finland", "Finland", "finnish", "Finnish")] [XmlEnum("FIN")] FIN, /// - /// Brittish annex + /// British annex /// - [Parseable("GB", "gb", "brittish", "Brittish", "great britain", "Great Britain")] + [Parseable("GB", "gb", "british", "British", "great britain", "Great Britain")] [XmlEnum("GB")] GB, /// /// Hungarian annex /// - [Parseable("H", "h", "hungary", "Hungary")] + [Parseable("H", "h", "hungary", "Hungary", "hungarian", "Hungarian")] [XmlEnum("H")] H, /// /// Latvian annex /// - [Parseable("LT", "lt", "lithuania", "Lithuania")] + [Parseable("LT", "lt", "latvia", "Latvia", "latvian", "Latvian")] [XmlEnum("LT")] LT, /// /// Norwegian annex /// - [Parseable("N", "n", "norway", "Norway")] + [Parseable("N", "n", "norway", "Norway", "norwegian", "Norwegian")] [XmlEnum("N")] N, @@ -85,25 +100,29 @@ public enum Country /// /// Polish annex /// - [Parseable("PL", "pl", "poland", "Poland")] + [Parseable("PL", "pl", "poland", "Poland", "polish", "Polish")] [XmlEnum("PL")] PL, /// /// Romanian annex /// - [Parseable("RO", "ro", "romania", "Romania")] + [Parseable("RO", "ro", "romania", "Romania", "romanian", "Romanian")] [XmlEnum("RO")] RO, + /// /// Swedish annex /// - [Parseable("S", "s", "SE", "sweden", "Sweden", "😎")] + [Parseable("S", "s", "SE", "sweden", "Sweden", "swedish", "Swedish", "😎")] [XmlEnum("S")] S, /// - /// Turkish annex + /// Turkish annex. + ///

+ ///

+ /// Note: the TR (Turkish) national annex is no longer supported by FEM-Design. ///
[Parseable("TR", "tr", "turkey", "Turkey")] [XmlEnum("TR")] diff --git a/FemDesign.Grasshopper/Deconstruct/ModelDeconstruct.cs b/FemDesign.Grasshopper/Deconstruct/ModelDeconstruct.cs index e0bc9aa39..cc697f914 100644 --- a/FemDesign.Grasshopper/Deconstruct/ModelDeconstruct.cs +++ b/FemDesign.Grasshopper/Deconstruct/ModelDeconstruct.cs @@ -20,7 +20,7 @@ protected override void RegisterInputParams(GH_InputParamManager pManager) } protected override void RegisterOutputParams(GH_OutputParamManager pManager) { - pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code: B/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR.", GH_ParamAccess.item); + pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code: B/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR\n\nNote: the TR (Turkish) national annex is no longer supported by FEM-Design.", GH_ParamAccess.item); pManager.AddGenericParameter("Foundations", "Foundations", "Single foundation element or list of foundation elements.", GH_ParamAccess.list); pManager.AddGenericParameter("Bars", "Bars", "Single bar element or list of bar elements.", GH_ParamAccess.list); pManager.AddGenericParameter("Shells", "Shells", "Single shell element or list of shell elements.", GH_ParamAccess.list); diff --git a/FemDesign.Grasshopper/Loads/Load categories/LoadCategoryDatabaseDefault.cs b/FemDesign.Grasshopper/Loads/Load categories/LoadCategoryDatabaseDefault.cs index c24caedea..49c0b8f21 100644 --- a/FemDesign.Grasshopper/Loads/Load categories/LoadCategoryDatabaseDefault.cs +++ b/FemDesign.Grasshopper/Loads/Load categories/LoadCategoryDatabaseDefault.cs @@ -13,7 +13,7 @@ public class LoadCategoryDefault: FEM_Design_API_Component } protected override void RegisterInputParams(GH_InputParamManager pManager) { - pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code: S/N.\n EST/FIN/GB/H/N/PL/RO/S/TR NOT yet implemented. Contact us at support@strusoft.freshdesk.com if you need it.", GH_ParamAccess.item, "S"); + pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code: S/N.\n B/COMMON/D/DK/E/EST/FIN/GB/H/LT/NL/PL/RO are NOT yet implemented. Contact us at support@strusoft.freshdesk.com if you need it.", GH_ParamAccess.item, "S"); pManager[pManager.ParamCount - 1].Optional = true; } protected override void RegisterOutputParams(GH_OutputParamManager pManager) diff --git a/FemDesign.Grasshopper/Loads/Load groups/LoadGroupToLoadComb.cs b/FemDesign.Grasshopper/Loads/Load groups/LoadGroupToLoadComb.cs index 0a527a96a..8020efa9f 100644 --- a/FemDesign.Grasshopper/Loads/Load groups/LoadGroupToLoadComb.cs +++ b/FemDesign.Grasshopper/Loads/Load groups/LoadGroupToLoadComb.cs @@ -22,7 +22,7 @@ public LoadGroupToLoadComb() : base("LoadGroupToLoadComb", "LoadGroupToLoadComb" protected override void RegisterInputParams(GH_InputParamManager pManager) { - pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code.\nConnect 'ValueList' to get the options.\nD,DK,EST,FIN,GB,H,N,PL,RO,S,TR,NL", GH_ParamAccess.item, "S"); + pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code.\nConnect 'ValueList' to get the options.\nB/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR\n\nNote: the TR (Turkish) national annex is no longer supported by FEM-Design.", GH_ParamAccess.item, "S"); pManager.AddGenericParameter("LoadGroups", "LoadGroups", "Load groups to convert in load combinations", GH_ParamAccess.list); pManager.AddTextParameter("CombinationMethod", "CombinationMethod", "Connect 'ValueList' to get the options.\nCombination Method type:\nEN 1990 6.4.3(6.10)\nEN 1990 6.4.3(6.10.a, b)", GH_ParamAccess.item, "EN 1990 6.4.3(6.10)"); pManager[pManager.ParamCount - 1].Optional = true; diff --git a/FemDesign.Grasshopper/Materials/MaterialDatabase.cs b/FemDesign.Grasshopper/Materials/MaterialDatabase.cs index 7f8b58ece..8e2453fc6 100644 --- a/FemDesign.Grasshopper/Materials/MaterialDatabase.cs +++ b/FemDesign.Grasshopper/Materials/MaterialDatabase.cs @@ -16,7 +16,7 @@ public MaterialDatabase() : base(" MaterialDatabase", "MaterialDatabase", "Load } protected override void RegisterInputParams(GH_InputParamManager pManager) { - pManager.AddTextParameter("CountryCode", "CountryCode", "Connect 'ValueList' to get the options.\nNational annex of calculation code: B/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR\n\nNote: TR (Turkish) doesn't contain the plastic material properties.", GH_ParamAccess.item, "S"); + pManager.AddTextParameter("CountryCode", "CountryCode", "Connect 'ValueList' to get the options.\nNational annex of calculation code: B/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR\n\nNote: the TR (Turkish) national annex is no longer supported by FEM-Design. The default material database doesn't contain the plastic material properties for code 'TR'.", GH_ParamAccess.item, "S"); pManager[pManager.ParamCount - 1].Optional = true; pManager.AddTextParameter("FilePath", "FilePath", "File path to .struxml file.\nnote: `CountryCode` will not be use if `FilePath` is specified", GH_ParamAccess.item); pManager[pManager.ParamCount - 1].Optional = true; @@ -77,9 +77,7 @@ public override Guid ComponentGuid protected override void BeforeSolveInstance() { - ValueListUtils.UpdateValueLists(this, 0, new List - { "B","COMMON","D","DK","E","EST","FIN","GB","H","LT","N","NL","PL","RO","S","TR" - }, null, GH_ValueListMode.DropDown); + ValueListUtils.UpdateValueLists(this, 0, Enum.GetNames(typeof(Country)).ToList(), null, GH_ValueListMode.DropDown); } public override GH_Exposure Exposure => GH_Exposure.primary; diff --git a/FemDesign.Grasshopper/Model/ModelConstruct.cs b/FemDesign.Grasshopper/Model/ModelConstruct.cs index b275119d1..f089e2e01 100644 --- a/FemDesign.Grasshopper/Model/ModelConstruct.cs +++ b/FemDesign.Grasshopper/Model/ModelConstruct.cs @@ -19,7 +19,7 @@ public class ModelConstruct : FEM_Design_API_Component } protected override void RegisterInputParams(GH_InputParamManager pManager) { - pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code.\nConnect 'ValueList' to get the options.\nD,DK,EST,FIN,GB,H,N,PL,RO,S,TR,NL", GH_ParamAccess.item, "S"); + pManager.AddTextParameter("CountryCode", "CountryCode", "National annex of calculation code.\nConnect 'ValueList' to get the options.\nB/COMMON/D/DK/E/EST/FIN/GB/H/LT/N/NL/PL/RO/S/TR\n\nNote: the TR (Turkish) national annex is no longer supported by FEM-Design.", GH_ParamAccess.item, "S"); pManager[pManager.ParamCount - 1].Optional = true; pManager.AddGenericParameter("Structure Elements", "Elements", "Single structure element or list of structure elements to add. Nested lists are not supported.", GH_ParamAccess.list); pManager[pManager.ParamCount - 1].Optional = true;