aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-10-07 13:05:29 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-07 13:05:29 +0300
commita2fcd642758c9506188160856a0f9cc0dc48be38 (patch)
tree10ad2cd62dff0d96e70a56e484b54498aaa2d7d9 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML
parent613be9fa6348139fd00ab8144885356ba36f5595 (diff)
downloadTango-a2fcd642758c9506188160856a0f9cc0dc48be38.tar.gz
Tango-a2fcd642758c9506188160856a0f9cc0dc48be38.zip
Working on RML module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs11
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs5
3 files changed, 25 insertions, 19 deletions
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 be46e2148..9e8286fa5 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
@@ -210,15 +210,12 @@ namespace Tango.MachineStudio.RML.ViewModels
ActiveProcessParametersTableView = CollectionViewSource.GetDefaultView(ActiveProcessParametersGroup.ProcessParametersTables);
ActiveProcessParametersTableView.SortDescriptions.Add(new SortDescription(nameof(ProcessParametersTable.TableIndex), ListSortDirection.Ascending));
- CalibrationDataViewVM = new CalibrationDataViewVM();
+ CalibrationDataViewVM = new CalibrationDataViewVM(_notification);
LiquidTypesRmls = ActiveRML.LiquidTypesRmls;
foreach (var liquidTypeRml in LiquidTypesRmls)
{
- CalibrationDataVM catVM = new CalibrationDataVM();
- catVM.Name = liquidTypeRml.LiquidType.Name;
- catVM.Color = liquidTypeRml.LiquidType.Color;
- catVM.LiquidType = liquidTypeRml.LiquidType;
+ CalibrationDataVM catVM = new CalibrationDataVM(liquidTypeRml.LiquidType);
if (liquidTypeRml.DefaultCatData != null)
{
@@ -359,9 +356,7 @@ namespace Tango.MachineStudio.RML.ViewModels
_active_context.LiquidTypesRmls.Add(liquidFactor);
- CalibrationDataVM catVM = new CalibrationDataVM();
- catVM.Name = liquidFactor.LiquidType.Name;
- catVM.Color = liquidFactor.LiquidType.Color;
+ CalibrationDataVM catVM = new CalibrationDataVM(liquidFactor.LiquidType);
CalibrationDataViewVM.LiquidsCalibrationData.Add(catVM);
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 aa6f39d9e..2ddd060f8 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
@@ -196,7 +196,7 @@
</ItemsControl>
</StackPanel>
- <dragAndDrop:DraggingSurface x:Name="draggingSurface" />
+ <dragAndDrop:DraggingSurface x:Name="draggingSurface" ClipToBounds="True" />
</Grid>
</DockPanel>
</Grid>
@@ -206,7 +206,6 @@
<DockPanel>
- <ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="120"/>
@@ -226,7 +225,9 @@
</Button>
</Grid>
</Border>
- <ItemsControl ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0">
+
+ <ScrollViewer x:Name="liquidsFactorsScrollViewer" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Hidden" Margin="15 0 20 0">
+ <ItemsControl Width="{Binding ElementName=calibrationDataView,Path=ActualWidth}" ItemsSource="{Binding LiquidTypesRmls}" Margin="0 10 0 0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid IsItemsHost="True" Rows="1"></UniformGrid>
@@ -259,7 +260,8 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
- </DockPanel>
+ </ScrollViewer>
+ </DockPanel>
</Grid>
<Grid Grid.Row="2">
@@ -270,18 +272,22 @@
<DropShadowEffect Opacity="0.4" />
</Border.Effect>
<Grid>
- <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock>
- <Button ToolTip="Create excel file template" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Width="30" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}">
- <materialDesign:PackIcon Kind="FileExcel" Foreground="DimGray" Width="16" Height="20" />
- </Button>
+ <TextBlock HorizontalAlignment="Left" Margin="20 0 0 0" FontSize="16">CALIBRATION DATA</TextBlock>
+ <Button ToolTip="Create excel file template" FontSize="11" Foreground="#202020" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}" Height="Auto" VerticalAlignment="Bottom" Padding="0" Command="{Binding CreateCalibrationDataExcelTemplateCommand}" Margin="0 0 5 0">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Kind="FileExcel" Foreground="DimGray" Width="16" Height="26" />
+ <TextBlock VerticalAlignment="Center" Margin="5 0 0 0">Create Empty Excel Template</TextBlock>
+ </StackPanel>
+ </Button>
</Grid>
</Border>
- <colorLabViews:CalibrationDataView Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" />
- </DockPanel>
+ <ScrollViewer x:Name="calibrationDataScrollViewer" ScrollChanged="calibrationDataScrollViewer_ScrollChanged" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Margin="15 0 20 0">
+ <colorLabViews:CalibrationDataView x:Name="calibrationDataView" Margin="0 10 0 0" DataContext="{Binding CalibrationDataViewVM}" />
+ </ScrollViewer>
+ </DockPanel>
</Grid>
</Grid>
- </ScrollViewer>
</DockPanel>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs
index c1bc9ad4a..2a5d317c6 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml.cs
@@ -47,5 +47,10 @@ namespace Tango.MachineStudio.RML.Views
ProcessParametersTable dropped = e.Droppable.DataContext as ProcessParametersTable;
_vm.OnProcessParametersTableDropped(dragged, dropped);
}
+
+ private void calibrationDataScrollViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
+ {
+ liquidsFactorsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset);
+ }
}
}