Skip to content

Commit

Permalink
Merge branch '22.1.0_Dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Mar 3, 2023
2 parents d86bc1b + b8ccaf0 commit 6618ba3
Show file tree
Hide file tree
Showing 104 changed files with 94,809 additions and 6,995 deletions.
6,508 changes: 0 additions & 6,508 deletions FD 21.01.003.xsd

This file was deleted.

5 changes: 1 addition & 4 deletions FemDesign.Core/Calculate/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public partial class Application
/// <summary>
/// Target version of class library.
/// </summary>
internal string FdTargetVersion = "22";


public string FdTargetVersion = "22";

public string OutputDir
{
Expand All @@ -58,7 +56,6 @@ public string OutputDir
private List<string> _outputDirsToBeDeleted = new List<string>();



public Application()
{
this.GetProcessInformation();
Expand Down
47 changes: 24 additions & 23 deletions FemDesign.Core/Calculate/CmdGlobalCfg.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// https://strusoft.com/
using System.Xml.Serialization;
using System.Xml.Linq;
using System.IO;
using System.Reflection;
using System.Linq;

namespace FemDesign.Calculate
{
Expand Down Expand Up @@ -67,6 +70,27 @@ public static CmdGlobalCfg Default()
return cmdGlobalCfg;
}


/// <summary>
/// Deserialize CmdGlobalCfg from resource.
/// </summary>
public static CmdGlobalCfg DeserializeCmdGlobalCfgFromFilePath(string filePath = null)
{
if(filePath == null)
{
string assemblyLocation = Assembly.GetExecutingAssembly().Location;
filePath = System.IO.Path.Combine( System.IO.Path.GetDirectoryName( assemblyLocation ), @"cmdglobalcfg.xml");
}

XmlSerializer deserializer = new XmlSerializer(typeof(CmdGlobalCfg));
TextReader reader = new StreamReader(filePath);
object obj = deserializer.Deserialize(reader);
var materialDatabase = (CmdGlobalCfg)obj;
reader.Close();
return materialDatabase;
}


public override XElement ToXElement()
{
return Extension.ToXElement<CmdGlobalCfg>(this);
Expand All @@ -75,29 +99,6 @@ public override XElement ToXElement()
}

























public partial class MeshGeneral
{
[XmlAttribute("fAdjustToLoads")]
Expand Down
7 changes: 6 additions & 1 deletion FemDesign.Core/Calculate/CmdUserModuleEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FemDesign.GenericClasses;

namespace FemDesign.Calculate
{
Expand All @@ -14,21 +15,25 @@ public enum CmdUserModule
/// <summary>
/// RESMODE
/// </summary>
[Parseable("RESMODE", "res", "RES", "Res")]
RESMODE,

/// <summary>
/// RCDESIGN
/// </summary>
[Parseable("RCDESIGN", "rc", "RC", "Rc")]
RCDESIGN,

/// <summary>
/// STEELDESIGN
/// </summary>
[Parseable("STEELDESIGN", "steel", "STEEL", "Steel")]
STEELDESIGN,

/// <summary>
/// TIMBERDESIGN
/// </summary>
[Parseable("TIMBERDESIGN", "timber", "TIMBER", "Timber")]
TIMBERDESIGN
}
}
}
4 changes: 2 additions & 2 deletions FemDesign.Core/Calculate/DocTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private int GetResType(ListProc resultType)
*/

string r = resultType.ToString();
if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies") || r.Contains("MaxOfLoadCombinationMinMax"))
if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies") || r.Contains("MaxOfLoadCombinationMinMax") || r == "CriticalParameters" || r == "ImperfectionFactors")
return 0;
if (r.EndsWith("LoadCase"))
return 1;
Expand All @@ -159,7 +159,7 @@ private int GetResType(ListProc resultType)
private int GetDefaultCaseIndex(ListProc resultType)
{
string r = resultType.ToString();
if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies") || r.Contains("MaxOfLoadCombinationMinMax"))
if (r.StartsWith("QuantityEstimation") || r.EndsWith("Utilization") || r.Contains("MaxComb") || r.StartsWith("FeaNode") || r.StartsWith("FeaBar") || r.StartsWith("FeaShell") || r.StartsWith("EigenFrequencies") || r.Contains("MaxOfLoadCombinationMinMax") || r == "CriticalParameters" || r == "ImperfectionFactors")
return 0;
if (r.EndsWith("LoadCase"))
return -65536; // All load cases
Expand Down
23 changes: 10 additions & 13 deletions FemDesign.Core/Calculate/FdScript_OBSOLETE.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ internal static FdScript CalculateStruxml(string struxmlPath, CmdUserModule mode
/// Create fdscript to read a str-model.
public static FdScript ReadStr(string strPath, List<string> bscPaths = null)
{
if (bscPaths != null && !Model.HasResults(strPath))
{
throw new Exception("Model does not contain any results!");
}

FdScript fdScript = new FdScript();
fdScript.XmlAttrib = "fdscript.xsd";

Expand Down Expand Up @@ -175,10 +180,13 @@ public static FdScript ReadStr(string strPath, List<string> bscPaths = null)
return fdScript;
}


/// Create fdscript to read a str-model.
public static FdScript ReadLoadCase(string strPath, List<string> bscPaths = null, List<MapCase> mapCases = null)
{
if (!Model.HasResults(strPath))
{
throw new Exception("Model does not contain any results!");
}

FdScript fdScript = new FdScript();
fdScript.XmlAttrib = "fdscript.xsd";

Expand Down Expand Up @@ -226,17 +234,6 @@ public static FdScript ReadLoadCase(string strPath, List<string> bscPaths = null














/// <summary>
/// Create fdscript to run analysis.
/// </summary>
Expand Down
30 changes: 30 additions & 0 deletions FemDesign.Core/Calculate/ListProc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,25 @@ public enum ListProc
#endregion
#endregion

#region STABILITY
/* STABILITY */
/// <summary>
/// Critical Parameters (only positive)
/// </summary>
[XmlEnum("frStabCritParamOnlyPositive_ListProc")]
CriticalParameters,
#endregion

#region STABILITY
/* STABILITY */
/// <summary>
/// Imperfection Factors (only positive)
/// </summary>
[XmlEnum("frImpfFactorsOnlyPositive_ListProc")]
ImperfectionFactors,
#endregion


#region EIGEN FREQUENCIES
/* EIGEN FREQUENCIES */
/// <summary>
Expand Down Expand Up @@ -542,5 +561,16 @@ public static bool IsLoadCombination(this ListProc listProc)
else return false;
}
}

public static bool IsQuantityEstimation(this ListProc listProc)
{
{
string r = listProc.ToString();
if (r.StartsWith("QuantityEstimation"))
return true;
else return false;
}
}

}
}
2 changes: 1 addition & 1 deletion FemDesign.Core/Calculate/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static Options GetOptions(ListProc resultType)
}
else
{
return new Options();
return Options.Default();
}
}
}
Expand Down
108 changes: 108 additions & 0 deletions FemDesign.Core/Drawing/TextAnnotation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
using StruSoft.Interop.StruXml.Data;

