diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-27 13:35:53 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-04-27 13:35:53 +0300 |
| commit | 98b4de2ceaecb091e12145921dcb7989f839cf10 (patch) | |
| tree | b40fc1a172da2435ae72034c5bee6fae99ada1d9 /Software/Visual_Studio | |
| parent | 9f900ab8d1c25e8c62ded7b56cd3991d4cd14248 (diff) | |
| download | Tango-98b4de2ceaecb091e12145921dcb7989f839cf10.tar.gz Tango-98b4de2ceaecb091e12145921dcb7989f839cf10.zip | |
MachineStudio. RML - add DencityCount and plies GUI objects.
Diffstat (limited to 'Software/Visual_Studio')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml | 70 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Entities/Rml.cs | 27 |
2 files changed, 69 insertions, 28 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index 08af47ef4..99e06ccdc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:global="clr-namespace:Tango.MachineStudio.RML" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" @@ -21,6 +22,14 @@ <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> <converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter"/> + <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter"/> + + <ObjectDataProvider x:Key="Plies" ObjectType="{x:Type sys:Enum}" MethodName="GetValues"> + <ObjectDataProvider.MethodParameters> + <x:Type TypeName="enumerations:Plies"/> + </ObjectDataProvider.MethodParameters> + </ObjectDataProvider> + </UserControl.Resources> <Grid Margin="20"> @@ -94,45 +103,64 @@ <ComboBox ItemsSource="{Binding Purposes}" SelectedItem="{Binding ActiveRML.MediaPurpose,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> <TextBlock Text="Condition:" ></TextBlock> - <ComboBox ItemsSource="{Binding Conditions}" SelectedItem="{Binding ActiveRML.MediaCondition,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <ComboBox ItemsSource="{Binding Conditions}" SelectedItem="{Binding ActiveRML.MediaCondition,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>--> + + <TextBlock Text="Linear Density:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="9999" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.FiberSize,Mode=TwoWay}" FontSize="16"></mahapps:NumericUpDown> - <TextBlock Text="Linear Mass Density Unit:" ></TextBlock> + <TextBlock Text="Linear Density Unit:" ></TextBlock> <ComboBox ItemsSource="{Binding LinearMassDensityUnits}" SelectedItem="{Binding ActiveRML.LinearMassDensityUnit,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> - <TextBlock Text="Fiber Shape:" ></TextBlock> - <ComboBox ItemsSource="{Binding FiberShapes}" SelectedItem="{Binding ActiveRML.FiberShape,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Plies:" ></TextBlock> + <ComboBox ItemsSource="{Binding Source={StaticResource Plies}}" SelectedItem="{Binding ActiveRML.RMLPlies, Mode=TwoWay}" > + <ComboBox.ItemTemplate> + <DataTemplate> + <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> - <TextBlock Text="Fiber Syntheses:" ></TextBlock> - <ComboBox ItemsSource="{Binding FiberSynths}" SelectedItem="{Binding ActiveRML.FiberSynth,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Filament count per plies:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.PliesPerFiber,Mode=TwoWay}"></mahapps:NumericUpDown> - <TextBlock Text="Fiber Size:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.FiberSize,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Count (den):" ></TextBlock> + <TextBlock Text="{Binding ActiveRML.DencityCount}" Foreground="Blue" ></TextBlock> - <TextBlock Text="Fibers Count:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.NumberOfFibers,Mode=TwoWay}"></mahapps:NumericUpDown> + <TextBlock Text="Fiber count:" ></TextBlock> + <TextBlock Text="{Binding ActiveRML.FiberCount}" Foreground="Blue" ></TextBlock> - <TextBlock Text="Plies Per Fiber:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.PliesPerFiber,Mode=TwoWay}"></mahapps:NumericUpDown> + <!--<TextBlock Text="Fiber Shape:" ></TextBlock> + <ComboBox ItemsSource="{Binding FiberShapes}" SelectedItem="{Binding ActiveRML.FiberShape,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>--> + + <!--<TextBlock Text="Fiber Syntheses:" ></TextBlock> + <ComboBox ItemsSource="{Binding FiberSynths}" SelectedItem="{Binding ActiveRML.FiberSynth,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox>--> + + <!--<TextBlock Text="Fiber Size:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.FiberSize,Mode=TwoWay}"></mahapps:NumericUpDown>--> + + <!--<TextBlock Text="Fibers Count:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.NumberOfFibers,Mode=TwoWay}"></mahapps:NumericUpDown>--> - <TextBlock Text="Plies Per Thread:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.PliesPerThread,Mode=TwoWay}"></mahapps:NumericUpDown> + <!--<TextBlock Text="Plies Per Thread:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.PliesPerThread,Mode=TwoWay}"></mahapps:NumericUpDown>--> + - <TextBlock Text="Tensile Strength:" ></TextBlock> + <!--<TextBlock Text="Tensile Strength:" ></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.TensileStrength,Mode=TwoWay}"></mahapps:NumericUpDown> <TextBlock Text="Elongation Break Percentage:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.ElongationAtBreakPercentage,Mode=TwoWay}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.ElongationAtBreakPercentage,Mode=TwoWay}"></mahapps:NumericUpDown>--> - <TextBlock Text="Estimated Thread Diameter:" ></TextBlock> - <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.EstimatedThreadDiameter,Mode=TwoWay}"></mahapps:NumericUpDown> + <!--<TextBlock Text="Estimated Thread Diameter:" ></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveRML.EstimatedThreadDiameter,Mode=TwoWay}"></mahapps:NumericUpDown>--> - <TextBlock Text="Twisted:" ></TextBlock> + <!--<TextBlock Text="Twisted:" ></TextBlock> <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding ActiveRML.Twisted}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> <TextBlock Text="Air Entanglement:" ></TextBlock> - <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding ActiveRML.AirEntanglement}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> + <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding ActiveRML.AirEntanglement}" Style="{StaticResource MaterialDesignSwitchToggleButton}" />--> - <TextBlock Text="Lubricant:" ></TextBlock> + <!--<TextBlock Text="Lubricant:" ></TextBlock> <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding ActiveRML.Lubricant}" Style="{StaticResource MaterialDesignSwitchToggleButton}" />--> </controls:TableGrid> </DockPanel> diff --git a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs index 80d3afdba..23aee0366 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Rml.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Rml.cs @@ -24,6 +24,7 @@ namespace Tango.BL.Entities WhitePointL = 92.1815; WhitePointA = 2.2555; WhitePointB = -10.9325; + PliesPerThread = 1; } protected override void OnWhitePointLChanged(double whitepointl) @@ -234,6 +235,15 @@ namespace Tango.BL.Entities { base.OnPliesPerFiberChanged(pliesperfiber); UpdateFiberCount(); + + } + + protected override void OnPliesPerThreadChanged(Int32 pliesperthread) + { + base.OnPliesPerThreadChanged(pliesperthread); + UpdateDencityCount(); + UpdateFiberCount(); + RaisePropertyChanged(nameof(RMLPlies)); } private void UpdateDencityCount() @@ -252,20 +262,21 @@ namespace Tango.BL.Entities { get { + var count = 0; if (LinearMassDensityUnit == null || FiberSize==0) - return 0; + return count; if (LinearMassDensityUnit.Name== "Tex") - return Convert.ToInt32(FiberSize) * 9; + count = Convert.ToInt32(FiberSize) * 9; if (LinearMassDensityUnit.Name == "DTEX") - return (int)(Convert.ToInt32(FiberSize) * 0.9); + count = (int)(Convert.ToInt32(FiberSize) * 0.9); if (LinearMassDensityUnit.Name == "Ne") - return (int)(5315 / Convert.ToInt32(FiberSize)); + count = (int)(5315 / Convert.ToInt32(FiberSize)); if (LinearMassDensityUnit.Name == "Nm") - return (int)(9000 / Convert.ToInt32(FiberSize)); + count = (int)(9000 / Convert.ToInt32(FiberSize)); if (LinearMassDensityUnit.Name == "Denier") - return (int)FiberSize; + count = (int)FiberSize; - return 0; + return PliesPerThread == 0 ? count : count * PliesPerThread; } } @@ -326,6 +337,8 @@ namespace Tango.BL.Entities { base.PliesPerThread = value.ToInt32(); RaisePropertyChangedAuto(); + UpdateDencityCount(); + UpdateFiberCount(); } } |
