Skip to content

Commit

Permalink
🆙 update country codes
Browse files Browse the repository at this point in the history
  • Loading branch information
lorinczandrea committed Jun 13, 2024
1 parent ce7445f commit 148a6bd
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 21 deletions.
45 changes: 32 additions & 13 deletions FemDesign.Core/Model/CountryEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ namespace FemDesign
/// </summary>
public enum Country
{
/// <summary>
/// Belgian annex
/// </summary>
[Parseable("B", "b", "belgium", "Belgium", "belgian", "Belgian")]
[XmlEnum("B")]
B,

/// <summary>
/// Unspecified/Common annex
/// </summary>
Expand All @@ -23,55 +30,63 @@ public enum Country
/// <summary>
/// German annex
/// </summary>
[Parseable("D", "d", "germany", "Germany")]
[Parseable("D", "d", "germany", "Germany", "german", "German")]
[XmlEnum("D")]
D,

/// <summary>
/// Danish annex
/// </summary>
[Parseable("DK", "dk", "denmark", "Denmark")]
[Parseable("DK", "dk", "denmark", "Denmark", "danish", "Danish")]
[XmlEnum("DK")]
DK,

/// <summary>
/// Spanish annex
/// </summary>
[Parseable("E", "e", "spain", "Spain", "spanish", "Spanish")]
[XmlEnum("E")]
E,

/// <summary>
/// Estonian annex
/// </summary>
[Parseable("EST", "est", "estonia", "Estonia")]
[Parseable("EST", "est", "estonia", "Estonia", "estonian", "Estonian")]
[XmlEnum("EST")]
EST,

/// <summary>
/// Finnish annex
/// </summary>
[Parseable("FIN", "fin", "finland", "Finland")]
[Parseable("FIN", "fin", "finland", "Finland", "finnish", "Finnish")]
[XmlEnum("FIN")]
FIN,

/// <summary>
/// Brittish annex
/// British annex
/// </summary>
[Parseable("GB", "gb", "brittish", "Brittish", "great britain", "Great Britain")]
[Parseable("GB", "gb", "british", "British", "great britain", "Great Britain")]
[XmlEnum("GB")]
GB,

/// <summary>
/// Hungarian annex
/// </summary>
[Parseable("H", "h", "hungary", "Hungary")]
[Parseable("H", "h", "hungary", "Hungary", "hungarian", "Hungarian")]
[XmlEnum("H")]
H,

/// <summary>
/// Latvian annex
/// </summary>
[Parseable("LT", "lt", "lithuania", "Lithuania")]
[Parseable("LT", "lt", "latvia", "Latvia", "latvian", "Latvian")]
[XmlEnum("LT")]
LT,

/// <summary>
/// Norwegian annex
/// </summary>
[Parseable("N", "n", "norway", "Norway")]
[Parseable("N", "n", "norway", "Norway", "norwegian", "Norwegian")]
[XmlEnum("N")]
N,

Expand All @@ -85,25 +100,29 @@ public enum Country
/// <summary>
/// Polish annex
/// </summary>
[Parseable("PL", "pl", "poland", "Poland")]
[Parseable("PL", "pl", "poland", "Poland", "polish", "Polish")]
[XmlEnum("PL")]
PL,

/// <summary>
/// Romanian annex
/// </summary>
[Parseable("RO", "ro", "romania", "Romania")]
[Parseable("RO", "ro", "romania", "Romania", "romanian", "Romanian")]
[XmlEnum("RO")]
RO,

/// <summary>
/// Swedish annex
/// </summary>
[Parseable("S", "s", "SE", "sweden", "Sweden", "😎")]
[Parseable("S", "s", "SE", "sweden", "Sweden", "swedish", "Swedish", "😎")]
[XmlEnum("S")]
S,

/// <summary>
/// Turkish annex
/// Turkish annex.
/// <br></br>
/// <br></br>
/// Note: the TR (Turkish) national annex is no longer supported by FEM-Design.
/// </summary>
[Parseable("TR", "tr", "turkey", "Turkey")]
[XmlEnum("TR")]
Expand Down
2 changes: 1 addition & 1 deletion FemDesign.Grasshopper/Deconstruct/ModelDeconstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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 [email protected] if you need it.", GH_ParamAccess.item, "S");
pManager[pManager.ParamCount - 1].Optional = true;
}
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions FemDesign.Grasshopper/Materials/MaterialDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -77,9 +77,7 @@ public override Guid ComponentGuid

protected override void BeforeSolveInstance()
{
ValueListUtils.UpdateValueLists(this, 0, new List<string>
{ "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;
Expand Down
2 changes: 1 addition & 1 deletion FemDesign.Grasshopper/Model/ModelConstruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 148a6bd

Please sign in to comment.