Force calculator was repaired for buckling calculations
This commit is contained in:
@@ -25,5 +25,7 @@
|
||||
public static string ExpectedWas(System.Type expected, object obj) => ExpectedWas(expected, obj.GetType());
|
||||
public static string NullReference => "#0018: Null reference";
|
||||
public static string ObjectNotFound => "#0018: Object not found";
|
||||
public static string ErrorDuring(string operation) => string.Format("Errors appeared during {0}, see detailed information", operation);
|
||||
public static string CalculationError => "#0019: Error of calculation";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,12 @@ using System.Windows.Forms;
|
||||
|
||||
namespace StructureHelperCommon.Infrastructures.Interfaces
|
||||
{
|
||||
public interface ILongProcessLogic
|
||||
public interface ILongProcessLogic : ILogic
|
||||
{
|
||||
int StepCount { get; }
|
||||
Action<int> SetProgress { get; set; }
|
||||
bool Result { get; set; }
|
||||
|
||||
IShiftTraceLogger? TraceLogger { get; set; }
|
||||
|
||||
void WorkerDoWork(object sender, DoWorkEventArgs e);
|
||||
void WorkerProgressChanged(object sender, ProgressChangedEventArgs e);
|
||||
void WorkerRunWorkCompleted(object sender, RunWorkerCompletedEventArgs e);
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace StructureHelperCommon.Models.Loggers
|
||||
public static string DimensionLess => "(dimensionless)";
|
||||
public static string MethodBasedOn => "Method of calculation based on ";
|
||||
public static string CalculationHasDone => "Calculation has done succesfully";
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,5 +42,6 @@ namespace StructureHelperCommon.Models.Parameters
|
||||
ColumnLabels = columnLabels;
|
||||
}
|
||||
}
|
||||
public ArrayParameter(int rowCount, List<string> columnLabels) : this(rowCount, columnLabels.Count, columnLabels) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
|
||||
namespace StructureHelperCommon.Models.Sections
|
||||
{
|
||||
public class AccidentalEccentricityLogic : IAccidentalEccentricityLogic
|
||||
@@ -64,10 +67,10 @@ namespace StructureHelperCommon.Models.Sections
|
||||
minEccentricity, yEccentricity,
|
||||
yFullEccentricity);
|
||||
TraceLogger?.AddMessage(mesEy);
|
||||
var xSign = InitialForceTuple.Mx == 0 ? 1 : Math.Sign(InitialForceTuple.Mx);
|
||||
var ySign = InitialForceTuple.My == 0 ? 1 : Math.Sign(InitialForceTuple.My);
|
||||
var mx = InitialForceTuple.Nz * yFullEccentricity * xSign;
|
||||
var my = InitialForceTuple.Nz * xFullEccentricity * ySign;
|
||||
var xSign = InitialForceTuple.Mx == 0d ? -1d : Math.Sign(InitialForceTuple.Mx);
|
||||
var ySign = InitialForceTuple.My == 0d ? -1d : Math.Sign(InitialForceTuple.My);
|
||||
var mx = (-1d) * InitialForceTuple.Nz * yFullEccentricity * xSign;
|
||||
var my = (-1d) * InitialForceTuple.Nz * xFullEccentricity * ySign;
|
||||
TraceLogger?.AddMessage(string.Format("Bending moment arbitrary X-axis Mx = {0} * {1} = {2}", InitialForceTuple.Nz, yFullEccentricity, mx), TraceLogStatuses.Debug);
|
||||
TraceLogger?.AddMessage(string.Format("Bending moment arbitrary Y-axis My = {0} * {1} = {2}", InitialForceTuple.Nz, xFullEccentricity, my), TraceLogStatuses.Debug);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Documents;
|
||||
|
||||
namespace StructureHelperCommon.Services.Units
|
||||
{
|
||||
@@ -47,11 +48,30 @@ namespace StructureHelperCommon.Services.Units
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect);
|
||||
}
|
||||
|
||||
public static IUnit GetUnit(UnitTypes unitType, string unitName)
|
||||
public static IUnit GetUnit(UnitTypes unitType, string unitName = null)
|
||||
{
|
||||
if (unitName is null)
|
||||
{
|
||||
var boolResult = DefaultUnitNames.TryGetValue(unitType, out unitName);
|
||||
if (boolResult == false)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": unit type{unitType} is unknown");
|
||||
}
|
||||
}
|
||||
return units.Where(u => u.UnitType == unitType & u.Name == unitName).Single();
|
||||
}
|
||||
|
||||
public static Dictionary<UnitTypes, string> DefaultUnitNames => new()
|
||||
{
|
||||
{ UnitTypes.Length, "m"},
|
||||
{ UnitTypes.Area, "m2"},
|
||||
{ UnitTypes.Force, "kN" },
|
||||
{ UnitTypes.Moment, "kNm"},
|
||||
{ UnitTypes.Stress, "MPa"},
|
||||
{ UnitTypes.Curvature, "1/m"},
|
||||
};
|
||||
|
||||
|
||||
public static string Convert(IUnit unit, string unitName, object value)
|
||||
{
|
||||
double val;
|
||||
|
||||
Reference in New Issue
Block a user