diff --git a/StructureHelper/Documentation/License.txt b/StructureHelper/Documentation/License.txt
new file mode 100644
index 0000000..31bf5cc
--- /dev/null
+++ b/StructureHelper/Documentation/License.txt
@@ -0,0 +1,7 @@
+Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/StructureHelper/Documentation/LicenseRus.txt b/StructureHelper/Documentation/LicenseRus.txt
new file mode 100644
index 0000000..bdc1a69
--- /dev/null
+++ b/StructureHelper/Documentation/LicenseRus.txt
@@ -0,0 +1,7 @@
+Copyright (c) 2023 Редикульцев Евгений, Екатеринбург, Россия
+
+Данная лицензия разрешает лицам, получившим копию данного программного обеспечения и сопутствующей документации (далее — Программное обеспечение), безвозмездно использовать Программное обеспечение без ограничений, включая неограниченное право на использование, копирование, изменение, слияние, публикацию, распространение, сублицензирование и/или продажу копий Программного обеспечения, а также лицам, которым предоставляется данное Программное обеспечение, при соблюдении следующих условий:
+
+Указанное выше уведомление об авторском праве и данные условия должны быть включены во все копии или значимые части данного Программного обеспечения.
+
+ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ ГАРАНТИИ ТОВАРНОЙ ПРИГОДНОСТИ, СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И ОТСУТСТВИЯ НАРУШЕНИЙ, НО НЕ ОГРАНИЧИВАЯСЬ ИМИ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО КАКИМ-ЛИБО ИСКАМ, ЗА УЩЕРБ ИЛИ ПО ИНЫМ ТРЕБОВАНИЯМ, В ТОМ ЧИСЛЕ, ПРИ ДЕЙСТВИИ КОНТРАКТА, ДЕЛИКТЕ ИЛИ ИНОЙ СИТУАЦИИ, ВОЗНИКШИМ ИЗ-ЗА ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ ИЛИ ИНЫХ ДЕЙСТВИЙ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.
\ No newline at end of file
diff --git a/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml b/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml
index 48f8196..90a84a8 100644
--- a/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml
+++ b/StructureHelper/Infrastructure/UI/Resources/ButtonStyles.xaml
@@ -50,6 +50,14 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml
new file mode 100644
index 0000000..9f2c000
--- /dev/null
+++ b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml
@@ -0,0 +1,23 @@
+п»ї
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml.cs b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml.cs
new file mode 100644
index 0000000..a6f4864
--- /dev/null
+++ b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressView.xaml.cs
@@ -0,0 +1,31 @@
+п»їusing StructureHelper.Properties;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace StructureHelper.Windows.CalculationWindows.ProgressViews
+{
+ ///
+ /// Логика взаимодействия для InterpolationProgressView.xaml
+ ///
+ public partial class InterpolationProgressView : Window
+ {
+ InterpolationProgressViewModel viewModel;
+ public InterpolationProgressView(InterpolationProgressViewModel viewModel)
+ {
+ InitializeComponent();
+ this.viewModel = viewModel;
+ this.DataContext = this.viewModel;
+ }
+ }
+}
diff --git a/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressViewModel.cs b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressViewModel.cs
new file mode 100644
index 0000000..8201cf1
--- /dev/null
+++ b/StructureHelper/Windows/CalculationWindows/ProgressViews/InterpolationProgressViewModel.cs
@@ -0,0 +1,15 @@
+п»їusing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace StructureHelper.Windows.CalculationWindows.ProgressViews
+{
+ public class InterpolationProgressViewModel
+ {
+ public double MinValue { get; set; }
+ public double MaxValue { get; set; }
+ public double Value { get; set; }
+ }
+}
diff --git a/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml b/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml
index 46029cb..d11094c 100644
--- a/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml
+++ b/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml
@@ -5,9 +5,13 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
xmlns:vm="clr-namespace:StructureHelper.Windows.ViewModels.Forces"
+ xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
d:DataContext="{d:DesignInstance vm:InterpolateTuplesViewModel}"
mc:Ignorable="d"
- Title="Interpolate Combinations" Height="200" Width="440" MinHeight="180" MinWidth="440" WindowStartupLocation="CenterScreen">
+ Title="Interpolate Combinations" Height="200" Width="500" MinHeight="180" MinWidth="500" WindowStartupLocation="CenterScreen">
+
+
+
@@ -32,6 +36,7 @@
+
@@ -44,12 +49,15 @@
-
-
-
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml.cs b/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml.cs
index f11652b..e37748f 100644
--- a/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml.cs
+++ b/StructureHelper/Windows/Forces/InterpolateTuplesView.xaml.cs
@@ -22,10 +22,12 @@ namespace StructureHelper.Windows.Forces
///
public partial class InterpolateTuplesView : Window
{
+ InterpolateTuplesViewModel viewModel;
public InterpolateTuplesView(InterpolateTuplesViewModel viewModel)
{
InitializeComponent();
- DataContext = viewModel;
+ this.viewModel = viewModel;
+ DataContext = this.viewModel;
}
private void Button_Click(object sender, RoutedEventArgs e)
@@ -33,5 +35,15 @@ namespace StructureHelper.Windows.Forces
DialogResult = true;
Close();
}
+
+ private void StartValueChanged(object sender, EventArgs e)
+ {
+ viewModel.RefreshStartTuple();
+ }
+
+ private void FinishValueChanged(object sender, EventArgs e)
+ {
+ viewModel.RefreshFinishTuple();
+ }
}
}
diff --git a/StructureHelper/Windows/MainWindow/MainView.xaml b/StructureHelper/Windows/MainWindow/MainView.xaml
index 2f85e73..532599b 100644
--- a/StructureHelper/Windows/MainWindow/MainView.xaml
+++ b/StructureHelper/Windows/MainWindow/MainView.xaml
@@ -16,13 +16,6 @@
d:DataContext="{d:DesignInstance local:MainViewModel}"
Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600">
-
diff --git a/StructureHelper/Windows/UserControls/MultiplyTuple.xaml b/StructureHelper/Windows/UserControls/MultiplyTuple.xaml
new file mode 100644
index 0000000..9a078a4
--- /dev/null
+++ b/StructureHelper/Windows/UserControls/MultiplyTuple.xaml
@@ -0,0 +1,27 @@
+п»ї
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/UserControls/MultiplyTuple.xaml.cs b/StructureHelper/Windows/UserControls/MultiplyTuple.xaml.cs
new file mode 100644
index 0000000..6aea13f
--- /dev/null
+++ b/StructureHelper/Windows/UserControls/MultiplyTuple.xaml.cs
@@ -0,0 +1,101 @@
+п»їusing StructureHelper.Infrastructure;
+using StructureHelperCommon.Models.Forces;
+using StructureHelperCommon.Services.Forces;
+using StructureHelperCommon.Services.Units;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Numerics;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace StructureHelper.Windows.UserControls
+{
+ ///
+ /// Логика взаимодействия для MultiplyTuple.xaml
+ ///
+ public partial class MultiplyTuple : UserControl
+ {
+ public event EventHandler ValueChanged;
+
+ public MultiplyTuple()
+ {
+ InitializeComponent();
+ //DataContext = this;
+ }
+
+ public ICommand MultiplyByFactor
+ {
+ get => muliplyByFactor ??= new RelayCommand(o =>
+ {
+ try
+ {
+ string s = (string)o;
+ double factor = CommonOperation.ConvertToDoubleChangeComma(s);
+ ChangeValue(factor);
+ }
+ catch(Exception ex)
+ {
+
+ }
+ });
+ }
+
+
+ public static readonly DependencyProperty ForceTupleProperty = DependencyProperty.Register(
+ "ForceTuple", typeof(ForceTuple), typeof(MultiplyTuple), new PropertyMetadata(new ForceTuple()));
+
+ private RelayCommand muliplyByFactor;
+
+ public ForceTuple ForceTuple
+ {
+ get { return (ForceTuple)GetValue(ForceTupleProperty); }
+ set { SetValue(ForceTupleProperty, value); }
+ }
+
+ private void Multy0_5_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(0.5d);
+ }
+ private void Multy2_0_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(2d);
+ }
+
+ private void ChangeValue(double factor)
+ {
+ var tmpTuple = ForceTupleService.MultiplyTuples(ForceTuple, factor);
+ ForceTupleService.CopyProperties(tmpTuple, ForceTuple, 1d);
+ ValueChanged?.Invoke(this, EventArgs.Empty);
+ }
+
+ private void Multy0_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(0d);
+ }
+
+ private void Multy0_12_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(0.1d);
+ }
+
+ private void MultyM1_2_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(-1d);
+ }
+
+ private void Multy10_02_Click(object sender, RoutedEventArgs e)
+ {
+ ChangeValue(10d);
+ }
+ }
+}
diff --git a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/InterpolateLogic.cs b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/InterpolateLogic.cs
index 56c849a..c14e762 100644
--- a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/InterpolateLogic.cs
+++ b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/InterpolateLogic.cs
@@ -18,7 +18,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
public void Show(IDesignForceTuple finishDesignTuple, IForceCalculator forceCalculator)
{
IDesignForceTuple startDesignTuple;
- var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null, 100);
+ var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
var wndTuples = new InterpolateTuplesView(viewModel);
wndTuples.ShowDialog();
if (wndTuples.DialogResult != true) return;
diff --git a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowCrackResultLogic.cs b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowCrackResultLogic.cs
index 2d94415..fe9d8e3 100644
--- a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowCrackResultLogic.cs
+++ b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowCrackResultLogic.cs
@@ -1,10 +1,15 @@
-п»їusing StructureHelper.Windows.Errors;
+п»їusing StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews;
+using StructureHelper.Windows.Errors;
+using StructureHelper.Windows.Forces;
using StructureHelper.Windows.ViewModels.Errors;
+using StructureHelper.Windows.ViewModels.Forces;
using StructureHelperCommon.Infrastructures.Enums;
using StructureHelperCommon.Infrastructures.Settings;
using StructureHelperCommon.Models.Forces;
+using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives;
+using StructureHelperLogics.Services.NdmCalculations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
using System.Collections.Generic;
@@ -23,44 +28,66 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators.ForceResul
public CalcTerms CalcTerm { get; set; }
public ForceTuple ForceTuple { get; set; }
public IEnumerable ndmPrimitives { get; set; }
- public void Show()
+ public void Show(IDesignForceTuple finishDesignTuple)
+ {
+ var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
+ viewModel.StepCountVisible = false;
+ var wndTuples = new InterpolateTuplesView(viewModel);
+ wndTuples.ShowDialog();
+ if (wndTuples.DialogResult != true) return;
+ var startDesignTuple = viewModel.StartDesignForce.ForceTuple;
+ var endDesignTuple = viewModel.FinishDesignForce.ForceTuple;
+ FindCrackFactor(endDesignTuple, startDesignTuple);
+ }
+
+ private void FindCrackFactor(ForceTuple finishDesignTuple, ForceTuple startDesignTuple)
{
var calculator = new CrackForceCalculator();
- calculator.EndTuple = ForceTuple;
+ calculator.StartTuple = startDesignTuple;
+ calculator.EndTuple = finishDesignTuple;
calculator.NdmCollection = NdmPrimitivesService.GetNdms(ndmPrimitives, LimitState, CalcTerm);
calculator.Run();
var result = (CrackForceResult)calculator.Result;
if (result.IsValid)
{
- //var softLogic = new ExponentialSofteningLogic() { ForceRatio = result.ActualFactor };
- string message = string.Empty;
- if (result.IsSectionCracked)
- {
- message += $"Actual crack factor {result.FactorOfCrackAppearance}\n";
- message += $"Softening crack factor PsiS={result.PsiS}\n";
- message += $"{GeometryNames.MomFstName}={result.TupleOfCrackAppearance.Mx},\n {GeometryNames.MomSndName}={result.TupleOfCrackAppearance.My},\n {GeometryNames.LongForceName}={result.TupleOfCrackAppearance.Nz}";
- }
- else
- {
- message += "Cracks are not apeared";
- }
- MessageBox.Show(
- message,
- "Crack results",
- MessageBoxButtons.OK,
- MessageBoxIcon.Information);
+ ShowResult(result);
}
else
{
- var errorVM = new ErrorProcessor()
- {
- ShortText = "Error apeared while crack calculate",
- DetailText = result.Description
- };
- var wnd = new ErrorMessage(errorVM);
- wnd.ShowDialog();
+ ShowError(result);
}
}
+ private static void ShowError(CrackForceResult result)
+ {
+ var errorVM = new ErrorProcessor()
+ {
+ ShortText = "Error apeared while crack calculate",
+ DetailText = result.Description
+ };
+ var wnd = new ErrorMessage(errorVM);
+ wnd.ShowDialog();
+ }
+
+ private static void ShowResult(CrackForceResult result)
+ {
+ //var softLogic = new ExponentialSofteningLogic() { ForceRatio = result.ActualFactor };
+ string message = string.Empty;
+ if (result.IsSectionCracked)
+ {
+ message += $"Actual crack factor {result.FactorOfCrackAppearance}\n";
+ message += $"Softening crack factor PsiS={result.PsiS}\n";
+ message += $"{GeometryNames.MomFstName}={result.TupleOfCrackAppearance.Mx},\n {GeometryNames.MomSndName}={result.TupleOfCrackAppearance.My},\n {GeometryNames.LongForceName}={result.TupleOfCrackAppearance.Nz}";
+ }
+ else
+ {
+ message += "Cracks are not apeared";
+ }
+ MessageBox.Show(
+ message,
+ "Crack results",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Information);
+ }
}
}
diff --git a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowDiagramLogic.cs b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowDiagramLogic.cs
index fedd663..f049b85 100644
--- a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowDiagramLogic.cs
+++ b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForceResultLogic/ShowDiagramLogic.cs
@@ -39,7 +39,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
string[] labels = GetLabels(unitForce, unitMoment, unitCurvature);
arrayParameter = new ArrayParameter(resultList.Count(), labels.Count(), labels);
CalculateWithoutCrack(resultList, unitForce, unitMoment, unitCurvature);
- SafetyProcessor.RunSafeProcess(ShowWindow, "Errors apearred during showing graph, see detailed information");
+ SafetyProcessor.RunSafeProcess(ShowWindow, "Errors appeared during showing a graph, see detail information");
}
public void ShowCracks(List results, IEnumerable ndmPrimitives)
{
@@ -51,7 +51,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
string[] labels = GetCrackLabels(unitForce, unitMoment, unitCurvature);
arrayParameter = new ArrayParameter(resultList.Count(), labels.Count(), labels);
CalculateWithCrack(resultList, ndmPrimitives, unitForce, unitMoment, unitCurvature);
- SafetyProcessor.RunSafeProcess(ShowWindow, "Errors apearred during showing graph, see detailed information");
+ SafetyProcessor.RunSafeProcess(ShowWindow, "Errors appeared during showing a graph, see detailed information");
}
private void CalculateWithCrack(List resultList, IEnumerable ndmPrimitives, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
diff --git a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForcesResultsViewModel.cs b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForcesResultsViewModel.cs
index 1f1078b..5d1d545 100644
--- a/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForcesResultsViewModel.cs
+++ b/StructureHelper/Windows/ViewModels/Calculations/Calculators/ForcesResultsViewModel.cs
@@ -126,7 +126,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
showCrackResultLogic.CalcTerm = CalcTerms.ShortTerm; //= SelectedResult.DesignForceTuple.CalcTerm;
showCrackResultLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
showCrackResultLogic.ndmPrimitives = ndmPrimitives;
- showCrackResultLogic.Show();
+ showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
}
public ICommand ShowCrackWidthResultCommand
diff --git a/StructureHelper/Windows/ViewModels/Forces/InterpolateTuplesViewModel.cs b/StructureHelper/Windows/ViewModels/Forces/InterpolateTuplesViewModel.cs
index a92dfae..26e5b82 100644
--- a/StructureHelper/Windows/ViewModels/Forces/InterpolateTuplesViewModel.cs
+++ b/StructureHelper/Windows/ViewModels/Forces/InterpolateTuplesViewModel.cs
@@ -13,9 +13,13 @@ namespace StructureHelper.Windows.ViewModels.Forces
public class InterpolateTuplesViewModel : OkCancelViewModelBase
{
private RelayCommand invertForcesCommand;
+ private RelayCommand copyToStartCommand;
+ private RelayCommand copyToFinishCommand;
public IDesignForceTuple StartDesignForce { get; private set; }
public IDesignForceTuple FinishDesignForce { get; private set; }
+
+ public bool StepCountVisible { get; set; }
public double StartMx
{
get => StartDesignForce.ForceTuple.Mx;
@@ -77,19 +81,52 @@ namespace StructureHelper.Windows.ViewModels.Forces
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
}
+ public ICommand CopyToStartCommand
+ {
+ get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
+ }
+
+ public ICommand CopyToFinishCommand
+ {
+ get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
+ }
+
private void InvertForces()
{
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
StartDesignForce = FinishDesignForce;
FinishDesignForce = tmpForce;
- OnPropertyChanged(nameof(StartMx));
- OnPropertyChanged(nameof(StartMy));
- OnPropertyChanged(nameof(StartNz));
+ StepCountVisible = true;
+ RefreshStartTuple();
+ RefreshFinishTuple();
+ }
+
+ private void CopyStartToFinish()
+ {
+ FinishDesignForce = StartDesignForce.Clone() as IDesignForceTuple;
+ RefreshFinishTuple();
+ }
+
+ private void CopyFinishToStart()
+ {
+ StartDesignForce = FinishDesignForce.Clone() as IDesignForceTuple;
+ RefreshStartTuple();
+ }
+
+ public void RefreshFinishTuple()
+ {
OnPropertyChanged(nameof(FinishMx));
OnPropertyChanged(nameof(FinishMy));
OnPropertyChanged(nameof(FinishNz));
}
+ public void RefreshStartTuple()
+ {
+ OnPropertyChanged(nameof(StartMx));
+ OnPropertyChanged(nameof(StartMy));
+ OnPropertyChanged(nameof(StartNz));
+ }
+
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
{
if (startDesignForce !=null)
diff --git a/StructureHelperCommon/Models/Calculators/FindParameterCalculator.cs b/StructureHelperCommon/Models/Calculators/FindParameterCalculator.cs
index b80f509..09b2c4d 100644
--- a/StructureHelperCommon/Models/Calculators/FindParameterCalculator.cs
+++ b/StructureHelperCommon/Models/Calculators/FindParameterCalculator.cs
@@ -18,6 +18,8 @@ namespace StructureHelperCommon.Models.Calculators
public IAccuracy Accuracy {get;set;}
public IResult Result => result;
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
public FindParameterCalculator()
{
StartValue = 0d;
diff --git a/StructureHelperCommon/Models/Calculators/ICalculator.cs b/StructureHelperCommon/Models/Calculators/ICalculator.cs
index 11bfcf6..94ca5b3 100644
--- a/StructureHelperCommon/Models/Calculators/ICalculator.cs
+++ b/StructureHelperCommon/Models/Calculators/ICalculator.cs
@@ -1,4 +1,5 @@
-п»їusing System;
+п»їusing LoaderCalculator.Data.ResultData;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -19,5 +20,6 @@ namespace StructureHelperCommon.Models.Calculators
/// Result of Calculations
///
IResult Result { get; }
+ Action ActionToOutputResults { get; set; }
}
}
diff --git a/StructureHelperCommon/Models/Forces/ForceTuple.cs b/StructureHelperCommon/Models/Forces/ForceTuple.cs
index 359cee8..ab298b7 100644
--- a/StructureHelperCommon/Models/Forces/ForceTuple.cs
+++ b/StructureHelperCommon/Models/Forces/ForceTuple.cs
@@ -21,6 +21,16 @@ namespace StructureHelperCommon.Models.Forces
///
public double Mz { get; set; }
+ public void Clear()
+ {
+ Mx = 0d;
+ My = 0d;
+ Nz = 0d;
+ Qx = 0d;
+ Qy = 0d;
+ Mz = 0d;
+ }
+
///
public object Clone()
{
diff --git a/StructureHelperCommon/Models/Forces/IForceTuple.cs b/StructureHelperCommon/Models/Forces/IForceTuple.cs
index 1713b32..9acab6b 100644
--- a/StructureHelperCommon/Models/Forces/IForceTuple.cs
+++ b/StructureHelperCommon/Models/Forces/IForceTuple.cs
@@ -31,5 +31,6 @@ namespace StructureHelperCommon.Models.Forces
/// Twisting moment round about z-axis
///
double Mz { get; set; }
+ void Clear();
}
}
diff --git a/StructureHelperCommon/Models/Forces/StrainTuple.cs b/StructureHelperCommon/Models/Forces/StrainTuple.cs
index 40ba0fd..70b1f25 100644
--- a/StructureHelperCommon/Models/Forces/StrainTuple.cs
+++ b/StructureHelperCommon/Models/Forces/StrainTuple.cs
@@ -20,6 +20,16 @@ namespace StructureHelperCommon.Models.Forces
///
public double Mz { get; set; }
+ public void Clear()
+ {
+ Mx = 0d;
+ My = 0d;
+ Nz = 0d;
+ Qx = 0d;
+ Qy = 0d;
+ Mz = 0d;
+ }
+
///
public object Clone()
{
diff --git a/StructureHelperCommon/Services/Forces/ForceTupleService.cs b/StructureHelperCommon/Services/Forces/ForceTupleService.cs
index b20eee9..028b405 100644
--- a/StructureHelperCommon/Services/Forces/ForceTupleService.cs
+++ b/StructureHelperCommon/Services/Forces/ForceTupleService.cs
@@ -11,7 +11,7 @@ namespace StructureHelperCommon.Services.Forces
public static void CopyProperties(IForceTuple source, IForceTuple target, double factor = 1d)
{
CheckTuples(source, target);
- SumTupleToTarget(source, target, 0);
+ target.Clear();
SumTupleToTarget(source, target, factor);
}
public static IForceTuple MoveTupleIntoPoint(IForceTuple forceTuple, IPoint2D point2D)
@@ -66,7 +66,7 @@ namespace StructureHelperCommon.Services.Forces
}
return tuples;
}
- private static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
+ public static void SumTupleToTarget(IForceTuple source, IForceTuple target, double factor = 1d)
{
target.Mx += source.Mx * factor;
target.My += source.My * factor;
diff --git a/StructureHelperCommon/Services/Units/CommonOperation.cs b/StructureHelperCommon/Services/Units/CommonOperation.cs
index 55470ea..c31127f 100644
--- a/StructureHelperCommon/Services/Units/CommonOperation.cs
+++ b/StructureHelperCommon/Services/Units/CommonOperation.cs
@@ -28,7 +28,8 @@ namespace StructureHelperCommon.Services.Units
public static IStringDoublePair DivideIntoStringDoublePair(string s)
{
s = s.Replace(" ", "");
- string digitPattern = @"^[-]?[+]?\d+(\.?|\,?)\d*";
+ //string digitPattern = @"^[-]?[+]?\d+(\.?)|(\,?)\d*";
+ string digitPattern = @"^[-]?[+]?\d*\.?\,?\d*";
string textPattern = @"[0-9]|\.|\,";
string caracterPattern = "[a-z]+$";
string target = "";
diff --git a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceCalculator.cs b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceCalculator.cs
index 5090764..35e69c0 100644
--- a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceCalculator.cs
@@ -24,6 +24,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public ICompressedMember CompressedMember { get; }
public IAccuracy Accuracy { get; set; }
public List ForceCombinationLists { get; private set; }
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
public void Run()
{
var checkResult = CheckInputData();
diff --git a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceTupleCalculator.cs b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceTupleCalculator.cs
index fa54613..79e4404 100644
--- a/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceTupleCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Analyses/ByForces/ForceTupleCalculator.cs
@@ -9,6 +9,8 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using LoaderCalculator.Data.ResultData;
+using System.Windows;
namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
@@ -18,6 +20,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
public string Name { get; set; }
public IResult Result { get; private set; }
+ public Action ActionToOutputResults { get; set; }
+
public ForceTupleCalculator(IForceTupleInputData inputData)
{
InputData = inputData;
@@ -51,6 +55,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
MaxIterationCount = accuracy.MaxIterationCount,
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
},
+ ActionToOutputResults = ShowResultToConsole,
NdmCollection = ndmCollection
};
var calculator = new Calculator();
@@ -79,5 +84,11 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
{
throw new NotImplementedException();
}
+
+ private static void ShowResultToConsole(ILoaderResults result)
+ {
+ var strain = result.StrainMatrix;
+ //MessageBox.Show($" Текущие результаты в {result.IterationCounter} итерации:");
+ }
}
}
diff --git a/StructureHelperLogics/NdmCalculations/Analyses/Geometry/GeometryCalculator.cs b/StructureHelperLogics/NdmCalculations/Analyses/Geometry/GeometryCalculator.cs
index 0e12ab5..c1e70b1 100644
--- a/StructureHelperLogics/NdmCalculations/Analyses/Geometry/GeometryCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Analyses/Geometry/GeometryCalculator.cs
@@ -18,6 +18,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.Geometry
public IResult Result => geometryResult;
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
public GeometryCalculator(IEnumerable ndms, IStrainMatrix strainMatrix)
{
parametersLogic = new TextParametersLogic(ndms, strainMatrix);
diff --git a/StructureHelperLogics/NdmCalculations/Buckling/ConcreteBucklingCalculator.cs b/StructureHelperLogics/NdmCalculations/Buckling/ConcreteBucklingCalculator.cs
index 77d83db..1064f8e 100644
--- a/StructureHelperLogics/NdmCalculations/Buckling/ConcreteBucklingCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Buckling/ConcreteBucklingCalculator.cs
@@ -27,6 +27,7 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
public IResult Result { get; private set; }
public IAccuracy Accuracy { get; set; }
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
private (double EtaAlongX, double EtaAlongY) GetBucklingCoefficients()
{
diff --git a/StructureHelperLogics/NdmCalculations/Cracking/CrackForceCalculator.cs b/StructureHelperLogics/NdmCalculations/Cracking/CrackForceCalculator.cs
index fa43312..2a96eb0 100644
--- a/StructureHelperLogics/NdmCalculations/Cracking/CrackForceCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Cracking/CrackForceCalculator.cs
@@ -29,6 +29,9 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public IEnumerable NdmCollection { get; set; }
public Accuracy Accuracy {get;set; }
public IResult Result => result;
+
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
public CrackForceCalculator(IForceTupleCalculator forceTupleCalculator)
{
StartTuple ??= new ForceTuple();
diff --git a/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthCalculator.cs b/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthCalculator.cs
index 5d2f58e..170d1b1 100644
--- a/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthCalculator.cs
@@ -23,6 +23,8 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public CrackWidthCalculatorInputData InputData { get; set; }
public IResult Result => result;
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
+
public void Run()
{
result = new() { IsValid = true, Description = ""};
diff --git a/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthSimpleCalculator.cs b/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthSimpleCalculator.cs
index dc7687d..24b503a 100644
--- a/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthSimpleCalculator.cs
+++ b/StructureHelperLogics/NdmCalculations/Cracking/CrackWidthSimpleCalculator.cs
@@ -15,6 +15,7 @@ namespace StructureHelperLogics.NdmCalculations.Cracking
public ICrackWidthSimpleCalculatorInputData InputData { get; set; }
public IResult Result => result;
+ public Action ActionToOutputResults { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
public void Run()
{
diff --git a/StructureHelperLogics/StructureHelperLogics.csproj b/StructureHelperLogics/StructureHelperLogics.csproj
index c221750..63a39ca 100644
--- a/StructureHelperLogics/StructureHelperLogics.csproj
+++ b/StructureHelperLogics/StructureHelperLogics.csproj
@@ -16,4 +16,8 @@
+
+
+
+