namespace FemDesign.Geometry
{
[Serializable]
public class TextAnnotation: GenericClasses.IStructureElement
{
[XmlElement("position")]
public Point3d Position { get; set; }
[XmlElement("local_x")]
public Vector3d LocalX { get; set; }
[XmlElement("local_y")]
public Vector3d LocalY { get; set; }
[XmlElement("style")]
public StruSoft.Interop.StruXml.Data.Style_type StyleType { get; set; }
[XmlAttribute("guid")]
public System.Guid Guid { get; set; }
[XmlAttribute("text")]
public string _text;
[XmlIgnore]
public string Text
{
get
{
return _text;
}
set
{
var regex = "[&#x0009;&#x000A;&#x000d; -&#xfffd;]{0,1023}";
var match = Regex.Match(value, regex);
if (match.Success)
{
_text = value;
}
else
{
throw new System.ArgumentException($"text value: {value} has bad formatting. Expected regex pattern: {regex}");
}
}
}
[XmlIgnore]
public static string DefaultLayer => "0";
public TextAnnotation()
{

}
public void Initialize()
{
Position = Point3d.Origin;
LocalX = Vector3d.UnitX;
LocalY = Vector3d.UnitY;
StyleType = new Style_type
{
Layer = DefaultLayer,
Font = new Font_type
{
Script = Script_type.Default
}
};
Guid = System.Guid.NewGuid();
}

public TextAnnotation(Point3d position, Vector3d localX, Vector3d localY, string text)
{
this.Initialize();
Position = position;
LocalX = localX;
LocalY = localY;
Text = text;
}
public TextAnnotation(Point3d position, Vector3d localX, Vector3d localY, Style_type styleType, string text)
{
this.Initialize();
Position = position;
LocalX = localX;
LocalY = localY;
StyleType = styleType;
Text = text;
}

public override string ToString()
{
return $"TextAnnotation: {this.Text} at {this.Position}";
}

public void EntityCreated()
{
throw new NotImplementedException();
}

public void EntityModified()
{
throw new NotImplementedException();
}

public static implicit operator Text_type(TextAnnotation t) => new Text_type{
Position = t.Position,
Local_x = t.LocalX,
Local_y = t.LocalY,
Style = t.StyleType,
Guid = t.Guid.ToString(),
Text = t.Text,
};
}
}
15 changes: 13 additions & 2 deletions FemDesign.Core/FemDesign.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<Compile Include="Foundations\IsolatedFoundation.cs" />
<Compile Include="Foundations\RefParts.cs" />
<Compile Include="Geometry\HorizontalPolygon2d.cs" />
<Compile Include="Drawing\TextAnnotation.cs" />
<Compile Include="Results\Stability\ImperfectionFactor.cs" />
<Compile Include="Results\Stability\CriticalParameter.cs" />
<Compile Include="Soil\BoreHole.cs" />
<Compile Include="Soil\SoilElements.cs" />
<Compile Include="Soil\Strata.cs" />
Expand All @@ -78,6 +81,8 @@
<Compile Include="GenericClasses\StiffnessAnalysisType.cs" />
<Compile Include="GenericClasses\TextFormatting.cs" />
<Compile Include="Reinforcement\ShearControlRegion.cs" />
<Compile Include="Utils\LoadCombinationTable.cs" />
<Compile Include="Utils\NationalAnnexEnum.cs" />
<Compile Include="Releases\RigidityDataType0.cs" />
<Compile Include="Results\Convert.cs" />
<Compile Include="Results\Node\PointSupportReactionMinMax.cs" />
Expand Down Expand Up @@ -210,9 +215,8 @@
<Compile Include="Loads\LoadBase.cs" />
<Compile Include="Loads\LoadCase.cs" />
<Compile Include="Loads\LoadCombinationCaseBase.cs" />
<Compile Include="Loads\LoadCombinationTable.cs" />
<Compile Include="Loads\LoadCombination.cs" />
<Compile Include="Loads\LoadCombinationType.cs" />
<Compile Include="Utils\LoadCombinationType.cs" />
<Compile Include="Loads\LoadGroupBase.cs" />
<Compile Include="Loads\LoadGroupRelationship.cs" />
<Compile Include="Loads\LoadGroupTable.cs" />
Expand Down Expand Up @@ -346,6 +350,7 @@
<Compile Include="StructureGrid\Axis.cs" />
<Compile Include="StructureGrid\Storey.cs" />
<Compile Include="StructureGrid\Storeys.cs" />
<Compile Include="StruSoft\Interop\StruXml\Data\Style_type.cs" />
<Compile Include="StruSoft\Interop\StruXml\Data\CompositePart.cs" />
<Compile Include="StruSoft\Interop\StruXml\Data\CompositeSectionType.cs" />
<Compile Include="StruSoft\Interop\StruXml\Data\FD-21.00.001.cs" />
Expand Down Expand Up @@ -387,6 +392,12 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="cmdglobalcfg.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
<ProjectExtensions>
<VisualStudio AllowExistingFolder="true" />
Expand Down
Loading

0 comments on commit 6618ba3

Please sign in to comment.