Buckling calculator was changed, accidental eccentricity logic was added
This commit is contained in:
@@ -22,26 +22,29 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
||||
private FlowDocument document;
|
||||
private ICommand rebuildCommand;
|
||||
private ICommand printDocumentCommand;
|
||||
private int maxPriority;
|
||||
private int priorityLimit;
|
||||
private int tabGap;
|
||||
|
||||
public FlowDocumentReader DocumentReader { get; set; }
|
||||
public int MaxPriority
|
||||
public int PriorityLimit
|
||||
{
|
||||
get => maxPriority; set
|
||||
get => priorityLimit; set
|
||||
{
|
||||
var oldValue = maxPriority;
|
||||
var oldValue = priorityLimit;
|
||||
try
|
||||
{
|
||||
maxPriority = Math.Max(value, 0);
|
||||
OnPropertyChanged(nameof(MaxPriority));
|
||||
priorityLimit = Math.Max(value, 0);
|
||||
OnPropertyChanged(nameof(PriorityLimit));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
maxPriority = oldValue;
|
||||
priorityLimit = oldValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int MaxPriority => loggerEntries.Max(x => x.Priority);
|
||||
|
||||
public int TabGap
|
||||
{
|
||||
get => tabGap; set
|
||||
@@ -61,7 +64,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
||||
public TraceDocumentVM(IEnumerable<ITraceLoggerEntry> loggerEntries)
|
||||
{
|
||||
this.loggerEntries = loggerEntries;
|
||||
maxPriority = 350;
|
||||
priorityLimit = 350;
|
||||
tabGap = 30;
|
||||
}
|
||||
|
||||
@@ -81,7 +84,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
||||
public void Prepare()
|
||||
{
|
||||
document = new();
|
||||
selectedLoggerEntries = loggerEntries.Where(x => x.Priority <= MaxPriority);
|
||||
selectedLoggerEntries = loggerEntries.Where(x => x.Priority <= PriorityLimit);
|
||||
var blocks = selectedLoggerEntries.Select(x => GetBlockByEntry(x));
|
||||
document.Blocks.AddRange(blocks);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="120"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<FlowDocumentReader Name="DocumentReader" ViewingMode="Scroll"/>
|
||||
<StackPanel Grid.Column="1">
|
||||
@@ -18,7 +18,13 @@
|
||||
<TextBox Text="{Binding TabGap, ValidatesOnExceptions=True}" />
|
||||
</GroupBox>
|
||||
<GroupBox Header="Max priority">
|
||||
<TextBox Text="{Binding MaxPriority, ValidatesOnExceptions=True}" />
|
||||
<StackPanel>
|
||||
<TextBox Text="{Binding PriorityLimit, ValidatesOnExceptions=True}" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Slider Width="88" Value="{Binding PriorityLimit}" Maximum="{Binding MaxPriority}" Minimum="0"/>
|
||||
<TextBlock Width="20" FontSize="8" Text="{Binding MaxPriority}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</GroupBox>
|
||||
<Button Margin="3" Content="Rebuild" ToolTip="Rebuild document" Command="{Binding RebuildCommand}"/>
|
||||
<Button Margin="3" Content="Print" ToolTip="Print document" Command="{Binding PrintDocumentCommand}"/>
|
||||
|
||||
@@ -128,16 +128,14 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
|
||||
private void RunCalculator()
|
||||
{
|
||||
if (SelectedItem.TraceLogger is not null)
|
||||
{
|
||||
SelectedItem.TraceLogger.TraceLoggerEntries.Clear();
|
||||
}
|
||||
if (SelectedItem is LimitCurvesCalculator calculator)
|
||||
{
|
||||
if (calculator.TraceLogger is not null) { calculator.TraceLogger.TraceLoggerEntries.Clear(); }
|
||||
var inputData = calculator.InputData;
|
||||
ShowInteractionDiagramByInputData(calculator);
|
||||
if (calculator.TraceLogger is not null)
|
||||
{
|
||||
var wnd = new TraceDocumentView(calculator.TraceLogger.TraceLoggerEntries);
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -146,13 +144,17 @@ namespace StructureHelper.Windows.ViewModels.NdmCrossSections
|
||||
if (result.IsValid == false)
|
||||
{
|
||||
MessageBox.Show(result.Description, "Check data for analisys", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessResult();
|
||||
}
|
||||
}
|
||||
if (SelectedItem.TraceLogger is not null)
|
||||
{
|
||||
var wnd = new TraceDocumentView(SelectedItem.TraceLogger.TraceLoggerEntries);
|
||||
wnd.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowInteractionDiagramByInputData(LimitCurvesCalculator calculator)
|
||||
|
||||
Reference in New Issue
Block a user