aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio
diff options
context:
space:
mode:
authorRoy Ben Shabat <roy.mail.net@gmail.com>2025-09-29 05:46:38 +0300
committerRoy Ben Shabat <roy.mail.net@gmail.com>2025-09-29 05:46:38 +0300
commit9c858b7b51be2eb5b2f515912d436224d7e6483c (patch)
tree46f854bfd37026967ef2dfa8f28a70cd8c8f7727 /Software/Visual_Studio/MachineStudio
parent103bd3c1c825e4ecbb1c714e293a5c9d97a09c8c (diff)
downloadTango-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')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs3
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml49
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs18
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml77
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs21
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml9
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/ProcessParameterToVisibilityConverter.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj3
9 files changed, 182 insertions, 30 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index d262e154e..ab74433a6 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -1902,7 +1902,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
//var processParams = _activeJobDbContext.ProcessParametersTables.ToList();
ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection();
- Rmls = _activeJobDbContext.Rmls.OrderBy(i => i.Name).ToObservableCollection();
+
+ Rmls = _activeJobDbContext.Rmls.Where(x => x.MachineType == SelectedMachine.MachineType || x.MachineType == null).ToList().OrderBy(i => i.FinalName).ToObservableCollection();
WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection();
SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection();
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
index a1cda2249..45c2d54cb 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
@@ -78,6 +78,7 @@
<localConverters:LiquidVolumesToLubricantLiquidVolume x:Key="LiquidVolumesToLubricantLiquidVolume" />
<commonConverters:UserRoleToVisibilityConverter x:Key="UserRoleToVisibilityConverter" />
<commonConverters:UserRoleToBooleanConverter x:Key="UserRoleToBooleanConverter" />
+ <commonConverters:ProcessParameterToVisibilityConverter x:Key="ProcessParameterToVisibilityConverter"></commonConverters:ProcessParameterToVisibilityConverter>
<ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
@@ -757,7 +758,7 @@
<StackPanel>
<TextBlock>MEDIA</TextBlock>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
- <controls:SearchComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" HorizontalContentAlignment="Stretch" SearchProperty="Name">
+ <controls:SearchComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" HorizontalContentAlignment="Stretch" SearchProperty="FinalName">
<ComboBox.ItemTemplate>
<DataTemplate>
<DockPanel>
@@ -838,7 +839,7 @@
</Viewbox>
<TextBlock Margin="5 0 0 0" FontSize="10">Use Preferred Index</TextBlock>
</StackPanel>
- <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
+ <Button Visibility="Collapsed" Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon>
<TextBlock Margin="10 0 0 0" Foreground="{StaticResource CheckmarkFill}">SAVE FACTORS</TextBlock>
@@ -1460,7 +1461,7 @@
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="{StaticResource BorderBrushGainsboro}"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
- <Setter Property="Padding" Value="2"></Setter>
+ <Setter Property="Padding" Value="2 2 0 2"></Setter>
<Setter Property="Margin" Value="4"></Setter>
<Setter Property="CornerRadius" Value="3"></Setter>
</Style>
@@ -1474,10 +1475,46 @@
</Setter.Value>
</Setter>
</Style>
+ </WrapPanel.Resources>
+ <ItemsControl ItemsSource="{Binding ParametersGroups}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <StackPanel>
+ <TextBlock Margin="0 10 0 0" Text="{Binding Name}" FontWeight="SemiBold" FontSize="10" Foreground="{StaticResource AccentColorBrush}"></TextBlock>
+ <ItemsControl ItemsSource="{Binding Parameters}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <WrapPanel IsItemsHost="True" Orientation="Horizontal" />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <DockPanel>
+ <Grid Background="Transparent">
+ <Grid.Visibility>
+ <MultiBinding Converter="{StaticResource ProcessParameterToVisibilityConverter}">
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedRML.ForMachineType" />
+ <Binding Path="MachineTypes" />
+ </MultiBinding>
+ </Grid.Visibility>
+ <ContentControl>
+ <DockPanel>
+ <TextBlock DockPanel.Dock="Top" ToolTip="{Binding Name}" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11" Foreground="{StaticResource MainWindow.Foreground}" TextWrapping="Wrap" TextAlignment="Center"></TextBlock>
+ <mahapps:NumericUpDown VerticalAlignment="Bottom" FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="{Binding StringFormat}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Foreground="{StaticResource MainWindow.Foreground}"></mahapps:NumericUpDown>
+ </DockPanel>
+ </ContentControl>
+ </Grid>
+ </DockPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </StackPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
- </WrapPanel.Resources>
- <editors:ParameterizedEditor ParameterizedObject="{Binding}">
+ <!--<editors:ParameterizedEditor ParameterizedObject="{Binding}">
<editors:ParameterizedEditor.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True" Orientation="Horizontal" />
@@ -1495,7 +1532,7 @@
</Grid>
</DataTemplate>
</editors:ParameterizedEditor.DoubleTemplate>
- </editors:ParameterizedEditor>
+ </editors:ParameterizedEditor>-->
</WrapPanel>
</DockPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs
index f6fca0ac2..7b6b0b692 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs
@@ -43,7 +43,7 @@ namespace Tango.MachineStudio.RML.ViewModels
public async override void OnShow()
{
base.OnShow();
- LiquidTypes = (await _context.LiquidTypes.ToListAsync()).ToObservableCollection();
+ LiquidTypes = (await _context.LiquidTypes.ToListAsync()).OrderBy(x => x.PreferredIndex).ToObservableCollection();
SelectedLiquidType = LiquidTypes.FirstOrDefault();
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
index 1da3723d1..2fcb87c59 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs
@@ -29,6 +29,7 @@ using Google.Protobuf;
using Tango.ColorConversion;
using Tango.CSV;
using Tango.Core;
+using Tango.SharedUI.Helpers;
namespace Tango.MachineStudio.RML.ViewModels
{
@@ -282,6 +283,8 @@ namespace Tango.MachineStudio.RML.ViewModels
public RelayCommand<ProcessParametersTable> RemoveProcessParametersTableCommand { get; set; }
+ public RelayCommand<ProcessParametersTable> CopyProcessParametersTableCommand { get; set; }
+
public RelayCommand AddLiquidFactorCommand { get; set; }
public RelayCommand<LiquidTypesRml> RemoveLiquidFactorCommand { get; set; }
@@ -329,6 +332,7 @@ namespace Tango.MachineStudio.RML.ViewModels
BackToRmlsCommand = new RelayCommand(BackToRmls, () => IsFree);
AddProcessParametersTableCommand = new RelayCommand(AddProcessParametersTable, () => IsFree);
RemoveProcessParametersTableCommand = new RelayCommand<ProcessParametersTable>(RemoveProcessParametersTable, () => IsFree);
+ CopyProcessParametersTableCommand = new RelayCommand<ProcessParametersTable>(CopyProcessParametersTable, () => IsFree);
AddLiquidFactorCommand = new RelayCommand(AddLiquidFactor, () => IsFree);
RemoveLiquidFactorCommand = new RelayCommand<LiquidTypesRml>(RemoveLiquidFactor, () => IsFree);
CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate);
@@ -481,6 +485,8 @@ namespace Tango.MachineStudio.RML.ViewModels
{
IsFree = false;
+ UIHelper.DoEvents();
+
if (_active_context != null)
{
_active_context.Dispose();
@@ -1045,6 +1051,18 @@ namespace Tango.MachineStudio.RML.ViewModels
}
}
+ private void CopyProcessParametersTable(ProcessParametersTable processParametersTable)
+ {
+ var nextTable = ActiveProcessParametersGroup.ProcessParametersTables.FirstOrDefault(x => x.TableIndex == processParametersTable.TableIndex + 1);
+ if (nextTable != null)
+ {
+ for (int i = 0; i < processParametersTable.VisualParameters.Count; i++)
+ {
+ nextTable.VisualParameters[i].Value = processParametersTable.VisualParameters[i].Value;
+ }
+ }
+ }
+
private void CreateCalibrationDataExcelTemplate()
{
SaveFileDialog dlg = new SaveFileDialog();
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>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs
index a6d03ca0e..29da7b293 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/ProcessParametersView.xaml.cs
@@ -23,6 +23,8 @@ namespace Tango.MachineStudio.RML.Views
/// </summary>
public partial class ProcessParametersView : UserControl
{
+ private HashSet<ScrollViewer> _processTablesViewers;
+
private MainViewVM _vm;
public DraggingSurface DraggingSurface
{
@@ -46,6 +48,7 @@ namespace Tango.MachineStudio.RML.Views
public ProcessParametersView()
{
InitializeComponent();
+ _processTablesViewers = new HashSet<ScrollViewer>();
DraggingSurface = draggingSurface;
Loaded += (_, __) => { _vm = DataContext as MainViewVM; };
}
@@ -55,5 +58,23 @@ namespace Tango.MachineStudio.RML.Views
ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable;
_vm.OnProcessParametersTableDropped(dragged, dropped);
}
+
+ private void ScrollViewer_Loaded(object sender, RoutedEventArgs e)
+ {
+ var viewer = sender as ScrollViewer;
+ if (!_processTablesViewers.Contains(viewer))
+ {
+ viewer.ScrollChanged += Viewer_ScrollChanged;
+ _processTablesViewers.Add(viewer);
+ }
+ }
+
+ private void Viewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
+ {
+ foreach (var viewer in _processTablesViewers.Where(x => x.IsLoaded && x.IsVisible && x != sender).ToList())
+ {
+ viewer.ScrollToVerticalOffset(e.VerticalOffset);
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
index eee16a2df..ff341f5ed 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml
@@ -6,6 +6,7 @@
xmlns:global="clr-namespace:Tango.MachineStudio.RML"
xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:vm="clr-namespace:Tango.MachineStudio.RML.ViewModels"
+ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
@@ -102,14 +103,14 @@
</StackPanel>
</Grid>
<Grid>
- <DataGrid Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" SelectionUnit="FullRow" RowHeight="60" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" HorizontalScrollBarVisibility="Disabled" EnableRowVirtualization="False">
- <DataGrid.CellStyle>
+ <controls:DoubleClickDataGrid Style="{StaticResource {x:Type DataGrid}}" DoubleClickCommand="{Binding ManageRmlCommand}" Margin="0 0 0 10" BorderBrush="Silver" IsReadOnly="True" BorderThickness="1" SelectionUnit="FullRow" RowHeight="60" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" HorizontalScrollBarVisibility="Disabled" EnableRowVirtualization="False">
+ <controls:DoubleClickDataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
</Style>
- </DataGrid.CellStyle>
+ </controls:DoubleClickDataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header="NAME" Width="220">
<DataGridTemplateColumn.CellTemplate>
@@ -162,7 +163,7 @@
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
</DataGrid.Columns>
- </DataGrid>
+ </controls:DoubleClickDataGrid>
<Grid Background="#19000000" Visibility="{Binding LoadingRmls,Converter={StaticResource BooleanToVisibilityConverter}}">
<mahapps:ProgressRing HorizontalAlignment="Center" VerticalAlignment="Center" Width="100" Height="100"></mahapps:ProgressRing>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/ProcessParameterToVisibilityConverter.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/ProcessParameterToVisibilityConverter.cs
new file mode 100644
index 000000000..4df25b3d3
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Converters/ProcessParameterToVisibilityConverter.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+using Tango.BL.Enumerations;
+
+namespace Tango.MachineStudio.Common.Converters
+{
+ public class ProcessParameterToVisibilityConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values[0] == DependencyProperty.UnsetValue) return Visibility.Visible;
+ MachineTypes? machineType = (MachineTypes?)values[0];
+ if (machineType == null) return Visibility.Visible;
+
+ List<MachineTypes> machineTypes = values[1] as List<MachineTypes>;
+ return machineTypes.Contains(machineType.Value) ? Visibility.Visible : Visibility.Collapsed;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
index 62e4ad659..736858d39 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj
@@ -102,6 +102,7 @@
<DependentUpon>MachineView.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\WpfGraphControl.cs" />
+ <Compile Include="Converters\ProcessParameterToVisibilityConverter.cs" />
<Compile Include="Converters\UserRoleToBooleanConverter.cs" />
<Compile Include="Converters\UserRoleToVisibilityConverter.cs" />
<Compile Include="MachineStudioTheme.cs" />
@@ -461,7 +462,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
<PropertyGroup>