Add cross-section convert strategies
This commit is contained in:
@@ -9,8 +9,18 @@ namespace StructureHelperCommon.Models.Analyses
|
||||
{
|
||||
public class DateVersion : IDateVersion
|
||||
{
|
||||
public Guid Id { get; }
|
||||
public DateTime DateTime { get; set; }
|
||||
public ISaveable AnalysisVersion { get; set; }
|
||||
|
||||
public ISaveable Item { get; set; }
|
||||
public DateVersion(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
}
|
||||
|
||||
public DateVersion() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Analyses
|
||||
{
|
||||
public interface IDateVersion
|
||||
public interface IDateVersion : ISaveable
|
||||
{
|
||||
DateTime DateTime { get; set; }
|
||||
ISaveable Item { get; set; }
|
||||
ISaveable AnalysisVersion { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace StructureHelperCommon.Models.Analyses
|
||||
Id = id;
|
||||
Versions = new();
|
||||
}
|
||||
public VersionProcessor() : this (new Guid())
|
||||
public VersionProcessor() : this (Guid.NewGuid())
|
||||
{
|
||||
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace StructureHelperCommon.Models.Analyses
|
||||
var version = new DateVersion()
|
||||
{
|
||||
DateTime = DateTime.Now,
|
||||
Item = newItem
|
||||
AnalysisVersion = newItem
|
||||
};
|
||||
AddVersion(version);
|
||||
}
|
||||
|
||||
13
StructureHelperCommon/Models/Calculators/IHasCalculators.cs
Normal file
13
StructureHelperCommon/Models/Calculators/IHasCalculators.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperCommon.Models.Calculators
|
||||
{
|
||||
public interface IHasCalculators
|
||||
{
|
||||
List<ICalculator> Calculators { get; }
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,6 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
public static string Summary => "Summary";
|
||||
public static string Maximum => "Maximum";
|
||||
public static string Minimum => "Minimum";
|
||||
public static string CalculatorType(object obj) => string.Format("Calculator type: {0}", obj.GetType());
|
||||
public static string LogicType(object obj) => string.Format("Logic type: {0}", obj.GetType());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace StructureHelperCommon.Models.Sections.Logics
|
||||
public (double ex, double ey) GetValue()
|
||||
{
|
||||
eccentricityLogic.TraceLogger = TraceLogger?.GetSimilarTraceLogger(50);
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(string.Format(accEccMessage, "x"));
|
||||
eccentricityLogic.Length = Length;
|
||||
eccentricityLogic.Size = SizeX;
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace StructureHelperCommon.Models.Sections.Logics
|
||||
}
|
||||
public double GetValue()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
var lengthEccetricity = Length / lengthFactor;
|
||||
TraceLogger?.AddMessage(string.Format("Length of member = {0}(m)", Length));
|
||||
TraceLogger?.AddMessage(string.Format("Accidental eccentricity by length e,a = {0}(m) / {1} = {2}(m)", Length, lengthFactor, lengthEccetricity));
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace StructureHelperCommon.Models.Sections
|
||||
|
||||
public IForceTuple GetValue()
|
||||
{
|
||||
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
|
||||
TraceLogger?.AddMessage(LoggerStrings.LogicType(this), TraceLogStatuses.Service);
|
||||
if (InputForceTuple is null)
|
||||
{
|
||||
string errorString = ErrorStrings.NullReference + $": {nameof(InputForceTuple)}";
|
||||
|
||||
Reference in New Issue
Block a user