Skip to content

Commit

Permalink
missing attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Feb 2, 2023
1 parent d34b67e commit 5e3a250
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
2 changes: 2 additions & 0 deletions FemDesign.Core/Bars/Bar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public List<Reinforcement.BarReinforcement> LongitudinalBars
}
}

[XmlAttribute("name")]
public string _name; // identifier
public string Name
{
get
Expand Down
15 changes: 7 additions & 8 deletions FemDesign.Core/Foundations/Foundations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ public partial class Foundations
public List<IsolatedFoundation> IsolatedFoundations = new List<IsolatedFoundation>();

[XmlElement("wall_foundation")]
private List<StruSoft.Interop.StruXml.Data.Lnfoundation_type> wall_foundationField = new List<StruSoft.Interop.StruXml.Data.Lnfoundation_type>();
public List<StruSoft.Interop.StruXml.Data.Lnfoundation_type> wall_foundationField = new List<StruSoft.Interop.StruXml.Data.Lnfoundation_type>();

[XmlElement("foundation_slab")]
private List<StruSoft.Interop.StruXml.Data.Sffoundation_type> foundation_slabField = new List<StruSoft.Interop.StruXml.Data.Sffoundation_type>();
public List<StruSoft.Interop.StruXml.Data.Sffoundation_type> foundation_slabField = new List<StruSoft.Interop.StruXml.Data.Sffoundation_type>();


public List<GenericClasses.IFoundationElement> GetFoundations()
public List<dynamic> GetFoundations()
{
var objs = new List<GenericClasses.IFoundationElement>();
var objs = new List<dynamic>();
objs.AddRange(this.IsolatedFoundations);
//objs.AddRange(this.wall_foundationField); // to implement
//objs.AddRange(this.foundation_slabField); // to implement
objs.AddRange(this.wall_foundationField); // to implement
objs.AddRange(this.foundation_slabField); // to implement
return objs;
}

}
}
}
3 changes: 2 additions & 1 deletion FemDesign.Core/Foundations/IsolatedFoundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public partial class IsolatedFoundation : NamedEntityBase, IStructureElement, IF
protected override int GetUniqueInstanceCount() => ++_instance;

[XmlAttribute("bedding_modulus")]
public double BeddingModulus { get; set; }
[DefaultValue(10000)]
public double BeddingModulus { get; set; } = 10000;

[XmlAttribute("stage")]
[DefaultValue(1)]
Expand Down
4 changes: 4 additions & 0 deletions FemDesign.Core/Geometry/Edge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.ComponentModel;

namespace FemDesign.Geometry
{
Expand Down Expand Up @@ -107,10 +108,13 @@ public string Type
set { this._type = RestrictedString.EdgeType(value); }
}
[XmlAttribute("radius")]
[DefaultValue(0)]
public double Radius { get; set; } // optional. double
[XmlAttribute("start_angle")]
[DefaultValue(0)]
public double StartAngle { get; set; } // optional. double
[XmlAttribute("end_angle")]
[DefaultValue(0)]
public double EndAngle { get; set; } // optional. double
[XmlIgnore]
public double Length
Expand Down
6 changes: 3 additions & 3 deletions FemDesign.Core/Model/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2207,9 +2207,9 @@ private bool SurfaceReinforcementParametersInModel(Reinforcement.SurfaceReinforc


/// <summary>
/// Add Support to Model
/// Add Foundation to the Model
/// </summary>
/// <param name="obj">PointSupport, LineSupport or SurfaceSupport</param>
/// <param name="obj">Isolated Foundation, Line Foundation or Slab Foundation</param>
/// <param name="overwrite"></param>
private void AddFoundation(IFoundationElement obj, bool overwrite)
{
Expand Down Expand Up @@ -3711,7 +3711,7 @@ internal void GetLoads()

var mapCase = this.Entities.Loads.LoadCases?.ToDictionary(x => x.Guid);

foreach (LoadBase load in loads)
foreach (var load in loads.OfType<LoadBase>())
{
load.LoadCase = mapCase[load.LoadCaseGuid].DeepClone();
}
Expand Down
2 changes: 1 addition & 1 deletion FemDesign.Core/Reinforcement/ShearControlRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public double X
}

[XmlAttribute("physical_extension")]
public double _physicalExtension { get; set; }
public double _physicalExtension { get; set; } = 0.01;

[XmlIgnore]
public double PhysicalExtension
Expand Down
4 changes: 3 additions & 1 deletion FemDesign.Core/Shells/Panel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Globalization;
using System.Xml.Serialization;
using FemDesign.GenericClasses;

using System.ComponentModel;

namespace FemDesign.Shells
{
Expand Down Expand Up @@ -325,6 +325,7 @@ public double UniformAvgMeshSize


[XmlAttribute("ignored_distance")]
[DefaultValue(0.02)]
public double _ignoredDistance = 0.02;

[XmlIgnore]
Expand All @@ -341,6 +342,7 @@ public double IgnoredDistance
}

[XmlAttribute("ignored_in_stability")]
[DefaultValue(false)]
public bool IgnoredInStability { get; set; } = false;

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions FemDesign.Core/Shells/Slab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace FemDesign.Shells
[System.Serializable]
public partial class Slab : EntityBase, INamedEntity, IStructureElement, IStageElement, IShell
{
[XmlAttribute("name")]
public string _name; // identifier
public string Name
{
get
Expand Down

0 comments on commit 5e3a250

Please sign in to comment.