Compare commits
3 Commits
master
...
Localizati
| Author | SHA1 | Date | |
|---|---|---|---|
| d8d20745e7 | |||
|
|
9562e56ffc | ||
| 971b5d6204 |
@@ -1,18 +1,12 @@
|
|||||||
using FieldVisualizer.InfraStructures.Exceptions;
|
using FieldVisualizer.InfraStructures.Enums;
|
||||||
|
using FieldVisualizer.InfraStructures.Exceptions;
|
||||||
using FieldVisualizer.InfraStructures.Strings;
|
using FieldVisualizer.InfraStructures.Strings;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace FieldVisualizer.Entities.ColorMaps.Factories
|
namespace FieldVisualizer.Entities.ColorMaps.Factories
|
||||||
{
|
{
|
||||||
public enum ColorMapsTypes
|
|
||||||
{
|
|
||||||
LiraSpectrum = 0, //Lira
|
|
||||||
FullSpectrum = 1, //StaDiCon
|
|
||||||
RedToWhite = 2,
|
|
||||||
RedToBlue = 3,
|
|
||||||
BlueToWhite = 4,
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Factory for creating of different color maps
|
/// Factory for creating of different color maps
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,39 +18,13 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
|||||||
if (mapsTypes == ColorMapsTypes.RedToWhite) { return GetRedToWhite(); }
|
if (mapsTypes == ColorMapsTypes.RedToWhite) { return GetRedToWhite(); }
|
||||||
if (mapsTypes == ColorMapsTypes.RedToBlue) { return GetRedToBlue(); }
|
if (mapsTypes == ColorMapsTypes.RedToBlue) { return GetRedToBlue(); }
|
||||||
if (mapsTypes == ColorMapsTypes.BlueToWhite) { return GetBlueToWhite(); }
|
if (mapsTypes == ColorMapsTypes.BlueToWhite) { return GetBlueToWhite(); }
|
||||||
if (mapsTypes == ColorMapsTypes.LiraSpectrum) { return GetLiraSpectrum(); }
|
|
||||||
else { throw new FieldVisulizerException(ErrorStrings.ColorMapTypeIsUnknown); }
|
else { throw new FieldVisulizerException(ErrorStrings.ColorMapTypeIsUnknown); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IColorMap GetLiraSpectrum()
|
|
||||||
{
|
|
||||||
ColorMap colorMap = new()
|
|
||||||
{
|
|
||||||
Name = "LiraSpectrumColorMap"
|
|
||||||
};
|
|
||||||
List<Color> colors = new();
|
|
||||||
byte Alpha = 0xff;
|
|
||||||
colors.AddRange(new Color[]{
|
|
||||||
Color.FromArgb(Alpha, 0, 0, 128) ,//Dark Blue
|
|
||||||
Color.FromArgb(Alpha, 0, 0, 255) ,//Blue
|
|
||||||
Color.FromArgb(Alpha, 0, 128, 255) ,//Blue
|
|
||||||
Color.FromArgb(Alpha, 0, 200, 255) ,//Blue
|
|
||||||
Color.FromArgb(Alpha, 60, 255, 255) ,//Light Blue
|
|
||||||
Color.FromArgb(Alpha, 255, 255, 128) ,//Light Yellow
|
|
||||||
Color.FromArgb(Alpha, 255, 255, 0) ,//Yellow
|
|
||||||
Color.FromArgb(Alpha, 255, 215, 0) ,//Gold
|
|
||||||
Color.FromArgb(Alpha, 255, 128, 0) ,//Orange Red
|
|
||||||
Color.FromArgb(Alpha, 255, 0, 0) ,//Red
|
|
||||||
});
|
|
||||||
colorMap.Colors = colors;
|
|
||||||
return colorMap;
|
|
||||||
}
|
|
||||||
private static IColorMap GetFullSpectrum()
|
private static IColorMap GetFullSpectrum()
|
||||||
{
|
{
|
||||||
ColorMap colorMap = new()
|
ColorMap colorMap = new ColorMap();
|
||||||
{
|
colorMap.Name = "FullSpectrumColorMap";
|
||||||
Name = "FullSpectrumColorMap"
|
|
||||||
};
|
|
||||||
List<Color> colors = new List<Color>();
|
List<Color> colors = new List<Color>();
|
||||||
byte Alpha = 0xff;
|
byte Alpha = 0xff;
|
||||||
colors.AddRange(new Color[]{
|
colors.AddRange(new Color[]{
|
||||||
@@ -75,6 +43,7 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
|||||||
colorMap.Colors = colors;
|
colorMap.Colors = colors;
|
||||||
return colorMap;
|
return colorMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IColorMap GetRedToWhite()
|
private static IColorMap GetRedToWhite()
|
||||||
{
|
{
|
||||||
ColorMap colorMap = new ColorMap();
|
ColorMap colorMap = new ColorMap();
|
||||||
@@ -88,6 +57,7 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
|||||||
colorMap.Colors = colors;
|
colorMap.Colors = colors;
|
||||||
return colorMap;
|
return colorMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IColorMap GetRedToBlue()
|
private static IColorMap GetRedToBlue()
|
||||||
{
|
{
|
||||||
ColorMap colorMap = new ColorMap();
|
ColorMap colorMap = new ColorMap();
|
||||||
@@ -101,6 +71,7 @@ namespace FieldVisualizer.Entities.ColorMaps.Factories
|
|||||||
colorMap.Colors = colors;
|
colorMap.Colors = colors;
|
||||||
return colorMap;
|
return colorMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IColorMap GetBlueToWhite()
|
private static IColorMap GetBlueToWhite()
|
||||||
{
|
{
|
||||||
ColorMap colorMap = new ColorMap();
|
ColorMap colorMap = new ColorMap();
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace FieldVisualizer.Entities.ColorMaps
|
|
||||||
{
|
|
||||||
public interface IValueColorArray
|
|
||||||
{
|
|
||||||
double AverageValue { get; set; }
|
|
||||||
Color BottomColor { get; set; }
|
|
||||||
double BottomValue { get; set; }
|
|
||||||
Color TopColor { get; set; }
|
|
||||||
double TopValue { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,19 @@
|
|||||||
using System.Windows.Media;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace FieldVisualizer.Entities.ColorMaps
|
namespace FieldVisualizer.Entities.ColorMaps
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Colored range for building color legend
|
|
||||||
/// </summary>
|
|
||||||
public interface IValueColorRange
|
public interface IValueColorRange
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// Flag of activity
|
|
||||||
/// </summary>
|
|
||||||
bool IsActive { get; set; }
|
bool IsActive { get; set; }
|
||||||
IValueColorArray ExactValues { get; }
|
double BottomValue { get; set; }
|
||||||
IValueColorArray RoundedValues { get; }
|
double AverageValue { get; set; }
|
||||||
|
double TopValue {get;set;}
|
||||||
|
Color BottomColor { get; set; }
|
||||||
|
Color TopColor { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace FieldVisualizer.Entities.ColorMaps
|
|
||||||
{
|
|
||||||
public class ValueColorArray : IValueColorArray
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Minimum value of range
|
|
||||||
/// </summary>
|
|
||||||
public double BottomValue { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Average value of range
|
|
||||||
/// </summary>
|
|
||||||
public double AverageValue { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Maximum value of range
|
|
||||||
/// </summary>
|
|
||||||
public double TopValue { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Color correspondent to minimum value
|
|
||||||
/// </summary>
|
|
||||||
public Color BottomColor { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Color correspondent to maximum value
|
|
||||||
/// </summary>
|
|
||||||
public Color TopColor { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,19 @@
|
|||||||
using System.Windows.Media;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace FieldVisualizer.Entities.ColorMaps
|
namespace FieldVisualizer.Entities.ColorMaps
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
|
||||||
public class ValueColorRange : IValueColorRange
|
public class ValueColorRange : IValueColorRange
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
|
public double BottomValue { get; set; }
|
||||||
public IValueColorArray ExactValues { get; private set; } = new ValueColorArray();
|
public double AverageValue { get; set; }
|
||||||
|
public double TopValue { get; set; }
|
||||||
public IValueColorArray RoundedValues { get; private set; } = new ValueColorArray();
|
public Color BottomColor { get; set; }
|
||||||
|
public Color TopColor { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,4 @@
|
|||||||
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
|
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="InfraStructures\Enums\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\StructureHelperCommon\StructureHelperCommon.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
14
FieldVisualizer/InfraStructures/Enums/ColorMapsTypes.cs
Normal file
14
FieldVisualizer/InfraStructures/Enums/ColorMapsTypes.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace FieldVisualizer.InfraStructures.Enums
|
||||||
|
{
|
||||||
|
public enum ColorMapsTypes
|
||||||
|
{
|
||||||
|
FullSpectrum = 0,
|
||||||
|
RedToWhite = 1,
|
||||||
|
RedToBlue = 2,
|
||||||
|
BlueToWhite = 3
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,5 @@
|
|||||||
using FieldVisualizer.Entities.ColorMaps;
|
using FieldVisualizer.Entities.ColorMaps;
|
||||||
using FieldVisualizer.Entities.Values;
|
using FieldVisualizer.Entities.Values;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -12,132 +10,54 @@ namespace FieldVisualizer.Services.ColorServices
|
|||||||
public static class ColorOperations
|
public static class ColorOperations
|
||||||
{
|
{
|
||||||
const byte Alpha = 0xff;
|
const byte Alpha = 0xff;
|
||||||
static IMathRoundLogic roundLogic = new SmartRoundLogic();
|
public static Color GetColorByValue(IValueRange range, IColorMap map, double val)
|
||||||
/// <summary>
|
{
|
||||||
///
|
if (range.TopValue == range.BottomValue || map.Colors.Count == 0) { return map.Colors[0]; }
|
||||||
/// </summary>
|
double minVal = range.BottomValue - 1e-15d*(Math.Abs(range.BottomValue));
|
||||||
/// <param name="fullRange"></param>
|
double maxVal = range.TopValue + 1e-15d * (Math.Abs(range.TopValue));
|
||||||
/// <param name="valueRanges"></param>
|
if (val > maxVal || val < minVal) { return Colors.Gray; }
|
||||||
/// <param name="colorMap"></param>
|
if (val == minVal) { return map.Colors[0]; }
|
||||||
/// <returns></returns>
|
if (val == maxVal) { return map.Colors[map.Colors.Count - 1]; }
|
||||||
|
|
||||||
|
double valPerc = (val - minVal) / (maxVal - minVal);// value%
|
||||||
|
if (valPerc >= 1d)
|
||||||
|
{ return map.Colors[map.Colors.Count - 1]; }
|
||||||
|
double colorPerc = 1d / (map.Colors.Count - 1d); // % of each block of color. the last is the "100% Color"
|
||||||
|
double blockOfColor = valPerc / colorPerc;// the integer part repersents how many block to skip
|
||||||
|
int blockIdx = (int)Math.Truncate(blockOfColor);// Idx of
|
||||||
|
double valPercResidual = valPerc - (blockIdx * colorPerc);//remove the part represented of block
|
||||||
|
double percOfColor = valPercResidual / colorPerc;// % of color of this block that will be filled
|
||||||
|
|
||||||
|
Color cTarget = map.Colors[blockIdx];
|
||||||
|
Color cNext = map.Colors[blockIdx + 1];
|
||||||
|
|
||||||
|
var deltaR = cNext.R - cTarget.R;
|
||||||
|
var deltaG = cNext.G - cTarget.G;
|
||||||
|
var deltaB = cNext.B - cTarget.B;
|
||||||
|
|
||||||
|
var R = cTarget.R + (deltaR * percOfColor);
|
||||||
|
var G = cTarget.G + (deltaG * percOfColor);
|
||||||
|
var B = cTarget.B + (deltaB * percOfColor);
|
||||||
|
|
||||||
|
Color c = map.Colors[0];
|
||||||
|
c = Color.FromArgb(Alpha, (byte)R, (byte)G, (byte)B);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
public static IEnumerable<IValueColorRange> GetValueColorRanges(IValueRange fullRange, IEnumerable<IValueRange> valueRanges, IColorMap colorMap)
|
public static IEnumerable<IValueColorRange> GetValueColorRanges(IValueRange fullRange, IEnumerable<IValueRange> valueRanges, IColorMap colorMap)
|
||||||
{
|
{
|
||||||
var colorRanges = new List<IValueColorRange>();
|
var colorRanges = new List<IValueColorRange>();
|
||||||
foreach (var valueRange in valueRanges)
|
foreach (var valueRange in valueRanges)
|
||||||
{
|
{
|
||||||
var valueColorRange = new ValueColorRange
|
IValueColorRange valueColorRange = new ValueColorRange();
|
||||||
{
|
valueColorRange.IsActive = true;
|
||||||
IsActive = true,
|
valueColorRange.BottomValue = valueRange.BottomValue;
|
||||||
};
|
valueColorRange.AverageValue = (valueRange.BottomValue + valueRange.TopValue) / 2;
|
||||||
valueColorRange.ExactValues.BottomValue = valueRange.BottomValue;
|
valueColorRange.TopValue = valueRange.TopValue;
|
||||||
valueColorRange.ExactValues.AverageValue = (valueRange.BottomValue + valueRange.TopValue) / 2;
|
valueColorRange.BottomColor = GetColorByValue(fullRange, colorMap, valueColorRange.BottomValue);
|
||||||
valueColorRange.ExactValues.TopValue = valueRange.TopValue;
|
valueColorRange.TopColor = GetColorByValue(fullRange, colorMap, valueColorRange.TopValue);
|
||||||
valueColorRange.ExactValues.BottomColor = GetColorByValue(fullRange, colorMap, valueColorRange.ExactValues.BottomValue);
|
|
||||||
valueColorRange.ExactValues.TopColor = GetColorByValue(fullRange, colorMap, valueColorRange.ExactValues.TopValue);
|
|
||||||
valueColorRange.RoundedValues.BottomValue = roundLogic.RoundValue(valueColorRange.ExactValues.BottomValue);
|
|
||||||
valueColorRange.RoundedValues.AverageValue = roundLogic.RoundValue(valueColorRange.ExactValues.AverageValue);
|
|
||||||
valueColorRange.RoundedValues.TopValue = roundLogic.RoundValue(valueColorRange.ExactValues.TopValue);
|
|
||||||
colorRanges.Add(valueColorRange);
|
colorRanges.Add(valueColorRange);
|
||||||
}
|
}
|
||||||
return colorRanges;
|
return colorRanges;
|
||||||
}
|
}
|
||||||
/// <summary>
|
|
||||||
/// Returns color by value, range of value an color map
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="range">Range of valoue</param>
|
|
||||||
/// <param name="map">Color map</param>
|
|
||||||
/// <param name="val">Value</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static Color GetColorByValue(IValueRange range, IColorMap map, double val)
|
|
||||||
{
|
|
||||||
CheckColorMap(map);
|
|
||||||
if (range.TopValue == range.BottomValue || map.Colors.Count == 1) //if range width is zero or map contain just 1 color
|
|
||||||
{
|
|
||||||
return map.Colors[0];
|
|
||||||
}
|
|
||||||
var valueRange = GetExtendedRange(range);
|
|
||||||
if (val >= valueRange.TopValue || val <= valueRange.BottomValue)
|
|
||||||
{
|
|
||||||
return GetColorValueIsOutOfRange(valueRange, map, val);
|
|
||||||
}
|
|
||||||
return GetColorValueIsInRange(valueRange, map, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Color GetColorValueIsOutOfRange(IValueRange range, IColorMap map, double val)
|
|
||||||
{
|
|
||||||
if (val > range.TopValue || val < range.BottomValue)
|
|
||||||
{
|
|
||||||
return Colors.Gray;
|
|
||||||
}
|
|
||||||
if (val == range.BottomValue)
|
|
||||||
{
|
|
||||||
return map.Colors[0];
|
|
||||||
}
|
|
||||||
if (val == range.TopValue)
|
|
||||||
{
|
|
||||||
return map.Colors[^1];
|
|
||||||
}
|
|
||||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Color GetColorValueIsInRange(IValueRange range, IColorMap map, double val)
|
|
||||||
{
|
|
||||||
var deltaVal = val - range.BottomValue;
|
|
||||||
var rangeWidth = range.TopValue - range.BottomValue;
|
|
||||||
var valPerc = deltaVal / rangeWidth; // percent of value on the distance from minValue to maxValue
|
|
||||||
if (valPerc >= 1d)
|
|
||||||
{
|
|
||||||
return map.Colors[^1];
|
|
||||||
}
|
|
||||||
double colorPerc = 1d / (map.Colors.Count - 1d); // % of each block of color. the last is the "100% Color"
|
|
||||||
double blockOfColor = valPerc / colorPerc;// the integer part represents how many block to skip
|
|
||||||
int blockIdx = (int)Math.Truncate(blockOfColor);// Idx of
|
|
||||||
double valPercResidual = valPerc - (blockIdx * colorPerc);//remove the part represented of block
|
|
||||||
double percOfColor = valPercResidual / colorPerc;// % of color of this block that will be filled
|
|
||||||
|
|
||||||
//in some cases due to accuracy of double type percent of color may be less than zero
|
|
||||||
if (percOfColor <= 0d)
|
|
||||||
{
|
|
||||||
return map.Colors[blockIdx];
|
|
||||||
}
|
|
||||||
Color c = GetColorByColorMap(map, blockIdx, percOfColor);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IValueRange GetExtendedRange(IValueRange range)
|
|
||||||
{
|
|
||||||
var minVal = range.BottomValue - 1e-15d * Math.Abs(range.BottomValue);
|
|
||||||
var maxVal = range.TopValue + 1e-15d * Math.Abs(range.TopValue);
|
|
||||||
return new ValueRange()
|
|
||||||
{
|
|
||||||
BottomValue = minVal,
|
|
||||||
TopValue = maxVal
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Color GetColorByColorMap(IColorMap map, int blockIdx, double percOfColor)
|
|
||||||
{
|
|
||||||
Color cTarget = map.Colors[blockIdx];
|
|
||||||
Color cNext = map.Colors[blockIdx + 1];
|
|
||||||
|
|
||||||
var deltaRed = cNext.R - cTarget.R;
|
|
||||||
var deltaGreen = cNext.G - cTarget.G;
|
|
||||||
var deltaBlue = cNext.B - cTarget.B;
|
|
||||||
|
|
||||||
var Red = cTarget.R + (deltaRed * percOfColor);
|
|
||||||
var Green = cTarget.G + (deltaGreen * percOfColor);
|
|
||||||
var Blue = cTarget.B + (deltaBlue * percOfColor);
|
|
||||||
|
|
||||||
Color c = Color.FromArgb(Alpha, (byte)Red, (byte)Green, (byte)Blue);
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CheckColorMap(IColorMap map)
|
|
||||||
{
|
|
||||||
if (map.Colors.Count == 0)
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Color map is empty");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,32 @@
|
|||||||
using FieldVisualizer.Entities.ColorMaps;
|
using FieldVisualizer.Entities.ColorMaps.Factories;
|
||||||
using FieldVisualizer.Entities.ColorMaps.Factories;
|
using FieldVisualizer.Entities.ColorMaps;
|
||||||
using FieldVisualizer.Entities.Values;
|
|
||||||
using FieldVisualizer.Entities.Values.Primitives;
|
using FieldVisualizer.Entities.Values.Primitives;
|
||||||
|
using FieldVisualizer.Entities.Values;
|
||||||
using FieldVisualizer.Infrastructure.Commands;
|
using FieldVisualizer.Infrastructure.Commands;
|
||||||
|
using FieldVisualizer.InfraStructures.Enums;
|
||||||
using FieldVisualizer.InfraStructures.Exceptions;
|
using FieldVisualizer.InfraStructures.Exceptions;
|
||||||
using FieldVisualizer.InfraStructures.Strings;
|
using FieldVisualizer.InfraStructures.Strings;
|
||||||
using FieldVisualizer.Services.ColorServices;
|
using FieldVisualizer.Services.ColorServices;
|
||||||
using FieldVisualizer.Services.PrimitiveServices;
|
using FieldVisualizer.Services.PrimitiveServices;
|
||||||
using FieldVisualizer.Services.ValueRanges;
|
using FieldVisualizer.Services.ValueRanges;
|
||||||
using FieldVisualizer.Windows.UserControls;
|
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using FieldVisualizer.Windows.UserControls;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
||||||
{
|
{
|
||||||
public class FieldViewerViewModel : ViewModelBase, IDataErrorInfo
|
public class FieldViewerViewModel : ViewModelBase, IDataErrorInfo
|
||||||
{
|
{
|
||||||
private IMathRoundLogic roundLogic = new SmartRoundLogic() { DigitQuant = 3 };
|
|
||||||
public ICommand RebuildCommand { get; }
|
public ICommand RebuildCommand { get; }
|
||||||
public ICommand ZoomInCommand { get; }
|
public ICommand ZoomInCommand { get; }
|
||||||
public ICommand ZoomOutCommand { get; }
|
public ICommand ZoomOutCommand { get; }
|
||||||
@@ -161,8 +164,8 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
|||||||
private ColorMapsTypes _ColorMapType;
|
private ColorMapsTypes _ColorMapType;
|
||||||
private IColorMap _ColorMap;
|
private IColorMap _ColorMap;
|
||||||
private IValueRange valueRange;
|
private IValueRange valueRange;
|
||||||
private IEnumerable<IValueRange> valueRanges;
|
private IEnumerable<IValueRange> _ValueRanges;
|
||||||
private IEnumerable<IValueColorRange> valueColorRanges;
|
private IEnumerable<IValueColorRange> _ValueColorRanges;
|
||||||
private bool setMinValue;
|
private bool setMinValue;
|
||||||
private bool setMaxValue;
|
private bool setMaxValue;
|
||||||
private double crossLineX;
|
private double crossLineX;
|
||||||
@@ -174,7 +177,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
|||||||
|
|
||||||
public FieldViewerViewModel()
|
public FieldViewerViewModel()
|
||||||
{
|
{
|
||||||
_ColorMapType = ColorMapsTypes.LiraSpectrum;
|
_ColorMapType = ColorMapsTypes.FullSpectrum;
|
||||||
RebuildCommand = new RelayCommand(o => ProcessPrimitives(), o => PrimitiveValidation());
|
RebuildCommand = new RelayCommand(o => ProcessPrimitives(), o => PrimitiveValidation());
|
||||||
ZoomInCommand = new RelayCommand(o => Zoom(1.2), o => PrimitiveValidation());
|
ZoomInCommand = new RelayCommand(o => Zoom(1.2), o => PrimitiveValidation());
|
||||||
ZoomOutCommand = new RelayCommand(o => Zoom(0.8), o => PrimitiveValidation());
|
ZoomOutCommand = new RelayCommand(o => Zoom(0.8), o => PrimitiveValidation());
|
||||||
@@ -192,7 +195,7 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
|||||||
if ((PrimitiveSet is null) == false)
|
if ((PrimitiveSet is null) == false)
|
||||||
{
|
{
|
||||||
ProcessPrimitives();
|
ProcessPrimitives();
|
||||||
Legend.ValueColorRanges = valueColorRanges;
|
Legend.ValueColorRanges = _ValueColorRanges;
|
||||||
Legend.Refresh();
|
Legend.Refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,14 +262,14 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
|||||||
{
|
{
|
||||||
SolidColorBrush brush = new SolidColorBrush();
|
SolidColorBrush brush = new SolidColorBrush();
|
||||||
brush.Color = ColorOperations.GetColorByValue(valueRange, _ColorMap, valuePrimitive.Value);
|
brush.Color = ColorOperations.GetColorByValue(valueRange, _ColorMap, valuePrimitive.Value);
|
||||||
foreach (var valueRange in valueColorRanges)
|
foreach (var valueRange in _ValueColorRanges)
|
||||||
{
|
{
|
||||||
if (valuePrimitive.Value >= valueRange.ExactValues.BottomValue & valuePrimitive.Value <= valueRange.ExactValues.TopValue & (!valueRange.IsActive))
|
if (valuePrimitive.Value >= valueRange.BottomValue & valuePrimitive.Value <= valueRange.TopValue & (!valueRange.IsActive))
|
||||||
{
|
{
|
||||||
brush.Color = Colors.Gray;
|
brush.Color = Colors.Gray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shape.ToolTip = roundLogic.RoundValue(valuePrimitive.Value);
|
shape.ToolTip = valuePrimitive.Value;
|
||||||
shape.Tag = valuePrimitive;
|
shape.Tag = valuePrimitive;
|
||||||
shape.Fill = brush;
|
shape.Fill = brush;
|
||||||
Canvas.SetLeft(shape, valuePrimitive.CenterX - addX - dX);
|
Canvas.SetLeft(shape, valuePrimitive.CenterX - addX - dX);
|
||||||
@@ -303,24 +306,10 @@ namespace FieldVisualizer.ViewModels.FieldViewerViewModels
|
|||||||
{
|
{
|
||||||
UserValueRange.TopValue = UserValueRange.BottomValue;
|
UserValueRange.TopValue = UserValueRange.BottomValue;
|
||||||
}
|
}
|
||||||
if (SetMinValue == true)
|
if (SetMinValue) { valueRange.BottomValue = UserValueRange.BottomValue; } else { UserValueRange.BottomValue = valueRange.BottomValue; }
|
||||||
{
|
if (SetMaxValue) { valueRange.TopValue = UserValueRange.TopValue; } else { UserValueRange.TopValue = valueRange.TopValue; }
|
||||||
valueRange.BottomValue = UserValueRange.BottomValue;
|
_ValueRanges = ValueRangeOperations.DivideValueRange(valueRange, RangeNumber);
|
||||||
}
|
_ValueColorRanges = ColorOperations.GetValueColorRanges(valueRange, _ValueRanges, _ColorMap);
|
||||||
else
|
|
||||||
{
|
|
||||||
UserValueRange.BottomValue = valueRange.BottomValue;
|
|
||||||
}
|
|
||||||
if (SetMaxValue == true)
|
|
||||||
{
|
|
||||||
valueRange.TopValue = UserValueRange.TopValue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UserValueRange.TopValue = valueRange.TopValue;
|
|
||||||
}
|
|
||||||
valueRanges = ValueRangeOperations.DivideValueRange(valueRange, RangeNumber);
|
|
||||||
valueColorRanges = ColorOperations.GetValueColorRanges(valueRange, valueRanges, _ColorMap);
|
|
||||||
}
|
}
|
||||||
private void SetCrossLine(object commandParameter)
|
private void SetCrossLine(object commandParameter)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,23 @@
|
|||||||
using FieldVisualizer.Entities.Values.Primitives;
|
using FieldVisualizer.Entities.ColorMaps;
|
||||||
|
using FieldVisualizer.Entities.ColorMaps.Factories;
|
||||||
|
using FieldVisualizer.Entities.Values;
|
||||||
|
using FieldVisualizer.Entities.Values.Primitives;
|
||||||
|
using FieldVisualizer.Infrastructure.Commands;
|
||||||
|
using FieldVisualizer.InfraStructures.Enums;
|
||||||
|
using FieldVisualizer.InfraStructures.Exceptions;
|
||||||
|
using FieldVisualizer.InfraStructures.Strings;
|
||||||
|
using FieldVisualizer.Services.ColorServices;
|
||||||
|
using FieldVisualizer.Services.PrimitiveServices;
|
||||||
|
using FieldVisualizer.Services.ValueRanges;
|
||||||
using FieldVisualizer.ViewModels.FieldViewerViewModels;
|
using FieldVisualizer.ViewModels.FieldViewerViewModels;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
using System.Windows.Shapes;
|
||||||
|
|
||||||
namespace FieldVisualizer.Windows.UserControls
|
namespace FieldVisualizer.Windows.UserControls
|
||||||
{
|
{
|
||||||
@@ -23,6 +39,17 @@ namespace FieldVisualizer.Windows.UserControls
|
|||||||
viewModel.Legend = LegendViewer;
|
viewModel.Legend = LegendViewer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//public FieldViewer(FieldViewerViewModel vm)
|
||||||
|
//{
|
||||||
|
// InitializeComponent();
|
||||||
|
// viewModel = vm;
|
||||||
|
// this.DataContext = viewModel;
|
||||||
|
// PrimitiveSet = viewModel.PrimitiveSet;
|
||||||
|
// viewModel.WorkPlaneBox = WorkPlaneBox;
|
||||||
|
// viewModel.WorkPlaneCanvas = WorkPlaneCanvas;
|
||||||
|
// viewModel.Legend = LegendViewer;
|
||||||
|
//}
|
||||||
|
|
||||||
public IPrimitiveSet PrimitiveSet { get => viewModel.PrimitiveSet; set { viewModel.PrimitiveSet = value; } }
|
public IPrimitiveSet PrimitiveSet { get => viewModel.PrimitiveSet; set { viewModel.PrimitiveSet = value; } }
|
||||||
|
|
||||||
internal void Refresh()
|
internal void Refresh()
|
||||||
|
|||||||
@@ -20,23 +20,23 @@
|
|||||||
<ColumnDefinition Width="10"/>
|
<ColumnDefinition Width="10"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<CheckBox Name="ActiveCheckBox" Grid.Column="0" IsChecked="{Binding Path=IsActive}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
<CheckBox Name="ActiveCheckBox" Grid.Column="0" IsChecked="{Binding Path=IsActive}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||||
<Rectangle Grid.Column="1" Margin="0,2,0,2" ToolTip="{Binding Path=RoundedValues.BottomValue}">
|
<Rectangle Grid.Column="1" Margin="0,2,0,2" ToolTip="{Binding Path=BottomValue}">
|
||||||
<Rectangle.Fill>
|
<Rectangle.Fill>
|
||||||
<SolidColorBrush Color="{Binding Path=ExactValues.BottomColor}"/>
|
<SolidColorBrush Color="{Binding Path=BottomColor}"/>
|
||||||
</Rectangle.Fill>
|
</Rectangle.Fill>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<Rectangle Grid.Column="2" Margin="0,2,0,2">
|
<Rectangle Grid.Column="2" Margin="0,2,0,2">
|
||||||
<Rectangle.Fill>
|
<Rectangle.Fill>
|
||||||
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
|
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
|
||||||
<GradientStop Color="{Binding Path=ExactValues.BottomColor}"/>
|
<GradientStop Color="{Binding Path=BottomColor}"/>
|
||||||
<GradientStop Color="{Binding Path=ExactValues.TopColor}" Offset="1"/>
|
<GradientStop Color="{Binding Path=TopColor}" Offset="1"/>
|
||||||
</LinearGradientBrush>
|
</LinearGradientBrush>
|
||||||
</Rectangle.Fill>
|
</Rectangle.Fill>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FF868686" Text="{Binding RoundedValues.AverageValue}"/>
|
<TextBlock Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#FF868686" Text="{Binding AverageValue}"/>
|
||||||
<Rectangle Grid.Column="3" Margin="0,2,0,2" ToolTip="{Binding Path=RoundedValues.TopValue}">
|
<Rectangle Grid.Column="3" Margin="0,2,0,2" ToolTip="{Binding Path=TopValue}">
|
||||||
<Rectangle.Fill>
|
<Rectangle.Fill>
|
||||||
<SolidColorBrush Color="{Binding Path=ExactValues.TopColor}"/>
|
<SolidColorBrush Color="{Binding Path=TopColor}"/>
|
||||||
</Rectangle.Fill>
|
</Rectangle.Fill>
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
xmlns:FieldViewerControl="clr-namespace:FieldVisualizer.Windows.UserControls"
|
xmlns:FieldViewerControl="clr-namespace:FieldVisualizer.Windows.UserControls"
|
||||||
xmlns:local="clr-namespace:FieldVisualizer.Windows"
|
xmlns:local="clr-namespace:FieldVisualizer.Windows"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="FieldViewer" Height="800" Width="1200" MinHeight="400" MinWidth="800" MaxHeight="1000" MaxWidth="1500" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
Title="FieldViewer" Height="800" Width="1200" WindowStartupLocation="CenterOwner">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="300"/>
|
<ColumnDefinition Width="300"/>
|
||||||
|
|||||||
@@ -14,9 +14,6 @@ EndProject
|
|||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructureHelperLogics", "StructureHelperLogics\StructureHelperLogics.csproj", "{C9192AE7-EE6D-409C-A05C-3549D78CBB34}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructureHelperLogics", "StructureHelperLogics\StructureHelperLogics.csproj", "{C9192AE7-EE6D-409C-A05C-3549D78CBB34}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FieldVisualizer", "FieldVisualizer\FieldVisualizer.csproj", "{6CAC5B83-81F3-47C2-92A1-0F94A58491C2}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FieldVisualizer", "FieldVisualizer\FieldVisualizer.csproj", "{6CAC5B83-81F3-47C2-92A1-0F94A58491C2}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
|
||||||
{F1548BD2-7FE8-46C2-9BC4-9BA813A5C59A} = {F1548BD2-7FE8-46C2-9BC4-9BA813A5C59A}
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/IconDictionary.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/IconDictionary.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/GraphsTemplates.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/GraphsTemplates.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/LimitCurveTemplates.xaml"/>
|
<ResourceDictionary Source="Infrastructure/UI/Resources/LimitCurveTemplates.xaml"/>
|
||||||
<ResourceDictionary Source="Infrastructure/UI/Resources/ServiceColors.xaml"/>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ namespace StructureHelper.Infrastructure.Enums
|
|||||||
{
|
{
|
||||||
ForceCalculator,
|
ForceCalculator,
|
||||||
LimitCurveCalculator,
|
LimitCurveCalculator,
|
||||||
CrackCalculator,
|
|
||||||
FireCalculator
|
FireCalculator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
internal class Area : UnitBase
|
internal class Area : UnitBase
|
||||||
{
|
{
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Area; }
|
public override UnitTypes UnitType { get => UnitTypes.Area; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm2"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "mm2"); }
|
||||||
public override string UnitName { get => "Area"; }
|
public override string UnitName { get => "Area"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|
||||||
{
|
|
||||||
internal class CrackWidth : UnitBase
|
|
||||||
{
|
|
||||||
public CrackWidth()
|
|
||||||
{
|
|
||||||
OperationLogic = new ConvertUnitLogic()
|
|
||||||
{
|
|
||||||
MathRoundLogic = new FixedRoundLogic()
|
|
||||||
{
|
|
||||||
DigitQuant = 3
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Length; }
|
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm"); }
|
|
||||||
public override string UnitName { get => "Length"; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
internal class Curvature : UnitBase
|
internal class Curvature : UnitBase
|
||||||
{
|
{
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Curvature; }
|
public override UnitTypes UnitType { get => UnitTypes.Curvature; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "1/mm"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "1/mm"); }
|
||||||
public override string UnitName { get => "Curvature"; }
|
public override string UnitName { get => "Curvature"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
internal class Force : UnitBase
|
internal class Force : UnitBase
|
||||||
{
|
{
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Force; }
|
public override UnitTypes UnitType { get => UnitTypes.Force; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "kN"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "kN"); }
|
||||||
public override string UnitName { get => "Force"; }
|
public override string UnitName { get => "Force"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
{
|
{
|
||||||
internal class Length : UnitBase
|
internal class Length : UnitBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Length; }
|
public override UnitTypes UnitType { get => UnitTypes.Length; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "mm"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "mm"); }
|
||||||
public override string UnitName { get => "Length"; }
|
public override string UnitName { get => "Length"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
internal class Moment : UnitBase
|
internal class Moment : UnitBase
|
||||||
{
|
{
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Moment; }
|
public override UnitTypes UnitType { get => UnitTypes.Moment; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "kNm"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "kNm"); }
|
||||||
public override string UnitName { get => "Moment"; }
|
public override string UnitName { get => "Moment"; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
{
|
{
|
||||||
internal class PlainDouble : IValueConverter
|
internal class PlainDouble : IValueConverter
|
||||||
{
|
{
|
||||||
IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -30,7 +28,7 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return ProcessString.ConvertCommaToCultureSettings((string)value);
|
return CommonOperation.ConvertToDoubleChangeComma((string)value);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -13,19 +12,8 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
{
|
{
|
||||||
internal class Stress : UnitBase
|
internal class Stress : UnitBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public override UnitTypes UnitType { get => UnitTypes.Stress; }
|
public override UnitTypes UnitType { get => UnitTypes.Stress; }
|
||||||
public override IUnit CurrentUnit { get => UnitLogic.GetUnit(UnitType, "MPa"); }
|
public override IUnit CurrentUnit { get => CommonOperation.GetUnit(UnitType, "MPa"); }
|
||||||
public override string UnitName { get => "Stress"; }
|
public override string UnitName { get => "Stress"; }
|
||||||
public Stress()
|
|
||||||
{
|
|
||||||
OperationLogic = new ConvertUnitLogic()
|
|
||||||
{
|
|
||||||
MathRoundLogic = new SmartRoundLogic()
|
|
||||||
{
|
|
||||||
DigitQuant = 3
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -17,61 +14,19 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
|||||||
{
|
{
|
||||||
internal abstract class UnitBase : IValueConverter
|
internal abstract class UnitBase : IValueConverter
|
||||||
{
|
{
|
||||||
IMathRoundLogic roundLogic = new DirectRoundLogic();
|
|
||||||
public IConvertUnitLogic OperationLogic { get; set; } = new ConvertUnitLogic();
|
|
||||||
public IGetUnitLogic UnitLogic { get; set; } = new GetUnitLogic();
|
|
||||||
public abstract UnitTypes UnitType { get; }
|
public abstract UnitTypes UnitType { get; }
|
||||||
public abstract IUnit CurrentUnit { get; }
|
public abstract IUnit CurrentUnit { get; }
|
||||||
public abstract string UnitName { get;}
|
public abstract string UnitName { get;}
|
||||||
/// <summary>
|
|
||||||
/// From variable to user
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="targetType"></param>
|
|
||||||
/// <param name="parameter"></param>
|
|
||||||
/// <param name="culture"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
var pair = OperationLogic.Convert(CurrentUnit, UnitName, value);
|
return CommonOperation.Convert(CurrentUnit, UnitName, value);
|
||||||
var result = pair.Value;
|
|
||||||
if (parameter is not null)
|
|
||||||
{
|
|
||||||
if (parameter is string paramString)
|
|
||||||
{
|
|
||||||
var logic = new ProcessDoublePairLogic() { DigitPlace = DigitPlace.Any };
|
|
||||||
var paramPair = logic.GetValuePairByString(paramString);
|
|
||||||
string paramTextPart = paramPair.Text.ToLower();
|
|
||||||
int paramValuePart = (int)paramPair.Value;
|
|
||||||
if (paramTextPart == "smart")
|
|
||||||
{
|
|
||||||
roundLogic = new SmartRoundLogic() { DigitQuant = paramValuePart };
|
|
||||||
}
|
}
|
||||||
else if (paramTextPart == "fixed")
|
|
||||||
{
|
|
||||||
roundLogic = new FixedRoundLogic() { DigitQuant = paramValuePart };
|
|
||||||
}
|
|
||||||
result = roundLogic.RoundValue(result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
string strValue = $"{result} {pair.Text}";
|
|
||||||
return strValue;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// From user to variable
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="value"></param>
|
|
||||||
/// <param name="targetType"></param>
|
|
||||||
/// <param name="parameter"></param>
|
|
||||||
/// <param name="culture"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
double result = OperationLogic.ConvertBack(UnitType, CurrentUnit, value);
|
return CommonOperation.ConvertBack(UnitType, CurrentUnit, value);
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,15 +2,13 @@
|
|||||||
using StructureHelper.Services.Primitives;
|
using StructureHelper.Services.Primitives;
|
||||||
using StructureHelper.Windows.MainWindow;
|
using StructureHelper.Windows.MainWindow;
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||||
using System;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace StructureHelper.Infrastructure.UI.DataContexts
|
namespace StructureHelper.Infrastructure.UI.DataContexts
|
||||||
{
|
{
|
||||||
public abstract class PrimitiveBase : ViewModelBase, IObserver<IRectangleShape>
|
public abstract class PrimitiveBase : ViewModelBase
|
||||||
{
|
{
|
||||||
#region Поля
|
#region Поля
|
||||||
private IPrimitiveRepository primitiveRepository;
|
private IPrimitiveRepository primitiveRepository;
|
||||||
@@ -238,6 +236,12 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
this.primitive = primitive;
|
this.primitive = primitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void RegisterDeltas(double dx, double dy)
|
||||||
|
{
|
||||||
|
DeltaX = dx;
|
||||||
|
DeltaY = dy;
|
||||||
|
}
|
||||||
|
|
||||||
public CrossSectionViewModel OwnerVM { get; private set; }
|
public CrossSectionViewModel OwnerVM { get; private set; }
|
||||||
|
|
||||||
public double DeltaX { get; private set; }
|
public double DeltaX { get; private set; }
|
||||||
@@ -249,6 +253,14 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
return primitive;
|
return primitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//public virtual void RefreshNdmPrimitive()
|
||||||
|
//{
|
||||||
|
//}
|
||||||
|
|
||||||
|
public void RefreshColor()
|
||||||
|
{
|
||||||
|
OnPropertyChanged(nameof(Color));
|
||||||
|
}
|
||||||
public virtual void Refresh()
|
public virtual void Refresh()
|
||||||
{
|
{
|
||||||
OnPropertyChanged(nameof(Name));
|
OnPropertyChanged(nameof(Name));
|
||||||
@@ -261,22 +273,5 @@ namespace StructureHelper.Infrastructure.UI.DataContexts
|
|||||||
OnPropertyChanged(nameof(PrimitiveWidth));
|
OnPropertyChanged(nameof(PrimitiveWidth));
|
||||||
OnPropertyChanged(nameof(PrimitiveHeight));
|
OnPropertyChanged(nameof(PrimitiveHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnCompleted()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnError(Exception error)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void OnNext(IRectangleShape value)
|
|
||||||
{
|
|
||||||
DeltaX = value.Width / 2d;
|
|
||||||
DeltaY = value.Height / 2d;
|
|
||||||
Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,38 +51,11 @@
|
|||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ToolButton" TargetType="Button">
|
<Style x:Key="ToolButton" TargetType="Button">
|
||||||
<Style.Resources>
|
|
||||||
<Style TargetType="Image">
|
|
||||||
<Setter Property="Width" Value="32"/>
|
|
||||||
<Setter Property="Height" Value="32"/>
|
|
||||||
<Setter Property="Margin" Value="-2"/>
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter Property="Opacity" Value="0.25"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
<Style TargetType="Viewbox">
|
|
||||||
<Setter Property="Margin" Value="-2"/>
|
|
||||||
<Setter Property="Width" Value="32"/>
|
|
||||||
<Setter Property="Height" Value="32"/>
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="Stretch" Value="UniformToFill"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter Property="Opacity" Value="0.25"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Style.Resources>
|
|
||||||
<Setter Property="Width" Value="32"/>
|
<Setter Property="Width" Value="32"/>
|
||||||
<Setter Property="Height" Value="32"/>
|
<Setter Property="Height" Value="32"/>
|
||||||
<Setter Property="Margin" Value="2,0,2,0"/>
|
<Setter Property="Margin" Value="2,0,2,0"/>
|
||||||
<Setter Property="Background" Value="#FFA19BC3"/>
|
<Setter Property="Background" Value="#FFA19BC3"/>
|
||||||
<Setter Property="BorderBrush" Value="Black"/>
|
<Setter Property="BorderBrush" Value="#FF857AB9"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style x:Key="ButtonImage16" TargetType="Image">
|
<Style x:Key="ButtonImage16" TargetType="Image">
|
||||||
@@ -94,41 +67,6 @@
|
|||||||
<Setter Property="Width" Value="32"/>
|
<Setter Property="Width" Value="32"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Color x:Key="ButtonLight" A="255" B="255" G="255" R="255"/>
|
|
||||||
<Color x:Key="CalculatorColor" A="255" B="149" G="149" R="211"/>
|
|
||||||
<Color x:Key="CalculatorFrameColor" A="255" B="109" G="109" R="166"/>
|
|
||||||
<Color x:Key="ResultColor" A="255" B="200" G="200" R="200"/>
|
|
||||||
<Color x:Key="ResultFrameColor" A="255" B="100" G="100" R="100"/>
|
|
||||||
<SolidColorBrush x:Key="CalculatorCanvas" Color="{DynamicResource CalculatorColor}"/>
|
|
||||||
<SolidColorBrush x:Key="CalculatorFrame" Color="{DynamicResource CalculatorFrameColor}"/>
|
|
||||||
<SolidColorBrush x:Key="ResultCanvas" Color="{DynamicResource ResultColor}"/>
|
|
||||||
<SolidColorBrush x:Key="ResultFrame" Color="{DynamicResource ResultFrameColor}"/>
|
|
||||||
|
|
||||||
<Style x:Key="ButtonCanvas" TargetType="Canvas">
|
|
||||||
<Setter Property="Width" Value="32"/>
|
|
||||||
<Setter Property="Height" Value="32"/>
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="ButtonCalculatorCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource CalculatorCanvas}"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="ButtonResultCanvas" TargetType="Canvas" BasedOn="{StaticResource ButtonCanvas}">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ResultCanvas}"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style x:Key="ButtonRect" TargetType="Rectangle">
|
|
||||||
<Setter Property="Margin" Value="3"/>
|
|
||||||
<Setter Property="Width" Value="26"/>
|
|
||||||
<Setter Property="Height" Value="26"/>
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
||||||
<Setter Property="StrokeThickness" Value="1"/>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
|
|
||||||
<DataTemplate x:Key="OkCancelButtons">
|
<DataTemplate x:Key="OkCancelButtons">
|
||||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Button Style="{StaticResource CancelButton}" Command="{Binding CancelCommand}"/>
|
<Button Style="{StaticResource CancelButton}" Command="{Binding CancelCommand}"/>
|
||||||
@@ -136,86 +74,5 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<DataTemplate x:Key="ButtonCalculatorRectangle">
|
|
||||||
<Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource CalculatorFrame}">
|
|
||||||
<Rectangle.Fill>
|
|
||||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
||||||
<GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
|
|
||||||
<GradientStop Color="{DynamicResource CalculatorColor}" Offset="1"/>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Rectangle.Fill>
|
|
||||||
</Rectangle>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="ButtonResultRectangle">
|
|
||||||
<Rectangle Style="{DynamicResource ButtonRect}" Stroke="{DynamicResource ResultFrame}">
|
|
||||||
<Rectangle.Fill>
|
|
||||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
|
|
||||||
<GradientStop Color="{DynamicResource ButtonLight}" Offset="0.2"/>
|
|
||||||
<GradientStop Color="{DynamicResource ResultColor}" Offset="1"/>
|
|
||||||
</LinearGradientBrush>
|
|
||||||
</Rectangle.Fill>
|
|
||||||
</Rectangle>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="DiagramCalculator">
|
|
||||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
|
||||||
<Canvas.Children>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
|
||||||
<Line Margin="4" X1="0" Y1="20" X2="25" Y2="20" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
|
|
||||||
<Line Margin="4" X1="4" Y1="0" X2="4" Y2="25" StrokeThickness="1.5" Stroke="{DynamicResource CalculatorFrame}"/>
|
|
||||||
<Path Margin="4" Data="M 0 5 l 4 -4 l 7 4 l 7 6 l 2 4 l -2 7 l -2 2 " Stroke="{DynamicResource CalculatorFrame}"/>
|
|
||||||
<TextBlock Margin="4,2,0,0" Text="M-N" Foreground="Black" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
|
|
||||||
</Canvas.Children>
|
|
||||||
</Canvas>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="CrackCalculator">
|
|
||||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
|
||||||
<Canvas.Children>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
|
||||||
<Path Margin="4" Data="M 0 0 l 25 0 l 0 20
|
|
||||||
l -4 0
|
|
||||||
l -1 -5 l 1 -5 l -2 5 l -2 5
|
|
||||||
l -3 0
|
|
||||||
l 0 -5 l 0 -10 l -2 10 l -2 5
|
|
||||||
l -3 0
|
|
||||||
l -1 -5 l 1 -5 l -2 5 l -2 5
|
|
||||||
l -4 0" Fill="{DynamicResource CalculatorFrame}"/>
|
|
||||||
<TextBlock Margin="4,2,0,0" Text="Crc" Foreground="White" FontSize="10" HorizontalAlignment="Stretch" FontWeight="Bold" />
|
|
||||||
</Canvas.Children>
|
|
||||||
</Canvas>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="CalculatorRun">
|
|
||||||
<Canvas Style="{DynamicResource ButtonCalculatorCanvas}">
|
|
||||||
<Canvas.Children>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ButtonCalculatorRectangle}"/>
|
|
||||||
<Path Margin="4" Data="M 4 2 l 12 10 l -12 10 l 0 -20" Fill="{DynamicResource CalculatorFrame}"/>
|
|
||||||
</Canvas.Children>
|
|
||||||
</Canvas>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="IsoFieldResult">
|
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
|
||||||
<Canvas.Children>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ButtonResultRectangle}"/>
|
|
||||||
<Path Margin="4" Data="M 0 0 h 20 A 20 20 90 0 1 0 24 z" Fill="Gray"/>
|
|
||||||
<Path Margin="4" Data="M 0 0 h 16 A 16 16 90 0 1 0 18 z" Fill="DarkGray"/>
|
|
||||||
<Path Margin="4" Data="M 0 0 h 10 A 10 10 90 0 1 0 10 z" Fill="LightGray"/>
|
|
||||||
</Canvas.Children>
|
|
||||||
</Canvas>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
<DataTemplate x:Key="ShowRebarsResult">
|
|
||||||
<Canvas Style="{DynamicResource ButtonResultCanvas}">
|
|
||||||
<Canvas.Children>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ButtonResultRectangle}"/>
|
|
||||||
<Rectangle Canvas.Left="8" Canvas.Top="6" Width="16" Height="21" Fill="LightGray" Stroke ="Black"/>
|
|
||||||
<Ellipse Canvas.Left="10" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
|
||||||
<Ellipse Canvas.Left="18" Canvas.Top="21" Width="4" Height="4" Fill="DarkGray" Stroke ="Black"/>
|
|
||||||
</Canvas.Children>
|
|
||||||
</Canvas>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -12,6 +12,5 @@
|
|||||||
<convertersUnits:Moment x:Key="MomentConverter"/>
|
<convertersUnits:Moment x:Key="MomentConverter"/>
|
||||||
<convertersUnits:Stress x:Key="StressConverter"/>
|
<convertersUnits:Stress x:Key="StressConverter"/>
|
||||||
<convertersUnits:Curvature x:Key="Curvature"/>
|
<convertersUnits:Curvature x:Key="Curvature"/>
|
||||||
<convertersUnits:CrackWidth x:Key="CrackWidth"/>
|
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<DataTemplate x:Key="CrackTextBox">
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding CrackWidth, Converter={StaticResource LengthConverter}}" HorizontalAlignment="Right">
|
|
||||||
<TextBlock.Style>
|
|
||||||
<Style TargetType="TextBlock">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsCrackLessThanUltimate}" Value="false">
|
|
||||||
<Setter Property="Background" Value="{StaticResource WarningColorBrush}" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</TextBlock.Style>
|
|
||||||
</TextBlock>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate x:Key="CrackGrid">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource CrackTextBox}" Content="{Binding LongTermResult}"/>
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource CrackTextBox}" Content="{Binding ShortTermResult}"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -23,8 +23,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ListBox Grid.Column="2" ItemsSource="{Binding TargetItems}"
|
<ListBox Grid.Column="2" ItemsSource="{Binding TargetItems}"
|
||||||
SelectedItem="{Binding SelectedTargetItem}"
|
SelectedItem="{Binding SelectedTargetItem}"
|
||||||
ItemTemplate="{Binding ItemDataDemplate}"
|
ItemTemplate="{Binding ItemDataDemplate}">
|
||||||
>
|
|
||||||
<!--<InputBindingCollection>
|
<!--<InputBindingCollection>
|
||||||
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding RemoveSelected}"/>
|
<MouseBinding Gesture="LeftDoubleClick" Command="{Binding RemoveSelected}"/>
|
||||||
</InputBindingCollection>-->
|
</InputBindingCollection>-->
|
||||||
@@ -34,23 +33,15 @@
|
|||||||
<DataTemplate x:Key="SelectItems">
|
<DataTemplate x:Key="SelectItems">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="auto"/>
|
<RowDefinition Height="25"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Height="25" Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding ShowButtons, Converter={StaticResource BooleanToVisibilityConverter}}">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding ShowButtons, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||||
<Button Content="Select All" Command="{Binding SelectAllCommand}"/>
|
<Button Content="Select All" Command="{Binding SelectAllCommand}"/>
|
||||||
<Button Content="Unselect All" Command="{Binding UnSelectAllCommand}"/>
|
<Button Content="Unselect All" Command="{Binding UnSelectAllCommand}"/>
|
||||||
<Button Content="Invert Selection" Command="{Binding InvertSelectionCommand}"/>
|
<Button Content="Invert Selection" Command="{Binding InvertSelectionCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible">
|
<ListBox Grid.Row="1" ItemsSource="{Binding CollectionItems}" SelectedItem="SelectedItem">
|
||||||
<ListBox ItemsSource="{Binding CollectionItems}" SelectedItem="SelectedItem" HorizontalAlignment="Stretch">
|
|
||||||
<ListBox.ContextMenu>
|
|
||||||
<ContextMenu>
|
|
||||||
<MenuItem Header="Select All" Command="{Binding SelectAllCommand}"/>
|
|
||||||
<MenuItem Header="UnSelect All" Command="{Binding UnSelectAllCommand}"/>
|
|
||||||
<MenuItem Header="Unvert Selection" Command="{Binding InvertSelectionCommand}"/>
|
|
||||||
</ContextMenu>
|
|
||||||
</ListBox.ContextMenu>
|
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -64,7 +55,6 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</ScrollViewer>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<Color x:Key="ErrorColor" R="255" G="192" B="203" A="100" />
|
|
||||||
<Color x:Key="WarningColor" R="255" G="255" B="0" A="100" />
|
|
||||||
<SolidColorBrush x:Key="ErrorColorBrush" Color="{DynamicResource ErrorColor}"/>
|
|
||||||
<SolidColorBrush x:Key="WarningColorBrush" Color="{DynamicResource WarningColor}"/>
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -9,11 +9,11 @@
|
|||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="180"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="Width"/>
|
<TextBlock Grid.Row="0" Text="{DynamicResource Width}"/>
|
||||||
<TextBlock Grid.Row="1" Text="Height"/>
|
<TextBlock Grid.Row="1" Text="{DynamicResource Height}"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding Width, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding Width, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Text="{Binding Height, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Text="{Binding Height, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -26,10 +26,10 @@
|
|||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="160"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="Diameter"/>
|
<TextBlock Grid.Row="0" Text="{DynamicResource Diameter}"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding Diameter, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding Diameter, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="Actions">Actions</system:String>
|
||||||
|
<system:String x:Key="Geometry">Geometry</system:String>
|
||||||
|
<system:String x:Key="Materials">Materials</system:String>
|
||||||
|
<system:String x:Key="Show Materials">Show Materials</system:String>
|
||||||
|
<system:String x:Key="Analisis">Analisis</system:String>
|
||||||
|
<system:String x:Key="Analises">Analises</system:String>
|
||||||
|
<system:String x:Key="Add Full Combination">Add Full Combination</system:String>
|
||||||
|
<system:String x:Key="Add Factored Combination">Add Factored Combination</system:String>
|
||||||
|
<system:String x:Key="Concrete">Concrete</system:String>
|
||||||
|
<system:String x:Key="Reinforcement">Reinforcement</system:String>
|
||||||
|
<system:String x:Key="Elastic">Elastic</system:String>
|
||||||
|
<system:String x:Key="CarbonFiber">CarbonFiber</system:String>
|
||||||
|
<system:String x:Key="GlassFiber">GlassFiber</system:String>
|
||||||
|
<system:String x:Key="Rectangle">Rectangle</system:String>
|
||||||
|
<system:String x:Key="Circle">Circle</system:String>
|
||||||
|
<system:String x:Key="Rebar">Rebar</system:String>
|
||||||
|
<system:String x:Key="Point">Point</system:String>
|
||||||
|
<system:String x:Key="Run">Run</system:String>
|
||||||
|
<system:String x:Key="Add">Add</system:String>
|
||||||
|
<system:String x:Key="Edit">Edit</system:String>
|
||||||
|
<system:String x:Key="Copy">Copy</system:String>
|
||||||
|
<system:String x:Key="Copy To">Copy To</system:String>
|
||||||
|
<system:String x:Key="Delete">Delete</system:String>
|
||||||
|
<system:String x:Key="To Foreground">To Foreground</system:String>
|
||||||
|
<system:String x:Key="To Background">To Background</system:String>
|
||||||
|
<system:String x:Key="Add Force Calculator">Add Force Calculator</system:String>
|
||||||
|
<system:String x:Key="Add Interaction Diagram Calculator">Add Interaction Diagram Calculator</system:String>
|
||||||
|
<system:String x:Key="Add Rectangle Primitive">Add Rectangle Primitive</system:String>
|
||||||
|
<system:String x:Key="Add Circle Primitive">Add Circle Primitive</system:String>
|
||||||
|
<system:String x:Key="Add Rebar Primitive">Add Rebar Primitive</system:String>
|
||||||
|
<system:String x:Key="Add Point Primitive">Add Point Primitive</system:String>
|
||||||
|
<system:String x:Key="Add Rectangle RC Column">Add Rectangle RC Column</system:String>
|
||||||
|
<system:String x:Key="Add Circle RC Column">Add Circle RC Column</system:String>
|
||||||
|
<system:String x:Key="Add RC Beam">Add RC Beam</system:String>
|
||||||
|
<system:String x:Key="Add RC Slab">Add RC Slab</system:String>
|
||||||
|
<system:String x:Key="Add Concrete">Add Concrete</system:String>
|
||||||
|
<system:String x:Key="Add Reinforcement Material">Add Reinforcement Material</system:String>
|
||||||
|
<system:String x:Key="Add Elastic Material">Add Elastic Material</system:String>
|
||||||
|
<system:String x:Key="Add Carbon Fiber Material">Add Carbon Fiber Material</system:String>
|
||||||
|
<system:String x:Key="Add Glass Fiber Material">Add Glass Fiber Material</system:String>
|
||||||
|
<system:String x:Key="Change Language">Change Language</system:String>
|
||||||
|
<system:String x:Key="Visual Settings">Visual Settings</system:String>
|
||||||
|
<system:String x:Key="RU_EN">EN</system:String>
|
||||||
|
<system:String x:Key="RC Templates">RC Templates</system:String>
|
||||||
|
<system:String x:Key="Base Primitives">Base Primitives</system:String>
|
||||||
|
<system:String x:Key="Tools">Tools</system:String>
|
||||||
|
<system:String x:Key="Grid size">Grid size: </system:String>
|
||||||
|
<system:String x:Key="Number of primitives">Number of primitives: </system:String>
|
||||||
|
<system:String x:Key="Full">Full</system:String>
|
||||||
|
<system:String x:Key="Fact">Fact</system:String>
|
||||||
|
<system:String x:Key="Run Calculations">Run Calculations</system:String>
|
||||||
|
<system:String x:Key="Move All Primitives to Gravity Center">Move All Primitives to Gravity Center</system:String>
|
||||||
|
<system:String x:Key="Combination By Factors">Combination By Factors</system:String>
|
||||||
|
<system:String x:Key="Combination">Combination</system:String>
|
||||||
|
<system:String x:Key="Templates">Templates</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Grid properies">Grid properies</system:String>
|
||||||
|
<system:String x:Key="Axis grid thickness">Axis grid thickness</system:String>
|
||||||
|
<system:String x:Key="Grid line thickness">Grid line thickness</system:String>
|
||||||
|
<system:String x:Key="Work plane width">Work plane width</system:String>
|
||||||
|
<system:String x:Key="Work plane height">Work plane height</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Reinforced rectangle template">Reinforced rectangle template</system:String>
|
||||||
|
<system:String x:Key="Width">Width</system:String>
|
||||||
|
<system:String x:Key="Height">Height</system:String>
|
||||||
|
<system:String x:Key="Cover gap">Cover gap</system:String>
|
||||||
|
<system:String x:Key="Top Diameter">Top Diameter</system:String>
|
||||||
|
<system:String x:Key="Bottom Diameter">Bottom Diameter</system:String>
|
||||||
|
<system:String x:Key="Width count">Width count</system:String>
|
||||||
|
<system:String x:Key="Height count">Height count</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Diameter">Diameter</system:String>
|
||||||
|
<system:String x:Key="Rebar Diameter">Rebar Diameter</system:String>
|
||||||
|
<system:String x:Key="Rebar Count">Rebar Count</system:String>
|
||||||
|
<system:String x:Key="Reinforced circle template">Reinforced circle template</system:String>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- All StringResources Goes Here -->
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<ResourceDictionary
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
|
<system:String x:Key="Actions">Усилия</system:String>
|
||||||
|
<system:String x:Key="Geometry">Геометрия</system:String>
|
||||||
|
<system:String x:Key="Materials">Материалы</system:String>
|
||||||
|
<system:String x:Key="Show Materials">Показать материалы</system:String>
|
||||||
|
<system:String x:Key="Analisis">Расчет</system:String>
|
||||||
|
<system:String x:Key="Analises">Расчеты</system:String>
|
||||||
|
<system:String x:Key="Add Full Combination">Создать комбинацию явно</system:String>
|
||||||
|
<system:String x:Key="Add Factored Combination">Создать комбинацию по коэффициентам</system:String>
|
||||||
|
<system:String x:Key="Concrete">Бетон</system:String>
|
||||||
|
<system:String x:Key="Reinforcement">Арматура</system:String>
|
||||||
|
<system:String x:Key="Elastic">Упругий</system:String>
|
||||||
|
<system:String x:Key="CarbonFiber">Углеволокно</system:String>
|
||||||
|
<system:String x:Key="GlassFiber">Стекловолокно</system:String>
|
||||||
|
<system:String x:Key="Rectangle">Прямоугольник</system:String>
|
||||||
|
<system:String x:Key="Circle">Окружность</system:String>
|
||||||
|
<system:String x:Key="Rebar">Стержень</system:String>
|
||||||
|
<system:String x:Key="Point">Точка</system:String>
|
||||||
|
<system:String x:Key="Run">Выполнить</system:String>
|
||||||
|
<system:String x:Key="Add">Создать</system:String>
|
||||||
|
<system:String x:Key="Edit">Изменить</system:String>
|
||||||
|
<system:String x:Key="Copy">Копировать</system:String>
|
||||||
|
<system:String x:Key="Copy To">Копировать в</system:String>
|
||||||
|
<system:String x:Key="Delete">Удалить</system:String>
|
||||||
|
<system:String x:Key="To Foreground">На передний план</system:String>
|
||||||
|
<system:String x:Key="To Background">На задний план</system:String>
|
||||||
|
<system:String x:Key="Add Force Calculator">Создать расчет по усилиям</system:String>
|
||||||
|
<system:String x:Key="Add Interaction Diagram Calculator">Создать расчет области прочности</system:String>
|
||||||
|
<system:String x:Key="Add Rectangle Primitive">Создать прямоугольник</system:String>
|
||||||
|
<system:String x:Key="Add Circle Primitive">Создать окружность</system:String>
|
||||||
|
<system:String x:Key="Add Rebar Primitive">Создать арматурный стержень</system:String>
|
||||||
|
<system:String x:Key="Add Point Primitive">Создать точку</system:String>
|
||||||
|
<system:String x:Key="Add Rectangle RC Column">Создать прямоугольную ЖБ колонну</system:String>
|
||||||
|
<system:String x:Key="Add Circle RC Column">Создать круглую ЖБ колонну</system:String>
|
||||||
|
<system:String x:Key="Add RC Beam">Создать ЖБ балку</system:String>
|
||||||
|
<system:String x:Key="Add RC Slab">Создать ЖБ плиту</system:String>
|
||||||
|
<system:String x:Key="Add Concrete">Создать бетон</system:String>
|
||||||
|
<system:String x:Key="Add Reinforcement Material">Создать материал армирования</system:String>
|
||||||
|
<system:String x:Key="Add Elastic Material">Создать упругий материал</system:String>
|
||||||
|
<system:String x:Key="Add Carbon Fiber Material">Создать углеволокно</system:String>
|
||||||
|
<system:String x:Key="Add Glass Fiber Material">Создать стекловолокно</system:String>
|
||||||
|
<system:String x:Key="Change Language">Смена языка</system:String>
|
||||||
|
<system:String x:Key="Visual Settings">Настройки изображения</system:String>
|
||||||
|
<system:String x:Key="RU_EN">RU</system:String>
|
||||||
|
<system:String x:Key="RC Templates">ЖБ шаблоны</system:String>
|
||||||
|
<system:String x:Key="Base Primitives">Базовые примитивы</system:String>
|
||||||
|
<system:String x:Key="Tools">Инструменты</system:String>
|
||||||
|
<system:String x:Key="Grid size">Шаг сетки: </system:String>
|
||||||
|
<system:String x:Key="Number of primitives">Кол-во примитивов: </system:String>
|
||||||
|
<system:String x:Key="Full">Явно</system:String>
|
||||||
|
<system:String x:Key="Fact">Коэффициент</system:String>
|
||||||
|
<system:String x:Key="Run Calculations">Выполнить расчеты</system:String>
|
||||||
|
<system:String x:Key="Move All Primitives to Gravity Center">Переместить все примитивы в центр тяжести</system:String>
|
||||||
|
<system:String x:Key="Combination By Factors">Комбинация по коэффициентам</system:String>
|
||||||
|
<system:String x:Key="Combination">Комбинация</system:String>
|
||||||
|
<system:String x:Key="Templates">Шаблоны</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Grid properies">Свойства сетки</system:String>
|
||||||
|
<system:String x:Key="Axis grid thickness">Толщина координатных осей</system:String>
|
||||||
|
<system:String x:Key="Grid line thickness">Толщина линий сетки</system:String>
|
||||||
|
<system:String x:Key="Work plane width">Ширина рабочей плоскости</system:String>
|
||||||
|
<system:String x:Key="Work plane height">Высота рабочей плоскости</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Reinforced rectangle template">Шаблон армирования прямоугольника</system:String>
|
||||||
|
<system:String x:Key="Width">Ширина</system:String>
|
||||||
|
<system:String x:Key="Height">Высота</system:String>
|
||||||
|
<system:String x:Key="Cover gap">Защитный слой</system:String>
|
||||||
|
<system:String x:Key="Top Diameter">Диаметр верхней арматуры</system:String>
|
||||||
|
<system:String x:Key="Bottom Diameter">Диаметр нижней арматуры</system:String>
|
||||||
|
<system:String x:Key="Width count">Число стержней по ширине</system:String>
|
||||||
|
<system:String x:Key="Height count">Число стержней по высоте</system:String>
|
||||||
|
|
||||||
|
<system:String x:Key="Diameter">Диаметр окужности</system:String>
|
||||||
|
<system:String x:Key="Rebar Diameter">Диаметр арматуры</system:String>
|
||||||
|
<system:String x:Key="Rebar Count">Число стержней арматуры</system:String>
|
||||||
|
<system:String x:Key="Reinforced circle template">Шаблон армирования окружности</system:String>
|
||||||
|
|
||||||
|
<!-- All StringResources Goes Here -->
|
||||||
|
</ResourceDictionary>
|
||||||
Binary file not shown.
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
-->
|
-->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<History>True|2024-03-11T15:33:14.1457807Z;True|2024-03-10T19:11:27.6834663+05:00;True|2024-02-02T12:22:50.1454015+05:00;True|2023-02-25T13:37:39.2738786+05:00;False|2023-02-25T13:37:24.0284261+05:00;True|2023-02-25T13:34:01.6858860+05:00;True|2023-02-25T13:31:18.8295711+05:00;False|2023-02-25T13:25:21.5807199+05:00;False|2023-02-25T13:24:41.7164398+05:00;</History>
|
<History>True|2024-02-02T07:22:50.1454015Z;True|2023-02-25T13:37:39.2738786+05:00;False|2023-02-25T13:37:24.0284261+05:00;True|2023-02-25T13:34:01.6858860+05:00;True|2023-02-25T13:31:18.8295711+05:00;False|2023-02-25T13:25:21.5807199+05:00;False|2023-02-25T13:24:41.7164398+05:00;</History>
|
||||||
<LastFailureDetails />
|
<LastFailureDetails />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Services.ResultViewers
|
|
||||||
{
|
|
||||||
public class CrackResultFunc : IResultFunc<Func<RebarCrackResult, double>>
|
|
||||||
{
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
public Func<RebarCrackResult, double> ResultFunction { get; set; }
|
|
||||||
|
|
||||||
public string UnitName { get; set; }
|
|
||||||
|
|
||||||
public double UnitFactor { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Services.ResultViewers
|
|
||||||
{
|
|
||||||
|
|
||||||
public static class CrackResultFuncFactory
|
|
||||||
{
|
|
||||||
private static readonly IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
private static readonly IGetUnitLogic UnitLogic = new GetUnitLogic();
|
|
||||||
|
|
||||||
static IUnit unitStress = UnitLogic.GetUnit(UnitTypes.Stress);
|
|
||||||
static IUnit unitLength = UnitLogic.GetUnit(UnitTypes.Length, "mm");
|
|
||||||
|
|
||||||
public static List<CrackResultFunc> GetResultFuncs()
|
|
||||||
{
|
|
||||||
List<CrackResultFunc> results = new()
|
|
||||||
{
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Long crack width",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.CrackWidth,
|
|
||||||
UnitFactor = unitLength.Multiplyer,
|
|
||||||
UnitName = unitLength.Name
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Short crack width",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.CrackWidth,
|
|
||||||
UnitFactor = unitLength.Multiplyer,
|
|
||||||
UnitName = unitLength.Name
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Long softening factor",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.SofteningFactor,
|
|
||||||
UnitFactor = 1,
|
|
||||||
UnitName = "Dimensionless"
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Short softening factor",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.SofteningFactor,
|
|
||||||
UnitFactor = 1,
|
|
||||||
UnitName = "Dimensionless"
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Long rebar stress",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.RebarStressResult.RebarStress,
|
|
||||||
UnitFactor = unitStress.Multiplyer,
|
|
||||||
UnitName = unitStress.Name
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Short rebar stress",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.RebarStressResult.RebarStress,
|
|
||||||
UnitFactor = unitStress.Multiplyer,
|
|
||||||
UnitName = unitStress.Name
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Long rebar strain",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.RebarStressResult.RebarStrain,
|
|
||||||
UnitFactor = 1d,
|
|
||||||
UnitName = string.Empty
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Short rebar strain",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.RebarStressResult.RebarStrain,
|
|
||||||
UnitFactor = 1d,
|
|
||||||
UnitName = string.Empty
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Long concrete strain",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.LongTermResult.RebarStressResult.ConcreteStrain,
|
|
||||||
UnitFactor = 1d,
|
|
||||||
UnitName = string.Empty
|
|
||||||
},
|
|
||||||
new()
|
|
||||||
{
|
|
||||||
Name = "Short concrete strain",
|
|
||||||
ResultFunction = (RebarCrackResult rebar) => rebar.ShortTermResult.RebarStressResult.ConcreteStrain,
|
|
||||||
UnitFactor = 1d,
|
|
||||||
UnitName = string.Empty
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
using LoaderCalculator.Logics;
|
|
||||||
using StructureHelper.Infrastructure.UI.Converters.Units;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Services.ResultViewers
|
|
||||||
{
|
|
||||||
public enum FuncsTypes
|
|
||||||
{
|
|
||||||
Strain,
|
|
||||||
Stress,
|
|
||||||
Forces,
|
|
||||||
Full,
|
|
||||||
}
|
|
||||||
public static class ForceResultFuncFactory
|
|
||||||
{
|
|
||||||
static IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
static IUnit unitForce = unitLogic.GetUnit(UnitTypes.Force);
|
|
||||||
static IUnit unitStress = unitLogic.GetUnit(UnitTypes.Stress);
|
|
||||||
static IUnit unitMoment = unitLogic.GetUnit(UnitTypes.Moment);
|
|
||||||
static IUnit unitCurvature = unitLogic.GetUnit(UnitTypes.Curvature);
|
|
||||||
|
|
||||||
static readonly IStressLogic stressLogic = new StressLogic();
|
|
||||||
public static List<ForceResultFunc> GetResultFuncs(FuncsTypes funcsType = FuncsTypes.Full)
|
|
||||||
{
|
|
||||||
List<ForceResultFunc> results = new();
|
|
||||||
if (funcsType == FuncsTypes.Strain)
|
|
||||||
{
|
|
||||||
results.AddRange(GetStrainResultFuncs());
|
|
||||||
}
|
|
||||||
else if (funcsType == FuncsTypes.Stress)
|
|
||||||
{
|
|
||||||
results.AddRange(GetStressResultFuncs());
|
|
||||||
}
|
|
||||||
else if (funcsType == FuncsTypes.Forces)
|
|
||||||
{
|
|
||||||
results.AddRange(GetForcesResultFuncs());
|
|
||||||
}
|
|
||||||
else if (funcsType == FuncsTypes.Full)
|
|
||||||
{
|
|
||||||
results.AddRange(GetStrainResultFuncs());
|
|
||||||
results.AddRange(GetStressResultFuncs());
|
|
||||||
results.AddRange(GetForcesResultFuncs());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(funcsType));
|
|
||||||
}
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
private static List<ForceResultFunc> GetStrainResultFuncs()
|
|
||||||
{
|
|
||||||
List<ForceResultFunc> resultFuncs = new ();
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Section Strain", ResultFunction = stressLogic.GetSectionStrain });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrain });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Prestrain", ResultFunction = stressLogic.GetPrestrain });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Elastic Strain", ResultFunction = stressLogic.GetElasticStrain });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Plastic Strain", ResultFunction = stressLogic.GetPlasticStrain });
|
|
||||||
return resultFuncs;
|
|
||||||
}
|
|
||||||
private static List<ForceResultFunc> GetStressResultFuncs()
|
|
||||||
{
|
|
||||||
List<ForceResultFunc> resultFuncs = new ();
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Stress", ResultFunction = stressLogic.GetStress, UnitFactor = unitStress.Multiplyer, UnitName = unitStress.Name });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Secant modulus", ResultFunction = stressLogic.GetSecantModulus, UnitFactor = unitStress.Multiplyer, UnitName = unitStress.Name });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Modulus degradation", ResultFunction = stressLogic.GetModulusDegradation });
|
|
||||||
return resultFuncs;
|
|
||||||
}
|
|
||||||
private static List<ForceResultFunc> GetForcesResultFuncs()
|
|
||||||
{
|
|
||||||
List<ForceResultFunc> resultFuncs = new ();
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Force", ResultFunction = stressLogic.GetForce, UnitFactor = unitForce.Multiplyer, UnitName = unitForce.Name });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Moment X", ResultFunction = stressLogic.GetMomentX, UnitFactor = unitMoment.Multiplyer, UnitName = unitMoment.Name });
|
|
||||||
resultFuncs.Add(new ForceResultFunc() { Name = "Moment Y", ResultFunction = stressLogic.GetMomentY, UnitFactor = unitMoment.Multiplyer, UnitName = unitMoment.Name });
|
|
||||||
return resultFuncs;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,11 +8,10 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelper.Services.ResultViewers
|
namespace StructureHelper.Services.ResultViewers
|
||||||
{
|
{
|
||||||
public interface IResultFunc <T>
|
public interface IResultFunc
|
||||||
{
|
{
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
T ResultFunction { get; }
|
Func<IStrainMatrix, INdm, double> ResultFunction { get; }
|
||||||
string UnitName { get; set; }
|
|
||||||
double UnitFactor { get; }
|
double UnitFactor { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,13 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace StructureHelper.Services.ResultViewers
|
namespace StructureHelper.Services.ResultViewers
|
||||||
{
|
{
|
||||||
public class ForceResultFunc : IResultFunc<Func<IStrainMatrix, INdm, double>>
|
public class ResultFunc : IResultFunc
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public Func<IStrainMatrix, INdm, double> ResultFunction { get; set; }
|
public Func<IStrainMatrix, INdm, double> ResultFunction { get; set; }
|
||||||
public string UnitName { get; set; }
|
|
||||||
public double UnitFactor { get; set; }
|
public double UnitFactor { get; set; }
|
||||||
|
|
||||||
public ForceResultFunc()
|
public ResultFunc()
|
||||||
{
|
{
|
||||||
UnitFactor = 1d;
|
UnitFactor = 1d;
|
||||||
}
|
}
|
||||||
30
StructureHelper/Services/ResultViewers/ResultFuncFactory.cs
Normal file
30
StructureHelper/Services/ResultViewers/ResultFuncFactory.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using LoaderCalculator.Logics;
|
||||||
|
using StructureHelper.Infrastructure.UI.Converters.Units;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Services.ResultViewers
|
||||||
|
{
|
||||||
|
public static class ResultFuncFactory
|
||||||
|
{
|
||||||
|
public static IEnumerable<IResultFunc> GetResultFuncs()
|
||||||
|
{
|
||||||
|
List<IResultFunc> resultFuncs = new List<IResultFunc>();
|
||||||
|
IStressLogic stressLogic = new StressLogic();
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Total Strain", ResultFunction = stressLogic.GetTotalStrain });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Total Strain with prestrain", ResultFunction = stressLogic.GetTotalStrainWithPresrain });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Elastic Strain", ResultFunction = stressLogic.GetElasticStrain });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Plastic Strain", ResultFunction = stressLogic.GetPlasticStrain });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Stress", ResultFunction = stressLogic.GetStress, UnitFactor = UnitConstants.Stress });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Secant modulus", ResultFunction = stressLogic.GetSecantModulus, UnitFactor = UnitConstants.Stress });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Modulus degradation", ResultFunction = stressLogic.GetModulusDegradation });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Force", ResultFunction = stressLogic.GetForce, UnitFactor = UnitConstants.Force });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Moment X", ResultFunction = stressLogic.GetMomentX, UnitFactor = UnitConstants.Force });
|
||||||
|
resultFuncs.Add(new ResultFunc() { Name = "Moment Y", ResultFunction = stressLogic.GetMomentY, UnitFactor = UnitConstants.Force });
|
||||||
|
return resultFuncs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,10 +4,6 @@ using LoaderCalculator.Data.Matrix;
|
|||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using LoaderCalculator.Data.ResultData;
|
using LoaderCalculator.Data.ResultData;
|
||||||
using LoaderCalculator.Logics;
|
using LoaderCalculator.Logics;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Services;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -18,14 +14,13 @@ namespace StructureHelper.Services.ResultViewers
|
|||||||
{
|
{
|
||||||
public static class ShowIsoFieldResult
|
public static class ShowIsoFieldResult
|
||||||
{
|
{
|
||||||
static IMathRoundLogic roundLogic = new SmartRoundLogic() { DigitQuant = 3 };
|
public static void ShowResult(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<IResultFunc> resultFuncs)
|
||||||
public static void ShowResult(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<ForceResultFunc> resultFuncs)
|
|
||||||
{
|
{
|
||||||
var primitiveSets = GetPrimitiveSets(strainMatrix, ndms, resultFuncs);
|
var primitiveSets = GetPrimitiveSets(strainMatrix, ndms, resultFuncs);
|
||||||
FieldViewerOperation.ShowViewer(primitiveSets);
|
FieldViewerOperation.ShowViewer(primitiveSets);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<IPrimitiveSet> GetPrimitiveSets(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<ForceResultFunc> resultFuncs)
|
public static List<IPrimitiveSet> GetPrimitiveSets(IStrainMatrix strainMatrix, IEnumerable<INdm> ndms, IEnumerable<IResultFunc> resultFuncs)
|
||||||
{
|
{
|
||||||
List<IPrimitiveSet> primitiveSets = new List<IPrimitiveSet>();
|
List<IPrimitiveSet> primitiveSets = new List<IPrimitiveSet>();
|
||||||
foreach (var valDelegate in resultFuncs)
|
foreach (var valDelegate in resultFuncs)
|
||||||
@@ -34,85 +29,23 @@ namespace StructureHelper.Services.ResultViewers
|
|||||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
||||||
foreach (INdm ndm in ndms)
|
foreach (INdm ndm in ndms)
|
||||||
{
|
{
|
||||||
primitives.Add(ProcessNdm(strainMatrix, valDelegate, ndm));
|
double val = valDelegate.ResultFunction.Invoke(strainMatrix, ndm) * valDelegate.UnitFactor;
|
||||||
}
|
|
||||||
primitiveSet.ValuePrimitives = primitives;
|
|
||||||
primitiveSets.Add(primitiveSet);
|
|
||||||
}
|
|
||||||
return primitiveSets;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<IPrimitiveSet> GetPrimitiveSets(IEnumerable<RebarCrackResult> rebarResults, IEnumerable<CrackResultFunc> resultFuncs)
|
|
||||||
{
|
|
||||||
List<IPrimitiveSet> primitiveSets = new List<IPrimitiveSet>();
|
|
||||||
foreach (var valDelegate in resultFuncs)
|
|
||||||
{
|
|
||||||
PrimitiveSet primitiveSet = new PrimitiveSet() { Name = valDelegate.Name };
|
|
||||||
List<IValuePrimitive> primitives = new List<IValuePrimitive>();
|
|
||||||
foreach (var rebarResult in rebarResults)
|
|
||||||
{
|
|
||||||
primitives.Add(ProcessNdm(valDelegate, rebarResult));
|
|
||||||
}
|
|
||||||
primitiveSet.ValuePrimitives = primitives;
|
|
||||||
primitiveSets.Add(primitiveSet);
|
|
||||||
}
|
|
||||||
return primitiveSets;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IValuePrimitive ProcessNdm(CrackResultFunc valDelegate, RebarCrackResult rebarResult)
|
|
||||||
{
|
|
||||||
double delegateResult = valDelegate.ResultFunction.Invoke(rebarResult);
|
|
||||||
var val = delegateResult * valDelegate.UnitFactor;
|
|
||||||
//val = roundLogic.RoundValue(val);
|
|
||||||
IValuePrimitive valuePrimitive;
|
IValuePrimitive valuePrimitive;
|
||||||
var rebarNdm = rebarResult.RebarPrimitive.GetRebarNdm(new TriangulationOptions()
|
if (ndm is IRectangleNdm)
|
||||||
{
|
{
|
||||||
LimiteState = LimitStates.SLS,
|
var shapeNdm = ndm as IRectangleNdm;
|
||||||
CalcTerm = CalcTerms.ShortTerm
|
valuePrimitive = new RectanglePrimitive() { CenterX = ndm.CenterX, CenterY = ndm.CenterY, Height = shapeNdm.Height, Width = shapeNdm.Width, Value = val };
|
||||||
}
|
|
||||||
);
|
|
||||||
valuePrimitive = ProcessCircle(rebarNdm, val);
|
|
||||||
return valuePrimitive;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IValuePrimitive ProcessNdm(IStrainMatrix strainMatrix, ForceResultFunc valDelegate, INdm ndm)
|
|
||||||
{
|
|
||||||
double delegateResult = valDelegate.ResultFunction.Invoke(strainMatrix, ndm);
|
|
||||||
double val = delegateResult * valDelegate.UnitFactor;
|
|
||||||
//val = roundLogic.RoundValue(val);
|
|
||||||
IValuePrimitive valuePrimitive;
|
|
||||||
if (ndm is IRectangleNdm shapeNdm)
|
|
||||||
{
|
|
||||||
valuePrimitive = ProcessRectangle(shapeNdm, val);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
valuePrimitive = ProcessCircle(ndm, val);
|
valuePrimitive = new CirclePrimitive() { CenterX = ndm.CenterX, CenterY = ndm.CenterY, Diameter = Math.Sqrt(ndm.Area / Math.PI) * 2, Value = val };
|
||||||
}
|
}
|
||||||
return valuePrimitive;
|
primitives.Add(valuePrimitive);
|
||||||
}
|
}
|
||||||
|
primitiveSet.ValuePrimitives = primitives;
|
||||||
private static IValuePrimitive ProcessRectangle(IRectangleNdm shapeNdm, double val)
|
primitiveSets.Add(primitiveSet);
|
||||||
{
|
|
||||||
return new RectanglePrimitive()
|
|
||||||
{
|
|
||||||
CenterX = shapeNdm.CenterX,
|
|
||||||
CenterY = shapeNdm.CenterY,
|
|
||||||
Height = shapeNdm.Height,
|
|
||||||
Width = shapeNdm.Width,
|
|
||||||
Value = val
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
return primitiveSets;
|
||||||
private static IValuePrimitive ProcessCircle(INdm ndm, double val)
|
|
||||||
{
|
|
||||||
return new CirclePrimitive()
|
|
||||||
{
|
|
||||||
CenterX = ndm.CenterX,
|
|
||||||
CenterY = ndm.CenterY,
|
|
||||||
Diameter = Math.Sqrt(ndm.Area / Math.PI) * 2,
|
|
||||||
Value = val
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,15 +12,6 @@
|
|||||||
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
|
<Compile Update="Windows\Arrays\ArrayView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackResultView.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\Cracks\TupleCrackResultView.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml.cs">
|
<Compile Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -45,15 +36,6 @@
|
|||||||
<Compile Update="Windows\Forces\ForceCombinationByFactorView.xaml.cs">
|
<Compile Update="Windows\Forces\ForceCombinationByFactorView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="Windows\Forces\ForceInterpolationControl.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\Forces\ForceTupleInterpolationControl.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\Forces\ValuePointsInterpolateView.xaml.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Update="Windows\Graphs\GraphView.xaml.cs">
|
<Compile Update="Windows\Graphs\GraphView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -77,9 +59,6 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="Infrastructure\UI\Resources\Cracks.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Infrastructure\UI\Resources\ForceTemplates.xaml">
|
<Page Update="Infrastructure\UI\Resources\ForceTemplates.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -95,24 +74,15 @@
|
|||||||
<Page Update="Infrastructure\UI\Resources\Materials.xaml">
|
<Page Update="Infrastructure\UI\Resources\Materials.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Infrastructure\UI\Resources\ServiceColors.xaml">
|
<Page Update="Infrastructure\UI\Resources\Strings.en-US.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Update="Infrastructure\UI\Resources\Strings.ru-RU.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Windows\Arrays\ArrayView.xaml">
|
<Page Update="Windows\Arrays\ArrayView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackCalculatorInputDataView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\CrackResultView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\Cracks.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\Cracks\TupleCrackResultView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml">
|
<Page Update="Windows\CalculationWindows\CalculatorsViews\ForceCalculatorViews\ForceResultLogic\LimitCurveDataView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -137,15 +107,6 @@
|
|||||||
<Page Update="Windows\Forces\ForceCombinationByFactorView.xaml">
|
<Page Update="Windows\Forces\ForceCombinationByFactorView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Update="Windows\Forces\ForceInterpolationControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\Forces\ForceTupleInterpolationControl.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\Forces\ValuePointsInterpolateView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Update="Windows\Graphs\GraphView.xaml">
|
<Page Update="Windows\Graphs\GraphView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
using StructureHelper.Windows.Graphs;
|
||||||
using StructureHelper.Windows.Graphs;
|
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
using StructureHelper.Windows.ViewModels.Errors;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
@@ -21,11 +20,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|||||||
{
|
{
|
||||||
internal class CrackDiagramLogic : ILongProcessLogic
|
internal class CrackDiagramLogic : ILongProcessLogic
|
||||||
{
|
{
|
||||||
static IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
static IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
static readonly CrackForceCalculator calculator = new();
|
static readonly CrackForceCalculator calculator = new();
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
|
||||||
|
|
||||||
private List<IForcesTupleResult> ValidTupleList { get; set; }
|
private List<IForcesTupleResult> ValidTupleList { get; set; }
|
||||||
ArrayParameter<double> arrayParameter;
|
ArrayParameter<double> arrayParameter;
|
||||||
private IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
private IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
||||||
@@ -65,27 +60,21 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|||||||
|
|
||||||
public void ShowCracks()
|
public void ShowCracks()
|
||||||
{
|
{
|
||||||
List<string> labels = GetCrackLabels();
|
var unitForce = CommonOperation.GetUnit(UnitTypes.Force, "kN");
|
||||||
arrayParameter = new ArrayParameter<double>(ValidTupleList.Count(), labels);
|
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
|
||||||
CalculateWithCrack(ValidTupleList,
|
var unitCurvature = CommonOperation.GetUnit(UnitTypes.Curvature, "1/m");
|
||||||
NdmPrimitives,
|
|
||||||
unitLogic.GetUnit(UnitTypes.Force),
|
string[] labels = GetCrackLabels(unitForce, unitMoment, unitCurvature);
|
||||||
unitLogic.GetUnit(UnitTypes.Moment),
|
arrayParameter = new ArrayParameter<double>(ValidTupleList.Count(), labels.Count(), labels);
|
||||||
unitLogic.GetUnit(UnitTypes.Curvature));
|
CalculateWithCrack(ValidTupleList, NdmPrimitives, unitForce, unitMoment, unitCurvature);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowWindow()
|
public void ShowWindow()
|
||||||
{
|
{
|
||||||
SafetyProcessor.RunSafeProcess(() =>
|
SafetyProcessor.RunSafeProcess(() =>
|
||||||
{
|
{
|
||||||
var series = new Series(arrayParameter)
|
var series = new Series(arrayParameter) { Name = "Forces and curvatures" };
|
||||||
{
|
var vm = new GraphViewModel(new List<Series>() { series });
|
||||||
Name = "Forces and curvatures"
|
|
||||||
};
|
|
||||||
var vm = new GraphViewModel(new List<Series>()
|
|
||||||
{
|
|
||||||
series
|
|
||||||
});
|
|
||||||
var wnd = new GraphView(vm);
|
var wnd = new GraphView(vm);
|
||||||
wnd.ShowDialog();
|
wnd.ShowDialog();
|
||||||
},
|
},
|
||||||
@@ -106,14 +95,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|||||||
calculator.EndTuple = validTupleList[i].DesignForceTuple.ForceTuple;
|
calculator.EndTuple = validTupleList[i].DesignForceTuple.ForceTuple;
|
||||||
var limitState = validTupleList[i].DesignForceTuple.LimitState;
|
var limitState = validTupleList[i].DesignForceTuple.LimitState;
|
||||||
var calcTerm = validTupleList[i].DesignForceTuple.CalcTerm;
|
var calcTerm = validTupleList[i].DesignForceTuple.CalcTerm;
|
||||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
var ndms = NdmPrimitivesService.GetNdms(ndmPrimitives, limitState, calcTerm);
|
||||||
{
|
|
||||||
Primitives = ndmPrimitives,
|
|
||||||
LimitState = limitState,
|
|
||||||
CalcTerm = calcTerm,
|
|
||||||
TraceLogger = TraceLogger
|
|
||||||
};
|
|
||||||
var ndms = triangulateLogic.GetNdms();
|
|
||||||
calculator.NdmCollection = ndms;
|
calculator.NdmCollection = ndms;
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
var result = (CrackForceResult)calculator.Result;
|
var result = (CrackForceResult)calculator.Result;
|
||||||
@@ -149,14 +131,18 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<string> GetCrackLabels()
|
private static string[] GetCrackLabels(IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||||
{
|
{
|
||||||
const string crc = "Crc";
|
const string crc = "Crc";
|
||||||
const string crcFactor = "CrcSofteningFactor";
|
const string crcFactor = "CrcSofteningFactor";
|
||||||
var labels = LabelsFactory.GetCommonLabels();
|
return new string[]
|
||||||
IUnit unitCurvature = unitLogic.GetUnit(UnitTypes.Curvature);
|
|
||||||
var crclabels = new List<string>
|
|
||||||
{
|
{
|
||||||
|
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
|
||||||
|
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
|
||||||
|
$"{GeometryNames.LongForceName}, {unitForce.Name}",
|
||||||
|
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
|
||||||
|
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
|
||||||
|
$"{GeometryNames.StrainTrdName}",
|
||||||
$"{crc}{GeometryNames.CurvFstName}, {unitCurvature.Name}",
|
$"{crc}{GeometryNames.CurvFstName}, {unitCurvature.Name}",
|
||||||
$"{crc}{GeometryNames.CurvSndName}, {unitCurvature.Name}",
|
$"{crc}{GeometryNames.CurvSndName}, {unitCurvature.Name}",
|
||||||
$"{crc}{GeometryNames.StrainTrdName}",
|
$"{crc}{GeometryNames.StrainTrdName}",
|
||||||
@@ -165,8 +151,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|||||||
$"{crcFactor}Az",
|
$"{crcFactor}Az",
|
||||||
$"PsiFactor"
|
$"PsiFactor"
|
||||||
};
|
};
|
||||||
labels.AddRange(crclabels);
|
|
||||||
return labels;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.CrackCalculatorInputDataView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
|
||||||
d:DataContext="{d:DesignInstance local:CrackCalculatorInputDataViewModel}"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="{Binding WindowTitle}" Height="390" Width="400" MinHeight="300" MinWidth="400"
|
|
||||||
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
|
|
||||||
Closing="Window_Closing" ShowInTaskbar="False" Icon="{Binding Mode=OneWay, Source={StaticResource CrackCalculator}}"
|
|
||||||
>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition Height="35"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TabControl>
|
|
||||||
<TabItem Header="General">
|
|
||||||
<StackPanel>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="100"/>
|
|
||||||
<ColumnDefinition Width="300"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Text="Name"/>
|
|
||||||
<TextBox Grid.Column="1" Text="{Binding Name}"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Forces">
|
|
||||||
<ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding CombinationViewModel}"/>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Primitives">
|
|
||||||
<ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding PrimitivesViewModel}"/>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Settings">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<CheckBox x:Name="SetSoftFactorFlag" Grid.ColumnSpan="2" Content="Set user value of softening factor (PsiS)" IsChecked="{Binding SetSofteningFactor}"/>
|
|
||||||
<TextBox Grid.Row="1" Text="{Binding SofteningFactor, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"
|
|
||||||
IsEnabled="{Binding IsChecked, ElementName=SetSoftFactorFlag}" Margin="0,0,0,3"/>
|
|
||||||
<CheckBox x:Name="SetLengthFlag" Grid.ColumnSpan="2" Grid.Row="2" Content="Set user value of length between cracks (Lcrc)" IsChecked="{Binding SetLengthBetweenCracks}"/>
|
|
||||||
<TextBox Grid.Row="3" Text="{Binding LengthBetweenCracks, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
|
||||||
IsEnabled="{Binding IsChecked, ElementName=SetLengthFlag}" Margin="0,0,0,3"/>
|
|
||||||
<TextBlock Grid.Row="4" Text="Ultimate limit crack width"/>
|
|
||||||
<TextBlock Grid.Row="5" Text="Long-term"/>
|
|
||||||
<TextBox Grid.Row="5" Grid.Column="1" Text="{Binding UltLongTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
|
||||||
Margin="3"/>
|
|
||||||
<TextBlock Grid.Row="6" Text="Short-term"/>
|
|
||||||
<TextBox Grid.Row="6" Grid.Column="1" Text="{Binding UltShortTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
|
|
||||||
Margin="3"/>
|
|
||||||
</Grid>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using StructureHelper.Windows.ViewModels.Calculations.Calculators;
|
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
|
||||||
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.CalculatorsViews
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Логика взаимодействия для CrackCalculatorInputDataView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class CrackCalculatorInputDataView : Window
|
|
||||||
{
|
|
||||||
private CrackCalculatorInputDataViewModel viewModel;
|
|
||||||
|
|
||||||
public CrackCalculatorInputDataView(CrackCalculatorInputDataViewModel viewModel)
|
|
||||||
{
|
|
||||||
this.viewModel = viewModel;
|
|
||||||
viewModel.ParentWindow = this;
|
|
||||||
DataContext = viewModel;
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
||||||
{
|
|
||||||
viewModel.Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public class CrackCalculatorInputDataViewModel : OkCancelViewModelBase
|
|
||||||
{
|
|
||||||
private CrackCalculator calculator;
|
|
||||||
CrackInputData crackInputData;
|
|
||||||
private bool setUserValueSofteningFactor;
|
|
||||||
private double softeningFactor;
|
|
||||||
private string name;
|
|
||||||
|
|
||||||
public SourceTargetVM<IForceAction> CombinationViewModel { get; }
|
|
||||||
public SourceTargetVM<PrimitiveBase> PrimitivesViewModel { get; private set; }
|
|
||||||
public string WindowTitle => "Crack calculator: " + Name;
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get => calculator.Name;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
calculator.Name = value;
|
|
||||||
OnPropertyChanged(nameof(Name));
|
|
||||||
OnPropertyChanged(nameof(WindowTitle));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool SetSofteningFactor
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.SetSofteningFactor;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
crackInputData.UserCrackInputData.SetSofteningFactor = value;
|
|
||||||
OnPropertyChanged(nameof(SetSofteningFactor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double SofteningFactor
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.SofteningFactor; set
|
|
||||||
{
|
|
||||||
if (value > 1d || value < 0d) { return; }
|
|
||||||
crackInputData.UserCrackInputData.SofteningFactor = value;
|
|
||||||
OnPropertyChanged(nameof(SetSofteningFactor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool SetLengthBetweenCracks
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.SetLengthBetweenCracks;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
crackInputData.UserCrackInputData.SetLengthBetweenCracks = value;
|
|
||||||
OnPropertyChanged(nameof(SetLengthBetweenCracks));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double LengthBetweenCracks
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.LengthBetweenCracks; set
|
|
||||||
{
|
|
||||||
if (value <= 0d) { return; }
|
|
||||||
crackInputData.UserCrackInputData.LengthBetweenCracks = value;
|
|
||||||
OnPropertyChanged(nameof(SetLengthBetweenCracks));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double UltLongTermCrackWidth
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.UltimateLongCrackWidth; set
|
|
||||||
{
|
|
||||||
if (value <= 0d) { return; }
|
|
||||||
crackInputData.UserCrackInputData.UltimateLongCrackWidth = value;
|
|
||||||
OnPropertyChanged(nameof(UltLongTermCrackWidth));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double UltShortTermCrackWidth
|
|
||||||
{
|
|
||||||
get => crackInputData.UserCrackInputData.UltimateShortCrackWidth; set
|
|
||||||
{
|
|
||||||
if (value <= 0d) { return; }
|
|
||||||
crackInputData.UserCrackInputData.UltimateShortCrackWidth = value;
|
|
||||||
OnPropertyChanged(nameof(UltShortTermCrackWidth));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CrackCalculatorInputDataViewModel(IEnumerable<INdmPrimitive> allowedPrimitives, IEnumerable<IForceAction> allowedCombinations, CrackCalculator crackCalculator)
|
|
||||||
{
|
|
||||||
calculator = crackCalculator;
|
|
||||||
crackInputData = calculator.InputData;
|
|
||||||
CombinationViewModel = SourceTargetFactory.GetSourceTargetVM(allowedCombinations, crackInputData.ForceActions);
|
|
||||||
PrimitivesViewModel = SourceTargetFactory.GetSourceTargetVM(allowedPrimitives, crackInputData.Primitives);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Refresh()
|
|
||||||
{
|
|
||||||
var combinations = CombinationViewModel.GetTargetItems();
|
|
||||||
crackInputData.ForceActions.Clear();
|
|
||||||
foreach (var item in combinations)
|
|
||||||
{
|
|
||||||
crackInputData.ForceActions.Add(item);
|
|
||||||
}
|
|
||||||
crackInputData.Primitives.Clear();
|
|
||||||
foreach (var item in PrimitivesViewModel.GetTargetItems())
|
|
||||||
{
|
|
||||||
crackInputData.Primitives.Add(item.GetNdmPrimitive());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,119 +0,0 @@
|
|||||||
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.CrackResultView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
|
||||||
d:DataContext="{d:DesignInstance local:CrackResultViewModel}"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Result of calculations of crack" Height="450" Width="800" MinHeight="300" MinWidth="600" MaxHeight="800" MaxWidth="1000" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
|
||||||
<Window.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceDictionary Source="/Windows/CalculationWindows/CalculatorsViews/Cracks/Cracks.xaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</Window.Resources>
|
|
||||||
<DockPanel>
|
|
||||||
<ToolBarTray DockPanel.Dock="Top">
|
|
||||||
<ToolBar>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowRebarsCommand}" ToolTip="Show results by rebars">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource ShowRebarsResult}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
</ToolBar>
|
|
||||||
</ToolBarTray>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<DataGrid IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding TupleResults}" SelectedItem="{Binding SelectedResult}">
|
|
||||||
<DataGrid.RowStyle>
|
|
||||||
<Style TargetType="DataGridRow">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsValid}" Value="false">
|
|
||||||
<Setter Property="Background" Value="{StaticResource ErrorColorBrush}"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</DataGrid.RowStyle>
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding Path=IsValid}"/>
|
|
||||||
<DataGridTextColumn Header="Action name" Binding="{Binding InputData.TupleName}" Width="120"/>
|
|
||||||
<DataGridTemplateColumn Header="Combination term" Width="120">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="Long-term"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="Short-term"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Moment Mx" Width="90">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding InputData.LongTermTuple.Mx, Converter={StaticResource MomentConverter}}" HorizontalAlignment="Right" />
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding InputData.ShortTermTuple.Mx, Converter={StaticResource MomentConverter}}" HorizontalAlignment="Right" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Moment My" Width="90">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding InputData.LongTermTuple.My, Converter={StaticResource MomentConverter}}" HorizontalAlignment="Right"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding InputData.ShortTermTuple.My, Converter={StaticResource MomentConverter}}" HorizontalAlignment="Right" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Force Nz" Width="90">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding InputData.LongTermTuple.Nz, Converter={StaticResource ForceConverter}}" HorizontalAlignment="Right" />
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding InputData.ShortTermTuple.Nz, Converter={StaticResource ForceConverter}}" HorizontalAlignment="Right" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Crack width" Width="80">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource CrackGrid}" Content="{Binding}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding CrackResult.Description}"/>
|
|
||||||
</Grid>
|
|
||||||
</DockPanel>
|
|
||||||
</Window>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
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.CalculatorsViews
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Логика взаимодействия для CrackResultView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class CrackResultView : Window
|
|
||||||
{
|
|
||||||
private readonly CrackResultViewModel viewModel;
|
|
||||||
|
|
||||||
public CrackResultView(CrackResultViewModel viewModel)
|
|
||||||
{
|
|
||||||
this.viewModel = viewModel;
|
|
||||||
InitializeComponent();
|
|
||||||
this.DataContext = this.viewModel;
|
|
||||||
}
|
|
||||||
public CrackResultView(CrackResult result) : this(new CrackResultViewModel(result))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public class CrackResultViewModel : ViewModelBase
|
|
||||||
{
|
|
||||||
IShowCrackIsoFieldsLogic showCrackIsoFieldsLogic => new ShowCrackIsoFieldsLogic();
|
|
||||||
private CrackResult crackResult;
|
|
||||||
private RelayCommand? showIsoFieldCommand;
|
|
||||||
private RelayCommand? showRebarsCommand;
|
|
||||||
|
|
||||||
public TupleCrackResult SelectedResult { get; set; }
|
|
||||||
public List<TupleCrackResult> TupleResults => CrackResult.TupleResults;
|
|
||||||
public ICommand ShowRebarsCommand
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return showRebarsCommand ??= new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
var wnd = new TupleCrackResultView(SelectedResult);
|
|
||||||
wnd.ShowDialog();
|
|
||||||
}, o => SelectedResult != null && SelectedResult.IsValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommand ShowIsoFieldCommand
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return showIsoFieldCommand ??= new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
showCrackIsoFieldsLogic.ShowIsoField(SelectedResult.RebarResults);
|
|
||||||
}, o => SelectedResult != null && SelectedResult.IsValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CrackResult CrackResult => crackResult;
|
|
||||||
|
|
||||||
public CrackResultViewModel(CrackResult crackResult)
|
|
||||||
{
|
|
||||||
this.crackResult = crackResult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
||||||
<DataTemplate x:Key="CrackTextBox">
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding CrackWidth, Converter={StaticResource CrackWidth}, ConverterParameter='Fixed3'}" HorizontalAlignment="Right">
|
|
||||||
<TextBlock.Style>
|
|
||||||
<Style TargetType="TextBlock">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsCrackLessThanUltimate}" Value="false">
|
|
||||||
<Setter Property="Background" Value="{StaticResource WarningColorBrush}" />
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</TextBlock.Style>
|
|
||||||
</TextBlock>
|
|
||||||
</DataTemplate>
|
|
||||||
<DataTemplate x:Key="CrackGrid">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource CrackTextBox}" Content="{Binding LongTermResult}"/>
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource CrackTextBox}" Content="{Binding ShortTermResult}"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public interface IShowCrackIsoFieldsLogic
|
|
||||||
{
|
|
||||||
void ShowIsoField(IEnumerable<RebarCrackResult> rebarResults);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
using StructureHelper.Services.Reports.CalculationReports;
|
|
||||||
using StructureHelper.Services.ResultViewers;
|
|
||||||
using StructureHelper.Windows.Errors;
|
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public class ShowCrackIsoFieldsLogic : IShowCrackIsoFieldsLogic
|
|
||||||
{
|
|
||||||
private IsoFieldReport isoFieldReport;
|
|
||||||
|
|
||||||
public void ShowIsoField(IEnumerable<RebarCrackResult> rebarResults)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(rebarResults, CrackResultFuncFactory.GetResultFuncs());
|
|
||||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
|
||||||
isoFieldReport.Show();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var vm = new ErrorProcessor()
|
|
||||||
{
|
|
||||||
ShortText = "Errors apearred during showing isofield, see detailed information",
|
|
||||||
DetailText = $"{ex}"
|
|
||||||
};
|
|
||||||
new ErrorMessage(vm).ShowDialog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.TupleCrackResultView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
|
|
||||||
d:DataContext="{d:DesignInstance local:TupleCrackResultViewModel}"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="{Binding WindowTitle}" Height="450" Width="900" MinHeight="300" MinWidth="500" MaxHeight="1000" MaxWidth="1400" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
|
||||||
<Window.Resources>
|
|
||||||
<ResourceDictionary>
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceDictionary Source="/Windows/CalculationWindows/CalculatorsViews/Cracks/Cracks.xaml" />
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
</Window.Resources>
|
|
||||||
<DockPanel>
|
|
||||||
<ToolBarTray DockPanel.Dock="Top">
|
|
||||||
<ToolBar>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
</ToolBar>
|
|
||||||
</ToolBarTray>
|
|
||||||
<DataGrid IsReadOnly="True" AutoGenerateColumns="False" ItemsSource="{Binding RebarResults}" SelectedItem="{Binding SelectedResult}">
|
|
||||||
<DataGrid.RowStyle>
|
|
||||||
<Style TargetType="DataGridRow">
|
|
||||||
<Style.Triggers>
|
|
||||||
<DataTrigger Binding="{Binding IsValid}" Value="false">
|
|
||||||
<Setter Property="Background" Value="{StaticResource ErrorColorBrush}"/>
|
|
||||||
</DataTrigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</DataGrid.RowStyle>
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridCheckBoxColumn Header="Valid" Binding="{Binding IsValid}"/>
|
|
||||||
<DataGridTextColumn Header="Rebar name" Binding="{Binding RebarPrimitive.Name}" Width="120" CanUserSort="True"/>
|
|
||||||
<DataGridTemplateColumn Header="Combination term" Width="120">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="Long-term" />
|
|
||||||
<TextBlock Grid.Row="1" Text="Short-term" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Softening factor" Width="100">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding LongTermResult.SofteningFactor, Converter={StaticResource PlainDouble}, StringFormat=F3}" HorizontalAlignment="Right" />
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding ShortTermResult.SofteningFactor, Converter={StaticResource PlainDouble}, StringFormat=F3}" HorizontalAlignment="Right" />
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Rebar stress" Width="80">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding LongTermResult.RebarStressResult.RebarStress, Converter={StaticResource StressConverter}, ConverterParameter='Smart3'}" HorizontalAlignment="Right"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding ShortTermResult.RebarStressResult.RebarStress, Converter={StaticResource StressConverter}, ConverterParameter='Smart3'}" HorizontalAlignment="Right"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Rebar strain" Width="80">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding LongTermResult.RebarStressResult.RebarStrain, StringFormat=F5}" HorizontalAlignment="Right"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding ShortTermResult.RebarStressResult.RebarStrain, StringFormat=F5}" HorizontalAlignment="Right"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Ref. concrete strain" Width="120">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock Grid.Row="0" Text="{Binding LongTermResult.RebarStressResult.ConcreteStrain, StringFormat=F5}" HorizontalAlignment="Right"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="{Binding ShortTermResult.RebarStressResult.ConcreteStrain, StringFormat=F5}" HorizontalAlignment="Right"/>
|
|
||||||
</Grid>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn Header="Crack width" Width="80">
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource CrackGrid}" Content="{Binding}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTextColumn Header="Description" Width="300" Binding="{Binding Description}"/>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</DockPanel>
|
|
||||||
</Window>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
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.CalculatorsViews
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Логика взаимодействия для TupleCrackResultView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class TupleCrackResultView : Window
|
|
||||||
{
|
|
||||||
TupleCrackResultViewModel viewModel;
|
|
||||||
public TupleCrackResultView(TupleCrackResultViewModel viewModel)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
this.viewModel = viewModel;
|
|
||||||
DataContext = this.viewModel;
|
|
||||||
}
|
|
||||||
public TupleCrackResultView(TupleCrackResult crackResult) : this(new TupleCrackResultViewModel(crackResult))
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
using LoaderCalculator.Data.Matrix;
|
|
||||||
using LoaderCalculator.Data.Ndms;
|
|
||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelper.Services.Reports.CalculationReports;
|
|
||||||
using StructureHelper.Services.ResultViewers;
|
|
||||||
using StructureHelper.Windows.Errors;
|
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Cracking;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public class TupleCrackResultViewModel : ViewModelBase
|
|
||||||
{
|
|
||||||
IShowCrackIsoFieldsLogic showCrackIsoFieldsLogic => new ShowCrackIsoFieldsLogic();
|
|
||||||
private TupleCrackResult crackResult;
|
|
||||||
private RelayCommand showIsoFieldCommand;
|
|
||||||
private IsoFieldReport isoFieldReport;
|
|
||||||
|
|
||||||
public TupleCrackResult CrackResult => crackResult;
|
|
||||||
public List<RebarCrackResult> RebarResults => crackResult.RebarResults;
|
|
||||||
public RebarCrackResult SelectedResult { get; set; }
|
|
||||||
public string WindowTitle => "Result of calculation of cracks for action " + crackResult.InputData.TupleName;
|
|
||||||
public ICommand ShowIsoFieldCommand
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return showIsoFieldCommand ??= new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
showCrackIsoFieldsLogic.ShowIsoField(crackResult.RebarResults);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public TupleCrackResultViewModel(TupleCrackResult crackResult)
|
|
||||||
{
|
|
||||||
this.crackResult = crackResult;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Create array of common values
|
|
||||||
/// </summary>
|
|
||||||
public class DiagramFactory
|
|
||||||
{
|
|
||||||
IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
private ArrayParameter<double> arrayParameter;
|
|
||||||
/// <summary>
|
|
||||||
/// Collection of force results
|
|
||||||
/// </summary>
|
|
||||||
public List<IForcesTupleResult> TupleList { get; set; }
|
|
||||||
|
|
||||||
//public Action<int> SetProgress { get; set; }
|
|
||||||
|
|
||||||
public ArrayParameter<double> GetCommonArray()
|
|
||||||
{
|
|
||||||
var labels = LabelsFactory.GetCommonLabels();
|
|
||||||
arrayParameter = new ArrayParameter<double>(TupleList.Count(), labels);
|
|
||||||
Calculate();
|
|
||||||
return arrayParameter;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Calculate()
|
|
||||||
{
|
|
||||||
var data = arrayParameter.Data;
|
|
||||||
for (int i = 0; i < TupleList.Count(); i++)
|
|
||||||
{
|
|
||||||
var valueList = ProcessResult(i);
|
|
||||||
for (int j = 0; j < valueList.Count; j++)
|
|
||||||
{
|
|
||||||
data[i, j] = valueList[j];
|
|
||||||
}
|
|
||||||
//SetProgress?.Invoke(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private List<double> ProcessResult(int i)
|
|
||||||
{
|
|
||||||
var unitForce = unitLogic.GetUnit(UnitTypes.Force);
|
|
||||||
var unitMoment = unitLogic.GetUnit(UnitTypes.Moment);
|
|
||||||
var unitCurvature = unitLogic.GetUnit(UnitTypes.Curvature);
|
|
||||||
|
|
||||||
return new List<double>
|
|
||||||
{
|
|
||||||
TupleList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
|
||||||
TupleList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
|
||||||
TupleList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer,
|
|
||||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
|
||||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
|
||||||
TupleList[i].LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using StructureHelper.Windows.Forces;
|
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
|
||||||
{
|
|
||||||
public interface IValuePointDiagramLogic
|
|
||||||
{
|
|
||||||
ForceCalculator Calculator { get; set; }
|
|
||||||
PointPrimitiveLogic PrimitiveLogic { get; set; }
|
|
||||||
IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
|
||||||
ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
|
||||||
|
|
||||||
GenericResult<ArrayParameter<double>> GetArrayParameter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -25,12 +25,10 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
const string ForceUnitString = "kN";
|
const string ForceUnitString = "kN";
|
||||||
const string MomentUnitString = "kNm";
|
const string MomentUnitString = "kNm";
|
||||||
|
|
||||||
IConvertUnitLogic operationLogic;
|
|
||||||
|
|
||||||
//private List<ArrayParameter<double>> arrayParameters;
|
//private List<ArrayParameter<double>> arrayParameters;
|
||||||
private IResult result;
|
private IResult result;
|
||||||
private IUnit unitForce;
|
private IUnit unitForce = CommonOperation.GetUnit(UnitTypes.Force, ForceUnitString);
|
||||||
private IUnit unitMoment;
|
private IUnit unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, MomentUnitString);
|
||||||
private int stepCount;
|
private int stepCount;
|
||||||
|
|
||||||
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||||
@@ -50,10 +48,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
stepCount *= InputData.CalcTerms.Count();
|
stepCount *= InputData.CalcTerms.Count();
|
||||||
stepCount *= InputData.PredicateEntries.Count();
|
stepCount *= InputData.PredicateEntries.Count();
|
||||||
//arrayParameters = new();
|
//arrayParameters = new();
|
||||||
operationLogic = new ConvertUnitLogic();
|
|
||||||
IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
unitForce = unitLogic.GetUnit(UnitTypes.Force, ForceUnitString);
|
|
||||||
unitMoment = unitLogic.GetUnit(UnitTypes.Moment, MomentUnitString);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DoCalculations()
|
private void DoCalculations()
|
||||||
@@ -96,7 +90,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
|
|
||||||
private ArrayParameter<double> GetParametersByCurveResult(LimitCurveResult curveResult)
|
private ArrayParameter<double> GetParametersByCurveResult(LimitCurveResult curveResult)
|
||||||
{
|
{
|
||||||
var labels = GetLabels();
|
string[] labels = GetLabels();
|
||||||
var items = curveResult.Points;
|
var items = curveResult.Points;
|
||||||
var arrayParameter = new ArrayParameter<double>(items.Count(), labels.Count(), labels);
|
var arrayParameter = new ArrayParameter<double>(items.Count(), labels.Count(), labels);
|
||||||
var data = arrayParameter.Data;
|
var data = arrayParameter.Data;
|
||||||
@@ -127,13 +121,11 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
SetProgress?.Invoke(parameterResult.IterationNumber);
|
SetProgress?.Invoke(parameterResult.IterationNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<string> GetLabels()
|
private string[] GetLabels()
|
||||||
{
|
{
|
||||||
List<string> strings = new()
|
string[] strings = new string[2];
|
||||||
{
|
strings[0] = GetLabel(InputData.SurroundData.ConvertLogicEntity.XForceType);
|
||||||
GetLabel(InputData.SurroundData.ConvertLogicEntity.XForceType),
|
strings[1] = GetLabel(InputData.SurroundData.ConvertLogicEntity.YForceType);
|
||||||
GetLabel(InputData.SurroundData.ConvertLogicEntity.YForceType)
|
|
||||||
};
|
|
||||||
return strings;
|
return strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
using StructureHelper.Windows.Forces;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
|
||||||
{
|
|
||||||
public class InterpolateValuePointsLogic
|
|
||||||
{
|
|
||||||
private InterpolationProgressLogic interpolationLogic;
|
|
||||||
private ValuePointsInterpolateViewModel viewModel;
|
|
||||||
private IResult result;
|
|
||||||
private ValuePointsInterpolationInputData inputData;
|
|
||||||
public ForcesTupleResult SelectedResult { get; set; }
|
|
||||||
public IEnumerable<INdmPrimitive> NdmPrimitives { get; set; }
|
|
||||||
public ForceCalculator ForceCalculator { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
public ILongProcessLogic ProgressLogic { get; set; }
|
|
||||||
public ShowProgressLogic ShowProgressLogic { get; set; }
|
|
||||||
|
|
||||||
public void InterpolateValuePoints()
|
|
||||||
{
|
|
||||||
var tuple = SelectedResult.DesignForceTuple ?? throw new StructureHelperException(ErrorStrings.NullReference + ": Design force combination");
|
|
||||||
PrepareInputData(tuple);
|
|
||||||
viewModel = new ValuePointsInterpolateViewModel(inputData);
|
|
||||||
if (ShowDialog() == false) { return; };
|
|
||||||
ShowDiagram(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PrepareInputData(IDesignForceTuple tuple)
|
|
||||||
{
|
|
||||||
inputData = new ValuePointsInterpolationInputData()
|
|
||||||
{
|
|
||||||
FinishDesignForce = tuple.Clone() as IDesignForceTuple,
|
|
||||||
LimitState = tuple.LimitState,
|
|
||||||
CalcTerm = tuple.CalcTerm,
|
|
||||||
};
|
|
||||||
inputData.PrimitiveBases.AddRange(PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(NdmPrimitives));
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ShowDialog()
|
|
||||||
{
|
|
||||||
var wnd = new ValuePointsInterpolateView(viewModel);
|
|
||||||
wnd.ShowDialog();
|
|
||||||
if (wnd.DialogResult != true) { return false; }
|
|
||||||
interpolationLogic = new InterpolationProgressLogic(ForceCalculator, viewModel.ForceInterpolationViewModel.Result);
|
|
||||||
ProgressLogic = interpolationLogic;
|
|
||||||
ShowProgressLogic = new(interpolationLogic)
|
|
||||||
{
|
|
||||||
WindowTitle = "Interpolate forces",
|
|
||||||
};
|
|
||||||
ShowProgressLogic.Show();
|
|
||||||
result = interpolationLogic.InterpolateCalculator.Result;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowDiagram(IResult result)
|
|
||||||
{
|
|
||||||
if (result.IsValid == false) { return; }
|
|
||||||
if (result is not IForcesResults)
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(IForcesResults), result));
|
|
||||||
}
|
|
||||||
var tupleResult = result as IForcesResults;
|
|
||||||
var pointGraphLogic = new ShowValuePointDiagramLogic()
|
|
||||||
{
|
|
||||||
Calculator = interpolationLogic.InterpolateCalculator,
|
|
||||||
PrimitiveLogic = viewModel.PrimitiveLogic,
|
|
||||||
ValueDelegatesLogic = viewModel.ValueDelegatesLogic,
|
|
||||||
TupleList = tupleResult.ForcesResultList
|
|
||||||
};
|
|
||||||
pointGraphLogic.ShowWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public static class LabelsFactory
|
|
||||||
{
|
|
||||||
static IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
static IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
private static IUnit unitForce = unitLogic.GetUnit(UnitTypes.Force);
|
|
||||||
private static IUnit unitMoment = unitLogic.GetUnit(UnitTypes.Moment);
|
|
||||||
private static IUnit unitCurvature = unitLogic.GetUnit(UnitTypes.Curvature);
|
|
||||||
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
|
||||||
public static List<string> GetCommonLabels()
|
|
||||||
{
|
|
||||||
var labels = new List<string>
|
|
||||||
{
|
|
||||||
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
|
|
||||||
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
|
|
||||||
$"{GeometryNames.LongForceName}, {unitForce.Name}",
|
|
||||||
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
|
|
||||||
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
|
|
||||||
$"{GeometryNames.StrainTrdName}",
|
|
||||||
};
|
|
||||||
return labels;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
internal class ShowCrackResultLogic
|
internal class ShowCrackResultLogic
|
||||||
{
|
{
|
||||||
private CrackForceCalculator calculator;
|
private CrackForceCalculator calculator;
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
|
||||||
|
|
||||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||||
public LimitStates LimitState { get; set; }
|
public LimitStates LimitState { get; set; }
|
||||||
@@ -28,12 +27,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
public void Show(IDesignForceTuple finishDesignTuple)
|
public void Show(IDesignForceTuple finishDesignTuple)
|
||||||
{
|
{
|
||||||
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
var viewModel = new InterpolateTuplesViewModel(finishDesignTuple, null);
|
||||||
viewModel.ForceInterpolationViewModel.StepCountVisible = false;
|
viewModel.StepCountVisible = false;
|
||||||
var wndTuples = new InterpolateTuplesView(viewModel);
|
var wndTuples = new InterpolateTuplesView(viewModel);
|
||||||
wndTuples.ShowDialog();
|
wndTuples.ShowDialog();
|
||||||
if (wndTuples.DialogResult != true) return;
|
if (wndTuples.DialogResult != true) return;
|
||||||
var startDesignTuple = viewModel.ForceInterpolationViewModel.StartDesignForce.ForceTuple;
|
var startDesignTuple = viewModel.StartDesignForce.ForceTuple;
|
||||||
var endDesignTuple = viewModel.ForceInterpolationViewModel.FinishDesignForce.ForceTuple;
|
var endDesignTuple = viewModel.FinishDesignForce.ForceTuple;
|
||||||
FindCrackFactor(endDesignTuple, startDesignTuple);
|
FindCrackFactor(endDesignTuple, startDesignTuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,13 +42,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
calculator.TraceLogger = new ShiftTraceLogger();
|
calculator.TraceLogger = new ShiftTraceLogger();
|
||||||
calculator.StartTuple = startDesignTuple;
|
calculator.StartTuple = startDesignTuple;
|
||||||
calculator.EndTuple = finishDesignTuple;
|
calculator.EndTuple = finishDesignTuple;
|
||||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
calculator.NdmCollection = NdmPrimitivesService.GetNdms(ndmPrimitives, LimitState, CalcTerm);
|
||||||
{
|
|
||||||
Primitives = ndmPrimitives,
|
|
||||||
LimitState = LimitState,
|
|
||||||
CalcTerm = CalcTerm
|
|
||||||
};
|
|
||||||
calculator.NdmCollection = triangulateLogic.GetNdms();
|
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
var result = (CrackForceResult)calculator.Result;
|
var result = (CrackForceResult)calculator.Result;
|
||||||
if (result.IsValid)
|
if (result.IsValid)
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
|
|
||||||
internal void Show()
|
internal void Show()
|
||||||
{
|
{
|
||||||
var inputData = new TupleCrackInputData()
|
var inputData = new CrackWidthCalculatorInputData()
|
||||||
{
|
{
|
||||||
//LimitState = LimitState,
|
LimitState = LimitState,
|
||||||
//CalcTerm = CalcTerm,
|
CalcTerm = CalcTerm,
|
||||||
LongTermTuple = ForceTuple,
|
ForceTuple = ForceTuple,
|
||||||
Primitives = ndmPrimitives
|
NdmPrimitives = ndmPrimitives
|
||||||
};
|
};
|
||||||
var calculator = new TupleCrackCalculator() { InputData = inputData };
|
var calculator = new CrackWidthCalculator() { InputData = inputData };
|
||||||
calculator.Run();
|
calculator.Run();
|
||||||
var result = calculator.Result;
|
var result = calculator.Result;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using StructureHelper.Windows.Graphs;
|
using StructureHelper.Windows.Graphs;
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
using StructureHelper.Windows.ViewModels.Errors;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Infrastructures.Settings;
|
using StructureHelperCommon.Infrastructures.Settings;
|
||||||
using StructureHelperCommon.Models;
|
using StructureHelperCommon.Models;
|
||||||
@@ -18,12 +17,14 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
{
|
{
|
||||||
internal class ShowDiagramLogic : ILongProcessLogic
|
internal class ShowDiagramLogic : ILongProcessLogic
|
||||||
{
|
{
|
||||||
private ArrayParameter<double> arrayParameter;
|
ArrayParameter<double> arrayParameter;
|
||||||
private IEnumerable<IForcesTupleResult> tupleList;
|
private IEnumerable<IForcesTupleResult> TupleList;
|
||||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
private IEnumerable<INdmPrimitive> NdmPrimitives;
|
||||||
private List<IForcesTupleResult> validTupleList;
|
private List<IForcesTupleResult> ValidTupleList;
|
||||||
|
|
||||||
public int StepCount => validTupleList.Count();
|
private static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||||
|
|
||||||
|
public int StepCount => ValidTupleList.Count();
|
||||||
|
|
||||||
public Action<int> SetProgress { get; set; }
|
public Action<int> SetProgress { get; set; }
|
||||||
public bool Result { get; set; }
|
public bool Result { get; set; }
|
||||||
@@ -52,25 +53,67 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
var vm = new GraphViewModel(new List<Series>() { series});
|
var vm = new GraphViewModel(new List<Series>() { series});
|
||||||
var wnd = new GraphView(vm);
|
var wnd = new GraphView(vm);
|
||||||
wnd.ShowDialog();
|
wnd.ShowDialog();
|
||||||
}, ErrorStrings.ErrorDuring("building chart"));
|
},
|
||||||
|
"Errors appeared during showing a graph, see detailed information");
|
||||||
}
|
}
|
||||||
private void Show()
|
private void Show()
|
||||||
{
|
{
|
||||||
validTupleList = tupleList.Where(x => x.IsValid == true).ToList();
|
ValidTupleList = TupleList.Where(x => x.IsValid == true).ToList();
|
||||||
|
var unitForce = CommonOperation.GetUnit(UnitTypes.Force, "kN");
|
||||||
|
var unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, "kNm");
|
||||||
|
var unitCurvature = CommonOperation.GetUnit(UnitTypes.Curvature, "1/m");
|
||||||
|
|
||||||
var factory = new DiagramFactory()
|
string[] labels = GetLabels(unitForce, unitMoment, unitCurvature);
|
||||||
{
|
arrayParameter = new ArrayParameter<double>(ValidTupleList.Count(), labels.Count(), labels);
|
||||||
TupleList = validTupleList,
|
CalculateWithoutCrack(ValidTupleList, unitForce, unitMoment, unitCurvature);
|
||||||
//SetProgress = SetProgress,
|
|
||||||
};
|
|
||||||
arrayParameter = factory.GetCommonArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ShowDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
public ShowDiagramLogic(IEnumerable<IForcesTupleResult> tupleList, IEnumerable<INdmPrimitive> ndmPrimitives)
|
||||||
{
|
{
|
||||||
this.tupleList = tupleList;
|
TupleList = tupleList;
|
||||||
this.ndmPrimitives = ndmPrimitives;
|
NdmPrimitives = ndmPrimitives;
|
||||||
validTupleList = tupleList.Where(x => x.IsValid == true).ToList();
|
ValidTupleList = TupleList.Where(x => x.IsValid == true).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CalculateWithoutCrack(List<IForcesTupleResult> resultList, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||||
|
{
|
||||||
|
var data = arrayParameter.Data;
|
||||||
|
for (int i = 0; i < resultList.Count(); i++)
|
||||||
|
{
|
||||||
|
var valueList = ProcessResultWithouCrack(resultList, unitForce, unitMoment, unitCurvature, i);
|
||||||
|
for (int j = 0; j < valueList.Count; j++)
|
||||||
|
{
|
||||||
|
data[i, j] = valueList[j];
|
||||||
|
}
|
||||||
|
SetProgress?.Invoke(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static List<double> ProcessResultWithouCrack(List<IForcesTupleResult> resultList, IUnit unitForce, IUnit unitMoment, IUnit unitCurvature, int i)
|
||||||
|
{
|
||||||
|
return new List<double>
|
||||||
|
{
|
||||||
|
resultList[i].DesignForceTuple.ForceTuple.Mx * unitMoment.Multiplyer,
|
||||||
|
resultList[i].DesignForceTuple.ForceTuple.My * unitMoment.Multiplyer,
|
||||||
|
resultList[i].DesignForceTuple.ForceTuple.Nz * unitForce.Multiplyer,
|
||||||
|
resultList[i].LoaderResults.ForceStrainPair.StrainMatrix.Kx * unitCurvature.Multiplyer,
|
||||||
|
resultList[i].LoaderResults.ForceStrainPair.StrainMatrix.Ky * unitCurvature.Multiplyer,
|
||||||
|
resultList[i].LoaderResults.ForceStrainPair.StrainMatrix.EpsZ
|
||||||
|
};
|
||||||
|
}
|
||||||
|
private static string[] GetLabels(IUnit unitForce, IUnit unitMoment, IUnit unitCurvature)
|
||||||
|
{
|
||||||
|
return new string[]
|
||||||
|
{
|
||||||
|
$"{GeometryNames.MomFstName}, {unitMoment.Name}",
|
||||||
|
$"{GeometryNames.MomSndName}, {unitMoment.Name}",
|
||||||
|
$"{GeometryNames.LongForceName}, {unitForce.Name}",
|
||||||
|
$"{GeometryNames.CurvFstName}, {unitCurvature.Name}",
|
||||||
|
$"{GeometryNames.CurvSndName}, {unitCurvature.Name}",
|
||||||
|
$"{GeometryNames.StrainTrdName}"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using StructureHelper.Windows.CalculationWindows.ProgressViews;
|
using StructureHelper.Windows.CalculationWindows.ProgressViews;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
using StructureHelperCommon.Models.Calculators;
|
using StructureHelperCommon.Models.Calculators;
|
||||||
using StructureHelperCommon.Models.Forces;
|
using StructureHelperCommon.Models.Forces;
|
||||||
@@ -12,7 +11,7 @@ using System.Windows.Forms;
|
|||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
|
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews
|
||||||
{
|
{
|
||||||
public class ShowProgressLogic
|
internal class ShowProgressLogic
|
||||||
{
|
{
|
||||||
private ShowProgressViewModel progressViewModel;
|
private ShowProgressViewModel progressViewModel;
|
||||||
private ShowProgressView wndProgress;
|
private ShowProgressView wndProgress;
|
||||||
@@ -83,7 +82,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
throw new StructureHelperException(ex);
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
|
||||||
using LoaderCalculator.Data.Ndms;
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Services.ResultViewers;
|
|
||||||
using StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic;
|
|
||||||
using StructureHelper.Windows.Forces;
|
|
||||||
using StructureHelper.Windows.Graphs;
|
|
||||||
using StructureHelper.Windows.ViewModels.Errors;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
|
||||||
using StructureHelperCommon.Models;
|
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
//Copyright (c) 2023 Redikultsev Evgeny, Ekaterinburg, Russia
|
|
||||||
//All rights reserved.
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews
|
|
||||||
{
|
|
||||||
public class ShowValuePointDiagramLogic //: ILongProcessLogic
|
|
||||||
{
|
|
||||||
private ArrayParameter<double> arrayParameter;
|
|
||||||
private IValuePointDiagramLogic pointDiagramLogic;
|
|
||||||
|
|
||||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
|
||||||
public ForceCalculator Calculator { get; set; }
|
|
||||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
|
||||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
|
||||||
|
|
||||||
//public int StepCount => throw new NotImplementedException();
|
|
||||||
|
|
||||||
//public Action<int> SetProgress { get; set; }
|
|
||||||
//public bool Result { get; set; }
|
|
||||||
//public IShiftTraceLogger? TraceLogger { get; set; }
|
|
||||||
public ShowValuePointDiagramLogic(IValuePointDiagramLogic pointDiagramLogic)
|
|
||||||
{
|
|
||||||
this.pointDiagramLogic = pointDiagramLogic;
|
|
||||||
}
|
|
||||||
public ShowValuePointDiagramLogic() : this(new ValuePointDiagramLogic())
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public void ShowWindow()
|
|
||||||
{
|
|
||||||
var result = GetResult();
|
|
||||||
if (result.IsValid != true)
|
|
||||||
{
|
|
||||||
SafetyProcessor.ShowMessage(ErrorStrings.DataIsInCorrect, result.Description);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
arrayParameter = result.Value;
|
|
||||||
SafetyProcessor.RunSafeProcess(() =>
|
|
||||||
{
|
|
||||||
var series = new Series(arrayParameter)
|
|
||||||
{
|
|
||||||
Name = "Forces and curvatures"
|
|
||||||
};
|
|
||||||
var vm = new GraphViewModel(new List<Series>()
|
|
||||||
{
|
|
||||||
series
|
|
||||||
});
|
|
||||||
var wnd = new GraphView(vm);
|
|
||||||
wnd.ShowDialog();
|
|
||||||
}, ErrorStrings.ErrorDuring("building chart"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericResult<ArrayParameter<double>> GetResult()
|
|
||||||
{
|
|
||||||
pointDiagramLogic.TupleList = TupleList;
|
|
||||||
pointDiagramLogic.PrimitiveLogic = PrimitiveLogic;
|
|
||||||
pointDiagramLogic.Calculator = Calculator;
|
|
||||||
pointDiagramLogic.ValueDelegatesLogic = ValueDelegatesLogic;
|
|
||||||
var results = pointDiagramLogic.GetArrayParameter();
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,173 +0,0 @@
|
|||||||
using LoaderCalculator.Data.Ndms;
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Services.ResultViewers;
|
|
||||||
using StructureHelper.Windows.Forces;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews.ForceResultLogic
|
|
||||||
{
|
|
||||||
public class ValuePointDiagramLogic : IValuePointDiagramLogic
|
|
||||||
{
|
|
||||||
private ArrayParameter<double> arrayParameter;
|
|
||||||
private List<(INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive)> pointCollection;
|
|
||||||
private List<IForcesTupleResult> validTuplesList;
|
|
||||||
private ArrayParameter<double> arrayOfValuesByPoint;
|
|
||||||
private IEnumerable<ForceResultFunc> selectedDelegates;
|
|
||||||
private string exceptionMessage;
|
|
||||||
|
|
||||||
public IEnumerable<IForcesTupleResult> TupleList { get; set; }
|
|
||||||
public ForceCalculator Calculator { get; set; }
|
|
||||||
public PointPrimitiveLogic PrimitiveLogic { get; set; }
|
|
||||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
|
||||||
|
|
||||||
public GenericResult<ArrayParameter<double>> GetArrayParameter()
|
|
||||||
{
|
|
||||||
SetParameters();
|
|
||||||
var checkResult = CheckParameters();
|
|
||||||
if (checkResult != true)
|
|
||||||
{
|
|
||||||
return GetFalseResult();
|
|
||||||
}
|
|
||||||
PrepareArray();
|
|
||||||
return GetValidResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
private GenericResult<ArrayParameter<double>> GetValidResult()
|
|
||||||
{
|
|
||||||
int i = 0;
|
|
||||||
foreach (var tuple in validTuplesList)
|
|
||||||
{
|
|
||||||
ProcessPointByTuple(tuple, i);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
arrayParameter.AddArray(arrayOfValuesByPoint);
|
|
||||||
return new GenericResult<ArrayParameter<double>>()
|
|
||||||
{
|
|
||||||
IsValid = true,
|
|
||||||
Value = arrayParameter
|
|
||||||
};
|
|
||||||
}
|
|
||||||
private GenericResult<ArrayParameter<double>> GetFalseResult()
|
|
||||||
{
|
|
||||||
return new GenericResult<ArrayParameter<double>>()
|
|
||||||
{
|
|
||||||
IsValid = false,
|
|
||||||
Description = exceptionMessage
|
|
||||||
};
|
|
||||||
}
|
|
||||||
private void SetParameters()
|
|
||||||
{
|
|
||||||
GetPointCollection();
|
|
||||||
selectedDelegates = ValueDelegatesLogic.ResultFuncs.SelectedItems;
|
|
||||||
validTuplesList = TupleList
|
|
||||||
.Where(x => x.IsValid == true)
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
private bool CheckParameters()
|
|
||||||
{
|
|
||||||
var result = true;
|
|
||||||
exceptionMessage = ErrorStrings.DataIsInCorrect;
|
|
||||||
if (pointCollection.Any() == false)
|
|
||||||
{
|
|
||||||
exceptionMessage += ", point collection is null";
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
if (selectedDelegates.Any() == false)
|
|
||||||
{
|
|
||||||
exceptionMessage += ", value expression collection is null";
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
if (validTuplesList.Any() == false)
|
|
||||||
{
|
|
||||||
exceptionMessage += ", force list is empty";
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
private void GetPointCollection()
|
|
||||||
{
|
|
||||||
pointCollection = new();
|
|
||||||
foreach (var primitiveValuePoint in PrimitiveLogic.Collection.CollectionItems)
|
|
||||||
{
|
|
||||||
foreach (var selectedPoint in primitiveValuePoint.Item.ValuePoints.SelectedItems)
|
|
||||||
{
|
|
||||||
var newPoint = (selectedPoint, primitiveValuePoint.Item.PrimitiveBase.GetNdmPrimitive());
|
|
||||||
pointCollection.Add(newPoint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
private void ProcessPointByTuple(IForcesTupleResult tuple, int i)
|
|
||||||
{
|
|
||||||
var values = new List<double>();
|
|
||||||
var strainMatrix = tuple.LoaderResults.ForceStrainPair.StrainMatrix;
|
|
||||||
|
|
||||||
foreach (var valuePoint in pointCollection)
|
|
||||||
{
|
|
||||||
var ndm = GetMockNdm(valuePoint, tuple);
|
|
||||||
|
|
||||||
foreach (var valDelegate in selectedDelegates)
|
|
||||||
{
|
|
||||||
double val = valDelegate.ResultFunction.Invoke(strainMatrix, ndm) * valDelegate.UnitFactor;
|
|
||||||
values.Add(val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
arrayOfValuesByPoint.AddRow(i, values);
|
|
||||||
}
|
|
||||||
private void PrepareArray()
|
|
||||||
{
|
|
||||||
var factory = new DiagramFactory()
|
|
||||||
{
|
|
||||||
TupleList = validTuplesList,
|
|
||||||
//SetProgress = SetProgress,
|
|
||||||
};
|
|
||||||
arrayParameter = factory.GetCommonArray();
|
|
||||||
|
|
||||||
var labels = GetValueLabels(selectedDelegates);
|
|
||||||
arrayOfValuesByPoint = new ArrayParameter<double>(validTuplesList.Count(), labels);
|
|
||||||
}
|
|
||||||
private INdm GetMockNdm((INamedAreaPoint areaPoint, INdmPrimitive ndmPrimitive) valuePoint, IForcesTupleResult tuple)
|
|
||||||
{
|
|
||||||
var limitState = tuple.DesignForceTuple.LimitState;
|
|
||||||
var calcTerm = tuple.DesignForceTuple.CalcTerm;
|
|
||||||
var material = valuePoint.ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
|
||||||
var userPrestrain = valuePoint.ndmPrimitive.UsersPrestrain;
|
|
||||||
var autoPrestrain = valuePoint.ndmPrimitive.AutoPrestrain;
|
|
||||||
var ndm = new Ndm()
|
|
||||||
{
|
|
||||||
Area = valuePoint.areaPoint.Area,
|
|
||||||
CenterX = valuePoint.areaPoint.Point.X,
|
|
||||||
CenterY = valuePoint.areaPoint.Point.Y,
|
|
||||||
Material = material,
|
|
||||||
};
|
|
||||||
ndm.Prestrain = (userPrestrain.Mx + autoPrestrain.Mx) * valuePoint.areaPoint.Point.Y
|
|
||||||
+ (userPrestrain.My + autoPrestrain.My) * valuePoint.areaPoint.Point.X
|
|
||||||
+ userPrestrain.Nz + autoPrestrain.Nz;
|
|
||||||
return ndm;
|
|
||||||
}
|
|
||||||
private List<string> GetValueLabels(IEnumerable<ForceResultFunc> selectedDelegates)
|
|
||||||
{
|
|
||||||
List<string> strings = new();
|
|
||||||
foreach (var valuePoint in pointCollection)
|
|
||||||
{
|
|
||||||
foreach (var deleg in selectedDelegates)
|
|
||||||
{
|
|
||||||
string s = valuePoint.ndmPrimitive.Name;
|
|
||||||
s += "_" + valuePoint.areaPoint.Name;
|
|
||||||
s += "_" + deleg.Name + ", " + deleg.UnitName;
|
|
||||||
strings.Add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return strings;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,30 +6,23 @@
|
|||||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews"
|
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalculatorViews"
|
||||||
d:DataContext="{d:DesignInstance local:ForcesResultsViewModel}"
|
d:DataContext="{d:DesignInstance local:ForcesResultsViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Calculation Results" Height="350" Width="850" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
Title="Calculation Results" Height="350" Width="850" MinHeight="300" MinWidth="400" WindowStartupLocation="CenterScreen">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<ToolBarTray DockPanel.Dock="Top">
|
<ToolBarTray DockPanel.Dock="Top">
|
||||||
<ToolBar>
|
<ToolBar>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowCrackResultCommand}" ToolTip="Show force of cracking">
|
<Button Command="{Binding ShowCrackResultCommand}" ToolTip="Show force of cracking">
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_crack.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_crack.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding InterpolateCommand}" ToolTip="Show result step by step">
|
<Button Command="{Binding InterpolateCommand}" ToolTip="Show result step by step">
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_interpolation_1_1.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_interpolation_1_1.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowGraphsCommand}" ToolTip="Show diagram moment-curvature">
|
<Button Command="{Binding ShowGraphsCommand}" ToolTip="Show diagram moment-curvature">
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding GraphValuePointsCommand}" ToolTip="Show diagram by value points">
|
<Button Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_2.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
|
||||||
</Button>
|
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowInteractionDiagramCommand}" ToolTip="Show interaction diagram">
|
|
||||||
<Image Source="/Windows/CalculationWindows/CalculatorsViews/ForceCalculatorViews/32px_graph_1.png"/>
|
|
||||||
</Button>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding ShowIsoFieldCommand}" ToolTip="Show isofield results">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource IsoFieldResult}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -63,11 +56,13 @@
|
|||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</DataGrid>
|
</DataGrid>
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel Grid.Column="1">
|
||||||
|
<Button Margin="3" Content="Graphic" ToolTip="Show graphic results" Command="{Binding ShowIsoFieldCommand}"/>
|
||||||
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
|
<Button Margin="3" Content="CrcDiagrams" ToolTip="Show diagrams for cracked section" Command="{Binding ShowCrackGraphsCommand}"/>
|
||||||
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
|
<Button Margin="3" Content="Export" ToolTip="Export results to *.csv" Command="{Binding ExportToCSVCommand}"/>
|
||||||
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
|
<Button Margin="3" Content="Set Prestrain" ToolTip="Set strains as auto prestrain" Command="{Binding SetPrestrainCommand}"/>
|
||||||
<Button Margin="3" Content="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
|
<Button Margin="3" Content="Anchorage" ToolTip="Set strains as auto prestrain" Command="{Binding ShowAnchorageCommand}"/>
|
||||||
<Button Margin="3" Content="Geometry" ToolTip="Show Geometry Properties" Command="{Binding ShowGeometryResultCommand}"/>
|
<Button Margin="3" Content="Geometry" ToolTip="Show Geometry Properties" Command="{Binding ShowGeometryResultCommand}"/>
|
||||||
|
<Button Margin="3" Content="Acrc" ToolTip="Show crack width" Command="{Binding ShowCrackWidthResultCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using LoaderCalculator.Data.Matrix;
|
using LoaderCalculator.Data.Matrix;
|
||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Services.Exports;
|
using StructureHelper.Services.Exports;
|
||||||
using StructureHelper.Services.Reports;
|
using StructureHelper.Services.Reports;
|
||||||
using StructureHelper.Services.Reports.CalculationReports;
|
using StructureHelper.Services.Reports.CalculationReports;
|
||||||
@@ -43,7 +42,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
private ShowProgressLogic showProgressLogic;
|
private ShowProgressLogic showProgressLogic;
|
||||||
private InteractionDiagramLogic interactionDiagramLogic;
|
private InteractionDiagramLogic interactionDiagramLogic;
|
||||||
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
private static readonly ShowCrackResultLogic showCrackResultLogic = new();
|
||||||
//private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
private static readonly ShowCrackWidthLogic showCrackWidthLogic = new();
|
||||||
private IForcesResults forcesResults;
|
private IForcesResults forcesResults;
|
||||||
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
private IEnumerable<INdmPrimitive> ndmPrimitives;
|
||||||
private IEnumerable<INdmPrimitive> selectedNdmPrimitives;
|
private IEnumerable<INdmPrimitive> selectedNdmPrimitives;
|
||||||
@@ -53,18 +52,17 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
public static GeometryNames GeometryNames => ProgramSetting.GeometryNames;
|
||||||
|
|
||||||
public ForcesTupleResult SelectedResult { get; set; }
|
public ForcesTupleResult SelectedResult { get; set; }
|
||||||
private ICommand? showIsoFieldCommand;
|
private ICommand showIsoFieldCommand;
|
||||||
private ICommand? exportToCSVCommand;
|
private ICommand exportToCSVCommand;
|
||||||
private ICommand? interpolateCommand;
|
private ICommand interpolateCommand;
|
||||||
private ICommand? setPrestrainCommand;
|
private ICommand setPrestrainCommand;
|
||||||
private ICommand? showAnchorageCommand;
|
private ICommand showAnchorageCommand;
|
||||||
private ICommand? showGeometryResultCommand;
|
private ICommand showGeometryResultCommand;
|
||||||
private ICommand? showGraphsCommand;
|
private ICommand showGraphsCommand;
|
||||||
private ICommand? showCrackResult;
|
private ICommand showCrackResult;
|
||||||
private ICommand? showCrackGraphsCommand;
|
private ICommand showCrackGraphsCommand;
|
||||||
private ICommand? showCrackWidthResult;
|
private RelayCommand showCrackWidthResult;
|
||||||
private ICommand? showInteractionDiagramCommand;
|
private ICommand showInteractionDiagramCommand;
|
||||||
private ICommand? graphValuepointsCommand;
|
|
||||||
|
|
||||||
public IForcesResults ForcesResults
|
public IForcesResults ForcesResults
|
||||||
{
|
{
|
||||||
@@ -152,12 +150,12 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
{
|
{
|
||||||
get => showGraphsCommand ??= new RelayCommand(o =>
|
get => showGraphsCommand ??= new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
InterpolateTuplesViewModel interpolateTuplesViewModel;
|
InterpolateTuplesViewModel interploateTuplesViewModel;
|
||||||
InterpolateTuplesView wndTuples;
|
InterpolateTuplesView wndTuples;
|
||||||
ShowInterpolationWindow(out interpolateTuplesViewModel, out wndTuples);
|
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||||
if (wndTuples.DialogResult != true) return;
|
if (wndTuples.DialogResult != true) return;
|
||||||
|
|
||||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interpolateTuplesViewModel.ForceInterpolationViewModel.Result);
|
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
|
||||||
showProgressLogic = new(interpolationLogic)
|
showProgressLogic = new(interpolationLogic)
|
||||||
{
|
{
|
||||||
WindowTitle = "Interpolate forces"
|
WindowTitle = "Interpolate forces"
|
||||||
@@ -176,7 +174,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
};
|
};
|
||||||
showProgressLogic.Show();
|
showProgressLogic.Show();
|
||||||
}
|
}
|
||||||
}, o => SelectedResult != null);
|
}, o => SelectedResult != null && SelectedResult.IsValid
|
||||||
|
);
|
||||||
}
|
}
|
||||||
public ICommand ShowCrackGraphsCommand
|
public ICommand ShowCrackGraphsCommand
|
||||||
{
|
{
|
||||||
@@ -187,7 +186,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||||
if (wndTuples.DialogResult != true) return;
|
if (wndTuples.DialogResult != true) return;
|
||||||
|
|
||||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
|
||||||
showProgressLogic = new(interpolationLogic)
|
showProgressLogic = new(interpolationLogic)
|
||||||
{
|
{
|
||||||
WindowTitle = "Interpolate forces"
|
WindowTitle = "Interpolate forces"
|
||||||
@@ -225,22 +224,22 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
|
showCrackResultLogic.Show(SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple);
|
||||||
}
|
}
|
||||||
|
|
||||||
//public ICommand ShowCrackWidthResultCommand
|
public ICommand ShowCrackWidthResultCommand
|
||||||
//{
|
{
|
||||||
// get => showCrackWidthResult ??= new RelayCommand(o =>
|
get => showCrackWidthResult ??= new RelayCommand(o =>
|
||||||
// {
|
{
|
||||||
// SafetyProcessor.RunSafeProcess(ShowCrackWidthResult);
|
SafetyProcessor.RunSafeProcess(ShowCrackWidthResult);
|
||||||
// }, o => SelectedResult != null && SelectedResult.IsValid);
|
}, o => SelectedResult != null && SelectedResult.IsValid);
|
||||||
//}
|
}
|
||||||
|
|
||||||
//private void ShowCrackWidthResult()
|
private void ShowCrackWidthResult()
|
||||||
//{
|
{
|
||||||
// showCrackWidthLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
showCrackWidthLogic.LimitState = SelectedResult.DesignForceTuple.LimitState;
|
||||||
// showCrackWidthLogic.CalcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
showCrackWidthLogic.CalcTerm = SelectedResult.DesignForceTuple.CalcTerm;
|
||||||
// showCrackWidthLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
|
showCrackWidthLogic.ForceTuple = SelectedResult.DesignForceTuple.ForceTuple;
|
||||||
// showCrackWidthLogic.ndmPrimitives = ndmPrimitives.ToList();
|
showCrackWidthLogic.ndmPrimitives = ndmPrimitives.ToList();
|
||||||
// showCrackWidthLogic.Show();
|
showCrackWidthLogic.Show();
|
||||||
//}
|
}
|
||||||
public ICommand InterpolateCommand
|
public ICommand InterpolateCommand
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -260,42 +259,13 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
ShowInterpolationWindow(out interploateTuplesViewModel, out wndTuples);
|
||||||
if (wndTuples.DialogResult != true) return;
|
if (wndTuples.DialogResult != true) return;
|
||||||
|
|
||||||
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.ForceInterpolationViewModel.Result);
|
var interpolationLogic = new InterpolationProgressLogic(forceCalculator, interploateTuplesViewModel.Result);
|
||||||
progressLogic = interpolationLogic;
|
progressLogic = interpolationLogic;
|
||||||
showProgressLogic = new(interpolationLogic);
|
showProgressLogic = new(interpolationLogic);
|
||||||
showProgressLogic.ShowResult = ShowInterpolationProgressDialog;
|
showProgressLogic.ShowResult = ShowInterpolationProgressDialog;
|
||||||
showProgressLogic.Show();
|
showProgressLogic.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICommand GraphValuePointsCommand
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return graphValuepointsCommand ??
|
|
||||||
(graphValuepointsCommand = new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
InterpolateValuePoints();
|
|
||||||
}, o => SelectedResult != null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InterpolateValuePoints()
|
|
||||||
{
|
|
||||||
if (SelectedResult is null)
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.NullReference + ": Nothing is selected");
|
|
||||||
}
|
|
||||||
var logic = new InterpolateValuePointsLogic()
|
|
||||||
{
|
|
||||||
SelectedResult = SelectedResult,
|
|
||||||
ForceCalculator = forceCalculator,
|
|
||||||
NdmPrimitives = ndmPrimitives,
|
|
||||||
ProgressLogic = progressLogic,
|
|
||||||
ShowProgressLogic = showProgressLogic
|
|
||||||
};
|
|
||||||
logic.InterpolateValuePoints();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowInterpolationWindow(out InterpolateTuplesViewModel interploateTuplesViewModel, out InterpolateTuplesView wndTuples)
|
private void ShowInterpolationWindow(out InterpolateTuplesViewModel interploateTuplesViewModel, out InterpolateTuplesView wndTuples)
|
||||||
{
|
{
|
||||||
IDesignForceTuple finishDesignTuple = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple;
|
IDesignForceTuple finishDesignTuple = SelectedResult.DesignForceTuple.Clone() as IDesignForceTuple;
|
||||||
@@ -416,7 +386,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
IStrainMatrix strainMatrix = SelectedResult.LoaderResults.ForceStrainPair.StrainMatrix;
|
||||||
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ForceResultFuncFactory.GetResultFuncs());
|
var primitiveSets = ShowIsoFieldResult.GetPrimitiveSets(strainMatrix, ndms, ResultFuncFactory.GetResultFuncs());
|
||||||
isoFieldReport = new IsoFieldReport(primitiveSets);
|
isoFieldReport = new IsoFieldReport(primitiveSets);
|
||||||
isoFieldReport.Show();
|
isoFieldReport.Show();
|
||||||
}
|
}
|
||||||
@@ -429,6 +399,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
};
|
};
|
||||||
new ErrorMessage(vm).ShowDialog();
|
new ErrorMessage(vm).ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
private void GetNdms()
|
private void GetNdms()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
{
|
{
|
||||||
const string ForceUnitString = "kN";
|
const string ForceUnitString = "kN";
|
||||||
const string MomentUnitString = "kNm";
|
const string MomentUnitString = "kNm";
|
||||||
static IConvertUnitLogic operationLogic = new ConvertUnitLogic();
|
|
||||||
static IGetUnitLogic unitLogic = new GetUnitLogic();
|
|
||||||
public SurroundData SurroundData
|
public SurroundData SurroundData
|
||||||
{
|
{
|
||||||
get => surroundData; set
|
get => surroundData; set
|
||||||
@@ -48,8 +47,8 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
OnPropertyChanged(nameof(ZUnitLabel));
|
OnPropertyChanged(nameof(ZUnitLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IUnit unitForce = unitLogic.GetUnit(UnitTypes.Force, ForceUnitString);
|
private static readonly IUnit unitForce = CommonOperation.GetUnit(UnitTypes.Force, ForceUnitString);
|
||||||
private static IUnit unitMoment = unitLogic.GetUnit(UnitTypes.Moment, MomentUnitString);
|
private static readonly IUnit unitMoment = CommonOperation.GetUnit(UnitTypes.Moment, MomentUnitString);
|
||||||
private SurroundData surroundData;
|
private SurroundData surroundData;
|
||||||
|
|
||||||
public IValueConverter ForceConverter { get => new Force(); }
|
public IValueConverter ForceConverter { get => new Force(); }
|
||||||
@@ -158,7 +157,6 @@ namespace StructureHelper.Windows.CalculationWindows.CalculatorsViews.ForceCalcu
|
|||||||
{
|
{
|
||||||
var factor = GetFactor(SurroundData.ConvertLogicEntity.ZForceType);
|
var factor = GetFactor(SurroundData.ConvertLogicEntity.ZForceType);
|
||||||
SurroundData.ConstZ = value / factor;
|
SurroundData.ConstZ = value / factor;
|
||||||
SurroundData.ConvertLogicEntity.ConstDirectionValue = SurroundData.ConstZ;
|
|
||||||
OnPropertyChanged(nameof(ConstZ));
|
OnPropertyChanged(nameof(ConstZ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,29 +22,26 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
|||||||
private FlowDocument document;
|
private FlowDocument document;
|
||||||
private ICommand rebuildCommand;
|
private ICommand rebuildCommand;
|
||||||
private ICommand printDocumentCommand;
|
private ICommand printDocumentCommand;
|
||||||
private int priorityLimit;
|
private int maxPriority;
|
||||||
private int tabGap;
|
private int tabGap;
|
||||||
|
|
||||||
public FlowDocumentReader DocumentReader { get; set; }
|
public FlowDocumentReader DocumentReader { get; set; }
|
||||||
public int PriorityLimit
|
public int MaxPriority
|
||||||
{
|
{
|
||||||
get => priorityLimit; set
|
get => maxPriority; set
|
||||||
{
|
{
|
||||||
var oldValue = priorityLimit;
|
var oldValue = maxPriority;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
priorityLimit = Math.Max(value, 0);
|
maxPriority = Math.Max(value, 0);
|
||||||
OnPropertyChanged(nameof(PriorityLimit));
|
OnPropertyChanged(nameof(MaxPriority));
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
priorityLimit = oldValue;
|
maxPriority = oldValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int MaxPriority => loggerEntries.Max(x => x.Priority);
|
|
||||||
|
|
||||||
public int TabGap
|
public int TabGap
|
||||||
{
|
{
|
||||||
get => tabGap; set
|
get => tabGap; set
|
||||||
@@ -64,7 +61,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
|||||||
public TraceDocumentVM(IEnumerable<ITraceLoggerEntry> loggerEntries)
|
public TraceDocumentVM(IEnumerable<ITraceLoggerEntry> loggerEntries)
|
||||||
{
|
{
|
||||||
this.loggerEntries = loggerEntries;
|
this.loggerEntries = loggerEntries;
|
||||||
priorityLimit = 350;
|
maxPriority = 350;
|
||||||
tabGap = 30;
|
tabGap = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +81,7 @@ namespace StructureHelper.Windows.CalculationWindows.ProgressViews
|
|||||||
public void Prepare()
|
public void Prepare()
|
||||||
{
|
{
|
||||||
document = new();
|
document = new();
|
||||||
selectedLoggerEntries = loggerEntries.Where(x => x.Priority <= PriorityLimit);
|
selectedLoggerEntries = loggerEntries.Where(x => x.Priority <= MaxPriority);
|
||||||
var blocks = selectedLoggerEntries.Select(x => GetBlockByEntry(x));
|
var blocks = selectedLoggerEntries.Select(x => GetBlockByEntry(x));
|
||||||
document.Blocks.AddRange(blocks);
|
document.Blocks.AddRange(blocks);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.ProgressViews"
|
xmlns:local="clr-namespace:StructureHelper.Windows.CalculationWindows.ProgressViews"
|
||||||
d:DataContext="{d:DesignInstance local:TraceDocumentVM}"
|
d:DataContext="{d:DesignInstance local:TraceDocumentVM}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Trace Document Viewer" Height="450" Width="800" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen" ShowInTaskbar="False">
|
Title="Trace Document Viewer" Height="450" Width="800" MinHeight="400" MinWidth="600" WindowStartupLocation="CenterScreen">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="120"/>
|
<ColumnDefinition Width="90"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<FlowDocumentReader Name="DocumentReader" ViewingMode="Scroll"/>
|
<FlowDocumentReader Name="DocumentReader" ViewingMode="Scroll"/>
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel Grid.Column="1">
|
||||||
@@ -18,13 +18,7 @@
|
|||||||
<TextBox Text="{Binding TabGap, ValidatesOnExceptions=True}" />
|
<TextBox Text="{Binding TabGap, ValidatesOnExceptions=True}" />
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Header="Max priority">
|
<GroupBox Header="Max priority">
|
||||||
<StackPanel>
|
<TextBox Text="{Binding MaxPriority, ValidatesOnExceptions=True}" />
|
||||||
<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>
|
</GroupBox>
|
||||||
<Button Margin="3" Content="Rebuild" ToolTip="Rebuild document" Command="{Binding RebuildCommand}"/>
|
<Button Margin="3" Content="Rebuild" ToolTip="Rebuild document" Command="{Binding RebuildCommand}"/>
|
||||||
<Button Margin="3" Content="Print" ToolTip="Print document" Command="{Binding PrintDocumentCommand}"/>
|
<Button Margin="3" Content="Print" ToolTip="Print document" Command="{Binding PrintDocumentCommand}"/>
|
||||||
|
|||||||
@@ -1,88 +0,0 @@
|
|||||||
<UserControl x:Class="StructureHelper.Windows.Forces.ForceInterpolationControl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="200" d:DesignWidth="460">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="110"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition Width="120"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
|
||||||
<Viewbox>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Viewbox>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
|
||||||
<Viewbox.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Viewbox.RenderTransform>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
|
||||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
|
||||||
<Viewbox.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Viewbox.RenderTransform>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
using StructureHelper.Windows.UserControls;
|
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
|
||||||
using StructureHelperCommon.Services.Forces;
|
|
||||||
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.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Логика взаимодействия для ForceInterpolationControl.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ForceInterpolationControl : UserControl
|
|
||||||
{
|
|
||||||
private ForceTupleInterpolationViewModel? properties;
|
|
||||||
|
|
||||||
public ForceTupleInterpolationViewModel? Properties
|
|
||||||
{
|
|
||||||
get => properties; set
|
|
||||||
{
|
|
||||||
properties = value;
|
|
||||||
DataContext = Properties;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public ForceInterpolationControl()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StartValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var obj = (MultiplyDouble)sender;
|
|
||||||
var tmpTuple = ForceTupleService.MultiplyTuples(Properties.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
|
||||||
ForceTupleService.CopyProperties(tmpTuple, Properties.StartDesignForce.ForceTuple, 1d);
|
|
||||||
Properties.RefreshStartTuple();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void FinishValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var obj = (MultiplyDouble)sender;
|
|
||||||
var tmpTuple = ForceTupleService.MultiplyTuples(Properties.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
|
||||||
ForceTupleService.CopyProperties(tmpTuple, Properties.FinishDesignForce.ForceTuple, 1d);
|
|
||||||
Properties.RefreshFinishTuple();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void StepCountValueChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
var obj = (MultiplyDouble)sender;
|
|
||||||
var factor = obj.DoubleFactor;
|
|
||||||
if (factor > 0d)
|
|
||||||
{
|
|
||||||
Properties.StepCount = Convert.ToInt32(Properties.StepCount * factor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
26
StructureHelper/Windows/Forces/ForceTupleControl.xaml
Normal file
26
StructureHelper/Windows/Forces/ForceTupleControl.xaml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<UserControl x:Class="StructureHelper.Windows.Forces.ForceTupleControl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||||
|
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||||
|
<ColumnDefinition Width="Auto" MinWidth="70"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" MinHeight="20"/>
|
||||||
|
<RowDefinition Height="Auto" MinHeight="20"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock HorizontalAlignment="Center" Text="Mx"/>
|
||||||
|
<TextBlock HorizontalAlignment="Center" Grid.Column="1" Text="My"/>
|
||||||
|
<TextBlock HorizontalAlignment="Center" Grid.Column="2" Text="Nz"/>
|
||||||
|
<TextBox Grid.Row="1" Text=""/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" Text=""/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="2" Text=""/>
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
@@ -18,10 +18,9 @@ namespace StructureHelper.Windows.Forces
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Логика взаимодействия для ForceTupleControl.xaml
|
/// Логика взаимодействия для ForceTupleControl.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class ForceTupleInterpolationControl : UserControl
|
public partial class ForceTupleControl : UserControl
|
||||||
{
|
{
|
||||||
public ForceTupleInterpolationViewModel? Properties { get; set; }
|
public ForceTupleControl()
|
||||||
public ForceTupleInterpolationControl()
|
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
<UserControl x:Class="StructureHelper.Windows.Forces.ForceTupleInterpolationControl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="200" d:DesignWidth="460">
|
|
||||||
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="25"/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="110"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<ColumnDefinition Width="120"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
|
||||||
<Viewbox>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Viewbox>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
|
||||||
<Viewbox.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Viewbox.RenderTransform>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</StackPanel>
|
|
||||||
</Button>
|
|
||||||
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
|
||||||
<Viewbox RenderTransformOrigin="0.5,0.5">
|
|
||||||
<Viewbox.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<ScaleTransform/>
|
|
||||||
<SkewTransform/>
|
|
||||||
<RotateTransform Angle="180"/>
|
|
||||||
<TranslateTransform/>
|
|
||||||
</TransformGroup>
|
|
||||||
</Viewbox.RenderTransform>
|
|
||||||
<Canvas Width="24" Height="24">
|
|
||||||
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
|
||||||
</Canvas>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
|
||||||
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
|
||||||
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class ForceTupleInterpolationViewModel : ViewModelBase
|
|
||||||
{
|
|
||||||
private RelayCommand invertForcesCommand;
|
|
||||||
private RelayCommand copyToStartCommand;
|
|
||||||
private RelayCommand copyToFinishCommand;
|
|
||||||
private int stepCount;
|
|
||||||
private IDesignForceTuple startDesignForce;
|
|
||||||
private IDesignForceTuple finishDesignForce;
|
|
||||||
|
|
||||||
public IDesignForceTuple StartDesignForce
|
|
||||||
{
|
|
||||||
get => startDesignForce; set
|
|
||||||
{
|
|
||||||
startDesignForce = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public IDesignForceTuple FinishDesignForce
|
|
||||||
{
|
|
||||||
get => finishDesignForce; set
|
|
||||||
{
|
|
||||||
finishDesignForce = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double StartFactor { get; set; }
|
|
||||||
public double FinishFactor { get; set; }
|
|
||||||
public double StepCountFactor { get; set; }
|
|
||||||
|
|
||||||
public bool StepCountVisible { get; set; }
|
|
||||||
public double StartMx
|
|
||||||
{
|
|
||||||
get => StartDesignForce.ForceTuple.Mx;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
StartDesignForce.ForceTuple.Mx = value;
|
|
||||||
OnPropertyChanged(nameof(StartMx));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double StartMy
|
|
||||||
{
|
|
||||||
get => StartDesignForce.ForceTuple.My;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
StartDesignForce.ForceTuple.My = value;
|
|
||||||
OnPropertyChanged(nameof(StartMy));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double StartNz
|
|
||||||
{
|
|
||||||
get => StartDesignForce.ForceTuple.Nz;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
StartDesignForce.ForceTuple.Nz = value;
|
|
||||||
OnPropertyChanged(nameof(StartNz));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double FinishMx
|
|
||||||
{
|
|
||||||
get => FinishDesignForce.ForceTuple.Mx;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
FinishDesignForce.ForceTuple.Mx = value;
|
|
||||||
OnPropertyChanged(nameof(FinishMx));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double FinishMy
|
|
||||||
{
|
|
||||||
get => FinishDesignForce.ForceTuple.My;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
FinishDesignForce.ForceTuple.My = value;
|
|
||||||
OnPropertyChanged(nameof(FinishMy));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public double FinishNz
|
|
||||||
{
|
|
||||||
get => FinishDesignForce.ForceTuple.Nz;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
FinishDesignForce.ForceTuple.Nz = value;
|
|
||||||
OnPropertyChanged(nameof(FinishNz));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int StepCount
|
|
||||||
{
|
|
||||||
get => stepCount; set
|
|
||||||
{
|
|
||||||
stepCount = value;
|
|
||||||
OnPropertyChanged(nameof(StepCount));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommand InvertForcesCommand
|
|
||||||
{
|
|
||||||
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
|
|
||||||
}
|
|
||||||
public ICommand CopyToStartCommand
|
|
||||||
{
|
|
||||||
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
|
|
||||||
}
|
|
||||||
public ICommand CopyToFinishCommand
|
|
||||||
{
|
|
||||||
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
|
|
||||||
}
|
|
||||||
public InterpolateTuplesResult Result
|
|
||||||
{
|
|
||||||
get => new()
|
|
||||||
{
|
|
||||||
StartTuple = StartDesignForce,
|
|
||||||
FinishTuple = FinishDesignForce,
|
|
||||||
StepCount = StepCount
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InvertForces()
|
|
||||||
{
|
|
||||||
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
|
|
||||||
StartDesignForce = FinishDesignForce;
|
|
||||||
FinishDesignForce = tmpForce;
|
|
||||||
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(FinishDesignForce));
|
|
||||||
OnPropertyChanged(nameof(FinishMx));
|
|
||||||
OnPropertyChanged(nameof(FinishMy));
|
|
||||||
OnPropertyChanged(nameof(FinishNz));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RefreshStartTuple()
|
|
||||||
{
|
|
||||||
OnPropertyChanged(nameof(StartDesignForce));
|
|
||||||
OnPropertyChanged(nameof(StartMx));
|
|
||||||
OnPropertyChanged(nameof(StartMy));
|
|
||||||
OnPropertyChanged(nameof(StartNz));
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForceTupleInterpolationViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce = null, int stepCount = 100)
|
|
||||||
{
|
|
||||||
if (startDesignForce != null)
|
|
||||||
{
|
|
||||||
CheckDesignForces(finishDesignForce, startDesignForce);
|
|
||||||
StartDesignForce = startDesignForce;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GetNewDesignForce(finishDesignForce);
|
|
||||||
}
|
|
||||||
FinishDesignForce = finishDesignForce;
|
|
||||||
StepCount = stepCount;
|
|
||||||
StepCountVisible = true;
|
|
||||||
}
|
|
||||||
public ForceTupleInterpolationViewModel()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void CheckDesignForces(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce)
|
|
||||||
{
|
|
||||||
if (startDesignForce.LimitState != finishDesignForce.LimitState)
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
|
||||||
}
|
|
||||||
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm)
|
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void GetNewDesignForce(IDesignForceTuple finishDesignForce)
|
|
||||||
{
|
|
||||||
StartDesignForce = new DesignForceTuple()
|
|
||||||
{
|
|
||||||
CalcTerm = finishDesignForce.CalcTerm,
|
|
||||||
LimitState = finishDesignForce.LimitState,
|
|
||||||
ForceTuple = new ForceTuple()
|
|
||||||
{
|
|
||||||
Mx = 0,
|
|
||||||
My = 0,
|
|
||||||
Nz = 0
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
|
||||||
d:DataContext="{d:DesignInstance local:InterpolateTuplesViewModel}"
|
d:DataContext="{d:DesignInstance local:InterpolateTuplesViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Interpolate Combinations" Height="250" Width="460" MinHeight="250" MinWidth="460" WindowStartupLocation="CenterScreen">
|
Title="Interpolate Combinations" Height="200" Width="460" MinHeight="180" MinWidth="460" WindowStartupLocation="CenterScreen">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
@@ -20,7 +20,94 @@
|
|||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="40"/>
|
<RowDefinition Height="40"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<local:ForceInterpolationControl x:Name="InterpolationControl"/>
|
<Grid>
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="0"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="25"/>
|
||||||
|
<RowDefinition Height="40"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="110"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="120"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<TextBlock Grid.Column="1" Text="Moment Mx" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Column="2" Text="Moment My" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Column="3" Text="Force Nz" HorizontalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Row="1" Text="Start Combination"/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding StartMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="2" Text="{Binding StartMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding StartNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<Button Grid.Row="2" Grid.Column="1" Command="{Binding CopyToStartCommand}">
|
||||||
|
<Viewbox>
|
||||||
|
<Canvas Width="24" Height="24">
|
||||||
|
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||||
|
</Canvas>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
<Button Grid.Row="2" Grid.Column="2" Command="{Binding InvertForcesCommand}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Viewbox>
|
||||||
|
<Canvas Width="24" Height="24">
|
||||||
|
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||||
|
</Canvas>
|
||||||
|
</Viewbox>
|
||||||
|
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||||
|
<Viewbox.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform/>
|
||||||
|
<SkewTransform/>
|
||||||
|
<RotateTransform Angle="180"/>
|
||||||
|
<TranslateTransform/>
|
||||||
|
</TransformGroup>
|
||||||
|
</Viewbox.RenderTransform>
|
||||||
|
<Canvas Width="24" Height="24">
|
||||||
|
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||||
|
</Canvas>
|
||||||
|
</Viewbox>
|
||||||
|
</StackPanel>
|
||||||
|
</Button>
|
||||||
|
<Button Grid.Row="2" Grid.Column="3" Command="{Binding CopyToFinishCommand}">
|
||||||
|
<Viewbox RenderTransformOrigin="0.5,0.5">
|
||||||
|
<Viewbox.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform/>
|
||||||
|
<SkewTransform/>
|
||||||
|
<RotateTransform Angle="180"/>
|
||||||
|
<TranslateTransform/>
|
||||||
|
</TransformGroup>
|
||||||
|
</Viewbox.RenderTransform>
|
||||||
|
<Canvas Width="24" Height="24">
|
||||||
|
<Path Data="M12 0L5 12h 14z M12 12h 4v 9h-8v-9h 4z" Fill="Black"/>
|
||||||
|
</Canvas>
|
||||||
|
</Viewbox>
|
||||||
|
</Button>
|
||||||
|
<TextBlock Grid.Row="3" Text="Finish Combination"/>
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding FinishMx, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="2" Text="{Binding FinishMy, Converter={StaticResource MomentConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<TextBox Grid.Row="3" Grid.Column="3" Text="{Binding FinishNz, Converter={StaticResource ForceConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
<TextBlock Grid.Row="4" Text="Step count" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||||
|
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding StepCount, ValidatesOnExceptions=True}" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||||
|
<uc:MultiplyDouble Grid.Column="4" Grid.Row="1" DoubleFactor="{Binding StartFactor}" ValueChanged="StartValueChanged"/>
|
||||||
|
<uc:MultiplyDouble Grid.Column="4" Grid.Row="3" DoubleFactor="{Binding FinishFactor}" ValueChanged="FinishValueChanged"/>
|
||||||
|
<uc:MultiplyDouble Grid.Column="4" Grid.Row="4" DoubleFactor="{Binding FinishFactor}" ValueChanged="StepCountValueChanged" Visibility="{Binding StepCountVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Button Style="{StaticResource CancelButton}"/>
|
||||||
|
<Button Style="{StaticResource OkButton}" Click="Button_Click"/>
|
||||||
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -27,11 +27,9 @@ namespace StructureHelper.Windows.Forces
|
|||||||
InterpolateTuplesViewModel viewModel;
|
InterpolateTuplesViewModel viewModel;
|
||||||
public InterpolateTuplesView(InterpolateTuplesViewModel viewModel)
|
public InterpolateTuplesView(InterpolateTuplesViewModel viewModel)
|
||||||
{
|
{
|
||||||
this.viewModel = viewModel;
|
|
||||||
this.viewModel.ParentWindow = this;
|
|
||||||
DataContext = this.viewModel;
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
InterpolationControl.Properties = viewModel.ForceInterpolationViewModel;
|
this.viewModel = viewModel;
|
||||||
|
DataContext = this.viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_Click(object sender, RoutedEventArgs e)
|
private void Button_Click(object sender, RoutedEventArgs e)
|
||||||
@@ -39,5 +37,31 @@ namespace StructureHelper.Windows.Forces
|
|||||||
DialogResult = true;
|
DialogResult = true;
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void StartValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var obj = (MultiplyDouble)sender;
|
||||||
|
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.StartDesignForce.ForceTuple, obj.DoubleFactor);
|
||||||
|
ForceTupleService.CopyProperties(tmpTuple, viewModel.StartDesignForce.ForceTuple, 1d);
|
||||||
|
viewModel.RefreshStartTuple();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FinishValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var obj = (MultiplyDouble)sender;
|
||||||
|
var tmpTuple = ForceTupleService.MultiplyTuples(viewModel.FinishDesignForce.ForceTuple, obj.DoubleFactor);
|
||||||
|
ForceTupleService.CopyProperties(tmpTuple, viewModel.FinishDesignForce.ForceTuple, 1d);
|
||||||
|
viewModel.RefreshFinishTuple();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StepCountValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var obj = (MultiplyDouble)sender;
|
||||||
|
var factor = obj.DoubleFactor;
|
||||||
|
if (factor > 0d)
|
||||||
|
{
|
||||||
|
viewModel.StepCount = Convert.ToInt32(viewModel.StepCount * factor);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,11 +8,162 @@ namespace StructureHelper.Windows.Forces
|
|||||||
{
|
{
|
||||||
public class InterpolateTuplesViewModel : OkCancelViewModelBase
|
public class InterpolateTuplesViewModel : OkCancelViewModelBase
|
||||||
{
|
{
|
||||||
public ForceTupleInterpolationViewModel ForceInterpolationViewModel { get; set; }
|
private RelayCommand invertForcesCommand;
|
||||||
|
private RelayCommand copyToStartCommand;
|
||||||
|
private RelayCommand copyToFinishCommand;
|
||||||
|
private int stepCount;
|
||||||
|
|
||||||
|
public IDesignForceTuple StartDesignForce { get; set; }
|
||||||
|
public IDesignForceTuple FinishDesignForce { get; set; }
|
||||||
|
|
||||||
|
public double StartFactor { get; set; }
|
||||||
|
public double FinishFactor { get; set; }
|
||||||
|
public double StepCountFactor { get; set; }
|
||||||
|
|
||||||
|
public bool StepCountVisible { get; set; }
|
||||||
|
public double StartMx
|
||||||
|
{
|
||||||
|
get => StartDesignForce.ForceTuple.Mx;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
StartDesignForce.ForceTuple.Mx = value;
|
||||||
|
OnPropertyChanged(nameof(StartMx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double StartMy
|
||||||
|
{
|
||||||
|
get => StartDesignForce.ForceTuple.My;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
StartDesignForce.ForceTuple.My = value;
|
||||||
|
OnPropertyChanged(nameof(StartMy));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double StartNz
|
||||||
|
{
|
||||||
|
get => StartDesignForce.ForceTuple.Nz;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
StartDesignForce.ForceTuple.Nz = value;
|
||||||
|
OnPropertyChanged(nameof(StartNz));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double FinishMx
|
||||||
|
{
|
||||||
|
get => FinishDesignForce.ForceTuple.Mx;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FinishDesignForce.ForceTuple.Mx = value;
|
||||||
|
OnPropertyChanged(nameof(FinishMx));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double FinishMy
|
||||||
|
{
|
||||||
|
get => FinishDesignForce.ForceTuple.My;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FinishDesignForce.ForceTuple.My = value;
|
||||||
|
OnPropertyChanged(nameof(FinishMy));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public double FinishNz
|
||||||
|
{
|
||||||
|
get => FinishDesignForce.ForceTuple.Nz;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
FinishDesignForce.ForceTuple.Nz = value;
|
||||||
|
OnPropertyChanged(nameof(FinishNz));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int StepCount
|
||||||
|
{
|
||||||
|
get => stepCount; set
|
||||||
|
{
|
||||||
|
stepCount = value;
|
||||||
|
OnPropertyChanged(nameof(StepCount));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand InvertForcesCommand
|
||||||
|
{
|
||||||
|
get => invertForcesCommand ??= new RelayCommand(o => InvertForces());
|
||||||
|
}
|
||||||
|
public ICommand CopyToStartCommand
|
||||||
|
{
|
||||||
|
get => copyToStartCommand ??= new RelayCommand(o => CopyFinishToStart());
|
||||||
|
}
|
||||||
|
public ICommand CopyToFinishCommand
|
||||||
|
{
|
||||||
|
get => copyToFinishCommand ??= new RelayCommand(o => CopyStartToFinish());
|
||||||
|
}
|
||||||
|
public InterpolateTuplesResult Result
|
||||||
|
{
|
||||||
|
get => new()
|
||||||
|
{
|
||||||
|
StartTuple = StartDesignForce,
|
||||||
|
FinishTuple = FinishDesignForce,
|
||||||
|
StepCount = StepCount
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InvertForces()
|
||||||
|
{
|
||||||
|
var tmpForce = StartDesignForce.Clone() as IDesignForceTuple;
|
||||||
|
StartDesignForce = FinishDesignForce;
|
||||||
|
FinishDesignForce = tmpForce;
|
||||||
|
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(FinishDesignForce));
|
||||||
|
OnPropertyChanged(nameof(FinishMx));
|
||||||
|
OnPropertyChanged(nameof(FinishMy));
|
||||||
|
OnPropertyChanged(nameof(FinishNz));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RefreshStartTuple()
|
||||||
|
{
|
||||||
|
OnPropertyChanged(nameof(StartDesignForce));
|
||||||
|
OnPropertyChanged(nameof(StartMx));
|
||||||
|
OnPropertyChanged(nameof(StartMy));
|
||||||
|
OnPropertyChanged(nameof(StartNz));
|
||||||
|
}
|
||||||
|
|
||||||
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
|
public InterpolateTuplesViewModel(IDesignForceTuple finishDesignForce, IDesignForceTuple startDesignForce=null, int stepCount = 100)
|
||||||
{
|
{
|
||||||
ForceInterpolationViewModel = new(finishDesignForce, startDesignForce, stepCount);
|
if (startDesignForce !=null)
|
||||||
|
{
|
||||||
|
if (startDesignForce.LimitState != finishDesignForce.LimitState) throw new StructureHelperException(ErrorStrings.LimitStatesIsNotValid);
|
||||||
|
if (startDesignForce.CalcTerm != finishDesignForce.CalcTerm) throw new StructureHelperException(ErrorStrings.LoadTermIsNotValid);
|
||||||
|
StartDesignForce = startDesignForce;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StartDesignForce = new DesignForceTuple()
|
||||||
|
{
|
||||||
|
CalcTerm = finishDesignForce.CalcTerm,
|
||||||
|
LimitState = finishDesignForce.LimitState,
|
||||||
|
ForceTuple = new ForceTuple() { Mx = 0, My = 0, Nz = 0 },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
FinishDesignForce = finishDesignForce;
|
||||||
|
StepCount = stepCount;
|
||||||
|
StepCountVisible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using StructureHelperCommon.Models.Calculators;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class PointPrimitiveLogic : ViewModelBase
|
|
||||||
{
|
|
||||||
public SelectItemsVM<PrimitiveValuePoints> Collection { get; private set; }
|
|
||||||
public PointPrimitiveLogic(IEnumerable<PrimitiveBase> primitiveBases)
|
|
||||||
{
|
|
||||||
List<PrimitiveValuePoints> collection = new();
|
|
||||||
foreach (var item in primitiveBases)
|
|
||||||
{
|
|
||||||
var primitiveValuePoint = new PrimitiveValuePoints(item)
|
|
||||||
{
|
|
||||||
PrimitiveBase = item
|
|
||||||
};
|
|
||||||
collection.Add(primitiveValuePoint);
|
|
||||||
}
|
|
||||||
Collection = new SelectItemsVM<PrimitiveValuePoints>(collection);
|
|
||||||
Collection.InvertSelection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using StructureHelperCommon.Models.Parameters;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class PrimitiveValuePoints
|
|
||||||
{
|
|
||||||
public PrimitiveBase PrimitiveBase {get;set;}
|
|
||||||
public SelectItemsVM<INamedAreaPoint> ValuePoints { get; set; }
|
|
||||||
|
|
||||||
public PrimitiveValuePoints(PrimitiveBase primitiveBase)
|
|
||||||
{
|
|
||||||
var ndmPrimitive = primitiveBase.GetNdmPrimitive();
|
|
||||||
var pointCollection = ndmPrimitive.GetValuePoints();
|
|
||||||
ValuePoints = new SelectItemsVM<INamedAreaPoint>(pointCollection)
|
|
||||||
{
|
|
||||||
ShowButtons = false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelper.Services.ResultViewers;
|
|
||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class ValueDelegatesLogic : ViewModelBase
|
|
||||||
{
|
|
||||||
private readonly List<ForceResultFunc> resultFuncs;
|
|
||||||
public SelectItemsVM<ForceResultFunc> ResultFuncs { get; }
|
|
||||||
public ValueDelegatesLogic()
|
|
||||||
{
|
|
||||||
resultFuncs = new List<ForceResultFunc>();
|
|
||||||
resultFuncs.AddRange(ForceResultFuncFactory.GetResultFuncs(FuncsTypes.Full));
|
|
||||||
ResultFuncs = new SelectItemsVM<ForceResultFunc>(resultFuncs)
|
|
||||||
{
|
|
||||||
ShowButtons = true
|
|
||||||
};
|
|
||||||
ResultFuncs.InvertSelection();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<Window x:Class="StructureHelper.Windows.Forces.ValuePointsInterpolateView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.Forces"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DataContext="{d:DesignInstance local:ValuePointsInterpolateViewModel}"
|
|
||||||
Title="Value Points Interpolation" Height="250" Width="460" MinHeight="250" MinWidth="460" MaxHeight="450" MaxWidth="460" WindowStartupLocation="CenterScreen">
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition/>
|
|
||||||
<RowDefinition Height="40"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TabControl>
|
|
||||||
<TabItem Header="Forces">
|
|
||||||
<local:ForceInterpolationControl x:Name="InterpolationControl"/>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem Header="Points" DataContext="{Binding PrimitiveLogic}">
|
|
||||||
<ListBox DataContext="{Binding Collection}" ItemsSource="{Binding CollectionItems}">
|
|
||||||
<ListBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Expander IsExpanded="True">
|
|
||||||
<Expander.Header>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=ColoredItemTemplate}" Content="{Binding Item.PrimitiveBase}"/>
|
|
||||||
</Expander.Header>
|
|
||||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding Item.ValuePoints}" Width="400"/>
|
|
||||||
</Expander>
|
|
||||||
</DataTemplate>
|
|
||||||
</ListBox.ItemTemplate>
|
|
||||||
</ListBox>
|
|
||||||
</TabItem>
|
|
||||||
<TabItem DataContext="{Binding ValueDelegatesLogic}" Header="Values">
|
|
||||||
<ContentControl ContentTemplate="{StaticResource ResourceKey=SelectItems}" Content="{Binding ResultFuncs}"/>
|
|
||||||
</TabItem>
|
|
||||||
</TabControl>
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Логика взаимодействия для ValuePoitsInterpolateView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ValuePointsInterpolateView : Window
|
|
||||||
{
|
|
||||||
private ValuePointsInterpolateViewModel viewModel;
|
|
||||||
public ValuePointsInterpolateView(ValuePointsInterpolateViewModel viewModel)
|
|
||||||
{
|
|
||||||
this.viewModel = viewModel;
|
|
||||||
this.viewModel.ParentWindow = this;
|
|
||||||
this.DataContext = this.viewModel;
|
|
||||||
InitializeComponent();
|
|
||||||
InterpolationControl.Properties = viewModel.ForceInterpolationViewModel;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class ValuePointsInterpolateViewModel : OkCancelViewModelBase
|
|
||||||
{
|
|
||||||
private readonly ValuePointsInterpolationInputData inputData;
|
|
||||||
|
|
||||||
public ForceTupleInterpolationViewModel ForceInterpolationViewModel { get; private set; }
|
|
||||||
public PointPrimitiveLogic PrimitiveLogic { get; private set; }
|
|
||||||
public ValueDelegatesLogic ValueDelegatesLogic { get; set; }
|
|
||||||
public ValuePointsInterpolateViewModel(ValuePointsInterpolationInputData inputData)
|
|
||||||
{
|
|
||||||
this.inputData = inputData;
|
|
||||||
ForceInterpolationViewModel = new(this.inputData.FinishDesignForce, this.inputData.StartDesignForce, this.inputData.StepCount);
|
|
||||||
PrimitiveLogic = new PointPrimitiveLogic(inputData.PrimitiveBases);
|
|
||||||
ValueDelegatesLogic = new();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
|
||||||
using StructureHelperCommon.Models.Forces;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.Forces
|
|
||||||
{
|
|
||||||
public class ValuePointsInterpolationInputData
|
|
||||||
{
|
|
||||||
public IDesignForceTuple FinishDesignForce { get; set; }
|
|
||||||
public IDesignForceTuple StartDesignForce { get; set; }
|
|
||||||
public int StepCount { get; set; }
|
|
||||||
public List<PrimitiveBase> PrimitiveBases { get; private set; }
|
|
||||||
public LimitStates LimitState { get; set; }
|
|
||||||
public CalcTerms CalcTerm { get; set; }
|
|
||||||
|
|
||||||
public ValuePointsInterpolationInputData()
|
|
||||||
{
|
|
||||||
PrimitiveBases = new List<PrimitiveBase>();
|
|
||||||
StepCount = 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -18,9 +18,8 @@
|
|||||||
</ToolBarTray>-->
|
</ToolBarTray>-->
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition MinWidth="250"/>
|
<ColumnDefinition Width="250"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="5*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
@@ -32,7 +31,7 @@
|
|||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Expander Header="{Binding Name}" IsExpanded="True" Background="{Binding Color}">
|
<Expander Header="{Binding Name}" IsExpanded="True" Background="{Binding Color}">
|
||||||
<Grid HorizontalAlignment="Stretch">
|
<Grid >
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="70"/>
|
<RowDefinition Height="70"/>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
@@ -82,8 +81,7 @@
|
|||||||
<Button Margin="3" Content="Draw Lines" ToolTip="Draw Lines" Command="{Binding RedrawLinesCommand}"/>
|
<Button Margin="3" Content="Draw Lines" ToolTip="Draw Lines" Command="{Binding RedrawLinesCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<GridSplitter Grid.Column="1" Width="3" VerticalAlignment="Stretch" HorizontalAlignment="Center" ShowsPreview="False"/>
|
<lvc:CartesianChart Name="MainChart" Grid.Column="1" Series="{Binding SeriesCollection}" LegendLocation="Bottom" Zoom="Xy">
|
||||||
<lvc:CartesianChart Name="MainChart" Grid.Column="2" Series="{Binding SeriesCollection}" LegendLocation="Bottom" Zoom="Xy">
|
|
||||||
<lvc:CartesianChart.AxisY>
|
<lvc:CartesianChart.AxisY>
|
||||||
<lvc:Axis Title="y-value"></lvc:Axis>
|
<lvc:Axis Title="y-value"></lvc:Axis>
|
||||||
</lvc:CartesianChart.AxisY>
|
</lvc:CartesianChart.AxisY>
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelper.Windows.ViewModels;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.MainWindow
|
|
||||||
{
|
|
||||||
public class AxisCanvasVM : OkCancelViewModelBase, IRectangleShape
|
|
||||||
{
|
|
||||||
private double axisLineThickness;
|
|
||||||
private double gridLineThickness;
|
|
||||||
private double gridSize;
|
|
||||||
private double width;
|
|
||||||
private double height;
|
|
||||||
private Color xAxisColor;
|
|
||||||
private Color yAxisColor;
|
|
||||||
private Color gridColor;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Thickness of x-, and y- axis line
|
|
||||||
/// </summary>
|
|
||||||
public double AxisLineThickness
|
|
||||||
{
|
|
||||||
get => axisLineThickness;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
axisLineThickness = value;
|
|
||||||
OnPropertyChanged(nameof(AxisLineThickness));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Thickness of lines of coordinate mesh
|
|
||||||
/// </summary>
|
|
||||||
public double GridLineThickness
|
|
||||||
{
|
|
||||||
get => gridLineThickness;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
gridLineThickness = value;
|
|
||||||
OnPropertyChanged(nameof(GridLineThickness));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Size of coordinate mesh
|
|
||||||
/// </summary>
|
|
||||||
public double GridSize
|
|
||||||
{
|
|
||||||
get => gridSize; set
|
|
||||||
{
|
|
||||||
gridSize = value;
|
|
||||||
OnPropertyChanged(nameof(GridSize));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Width of work plane
|
|
||||||
/// </summary>
|
|
||||||
public double Width
|
|
||||||
{
|
|
||||||
get => width; set
|
|
||||||
{
|
|
||||||
width = value;
|
|
||||||
OnPropertyChanged(nameof(Width));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Height of work plane
|
|
||||||
/// </summary>
|
|
||||||
public double Height
|
|
||||||
{
|
|
||||||
get => height; set
|
|
||||||
{
|
|
||||||
height = value;
|
|
||||||
OnPropertyChanged(nameof(Height));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double Angle { get; set; }
|
|
||||||
|
|
||||||
public Color XAxisColor
|
|
||||||
{
|
|
||||||
get => xAxisColor; set
|
|
||||||
{
|
|
||||||
xAxisColor = value;
|
|
||||||
OnPropertyChanged(nameof(XAxisColor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public Color YAxisColor
|
|
||||||
{
|
|
||||||
get => yAxisColor; set
|
|
||||||
{
|
|
||||||
yAxisColor = value;
|
|
||||||
OnPropertyChanged(nameof(YAxisColor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Color GridColor
|
|
||||||
{
|
|
||||||
get => gridColor; set
|
|
||||||
{
|
|
||||||
gridColor = value;
|
|
||||||
OnPropertyChanged(nameof(GridColor));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public AxisCanvasVM()
|
|
||||||
{
|
|
||||||
AxisLineThickness = 2d;
|
|
||||||
GridLineThickness = 0.25d;
|
|
||||||
GridSize = 0.05d;
|
|
||||||
Width = 1.2d;
|
|
||||||
Height = 1.2d;
|
|
||||||
XAxisColor = Colors.Red;
|
|
||||||
YAxisColor = Colors.ForestGreen;
|
|
||||||
GridColor = Colors.DarkGray;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
using Autofac.Features.Metadata;
|
|
||||||
using StructureHelper.Infrastructure;
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
|
||||||
using StructureHelperCommon.Models.Shapes;
|
|
||||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
|
||||||
using System;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace StructureHelper.Windows.MainWindow
|
|
||||||
{
|
|
||||||
public class CrossSectionVisualPropertyVM : ViewModelBase
|
|
||||||
{
|
|
||||||
private double scaleValue;
|
|
||||||
private ICommand previewMouseMove;
|
|
||||||
private double delta = 0.0005;
|
|
||||||
private readonly double scaleRate = 1.1d;
|
|
||||||
|
|
||||||
public AxisCanvasVM AxisCanvasVM { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Thickness of x-, and y- axis line
|
|
||||||
/// </summary>
|
|
||||||
public double AxisLineThickness => AxisCanvasVM.AxisLineThickness / scaleValue;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Thickness of lines of coordinate mesh
|
|
||||||
/// </summary>
|
|
||||||
public double GridLineThickness => AxisCanvasVM.GridLineThickness / scaleValue;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Size of coordinate mesh
|
|
||||||
/// </summary>
|
|
||||||
public double GridSize => AxisCanvasVM.GridSize;
|
|
||||||
/// <summary>
|
|
||||||
/// Width of work plane
|
|
||||||
/// </summary>
|
|
||||||
public double Width => AxisCanvasVM.Width;
|
|
||||||
/// <summary>
|
|
||||||
/// Height of work plane
|
|
||||||
/// </summary>
|
|
||||||
public double Height => AxisCanvasVM.Height;
|
|
||||||
public double HalfOfWidth => AxisCanvasVM.Width / 2d;
|
|
||||||
public double HalfOfHeight => AxisCanvasVM.Height / 2d;
|
|
||||||
|
|
||||||
public string CanvasViewportSize
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string s = GridSize.ToString();
|
|
||||||
s = s.Replace(',', '.');
|
|
||||||
return $"0,0,{s},{s}";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public double ScaleValue
|
|
||||||
{
|
|
||||||
get => Math.Round(scaleValue);
|
|
||||||
set
|
|
||||||
{
|
|
||||||
OnPropertyChanged(value, ref scaleValue);
|
|
||||||
OnPropertyChanged(nameof(AxisLineThickness));
|
|
||||||
OnPropertyChanged(nameof(GridLineThickness));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommand PreviewMouseMove
|
|
||||||
{
|
|
||||||
get => previewMouseMove ??= new RelayCommand(o => PreviewMouseMoveMethod(o));
|
|
||||||
}
|
|
||||||
private void PreviewMouseMoveMethod(object o)
|
|
||||||
{
|
|
||||||
if (o is RectangleViewPrimitive rect && rect.BorderCaptured && !rect.ElementLock)
|
|
||||||
{
|
|
||||||
if (rect.PrimitiveWidth % 10d < delta || rect.PrimitiveWidth % 10d >= delta)
|
|
||||||
rect.PrimitiveWidth = Math.Round(PanelX / 10d) * 10d - rect.PrimitiveLeft + 10d;
|
|
||||||
else
|
|
||||||
rect.PrimitiveWidth = PanelX - rect.PrimitiveLeft + 10d;
|
|
||||||
|
|
||||||
if (rect.PrimitiveHeight % 10d < delta || rect.PrimitiveHeight % 10d >= delta)
|
|
||||||
rect.PrimitiveHeight = Math.Round(PanelY / 10d) * 10d - rect.PrimitiveTop + 10d;
|
|
||||||
else
|
|
||||||
rect.PrimitiveHeight = PanelY - rect.PrimitiveTop + 10d;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Brush XAxisColorBrush => new SolidColorBrush(AxisCanvasVM.XAxisColor);
|
|
||||||
public Brush YAxisColorBrush => new SolidColorBrush(AxisCanvasVM.YAxisColor);
|
|
||||||
public Brush GridColorBrush => new SolidColorBrush(AxisCanvasVM.GridColor);
|
|
||||||
|
|
||||||
internal void Refresh()
|
|
||||||
{
|
|
||||||
OnPropertyChanged(nameof(Width));
|
|
||||||
OnPropertyChanged(nameof(Height));
|
|
||||||
OnPropertyChanged(nameof(HalfOfWidth));
|
|
||||||
OnPropertyChanged(nameof(HalfOfHeight));
|
|
||||||
OnPropertyChanged(nameof(GridSize));
|
|
||||||
OnPropertyChanged(nameof(AxisLineThickness));
|
|
||||||
OnPropertyChanged(nameof(GridLineThickness));
|
|
||||||
OnPropertyChanged(nameof(CanvasViewportSize));
|
|
||||||
OnPropertyChanged(nameof(XAxisColorBrush));
|
|
||||||
OnPropertyChanged(nameof(YAxisColorBrush));
|
|
||||||
OnPropertyChanged(nameof(GridColorBrush));
|
|
||||||
}
|
|
||||||
|
|
||||||
private double panelX, panelY, scrollPanelX, scrollPanelY;
|
|
||||||
private ICommand scaleCanvasDown;
|
|
||||||
private ICommand scaleCanvasUp;
|
|
||||||
|
|
||||||
public double PanelX
|
|
||||||
{
|
|
||||||
get => panelX;
|
|
||||||
set => OnPropertyChanged(value, ref panelX);
|
|
||||||
}
|
|
||||||
public double PanelY
|
|
||||||
{
|
|
||||||
get => panelY;
|
|
||||||
set => OnPropertyChanged(value, ref panelY);
|
|
||||||
}
|
|
||||||
public double ScrollPanelX
|
|
||||||
{
|
|
||||||
get => scrollPanelX;
|
|
||||||
set => OnPropertyChanged(value, ref scrollPanelX);
|
|
||||||
}
|
|
||||||
public double ScrollPanelY
|
|
||||||
{
|
|
||||||
get => scrollPanelY;
|
|
||||||
set => OnPropertyChanged(value, ref scrollPanelY);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ICommand ScaleCanvasDown => scaleCanvasDown ??= new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
ScrollPanelX = PanelX;
|
|
||||||
ScrollPanelY = PanelY;
|
|
||||||
ScaleValue *= scaleRate;
|
|
||||||
});
|
|
||||||
public ICommand ScaleCanvasUp => scaleCanvasUp ??= new RelayCommand(o =>
|
|
||||||
{
|
|
||||||
ScrollPanelX = PanelX;
|
|
||||||
ScrollPanelY = PanelY;
|
|
||||||
ScaleValue /= scaleRate;
|
|
||||||
});
|
|
||||||
|
|
||||||
public CrossSectionViewModel ParentViewModel { get; set; }
|
|
||||||
|
|
||||||
public CrossSectionVisualPropertyVM()
|
|
||||||
{
|
|
||||||
AxisCanvasVM = new();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using LoaderCalculator;
|
using LoaderCalculator;
|
||||||
using LoaderCalculator.Data.Materials.MaterialBuilders;
|
|
||||||
using LoaderCalculator.Data.Matrix;
|
using LoaderCalculator.Data.Matrix;
|
||||||
using LoaderCalculator.Data.Ndms;
|
using LoaderCalculator.Data.Ndms;
|
||||||
using LoaderCalculator.Data.ResultData;
|
using LoaderCalculator.Data.ResultData;
|
||||||
@@ -10,7 +9,6 @@ using StructureHelper.Services.Primitives;
|
|||||||
using StructureHelper.UnitSystem;
|
using StructureHelper.UnitSystem;
|
||||||
using StructureHelper.UnitSystem.Systems;
|
using StructureHelper.UnitSystem.Systems;
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Models;
|
|
||||||
using StructureHelperCommon.Services.Units;
|
using StructureHelperCommon.Services.Units;
|
||||||
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
using StructureHelperLogics.Models.Calculations.CalculationProperties;
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
@@ -28,8 +26,6 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
public class CrossSectionModel
|
public class CrossSectionModel
|
||||||
{
|
{
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
|
||||||
|
|
||||||
public ICrossSection Section { get; private set; }
|
public ICrossSection Section { get; private set; }
|
||||||
private IPrimitiveRepository primitiveRepository;
|
private IPrimitiveRepository primitiveRepository;
|
||||||
public IHeadMaterialRepository HeadMaterialRepository { get; }
|
public IHeadMaterialRepository HeadMaterialRepository { get; }
|
||||||
@@ -56,13 +52,7 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
public IEnumerable<INdm> GetNdms(ICalculationProperty calculationProperty)
|
public IEnumerable<INdm> GetNdms(ICalculationProperty calculationProperty)
|
||||||
{
|
{
|
||||||
var ndmPrimitives = Section.SectionRepository.Primitives;
|
var ndmPrimitives = Section.SectionRepository.Primitives;
|
||||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
return NdmPrimitivesService.GetNdms(ndmPrimitives, calculationProperty.LimitState, calculationProperty.CalcTerm);
|
||||||
{
|
|
||||||
Primitives = ndmPrimitives,
|
|
||||||
LimitState = calculationProperty.LimitState,
|
|
||||||
CalcTerm = calculationProperty.CalcTerm
|
|
||||||
};
|
|
||||||
return triangulateLogic.GetNdms();
|
|
||||||
////Настройки триангуляции, пока опции могут быть только такие
|
////Настройки триангуляции, пока опции могут быть только такие
|
||||||
//ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
//ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
||||||
|
|
||||||
|
|||||||
@@ -27,75 +27,73 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||||
<ContextMenu x:Key="EditCopyDelete">
|
<ContextMenu x:Key="EditCopyDelete">
|
||||||
<MenuItem Header="Edit" Command="{Binding Edit}">
|
<MenuItem Header="{DynamicResource Edit}" Command="{Binding Edit}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}">
|
<MenuItem Header="{DynamicResource Copy}" Command="{Binding Copy}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}">
|
<MenuItem Header="{DynamicResource Delete}" Command="{Binding Delete}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
<ContextMenu x:Key="PrimitiveCRUD">
|
<ContextMenu x:Key="PrimitiveCRUD">
|
||||||
<MenuItem Header="Edit" Command="{Binding Edit}">
|
<MenuItem Header="{DynamicResource Edit}" Command="{Binding Edit}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}">
|
<MenuItem Header="{DynamicResource Copy}" Command="{Binding Copy}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy To" Command="{Binding CopyTo}">
|
<MenuItem Header="{DynamicResource Copy To}" Command="{Binding CopyTo}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}">
|
<MenuItem Header="{DynamicResource Delete}" Command="{Binding Delete}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<MenuItem Header="To Foreground" Command="{Binding SetToFront}">
|
<MenuItem Header="{DynamicResource To Foreground}" Command="{Binding SetToFront}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToForeground.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToForeground.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="To Background" Command="{Binding SetToBack}">
|
<MenuItem Header="{DynamicResource To Background}" Command="{Binding SetToBack}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToBackground.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToBackground.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
<ContextMenu x:Key="AnalisesCRUD">
|
<ContextMenu x:Key="AnalisesCRUD">
|
||||||
<MenuItem Header="Run" Command="{Binding Run}">
|
<MenuItem Header="{DynamicResource Run}" Command="{Binding Run}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Viewbox Width="16" Height="16">
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Run.png" />
|
||||||
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<MenuItem Header="Edit" Command="{Binding Edit}">
|
<MenuItem Header="{DynamicResource Edit}" Command="{Binding Edit}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Copy" Command="{Binding Copy}">
|
<MenuItem Header="{DynamicResource Copy}" Command="{Binding Copy}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Delete" Command="{Binding Delete}">
|
<MenuItem Header="{DynamicResource Delete}" Command="{Binding Delete}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@@ -138,86 +136,76 @@
|
|||||||
<Button Style="{StaticResource ToolButton}"
|
<Button Style="{StaticResource ToolButton}"
|
||||||
Command="{Binding Add}"
|
Command="{Binding Add}"
|
||||||
CommandParameter="{x:Static enums:ActionType.ForceCombination}"
|
CommandParameter="{x:Static enums:ActionType.ForceCombination}"
|
||||||
Content="Full" ToolTip="Add Full Combination"/>
|
Content="{DynamicResource Full}" ToolTip="{DynamicResource Add Full Combination}"/>
|
||||||
<Button Style="{StaticResource ToolButton}"
|
<Button Style="{StaticResource ToolButton}"
|
||||||
Command="{Binding Add}"
|
Command="{Binding Add}"
|
||||||
CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"
|
CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"
|
||||||
Content="Fact" ToolTip="Add Factored Combination"/>
|
Content="{DynamicResource Fact}" ToolTip="{DynamicResource Add Factored Combination}"/>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar DataContext="{Binding MaterialsLogic}" ToolTip="Materials">
|
<ToolBar DataContext="{Binding MaterialsLogic}" ToolTip="{DynamicResource Materials}">
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}" ToolTip="{DynamicResource Add Concrete}">
|
||||||
<Image Source="/Windows/MainWindow/ConMaterial32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/ConMaterial32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}" ToolTip="Add Reinforcement Material">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}" ToolTip="{DynamicResource Add Reinforcement Material}">
|
||||||
<Image Source="/Windows/MainWindow/RFMaterial32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/RFMaterial32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}" ToolTip="Add Elastic Material">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}" ToolTip="{DynamicResource Add Elastic Material}">
|
||||||
<Image Source="/Windows/MainWindow/ElasticMaterial32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/ElasticMaterial32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}" ToolTip="Add Carbon Fiber Material">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}" ToolTip="{DynamicResource Add Carbon Fiber Material}">
|
||||||
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/СarbonMaterial32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/СarbonMaterial32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}" ToolTip="Add Glass Fiber Material">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}" ToolTip="{DynamicResource Add Glass Fiber Material}">
|
||||||
<Image Source="/Windows/MainWindow/GlassMaterial32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/GlassMaterial32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding EditMaterialsCommand}" ToolTip="Show Materials">
|
<Button Command="{Binding EditMaterialsCommand}" ToolTip="Show Materials">
|
||||||
<Image Source="/Windows/MainWindow/Materials32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Materials32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar ToolTip="Base Primitives" DataContext="{Binding PrimitiveLogic}">
|
<ToolBar ToolTip="Base Primitives" DataContext="{Binding PrimitiveLogic}">
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}" ToolTip="Add Rectangle Primitive">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}" ToolTip="{DynamicResource Add Rectangle Primitive}">
|
||||||
<Image Source="/Windows/MainWindow/Rectangle32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Rectangle32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}" ToolTip="Add Circle Primitive">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}" ToolTip="{DynamicResource Add Circle Primitive}">
|
||||||
<Image Source="/Windows/MainWindow/Circle32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Circle32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}" ToolTip="Add Rebar Primitive">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}" ToolTip="{DynamicResource Add Rebar Primitive}">
|
||||||
<Image Source="/Windows/MainWindow/Rebar32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Rebar32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}" ToolTip="Add Point Primitive">
|
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}" ToolTip="{DynamicResource Add Point Primitive}">
|
||||||
<Image Source="/Windows/MainWindow/Point32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Point32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar ToolTip="RC Templates">
|
<ToolBar ToolTip="RC Templates">
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding AddColumnCase}" ToolTip="Add Rectangle RC Column">
|
<Button Command="{Binding AddColumnCase}" ToolTip="{DynamicResource Add Rectangle RC Column}">
|
||||||
<Image Source="/Windows/MainWindow/RectangleColumn32.png"/>
|
<Image Width="32" Height="32" Source="/Windows/MainWindow/RectangleColumn32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding AddRCCircleCase}" ToolTip="Add Circle RC Column">
|
<Button Command="{Binding AddRCCircleCase}" ToolTip="{DynamicResource Add Circle RC Column}">
|
||||||
<Image Source="/Windows/MainWindow/CircleColumn32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/CircleColumn32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding AddBeamCase}" ToolTip="Add RC Beam">
|
<Button Command="{Binding AddBeamCase}" ToolTip="{DynamicResource Add RC Beam}">
|
||||||
<Image Source="/Windows/MainWindow/Beam32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Beam32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding AddSlabCase}" ToolTip="Add RC Slab">
|
<Button Command="{Binding AddSlabCase}" ToolTip="{DynamicResource Add RC Slab}">
|
||||||
<Image Source="/Windows/MainWindow/Slab32.png"/>
|
<Image Width="32" Height="32" Source="/Windows/MainWindow/Slab32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar ToolTip="Analises" DataContext="{Binding CalculatorsLogic}">
|
<ToolBar ToolTip="{DynamicResource Analises}" DataContext="{Binding CalculatorsLogic}">
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}" ToolTip="Add Force Calculator">
|
<Button Command="{Binding Add}" ToolTip="{DynamicResource Add Force Calculator}">
|
||||||
<Image Source="/Windows/MainWindow/Calculator32.png"/>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Calculator32.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}" ToolTip="Add Interaction Diagram Calculator">
|
<Button Command="{Binding Run}" ToolTip="{DynamicResource Run Calculations}">
|
||||||
<Viewbox>
|
<Image Style="{StaticResource ButtonImage32}" Source="/Windows/MainWindow/Analysis32.png"/>
|
||||||
<ContentControl ContentTemplate="{DynamicResource DiagramCalculator}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.CrackCalculator}" ToolTip="Add Crack Calculator">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource CrackCalculator}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
|
||||||
<Button Style="{DynamicResource ToolButton}" Command="{Binding Run}" ToolTip="Run Calculations">
|
|
||||||
<Viewbox>
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource CalculatorRun}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
<ToolBar ToolTip="Tools">
|
<ToolBar ToolTip="{DynamicResource Tools}">
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding MovePrimitiveToGravityCenterCommand}" ToolTip="Move All Primitives to Gravity Center">
|
<Button Command="{Binding MovePrimitiveToGravityCenterCommand}" ToolTip="{DynamicResource Move All Primitives to Gravity Center}">
|
||||||
<Image Source="/Windows/MainWindow/MovePrimitivesToCenter.png"/>
|
<Image Width="32" Height="32" Source="/Windows/MainWindow/MovePrimitivesToCenter.png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource ToolButton}" Command="{Binding ShowVisualProperty}" ToolTip="Visual Settings">
|
<Button Command="{Binding ShowVisualProperty}" ToolTip="{DynamicResource Visual Settings}">
|
||||||
<Image Source="/Windows/MainWindow/Tools_Settings.png"/>
|
<Image Width="32" Height="32" Source="/Windows/MainWindow/Tools_Settings.png"/>
|
||||||
|
</Button>
|
||||||
|
<Button Command="{Binding ChangeLanguage}" ToolTip="{DynamicResource Change Language}" Content="{DynamicResource RU_EN}">
|
||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</ToolBarTray>
|
</ToolBarTray>
|
||||||
@@ -236,12 +224,12 @@
|
|||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
|
<Expander Header="{DynamicResource Actions}" MinWidth="20" DataContext="{Binding CombinationsLogic}">
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Add">
|
<MenuItem Header="{DynamicResource Add}">
|
||||||
<Button Content="Combination" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/>
|
<Button Content="{DynamicResource Combination}" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/>
|
||||||
<Button Content="Combination By Factors" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/>
|
<Button Content="{DynamicResource Combination By Factors}" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</Expander.ContextMenu>
|
</Expander.ContextMenu>
|
||||||
@@ -259,38 +247,38 @@
|
|||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Materials32.png"/>
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Materials32.png"/>
|
||||||
<TextBlock Text="Materials" Margin="5,0,0,0"/>
|
<TextBlock Text="{DynamicResource Materials}" Margin="5,0,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Materials" Command="{Binding EditMaterialsCommand}">
|
<MenuItem Header="{DynamicResource Materials}" Command="{Binding EditMaterialsCommand}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Materials32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Materials32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add">
|
<MenuItem Header="{DynamicResource Add}">
|
||||||
<MenuItem Header="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}">
|
<MenuItem Header="{DynamicResource Concrete}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/ConMaterial32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/ConMaterial32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}">
|
<MenuItem Header="{DynamicResource Reinforcement}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/RFMaterial32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/RFMaterial32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}">
|
<MenuItem Header="{DynamicResource Elastic}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/ElasticMaterial32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/ElasticMaterial32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="CarbonFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}">
|
<MenuItem Header="{DynamicResource CarbonFiber}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/СarbonMaterial32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/СarbonMaterial32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="GlassFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}">
|
<MenuItem Header="{DynamicResource GlassFiber}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/GlassMaterial32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/GlassMaterial32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@@ -303,26 +291,26 @@
|
|||||||
ItemTemplate="{StaticResource ColoredItemTemplate}"
|
ItemTemplate="{StaticResource ColoredItemTemplate}"
|
||||||
ContextMenu="{StaticResource EditCopyDelete}"/>
|
ContextMenu="{StaticResource EditCopyDelete}"/>
|
||||||
</Expander>
|
</Expander>
|
||||||
<Expander Header="Geometry" MinWidth="20">
|
<Expander Header="{DynamicResource Geometry}" MinWidth="20">
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Add" DataContext="{Binding PrimitiveLogic}">
|
<MenuItem Header="{DynamicResource Add}" DataContext="{Binding PrimitiveLogic}">
|
||||||
<MenuItem Header="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
|
<MenuItem Header="{DynamicResource Rectangle}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rectangle32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rectangle32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
|
<MenuItem Header="{DynamicResource Circle}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Circle32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Circle32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
|
<MenuItem Header="{DynamicResource Rebar}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rebar32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rebar32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
|
<MenuItem Header="{DynamicResource Point}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Point32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Point32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@@ -339,12 +327,12 @@
|
|||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Analysis32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Analysis32.png" />
|
||||||
<TextBlock Text="Analisis" Margin="5,0,0,0"/>
|
<TextBlock Text="{DynamicResource Analisis}" Margin="5,0,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<Expander.ContextMenu>
|
<Expander.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Add" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
<MenuItem Header="{DynamicResource Add}" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
||||||
<MenuItem Header="Add Force Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
<MenuItem Header="Add Force Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.ForceCalculator}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
||||||
@@ -352,16 +340,7 @@
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add Interaction Diagram Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}">
|
<MenuItem Header="Add Interaction Diagram Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.LimitCurveCalculator}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Viewbox Width="16" Height="16">
|
<Image Width="16" Height="16" Source="/Windows/MainWindow/Calculator32.png" />
|
||||||
<ContentControl ContentTemplate="{DynamicResource DiagramCalculator}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</MenuItem.Icon>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Add Crack Calculator" Command="{Binding Add}" CommandParameter="{x:Static enums:CalculatorTypes.CrackCalculator}">
|
|
||||||
<MenuItem.Icon>
|
|
||||||
<Viewbox Width="16" Height="16">
|
|
||||||
<ContentControl ContentTemplate="{DynamicResource CrackCalculator}"/>
|
|
||||||
</Viewbox>
|
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
@@ -385,55 +364,49 @@
|
|||||||
<i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/>
|
<i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/>
|
||||||
</i:EventTrigger>
|
</i:EventTrigger>
|
||||||
</i:Interaction.Triggers>
|
</i:Interaction.Triggers>
|
||||||
<ScrollViewer
|
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
|
||||||
DataContext="{Binding VisualProperty}"
|
<Canvas Name="WorkPlane" ClipToBounds="True" Width="{Binding VisualProperty.WorkPlainWidth}" Height="{Binding VisualProperty.WorkPlainHeight}">
|
||||||
VerticalScrollBarVisibility="Visible"
|
|
||||||
HorizontalScrollBarVisibility="Visible">
|
|
||||||
<Canvas Name="WorkPlane"
|
|
||||||
ClipToBounds="True"
|
|
||||||
Width="{Binding Width}"
|
|
||||||
Height="{Binding Height}">
|
|
||||||
<Canvas.ContextMenu>
|
<Canvas.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
<MenuItem Header="Add" DataContext="{Binding ParentViewModel.PrimitiveLogic}">
|
<MenuItem Header="{DynamicResource Add}" DataContext="{Binding PrimitiveLogic}">
|
||||||
<MenuItem Header="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
|
<MenuItem Header="{DynamicResource Rectangle}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rectangle32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rectangle32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
|
<MenuItem Header="{DynamicResource Circle}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Circle32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Circle32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
|
<MenuItem Header="{DynamicResource Rebar}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rebar32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Rebar32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
|
<MenuItem Header="{DynamicResource Point}" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Point.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Point.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Templates" DataContext="{Binding ParentViewModel}">
|
<MenuItem Header="{DynamicResource Templates}" DataContext="{Binding}">
|
||||||
<MenuItem Header="Add Rectangle RC Column" Command="{Binding AddColumnCase}">
|
<MenuItem Header="{DynamicResource Add Rectangle RC Column}" Command="{Binding AddColumnCase}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/RectangleColumn32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/RectangleColumn32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add Circle RC Column" Command="{Binding AddRCCircleCase}">
|
<MenuItem Header="{DynamicResource Add Circle RC Column}" Command="{Binding AddRCCircleCase}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/CircleColumn32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/CircleColumn32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add RC Beam" Command="{Binding AddBeamCase}">
|
<MenuItem Header="{DynamicResource Add RC Beam}" Command="{Binding AddBeamCase}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Beam32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Beam32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="Add RC slab" Command="{Binding AddSlabCase}">
|
<MenuItem Header="{DynamicResource Add RC Slab}" Command="{Binding AddSlabCase}">
|
||||||
<MenuItem.Icon>
|
<MenuItem.Icon>
|
||||||
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Slab32.png" />
|
<Image Style="{StaticResource ButtonImage16}" Source="/Windows/MainWindow/Slab32.png" />
|
||||||
</MenuItem.Icon>
|
</MenuItem.Icon>
|
||||||
@@ -463,30 +436,15 @@
|
|||||||
Viewport="{Binding CanvasViewportSize}" ViewportUnits="Absolute"
|
Viewport="{Binding CanvasViewportSize}" ViewportUnits="Absolute"
|
||||||
Viewbox="{Binding CanvasViewportSize}" ViewboxUnits="Absolute">
|
Viewbox="{Binding CanvasViewportSize}" ViewboxUnits="Absolute">
|
||||||
<VisualBrush.Visual>
|
<VisualBrush.Visual>
|
||||||
<Rectangle
|
<Rectangle StrokeThickness="{Binding GridLineThickness}" Height="{Binding GridSize}" Width="{Binding GridSize}" Stroke="Darkgray"/>
|
||||||
Height="{Binding GridSize}"
|
|
||||||
Width="{Binding GridSize}"
|
|
||||||
Stroke="{Binding GridColorBrush}"
|
|
||||||
StrokeThickness="{Binding GridLineThickness}"/>
|
|
||||||
</VisualBrush.Visual>
|
</VisualBrush.Visual>
|
||||||
</VisualBrush>
|
</VisualBrush>
|
||||||
</Canvas.Background>
|
</Canvas.Background>
|
||||||
<!--Horizontal axis line-->
|
<!--Horizontal axis line-->
|
||||||
<Line
|
<Line X1="0" X2="{Binding RightLimitX}" Y1="{Binding MiddleLimitY}" Y2="{Binding MiddleLimitY}" Stroke="Red" StrokeThickness="{Binding AxisLineThickness}"/>
|
||||||
X1="0" X2="{Binding Width}"
|
|
||||||
Y1="{Binding HalfOfHeight}" Y2="{Binding HalfOfHeight}"
|
|
||||||
Stroke="{Binding XAxisColorBrush}"
|
|
||||||
StrokeThickness="{Binding AxisLineThickness}"/>
|
|
||||||
<!--Vertical axis line-->
|
<!--Vertical axis line-->
|
||||||
<Line
|
<Line X1="{Binding MiddleLimitX}" X2="{Binding MiddleLimitX}" Y1="0" Y2="{Binding BottomLimitY}" Stroke="ForestGreen" StrokeThickness="{Binding AxisLineThickness}"/>
|
||||||
X1="{Binding HalfOfWidth}" X2="{Binding HalfOfWidth}"
|
<ItemsControl DataContext="{Binding PrimitiveLogic}" ItemsSource="{Binding Items}" ContextMenu="{StaticResource PrimitiveCRUD}">
|
||||||
Y1="0" Y2="{Binding Height}"
|
|
||||||
Stroke="{Binding YAxisColorBrush}"
|
|
||||||
StrokeThickness="{Binding AxisLineThickness}"/>
|
|
||||||
<ItemsControl
|
|
||||||
DataContext="{Binding ParentViewModel.PrimitiveLogic}"
|
|
||||||
ItemsSource="{Binding Items}"
|
|
||||||
ContextMenu="{StaticResource PrimitiveCRUD}">
|
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<Canvas/>
|
<Canvas/>
|
||||||
@@ -510,19 +468,19 @@
|
|||||||
<StatusBarItem>
|
<StatusBarItem>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Zoom: "/>
|
<TextBlock Text="Zoom: "/>
|
||||||
<TextBlock Text="{Binding VisualProperty.ScaleValue}"/>
|
<TextBlock Text="{Binding ScaleValue}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StatusBarItem>
|
</StatusBarItem>
|
||||||
<StatusBarItem>
|
<StatusBarItem>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Number of primitives: "/>
|
<TextBlock Text="{DynamicResource Number of primitives}"/>
|
||||||
<TextBlock Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
|
<TextBlock Margin="5,0,0,0" Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StatusBarItem>
|
</StatusBarItem>
|
||||||
<StatusBarItem>
|
<StatusBarItem>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="Grid size: "/>
|
<TextBlock Text="{DynamicResource Grid size}"/>
|
||||||
<TextBlock Text="{Binding VisualProperty.GridSize, Converter={StaticResource LengthConverter}}"/>
|
<TextBlock Margin="5,0,0,0" Text="{Binding GridSize, Converter={StaticResource LengthConverter}}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StatusBarItem>
|
</StatusBarItem>
|
||||||
</StatusBar>
|
</StatusBar>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.Windows;
|
using System;
|
||||||
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelper.Services;
|
using StructureHelper.Services;
|
||||||
using StructureHelper.Services.Primitives;
|
using StructureHelper.Services.Primitives;
|
||||||
@@ -16,6 +18,11 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
PrimitiveRepository = primitiveRepository;
|
PrimitiveRepository = primitiveRepository;
|
||||||
this.viewModel = viewModel;
|
this.viewModel = viewModel;
|
||||||
DataContext = this.viewModel;
|
DataContext = this.viewModel;
|
||||||
|
viewModel.MV = this;
|
||||||
|
ResourceDictionary dict = new ResourceDictionary();
|
||||||
|
dict.Source = new Uri("..\\Infrastructure\\UI\\Resources\\Strings.en-US.xaml",
|
||||||
|
UriKind.Relative);
|
||||||
|
this.Resources.MergedDictionaries.Add(dict);
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using LoaderCalculator.Logics.Geometry;
|
using LoaderCalculator.Logics.Geometry;
|
||||||
|
|
||||||
using StructureHelper.Infrastructure;
|
using StructureHelper.Infrastructure;
|
||||||
using StructureHelper.Infrastructure.UI.DataContexts;
|
using StructureHelper.Infrastructure.UI.DataContexts;
|
||||||
using StructureHelper.Models.Materials;
|
using StructureHelper.Models.Materials;
|
||||||
@@ -9,12 +10,15 @@ using StructureHelper.Windows.ViewModels;
|
|||||||
using StructureHelper.Windows.ViewModels.Forces;
|
using StructureHelper.Windows.ViewModels.Forces;
|
||||||
using StructureHelper.Windows.ViewModels.Materials;
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
using StructureHelper.Windows.ViewModels.NdmCrossSections;
|
||||||
|
|
||||||
using StructureHelperCommon.Infrastructures.Enums;
|
using StructureHelperCommon.Infrastructures.Enums;
|
||||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||||
|
|
||||||
using StructureHelperLogics.Models.CrossSections;
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
using StructureHelperLogics.Models.Templates.CrossSections.RCs;
|
||||||
using StructureHelperLogics.Models.Templates.RCs;
|
using StructureHelperLogics.Models.Templates.RCs;
|
||||||
using StructureHelperLogics.Services.NdmPrimitives;
|
using StructureHelperLogics.Services.NdmPrimitives;
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
@@ -29,15 +33,14 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
private ICrossSection section;
|
private ICrossSection section;
|
||||||
private ICrossSectionRepository repository => section.SectionRepository;
|
private ICrossSectionRepository repository => section.SectionRepository;
|
||||||
private ITriangulatePrimitiveLogic triangulateLogic;
|
private readonly double scaleRate = 1.1d;
|
||||||
|
|
||||||
|
|
||||||
public CrossSectionVisualPropertyVM VisualProperty { get; private set; }
|
public CrossSectionVisualPropertyVM VisualProperty { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
public PrimitiveBase SelectedPrimitive { get; set; }
|
public PrimitiveBase SelectedPrimitive { get; set; }
|
||||||
|
|
||||||
public AnalysisViewModelLogic CalculatorsLogic { get; private set; }
|
public AnalysisVewModelLogic CalculatorsLogic { get; private set; }
|
||||||
public ActionsViewModel CombinationsLogic { get; }
|
public ActionsViewModel CombinationsLogic { get; }
|
||||||
public MaterialsViewModel MaterialsLogic { get; }
|
public MaterialsViewModel MaterialsLogic { get; }
|
||||||
public PrimitiveViewModelLogic PrimitiveLogic { get; }
|
public PrimitiveViewModelLogic PrimitiveLogic { get; }
|
||||||
@@ -45,6 +48,64 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
|
|
||||||
private CrossSectionModel Model { get; }
|
private CrossSectionModel Model { get; }
|
||||||
|
|
||||||
|
private double panelX, panelY, scrollPanelX, scrollPanelY;
|
||||||
|
|
||||||
|
public double PanelX
|
||||||
|
{
|
||||||
|
get => panelX;
|
||||||
|
set => OnPropertyChanged(value, ref panelX);
|
||||||
|
}
|
||||||
|
public double PanelY
|
||||||
|
{
|
||||||
|
get => panelY;
|
||||||
|
set => OnPropertyChanged(value, ref panelY);
|
||||||
|
}
|
||||||
|
public double ScrollPanelX
|
||||||
|
{
|
||||||
|
get => scrollPanelX;
|
||||||
|
set => OnPropertyChanged(value, ref scrollPanelX);
|
||||||
|
}
|
||||||
|
public double ScrollPanelY
|
||||||
|
{
|
||||||
|
get => scrollPanelY;
|
||||||
|
set => OnPropertyChanged(value, ref scrollPanelY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private double scaleValue;
|
||||||
|
|
||||||
|
public double ScaleValue
|
||||||
|
{
|
||||||
|
get => Math.Round(scaleValue);
|
||||||
|
set
|
||||||
|
{
|
||||||
|
OnPropertyChanged(value, ref scaleValue);
|
||||||
|
OnPropertyChanged(nameof(AxisLineThickness));
|
||||||
|
OnPropertyChanged(nameof(GridLineThickness));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public double AxisLineThickness
|
||||||
|
{
|
||||||
|
get => VisualProperty.AxisLineThickness / scaleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double GridLineThickness
|
||||||
|
{
|
||||||
|
get => VisualProperty.GridLineThickness / scaleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string CanvasViewportSize
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string s = VisualProperty.GridSize.ToString();
|
||||||
|
s = s.Replace(',', '.');
|
||||||
|
return $"0,0,{s},{s}";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public double GridSize => VisualProperty.GridSize;
|
||||||
|
|
||||||
public ObservableCollection<IHeadMaterial> HeadMaterials
|
public ObservableCollection<IHeadMaterial> HeadMaterials
|
||||||
{
|
{
|
||||||
@@ -59,6 +120,67 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Right edge of work plane, coordinate X
|
||||||
|
/// </summary>
|
||||||
|
public double RightLimitX => VisualProperty.WorkPlainWidth;
|
||||||
|
/// <summary>
|
||||||
|
/// Bottom edge of work plane Y
|
||||||
|
/// </summary>
|
||||||
|
public double BottomLimitY => VisualProperty.WorkPlainHeight;
|
||||||
|
/// <summary>
|
||||||
|
/// Middle of coordinate X
|
||||||
|
/// </summary>
|
||||||
|
public double MiddleLimitX => VisualProperty.WorkPlainWidth / 2d;
|
||||||
|
/// <summary>
|
||||||
|
/// Middle of coordinate Y
|
||||||
|
/// </summary>
|
||||||
|
public double MiddleLimitY => VisualProperty.WorkPlainHeight / 2d;
|
||||||
|
|
||||||
|
private int langID = 0;
|
||||||
|
public int LangID { get => langID; set { langID = value; OnPropertyChanged(); } }
|
||||||
|
public RelayCommand ChangeLanguage
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return changeLanguage ?? (changeLanguage = new RelayCommand(obj => { ChangeLang(); }));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ChangeLang()
|
||||||
|
{
|
||||||
|
if (LangID == 0)
|
||||||
|
{
|
||||||
|
LangID = 1;
|
||||||
|
SetLanguageDictionary(LangID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LangID = 0;
|
||||||
|
SetLanguageDictionary(LangID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal ResourceDictionary dict = new ResourceDictionary();
|
||||||
|
// Загрузка файлов ресурсов для выбранного языка
|
||||||
|
private void SetLanguageDictionary(int local)
|
||||||
|
{
|
||||||
|
switch (local)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
dict.Source = new Uri("..\\Infrastructure\\UI\\Resources\\Strings.en-US.xaml",
|
||||||
|
UriKind.Relative);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
dict.Source = new Uri("..\\Infrastructure\\UI\\Resources\\Strings.ru-RU.xaml",
|
||||||
|
UriKind.Relative);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
MV.Resources.MergedDictionaries.Add(dict);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal CrossSectionView MV;
|
||||||
|
|
||||||
public ICommand Calculate { get; }
|
public ICommand Calculate { get; }
|
||||||
public ICommand EditCalculationPropertyCommand { get; }
|
public ICommand EditCalculationPropertyCommand { get; }
|
||||||
public ICommand EditHeadMaterialsCommand { get; }
|
public ICommand EditHeadMaterialsCommand { get; }
|
||||||
@@ -79,7 +201,7 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
public ICommand LeftButtonDown { get; }
|
public ICommand LeftButtonDown { get; }
|
||||||
public ICommand LeftButtonUp { get; }
|
public ICommand LeftButtonUp { get; }
|
||||||
public ICommand MovePrimitiveToGravityCenterCommand { get; }
|
public ICommand MovePrimitiveToGravityCenterCommand { get; }
|
||||||
|
public ICommand PreviewMouseMove { get; }
|
||||||
public ICommand ClearSelection { get; }
|
public ICommand ClearSelection { get; }
|
||||||
public ICommand OpenMaterialCatalog { get; }
|
public ICommand OpenMaterialCatalog { get; }
|
||||||
public ICommand OpenMaterialCatalogWithSelection { get; }
|
public ICommand OpenMaterialCatalogWithSelection { get; }
|
||||||
@@ -87,7 +209,8 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
public ICommand SetColor { get; }
|
public ICommand SetColor { get; }
|
||||||
public ICommand SetInFrontOfAll { get; }
|
public ICommand SetInFrontOfAll { get; }
|
||||||
public ICommand SetInBackOfAll { get; }
|
public ICommand SetInBackOfAll { get; }
|
||||||
|
public ICommand ScaleCanvasDown { get; }
|
||||||
|
public ICommand ScaleCanvasUp { get; }
|
||||||
public ICommand SetPopupCanBeClosedTrue { get; }
|
public ICommand SetPopupCanBeClosedTrue { get; }
|
||||||
public ICommand SetPopupCanBeClosedFalse { get; }
|
public ICommand SetPopupCanBeClosedFalse { get; }
|
||||||
public RelayCommand ShowVisualProperty
|
public RelayCommand ShowVisualProperty
|
||||||
@@ -97,12 +220,19 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
return showVisualProperty ??
|
return showVisualProperty ??
|
||||||
(showVisualProperty = new RelayCommand(o =>
|
(showVisualProperty = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
var wnd = new AxisCanvasView(VisualProperty.AxisCanvasVM);
|
var wnd = new VisualPropertyView(VisualProperty);
|
||||||
|
SetLanguageDictionary(langID);
|
||||||
|
wnd.Resources.MergedDictionaries.Add(dict);
|
||||||
wnd.ShowDialog();
|
wnd.ShowDialog();
|
||||||
if (wnd.DialogResult == false) { return; }
|
OnPropertyChanged(nameof(AxisLineThickness));
|
||||||
VisualProperty.Refresh();
|
OnPropertyChanged(nameof(CanvasViewportSize));
|
||||||
PrimitiveLogic.Width = VisualProperty.Width;
|
OnPropertyChanged(nameof(GridSize));
|
||||||
PrimitiveLogic.Height = VisualProperty.Height;
|
OnPropertyChanged(nameof(RightLimitX));
|
||||||
|
OnPropertyChanged(nameof(BottomLimitY));
|
||||||
|
OnPropertyChanged(nameof(MiddleLimitX));
|
||||||
|
OnPropertyChanged(nameof(MiddleLimitY));
|
||||||
|
PrimitiveLogic.WorkPlaneWidth = VisualProperty.WorkPlainWidth;
|
||||||
|
PrimitiveLogic.WorkPlaneHeight = VisualProperty.WorkPlainHeight;
|
||||||
PrimitiveLogic.Refresh();
|
PrimitiveLogic.Refresh();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@@ -112,37 +242,37 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return selectPrimitive ??= new RelayCommand(obj=>
|
return selectPrimitive ??
|
||||||
|
(selectPrimitive = new RelayCommand(obj =>
|
||||||
{
|
{
|
||||||
if (obj is PrimitiveBase)
|
if (obj is PrimitiveBase)
|
||||||
{
|
{
|
||||||
SelectedPrimitive = obj as PrimitiveBase;
|
SelectedPrimitive = obj as PrimitiveBase;
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double delta = 0.0005;
|
||||||
private RelayCommand showVisualProperty;
|
private RelayCommand showVisualProperty;
|
||||||
private RelayCommand selectPrimitive;
|
private RelayCommand selectPrimitive;
|
||||||
|
private RelayCommand changeLanguage;
|
||||||
|
|
||||||
public CrossSectionViewModel(CrossSectionModel model)
|
public CrossSectionViewModel(CrossSectionModel model)
|
||||||
{
|
{
|
||||||
VisualProperty = new CrossSectionVisualPropertyVM()
|
VisualProperty = new CrossSectionVisualPropertyVM();
|
||||||
{
|
|
||||||
ScaleValue = 500d,
|
|
||||||
ParentViewModel = this
|
|
||||||
};
|
|
||||||
Model = model;
|
Model = model;
|
||||||
section = model.Section;
|
section = model.Section;
|
||||||
CombinationsLogic = new ActionsViewModel(repository);
|
CombinationsLogic = new ActionsViewModel(repository);
|
||||||
MaterialsLogic = new MaterialsViewModel(repository);
|
MaterialsLogic = new MaterialsViewModel(repository);
|
||||||
MaterialsLogic.AfterItemsEdit += AfterMaterialEdit;
|
MaterialsLogic.AfterItemsEdit += afterMaterialEdit;
|
||||||
CalculatorsLogic = new AnalysisViewModelLogic(repository);
|
CalculatorsLogic = new AnalysisVewModelLogic(repository);
|
||||||
PrimitiveLogic = new PrimitiveViewModelLogic(section)
|
PrimitiveLogic = new PrimitiveViewModelLogic(section)
|
||||||
{
|
{
|
||||||
Width = VisualProperty.Width,
|
WorkPlaneWidth = VisualProperty.WorkPlainWidth,
|
||||||
Height = VisualProperty.Height
|
WorkPlaneHeight = VisualProperty.WorkPlainHeight
|
||||||
};
|
};
|
||||||
|
scaleValue = 500d;
|
||||||
|
|
||||||
LeftButtonUp = new RelayCommand(o =>
|
LeftButtonUp = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
@@ -152,6 +282,35 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
if (o is RectangleViewPrimitive rect) rect.BorderCaptured = true;
|
if (o is RectangleViewPrimitive rect) rect.BorderCaptured = true;
|
||||||
});
|
});
|
||||||
|
PreviewMouseMove = new RelayCommand(o =>
|
||||||
|
{
|
||||||
|
if (o is RectangleViewPrimitive rect && rect.BorderCaptured && !rect.ElementLock)
|
||||||
|
{
|
||||||
|
if (rect.PrimitiveWidth % 10d < delta || rect.PrimitiveWidth % 10d >= delta)
|
||||||
|
rect.PrimitiveWidth = Math.Round(PanelX / 10d) * 10d - rect.PrimitiveLeft + 10d;
|
||||||
|
else
|
||||||
|
rect.PrimitiveWidth = PanelX - rect.PrimitiveLeft + 10d;
|
||||||
|
|
||||||
|
if (rect.PrimitiveHeight % 10d < delta || rect.PrimitiveHeight % 10d >= delta)
|
||||||
|
rect.PrimitiveHeight = Math.Round(PanelY / 10d) * 10d - rect.PrimitiveTop + 10d;
|
||||||
|
else
|
||||||
|
rect.PrimitiveHeight = PanelY - rect.PrimitiveTop + 10d;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ScaleCanvasDown = new RelayCommand(o =>
|
||||||
|
{
|
||||||
|
ScrollPanelX = PanelX;
|
||||||
|
ScrollPanelY = PanelY;
|
||||||
|
ScaleValue *= scaleRate;
|
||||||
|
});
|
||||||
|
|
||||||
|
ScaleCanvasUp = new RelayCommand(o =>
|
||||||
|
{
|
||||||
|
ScrollPanelX = PanelX;
|
||||||
|
ScrollPanelY = PanelY;
|
||||||
|
ScaleValue /= scaleRate;
|
||||||
|
});
|
||||||
|
|
||||||
AddBeamCase = new RelayCommand(o =>
|
AddBeamCase = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
@@ -174,13 +333,7 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
MovePrimitiveToGravityCenterCommand = new RelayCommand(o =>
|
MovePrimitiveToGravityCenterCommand = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
if (CheckMaterials() == false) { return; }
|
if (CheckMaterials() == false) { return; }
|
||||||
triangulateLogic = new TriangulatePrimitiveLogic()
|
var ndms = NdmPrimitivesService.GetNdms(repository.Primitives, LimitStates.SLS, CalcTerms.ShortTerm);
|
||||||
{
|
|
||||||
Primitives = repository.Primitives,
|
|
||||||
LimitState = LimitStates.SLS,
|
|
||||||
CalcTerm = CalcTerms.ShortTerm
|
|
||||||
};
|
|
||||||
var ndms = triangulateLogic.GetNdms();
|
|
||||||
var center = GeometryOperations.GetGravityCenter(ndms);
|
var center = GeometryOperations.GetGravityCenter(ndms);
|
||||||
foreach (var item in PrimitiveLogic.Items)
|
foreach (var item in PrimitiveLogic.Items)
|
||||||
{
|
{
|
||||||
@@ -199,14 +352,17 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
|
|
||||||
SetPopupCanBeClosedFalse = new RelayCommand(o =>
|
SetPopupCanBeClosedFalse = new RelayCommand(o =>
|
||||||
{
|
{
|
||||||
if (o is not PrimitiveBase primitive) return;
|
if (!(o is PrimitiveBase primitive)) return;
|
||||||
primitive.PopupCanBeClosed = false;
|
primitive.PopupCanBeClosed = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AfterMaterialEdit(SelectItemVM<IHeadMaterial> sender, CRUDVMEventArgs e)
|
private void afterMaterialEdit(SelectItemVM<IHeadMaterial> sender, CRUDVMEventArgs e)
|
||||||
{
|
{
|
||||||
PrimitiveLogic.Refresh();
|
foreach (var primitive in PrimitiveLogic.Items)
|
||||||
|
{
|
||||||
|
primitive.RefreshColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckMaterials()
|
private bool CheckMaterials()
|
||||||
@@ -215,7 +371,8 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
{
|
{
|
||||||
if (item.HeadMaterial == null)
|
if (item.HeadMaterial == null)
|
||||||
{
|
{
|
||||||
System.Windows.Forms.MessageBox.Show($"Primitive {item.Name} does not has material", "Check data for analisys", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
if(langID == 0) { System.Windows.Forms.MessageBox.Show($"Primitive {item.Name} does not has material", "Check data for analisys", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
|
||||||
|
else { System.Windows.Forms.MessageBox.Show($"Примитиву {item.Name} не назначен материал", "Проверьте расчетные данные", MessageBoxButtons.OK, MessageBoxIcon.Warning); }
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,26 +390,12 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
}
|
}
|
||||||
private IEnumerable<PrimitiveBase> GetColumnCasePrimitives()
|
private IEnumerable<PrimitiveBase> GetColumnCasePrimitives()
|
||||||
{
|
{
|
||||||
var template = new RectangleBeamTemplate(0.5d, 0.5d)
|
var template = new RectangleBeamTemplate(0.5d, 0.5d) { CoverGap = 0.05, WidthCount = 3, HeightCount = 3, TopDiameter = 0.025d, BottomDiameter = 0.025d };
|
||||||
{
|
|
||||||
CoverGap = 0.05,
|
|
||||||
WidthCount = 3,
|
|
||||||
HeightCount = 3,
|
|
||||||
TopDiameter = 0.025d,
|
|
||||||
BottomDiameter = 0.025d
|
|
||||||
};
|
|
||||||
return GetCasePrimitives(template);
|
return GetCasePrimitives(template);
|
||||||
}
|
}
|
||||||
private IEnumerable<PrimitiveBase> GetSlabCasePrimitives()
|
private IEnumerable<PrimitiveBase> GetSlabCasePrimitives()
|
||||||
{
|
{
|
||||||
var template = new RectangleBeamTemplate(1d, 0.2d)
|
var template = new RectangleBeamTemplate(1d, 0.2d) { CoverGap = 0.04, WidthCount = 5, HeightCount = 2, TopDiameter = 0.012d, BottomDiameter = 0.012d };
|
||||||
{
|
|
||||||
CoverGap = 0.04,
|
|
||||||
WidthCount = 5,
|
|
||||||
HeightCount = 2,
|
|
||||||
TopDiameter = 0.012d,
|
|
||||||
BottomDiameter = 0.012d
|
|
||||||
};
|
|
||||||
return GetCasePrimitives(template);
|
return GetCasePrimitives(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,22 +408,23 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
var rectTemplate = template as IRectangleBeamTemplate;
|
var rectTemplate = template as IRectangleBeamTemplate;
|
||||||
geometryLogic = new RectGeometryLogic(rectTemplate);
|
geometryLogic = new RectGeometryLogic(rectTemplate);
|
||||||
wnd = new RectangleBeamView(rectTemplate);
|
wnd = new RectangleBeamView(rectTemplate);
|
||||||
|
SetLanguageDictionary(langID);
|
||||||
|
wnd.Resources.MergedDictionaries.Add(dict);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (template is ICircleTemplate)
|
else if (template is ICircleTemplate)
|
||||||
{
|
{
|
||||||
var circleTemplate = template as ICircleTemplate;
|
var circleTemplate = template as ICircleTemplate;
|
||||||
geometryLogic = new CircleGeometryLogic(circleTemplate);
|
geometryLogic = new CircleGeometryLogic(circleTemplate);
|
||||||
wnd = new CircleView(circleTemplate);
|
wnd = new CircleView(circleTemplate);
|
||||||
|
SetLanguageDictionary(langID);
|
||||||
|
wnd.Resources.MergedDictionaries.Add(dict);
|
||||||
}
|
}
|
||||||
else
|
else { throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknown + $"Was: {nameof(template)}"); }
|
||||||
{
|
|
||||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(template));
|
|
||||||
}
|
|
||||||
wnd.ShowDialog();
|
wnd.ShowDialog();
|
||||||
if (wnd.DialogResult == false)
|
if (wnd.DialogResult == true)
|
||||||
{
|
{
|
||||||
return new List<PrimitiveBase>();
|
|
||||||
}
|
|
||||||
var newSection = new SectionTemplate(geometryLogic).GetCrossSection();
|
var newSection = new SectionTemplate(geometryLogic).GetCrossSection();
|
||||||
var newRepository = newSection.SectionRepository;
|
var newRepository = newSection.SectionRepository;
|
||||||
repository.HeadMaterials.AddRange(newRepository.HeadMaterials);
|
repository.HeadMaterials.AddRange(newRepository.HeadMaterials);
|
||||||
@@ -291,6 +435,10 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
CombinationsLogic.AddItems(newRepository.ForceActions);
|
CombinationsLogic.AddItems(newRepository.ForceActions);
|
||||||
CalculatorsLogic.AddItems(newRepository.CalculatorsList);
|
CalculatorsLogic.AddItems(newRepository.CalculatorsList);
|
||||||
var primitives = PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(newRepository.Primitives);
|
var primitives = PrimitiveOperations.ConvertNdmPrimitivesToPrimitiveBase(newRepository.Primitives);
|
||||||
|
foreach (var item in primitives)
|
||||||
|
{
|
||||||
|
item.RegisterDeltas(VisualProperty.WorkPlainWidth / 2, VisualProperty.WorkPlainHeight / 2);
|
||||||
|
}
|
||||||
PrimitiveLogic.Refresh();
|
PrimitiveLogic.Refresh();
|
||||||
foreach (var item in newRepository.HeadMaterials)
|
foreach (var item in newRepository.HeadMaterials)
|
||||||
{
|
{
|
||||||
@@ -301,7 +449,8 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
GlobalRepository.Actions.Create(item);
|
GlobalRepository.Actions.Create(item);
|
||||||
}
|
}
|
||||||
return primitives;
|
return primitives;
|
||||||
|
}
|
||||||
|
return new List<PrimitiveBase>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainWindow
|
||||||
|
{
|
||||||
|
public class CrossSectionVisualPropertyVM : ViewModelBase
|
||||||
|
{
|
||||||
|
private double axisLineThickness;
|
||||||
|
private double gridLineThickness;
|
||||||
|
private double gridSize;
|
||||||
|
private double workPlainWidth;
|
||||||
|
private double workPlainHeight;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Thickness of x-, and y- axis line
|
||||||
|
/// </summary>
|
||||||
|
public double AxisLineThickness
|
||||||
|
{
|
||||||
|
get => axisLineThickness; set
|
||||||
|
{
|
||||||
|
axisLineThickness = value;
|
||||||
|
OnPropertyChanged(nameof(AxisLineThickness));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Thickness of lines of coordinate mesh
|
||||||
|
/// </summary>
|
||||||
|
public double GridLineThickness
|
||||||
|
{
|
||||||
|
get => gridLineThickness; set
|
||||||
|
{
|
||||||
|
gridLineThickness = value;
|
||||||
|
OnPropertyChanged(nameof(GridLineThickness));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Size of coordinate mesh
|
||||||
|
/// </summary>
|
||||||
|
public double GridSize
|
||||||
|
{
|
||||||
|
get => gridSize; set
|
||||||
|
{
|
||||||
|
gridSize = value;
|
||||||
|
OnPropertyChanged(nameof(GridSize));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Width of work plane
|
||||||
|
/// </summary>
|
||||||
|
public double WorkPlainWidth
|
||||||
|
{
|
||||||
|
get => workPlainWidth; set
|
||||||
|
{
|
||||||
|
workPlainWidth = value;
|
||||||
|
OnPropertyChanged(nameof(WorkPlainWidth));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Height of work plane
|
||||||
|
/// </summary>
|
||||||
|
public double WorkPlainHeight
|
||||||
|
{
|
||||||
|
get => workPlainHeight; set
|
||||||
|
{
|
||||||
|
workPlainHeight = value;
|
||||||
|
OnPropertyChanged(nameof(WorkPlainHeight));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public CrossSectionVisualPropertyVM()
|
||||||
|
{
|
||||||
|
AxisLineThickness = 2d;
|
||||||
|
GridLineThickness = 0.25d;
|
||||||
|
GridSize = 0.05d;
|
||||||
|
WorkPlainWidth = 1.2d;
|
||||||
|
WorkPlainHeight = 1.2d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +1,13 @@
|
|||||||
<Window x:Class="StructureHelper.Windows.MainWindow.AxisCanvasView"
|
<Window x:Class="StructureHelper.Windows.MainWindow.VisualPropertyView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.MainWindow"
|
xmlns:local="clr-namespace:StructureHelper.Windows.MainWindow"
|
||||||
d:DataContext="{d:DesignInstance local:AxisCanvasVM}"
|
d:DataContext="{d:DesignInstance local:CrossSectionVisualPropertyVM}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Grid properies" Height="200" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
Title="{DynamicResource Grid properies}" Height="200" Width="320" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
|
||||||
<Grid>
|
<Grid Margin="10">
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="35"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
@@ -22,20 +17,18 @@
|
|||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="130"/>
|
<ColumnDefinition Width="180"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Text="Axis grid thickness"/>
|
<TextBlock Text="{DynamicResource Axis grid thickness}"/>
|
||||||
<TextBox Grid.Column="1" Text="{Binding AxisLineThickness, Converter={StaticResource PlainDouble}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Column="1" Text="{Binding AxisLineThickness, Converter={StaticResource PlainDouble}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBlock Grid.Row="1" Text="Grid size"/>
|
<TextBlock Grid.Row="1" Text="{DynamicResource Grid size}"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding GridSize, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding GridSize, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBlock Grid.Row="2" Text="Grid line thickness"/>
|
<TextBlock Grid.Row="2" Text="{DynamicResource Grid line thickness}"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding GridLineThickness, Converter={StaticResource PlainDouble}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Text="{Binding GridLineThickness, Converter={StaticResource PlainDouble}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBlock Grid.Row="3" Text="Work plane width"/>
|
<TextBlock Grid.Row="3" Text="{DynamicResource Work plane width}"/>
|
||||||
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding Width, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="3" Grid.Column="1" Text="{Binding WorkPlainWidth, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBlock Grid.Row="4" Text="Work plane height"/>
|
<TextBlock Grid.Row="4" Text="{DynamicResource Work plane height}"/>
|
||||||
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Height, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="4" Grid.Column="1" Text="{Binding WorkPlainHeight, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
</Grid>
|
|
||||||
<ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -17,13 +17,12 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Логика взаимодействия для VisualPropertyView.xaml
|
/// Логика взаимодействия для VisualPropertyView.xaml
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class AxisCanvasView : Window
|
public partial class VisualPropertyView : Window
|
||||||
{
|
{
|
||||||
public AxisCanvasView(AxisCanvasVM vm)
|
public VisualPropertyView(CrossSectionVisualPropertyVM vm)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
|
||||||
vm.ParentWindow = this;
|
|
||||||
DataContext = vm;
|
DataContext = vm;
|
||||||
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.PrimitiveTemplates.RCs.Beams"
|
xmlns:local="clr-namespace:StructureHelper.Windows.PrimitiveTemplates.RCs.Beams"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Reinforced circle template" Height="220" Width="300" SizeToContent="Height" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
Title="{DynamicResource Reinforced circle template}" Height="220" Width="300" SizeToContent="Height" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||||
<Grid>
|
<Grid Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="35"/>
|
<RowDefinition Height="35"/>
|
||||||
@@ -22,12 +22,12 @@
|
|||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="160"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="Cover gap"/>
|
<TextBlock Grid.Row="0" Text="{DynamicResource Cover gap}"/>
|
||||||
<TextBlock Grid.Row="1" Text="Rebar Diameter"/>
|
<TextBlock Grid.Row="1" Text="{DynamicResource Rebar Diameter}"/>
|
||||||
<TextBlock Grid.Row="2" Text="Rebar Count"/>
|
<TextBlock Grid.Row="2" Text="{DynamicResource Rebar Count}"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding CoverGap, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding CoverGap, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarCount, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BarCount, ValidatesOnExceptions=True}"/>
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
xmlns:vm ="clr-namespace:StructureHelper.Windows.ViewModels.PrimitiveTemplates.RCs"
|
xmlns:vm ="clr-namespace:StructureHelper.Windows.ViewModels.PrimitiveTemplates.RCs"
|
||||||
d:DataContext="{d:DesignInstance vm:RectangleBeamViewModel}"
|
d:DataContext="{d:DesignInstance vm:RectangleBeamViewModel}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Reinforced rectangle template" Height="220" Width="300" SizeToContent="Height" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
Title="{DynamicResource Reinforced rectangle template}" Height="220" Width="300" SizeToContent="Height" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<Grid Margin="5">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition/>
|
<RowDefinition/>
|
||||||
<RowDefinition Height="35"/>
|
<RowDefinition Height="35"/>
|
||||||
@@ -27,14 +27,14 @@
|
|||||||
<RowDefinition Height="22"/>
|
<RowDefinition Height="22"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="100"/>
|
<ColumnDefinition Width="180"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<TextBlock Grid.Row="0" Text="Cover gap"/>
|
<TextBlock Grid.Row="0" Text="{DynamicResource Cover gap}"/>
|
||||||
<TextBlock Grid.Row="1" Text="Top Diameter"/>
|
<TextBlock Grid.Row="1" Text="{DynamicResource Top Diameter}"/>
|
||||||
<TextBlock Grid.Row="2" Text="Bottom Diameter"/>
|
<TextBlock Grid.Row="2" Text="{DynamicResource Bottom Diameter}"/>
|
||||||
<TextBlock Grid.Row="3" Text="Width count"/>
|
<TextBlock Grid.Row="3" Text="{DynamicResource Width count}"/>
|
||||||
<TextBlock Grid.Row="4" Text="Height count"/>
|
<TextBlock Grid.Row="4" Text="{DynamicResource Height count}"/>
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding CoverGap, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="0" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding CoverGap, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding TopDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="1" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding TopDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BottomDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
<TextBox Grid.Row="2" Grid.Column="1" Margin="1" Style="{StaticResource ValidatedError}" Text="{Binding BottomDiameter, Converter={StaticResource LengthConverter}, ValidatesOnExceptions=True}"/>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user