Add calculators saving

This commit is contained in:
Evgeny Redikultsev
2024-10-19 20:32:25 +05:00
parent d16c0e1f79
commit d3a1992f4d
131 changed files with 1742 additions and 375 deletions

View File

@@ -1,8 +1,25 @@
namespace StructureHelperCommon.Models.Calculators
using System;
namespace StructureHelperCommon.Models.Calculators
{
/// <inheritdoc/>
public class Accuracy : IAccuracy
{
/// <inheritdoc/>
public Guid Id { get; }
/// <inheritdoc/>
public double IterationAccuracy { get; set; }
/// <inheritdoc/>
public int MaxIterationCount { get; set; }
public Accuracy(Guid id)
{
Id = id;
}
public Accuracy() : this (Guid.NewGuid())
{
}
}
}

View File

@@ -21,6 +21,8 @@ namespace StructureHelperCommon.Models.Calculators
public Action<IResult> ActionToOutputResults { get; set; }
public IShiftTraceLogger? TraceLogger { get; set; }
public Guid Id => throw new NotImplementedException();
public FindParameterCalculator()
{
InputData = new FindParameterCalculatorInputData();

View File

@@ -1,9 +1,11 @@
namespace StructureHelperCommon.Models.Calculators
using StructureHelperCommon.Infrastructures.Interfaces;
namespace StructureHelperCommon.Models.Calculators
{
/// <summary>
/// Rate of calculation which based on iteration of finished accuracy
/// </summary>
public interface IAccuracy
public interface IAccuracy : ISaveable
{
/// <summary>
/// Max accuracy of iteration

View File

@@ -3,7 +3,7 @@ using System;
namespace StructureHelperCommon.Models.Calculators
{
public interface ICalculator : ILogic, ICloneable
public interface ICalculator : ILogic, ISaveable, ICloneable
{
string Name { get; set; }
/// <summary>

View File

@@ -1,4 +1,6 @@
namespace StructureHelperCommon.Models.Sections
using System;
namespace StructureHelperCommon.Models.Sections
{
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
@@ -9,29 +11,30 @@
{
static readonly CompressedMemberUpdateStrategy updateStrategy = new();
/// <inheritdoc/>
public bool Buckling { get; set; }
public Guid Id { get;}
/// <inheritdoc/>
public double GeometryLength { get; set; }
public bool Buckling { get; set; } = true;
/// <inheritdoc/>
public double LengthFactorX { get; set; }
public double GeometryLength { get; set; } = 3d;
/// <inheritdoc/>
public double DiagramFactorX { get; set; }
public double LengthFactorX { get; set; } = 1d;
/// <inheritdoc/>
public double LengthFactorY { get; set; }
public double DiagramFactorX { get; set; } = 1d;
/// <inheritdoc/>
public double DiagramFactorY { get; set; }
public double LengthFactorY { get; set; } = 1d;
/// <inheritdoc/>
public double DiagramFactorY { get; set; } = 1d;
public CompressedMember()
public CompressedMember(Guid id)
{
Buckling = true;
GeometryLength = 3d;
LengthFactorX = 1d;
DiagramFactorX = 1d;
LengthFactorY = 1d;
DiagramFactorY = 1d;
Id = id;
}
public CompressedMember() : this(Guid.NewGuid())
{
}
public object Clone()
{
var newItem = new CompressedMember();

View File

@@ -1,4 +1,5 @@
using System;
using StructureHelperCommon.Infrastructures.Interfaces;
using System;
namespace StructureHelperCommon.Models.Sections
{
@@ -9,7 +10,7 @@ namespace StructureHelperCommon.Models.Sections
/// <summary>
/// Interface of properties for compressed strucrue members
/// </summary>
public interface ICompressedMember : ICloneable
public interface ICompressedMember : ISaveable, ICloneable
{
/// <summary>
/// Flag of considering of buckling

View File

@@ -10,9 +10,5 @@
/// Height of rectangle, m
/// </summary>
double Height { get; set; }
/// <summary>
/// Angle of rotating rectangle, rad
/// </summary>
double Angle { get; set; }
}
}

View File

@@ -17,7 +17,6 @@ namespace StructureHelperCommon.Models.Shapes
if (ReferenceEquals(targetObject, sourceObject)) { return; }
targetObject.Width = sourceObject.Width;
targetObject.Height = sourceObject.Height;
targetObject.Angle = sourceObject.Angle;
}
}
}

View File

@@ -10,8 +10,6 @@ namespace StructureHelperCommon.Models.Shapes
public double Width { get; set; }
/// <inheritdoc />
public double Height { get; set; }
/// <inheritdoc />
public double Angle { get; set; }
public RectangleShape(Guid id)
{

View File

@@ -23,6 +23,8 @@ namespace StructureHelperCommon.Models.Soils
public Action<IResult> ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public IShiftTraceLogger? TraceLogger { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public Guid Id => throw new NotImplementedException();
public AnchorCalculator(SoilAnchor soilAnchor, IAnchorSoilProperties anchorSoilProperties)
{
Anchor = soilAnchor;