diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-29 05:46:38 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-29 05:46:38 +0300 |
| commit | 9c858b7b51be2eb5b2f515912d436224d7e6483c (patch) | |
| tree | 46f854bfd37026967ef2dfa8f28a70cd8c8f7727 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml | |
| parent | 103bd3c1c825e4ecbb1c714e293a5c9d97a09c8c (diff) | |
| download | Tango-9c858b7b51be2eb5b2f515912d436224d7e6483c.tar.gz Tango-9c858b7b51be2eb5b2f515912d436224d7e6483c.zip | |
Process Parameters Visual Representation.
Filter RML by machine type on Research module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml | 77 |
1 files changed, 60 insertions, 17 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml index 03bf65522..b9e9f30c3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml @@ -11,6 +11,7 @@ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:commonConverters="clr-namespace:Tango.MachineStudio.Common.Converters;assembly=Tango.MachineStudio.Common" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.RML.Views" @@ -19,6 +20,8 @@ <UserControl.Resources> <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <converters:LastItemInContainerToBooleanConverter x:Key="LastItemInContainerToBooleanConverter" /> + <commonConverters:ProcessParameterToVisibilityConverter x:Key="ProcessParameterToVisibilityConverter"></commonConverters:ProcessParameterToVisibilityConverter> </UserControl.Resources> <Grid> <Grid.RowDefinitions> @@ -49,9 +52,27 @@ <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> - <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> - <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> - </Button> + <StackPanel DockPanel.Dock="Right" VerticalAlignment="Bottom"> + <Grid> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ContentPresenter},Converter={StaticResource LastItemInContainerToBooleanConverter}}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Copy table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.CopyProcessParametersTableCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="ChevronDoubleRight" Width="24" Height="24" Foreground="{StaticResource GreenBrush}" /> + </Button> + </Grid> + <Button DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" VerticalAlignment="Bottom" ToolTip="Remove table" Width="30" Margin="10 0 0 10" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveProcessParametersTableCommand}" CommandParameter="{Binding}"> + <materialDesign:PackIcon Kind="Delete" Width="24" Height="24" Foreground="#FF7D7D" /> + </Button> + </StackPanel> + <Grid Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessTableDropped"> <Border Padding="5" BorderThickness="1" Margin="20 5 0 5" BorderBrush="{StaticResource DarkGrayBrush}" Background="{StaticResource TransparentBackgroundBrush100}"> @@ -59,22 +80,44 @@ <DockPanel Width="300"> <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> - <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5"> - <editors:ParameterizedEditor ParameterizedObject="{Binding}"> - <editors:ParameterizedEditor.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel IsItemsHost="True" /> - </ItemsPanelTemplate> - </editors:ParameterizedEditor.ItemsPanel> - <editors:ParameterizedEditor.DoubleTemplate> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Padding="5" Loaded="ScrollViewer_Loaded"> + <ItemsControl ItemsSource="{Binding ParametersGroups}"> + <ItemsControl.ItemTemplate> <DataTemplate> - <DockPanel> - <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11"></TextBlock> - <mahapps:NumericUpDown HorizontalAlignment="Right" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Right" Maximum="10000" StringFormat="{Binding StringFormat}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> - </DockPanel> + <StackPanel> + <TextBlock Margin="0 10 0 0" Text="{Binding Name}" FontWeight="SemiBold" FontSize="10" Foreground="{StaticResource AccentColorBrush}"></TextBlock> + <ItemsControl ItemsSource="{Binding Parameters}"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <DockPanel.Visibility> + <MultiBinding Converter="{StaticResource ProcessParameterToVisibilityConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveRML.ForMachineType" /> + <Binding Path="MachineTypes" /> + </MultiBinding> + </DockPanel.Visibility> + <TextBlock VerticalAlignment="Center" Text="{Binding Name}"></TextBlock> + <mahapps:NumericUpDown StringFormat="{Binding StringFormat}" InterceptArrowKeys="True" InterceptMouseWheel="True" HasDecimals="True" HorizontalAlignment="Right" Width="80" Minimum="0" Maximum="10000" Value="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + <mahapps:NumericUpDown.Style> + <Style TargetType="mahapps:NumericUpDown" BasedOn="{StaticResource {x:Type mahapps:NumericUpDown}}"> + <Setter Property="FontWeight" Value="Normal"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding HasDiff}" Value="True"> + <Setter Property="FontWeight" Value="Bold"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </mahapps:NumericUpDown.Style> + </mahapps:NumericUpDown> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> </DataTemplate> - </editors:ParameterizedEditor.DoubleTemplate> - </editors:ParameterizedEditor> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> </DockPanel> </Grid> |
