diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-01-31 10:11:27 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-01-31 10:11:27 +0200 |
| commit | b55483f9f095b699728e0b587ceebfdf6409a48a (patch) | |
| tree | 1d424d3fc9f75154ecae30806b952fdfb029fce9 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views | |
| parent | e027cb9fdd17fe3be7bb2c385dc37061a7eea8bb (diff) | |
| parent | 2fa92ca3654ebb274482f9bad86231028d357e5a (diff) | |
| download | Tango-b55483f9f095b699728e0b587ceebfdf6409a48a.tar.gz Tango-b55483f9f095b699728e0b587ceebfdf6409a48a.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views')
2 files changed, 1474 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index cd91b007f..e0786a1ba 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -3,10 +3,1413 @@ 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:global="clr-namespace:Tango.MachineStudio.Developer" + xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:db="clr-namespace:Tango.MachineStudio.DB.Views.DBViews;assembly=Tango.MachineStudio.DB" + xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" + xmlns:designer="clr-namespace:Tango.MachineStudio.MachineDesigner.Views;assembly=Tango.MachineStudio.MachineDesigner" + xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" + xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration" + xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="300" Background="#CBCBCB"> + d:DesignHeight="1080" d:DesignWidth="1920" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> + <Setter Property="mahapps:ControlsHelper.HeaderFontSize" Value="14" /> + <Setter Property="Margin" Value="2" /> + </Style> + + <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> + <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> + <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter"></converters:GreaterThanToBooleanConverter> + <converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter"></converters:SmallerThanToBooleanConverter> + <localConverters:BrushStopToColorConverter x:Key="BrushStopToColorConverter" /> + <localConverters:BrushStopCMYKToColorConverter x:Key="BrushStopCMYKToColorConverter" /> + <localConverters:BrushStopLabToColorConverter x:Key="BrushStopLabToColorConverter" /> + <localConverters:SegmentToGradientStopsConverter x:Key="SegmentToGradientStopsConverter" /> + <localConverters:BrushStopToOffsetLimitConverter x:Key="BrushStopToOffsetLimitConverter" /> + <localConverters:JobToColumnDefinitionsConverter x:Key="JobToColumnDefinitionsConverter" /> + <localConverters:SegmentLengthToWidthConverter x:Key="SegmentLengthToWidthConverter" /> + <localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" /> + + <SolidColorBrush x:Key="SideBarBackground" Color="#F9F9F9"> + + </SolidColorBrush> + + <Color x:Key="dummyColor">Transparent</Color> + + <Style x:Key="droppableGrid" TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + <Style.Triggers> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + <Trigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.EnterActions> + <Trigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.ExitActions> + </Trigger> + </Style.Triggers> + </Style> + + <Style x:Key="brushStopBorder" TargetType="Border"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + <Style.Triggers> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + <Trigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.EnterActions> + <Trigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation> + <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </Trigger.ExitActions> + </Trigger> + </Style.Triggers> + </Style> + + <Style x:Key="draggableGrid" TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter> + <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter> + </Style> + + <Style TargetType="Border" x:Key="JobFieldBorder"> + <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="CornerRadius" Value="100 10 100 0"></Setter> + <Setter Property="Padding" Value="10 5"></Setter> + <Setter Property="Margin" Value="0 0 10 0"></Setter> + <Setter Property="Background"> + <Setter.Value> + <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> + <GradientStop Color="#73F4F4F4"/> + <GradientStop Color="White" Offset="1"/> + </LinearGradientBrush> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="ContentControl" x:Key="colorPicker"> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate> + <colorPicker:ColorPickerCombo SelectedColorChanged="ColorPickerCombo_SelectedColorChanged" SelectedColor="{Binding Color,Mode=TwoWay}" Margin="30 0 0 0" VerticalAlignment="Center" Width="100" BorderBrush="{StaticResource AccentColorBrush}" Background="White"> + + </colorPicker:ColorPickerCombo> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + </UserControl.Resources> + <Grid> - <TextBlock FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center">DEVLOPER MODULE</TextBlock> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid Background="{StaticResource SideBarBackground}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Height" Value="350"></Setter> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <ScrollViewer VerticalScrollBarVisibility="Auto"> + <StackPanel> + <Expander Header="PROCESS PARAMETERS" IsExpanded="True"> + <Grid> + <Grid Height="250"> + <StackPanel Orientation="Horizontal" Margin="25 0 0 0"> + + <Border Width="140" Margin="0 0 10 0" Padding="5" CornerRadius="5" BorderThickness="1" BorderBrush="Silver"> + <DockPanel> + <TextBlock DockPanel.Dock="Top" VerticalAlignment="Center" Padding="2">HISTORY</TextBlock> + <ListBox Margin="0 10 0 0" ItemsSource="{Binding GroupsHistory}" SelectedItem="{Binding SelectedGroupHistory}"> + <ListBox.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding Name}" FontSize="11" FontWeight="Bold"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Style.Triggers> + <DataTrigger Binding="{Binding Active}" Value="True"> + <Setter Property="Foreground" Value="#FF5F5F"></Setter> + <Setter Property="FontStyle" Value="Italic"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + <TextBlock Text="{Binding SaveDate}" FontStyle="Italic" Foreground="Gray" FontSize="10"></TextBlock> + </StackPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </DockPanel> + </Border> + <ItemsControl ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" IsEnabled="{Binding RmlProcessParametersTableGroup.Active}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True"></WrapPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:ProcessParametersTable}"> + <Border Padding="5" CornerRadius="5" BorderThickness="1" BorderBrush="Silver" Height="250" Margin="0 0 10 0"> + <DockPanel> + <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox> + <WrapPanel Orientation="Vertical" Margin="0 5 0 0"> + <WrapPanel.Resources> + <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}"> + <Setter Property="FontSize" Value="10"></Setter> + <Setter Property="Foreground" Value="#7A7A7A"></Setter> + <Setter Property="Margin" Value="0 5 0 5"></Setter> + <Setter Property="MinWidth" Value="80"></Setter> + </Style> + + <Style TargetType="mahapps:NumericUpDown"> + <Setter Property="FontFamily" Value="digital-7"></Setter> + </Style> + + <Style TargetType="ContentControl"> + <Setter Property="FontFamily" Value="digital-7"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ContentControl"> + <Grid> + <Border> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="BorderBrush" Value="Gainsboro"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="Padding" Value="2"></Setter> + <Setter Property="Margin" Value="5"></Setter> + <Setter Property="CornerRadius" Value="3"></Setter> + </Style> + </Border.Style> + <ContentPresenter Content="{TemplateBinding Content}"></ContentPresenter> + </Border> + + <materialDesign:PackIcon HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0 0 0 0" Width="12" Height="12" Kind="Settings"></materialDesign:PackIcon> + </Grid> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + + </WrapPanel.Resources> + <editors:ParameterizedEditor ParameterizedObject="{Binding}"> + <editors:ParameterizedEditor.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True" Orientation="Vertical" /> + </ItemsPanelTemplate> + </editors:ParameterizedEditor.ItemsPanel> + <editors:ParameterizedEditor.DoubleTemplate> + <DataTemplate> + <ContentControl> + <StackPanel> + <TextBlock Text="{Binding Name}"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </ContentControl> + </DataTemplate> + </editors:ParameterizedEditor.DoubleTemplate> + </editors:ParameterizedEditor> + </WrapPanel> + </DockPanel> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <StackPanel Margin="5 0 0 10" VerticalAlignment="Bottom"> + <Button Command="{Binding SaveProcessParametersCommand}">SAVE GROUP</Button> + </StackPanel> + </StackPanel> + </Grid> + + <Grid Background="White"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> + </Grid> + </Grid> + </Expander> + <Expander Header="CONTROL PARAMETERS" IsExpanded="False"> + + </Expander> + </StackPanel> + </ScrollViewer> + + <Rectangle VerticalAlignment="Bottom" Stroke="#CECECE" StrokeThickness="1"></Rectangle> + </Grid> + + <Grid Grid.Row="1"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="234*"/> + <RowDefinition x:Name="graphRowDefinition" Height="440"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="350"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + + <Grid> + <Rectangle HorizontalAlignment="Right" StrokeDashArray="5" StrokeThickness="1" Stroke="Silver" Margin="0 40 0 40"></Rectangle> + <DockPanel Margin="10"> + <StackPanel DockPanel.Dock="Top" > + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="70"></Image> + <TextBlock VerticalAlignment="Center" FontWeight="SemiBold" Margin="10 0 0 0" FontSize="30">MACHINE JOBS</TextBlock> + </StackPanel> + + <Rectangle VerticalAlignment="Bottom" StrokeDashArray="7" StrokeThickness="1" Stroke="Silver" Margin="0 8 0 0"></Rectangle> + </StackPanel> + <Border DockPanel.Dock="Bottom" Background="{StaticResource SideBarBackground}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Command="{Binding RemoveJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Job"> + <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + <Button Command="{Binding AddJobCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Job"> + <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + </StackPanel> + </Border> + <ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0"> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/rgb.png" Width="32"></Image> + + <StackPanel VerticalAlignment="Center" Margin="10 0 0 0"> + <TextBlock FontWeight="Bold" Text="{Binding Name}"></TextBlock> + <TextBlock Foreground="Gray" FontStyle="Italic" FontSize="10" Text="{Binding CreationDate}"></TextBlock> + </StackPanel> + + + </StackPanel> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </DockPanel> + </Grid> + + <Grid Grid.Column="1" Margin="10 10 10 0"> + <Grid.ColumnDefinitions> + <ColumnDefinition/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <StackPanel> + <Grid> + <StackPanel Orientation="Horizontal" Margin="0 5 0 0"> + <Image Source="../Images/rgb.png" Width="24"></Image> + <TextBlock Margin="5 0 0 0" Text="{Binding SelectedJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock> + </StackPanel> + + <StackPanel Orientation="Horizontal" Margin="0 5 0 0" HorizontalAlignment="Right"> + <TextBlock Margin="0 0 5 0" Text="{Binding SelectedJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock> + <Image Source="../Images/calendar.png" Width="16"></Image> + </StackPanel> + </Grid> + + <StackPanel Orientation="Horizontal" Margin="0 20 0 0" MaxWidth="940" HorizontalAlignment="Left"> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/name.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> + </StackPanel> + <TextBox Margin="0 3 0 0" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> + </StackPanel> + </Border> + + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="10 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/wind.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock> + </StackPanel> + <ComboBox ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox> + </StackPanel> + </Border> + + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="20 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/inter-segment.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock> + </StackPanel> + <DockPanel LastChildFill="True"> + <ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton> + <mahapps:NumericUpDown IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown> + </DockPanel> + </StackPanel> + </Border> + + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="20 5 5 5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/lubrication.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock> + </StackPanel> + <DockPanel LastChildFill="True" Margin="0 10 0 0"> + <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton> + </DockPanel> + </StackPanel> + </Border> + + <Border Style="{StaticResource JobFieldBorder}" Height="90"> + <StackPanel Width="200"> + <StackPanel Orientation="Horizontal" Margin="10 0 0 0"> + <Image Source="../Images/description.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Description</TextBlock> + </StackPanel> + + <Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5"> + <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding SelectedJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox> + </Border> + </StackPanel> + </Border> + </StackPanel> + + + </StackPanel> + + <Grid Grid.Row="1" Margin="0 20 0 0"> + <Grid.RowDefinitions> + <RowDefinition Height="1*" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="200"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <DockPanel> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <Image Source="../Images/segment.png" Width="42"></Image> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENTS</TextBlock> + </StackPanel> + + <Border DockPanel.Dock="Bottom" Background="{StaticResource SideBarBackground}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Command="{Binding RemoveSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Segment"> + <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + <Button Command="{Binding AddSegmentCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Segment"> + <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + </StackPanel> + </Border> + + <ListBox SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}"> + <ListBox.ItemTemplate> + <DataTemplate> + <StackPanel Orientation="Horizontal" Margin="0 5 0 0"> + <Image Source="../Images/segment-single.png" Width="24"></Image> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}" FontSize="12" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock> + </StackPanel> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </DockPanel> + + <Grid Grid.Column="1" Margin="10 5 0 0"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> + <Image Source="../Images/segment-single.png" Width="24"></Image> + <TextBlock Margin="5 0 0 0" Text="{Binding SelectedSegment.Name,FallbackValue=''}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock> + </StackPanel> + + <Grid Margin="0 10 0 0"> + <DockPanel> + <Grid DockPanel.Dock="Top"> + <Grid> + <StackPanel Orientation="Horizontal"> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/name.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock> + </StackPanel> + <TextBox Margin="0 3 0 0" Text="{Binding SelectedSegment.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox> + </StackPanel> + </Border> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/ruler.png" Width="32"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock> + </StackPanel> + <mahapps:NumericUpDown IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> + </StackPanel> + + <Grid HorizontalAlignment="Right"> + <StackPanel Orientation="Horizontal"> + + </StackPanel> + </Grid> + </Grid> + </Grid> + + <Border DockPanel.Dock="Bottom" Background="{StaticResource SideBarBackground}"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" HorizontalAlignment="Right"> + <Button Command="{Binding RemoveBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Remove Color"> + <materialDesign:PackIcon Kind="MinusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + <Button Command="{Binding AddBrushStopCommand}" Margin="5" Style="{StaticResource MaterialDesignFlatButton}" Padding="0" ToolTip="Add Color"> + <materialDesign:PackIcon Kind="PlusCircleOutline" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + </StackPanel> + </Border> + + <Grid Margin="0 20 0 0"> + <DockPanel> + <Grid DockPanel.Dock="Top"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> + <Image Source="../Images/color-palette.png" Width="42"></Image> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">SEGMENT BRUSH</TextBlock> + </StackPanel> + + <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="8" Margin="200 0 80 0" StrokeThickness="1" Stroke="Gainsboro"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,0" x:Name="gradientBrush"></LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + <Grid Margin="0 10 0 0"> + <ListBox Style="{x:Null}" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}"> + + </Style> + </ListBox.ItemContainerStyle> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:BrushStop}"> + + <StackPanel Margin="0 0 0 5"> + <Border BorderThickness="1" CornerRadius="5" Padding="10" Background="Transparent" dragAndDrop:DragAndDropService.Drop="OnBrushStopBorderDrop"> + <Border.Style> + <Style TargetType="Border" BasedOn="{StaticResource brushStopBorder}"> + <Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter> + <Setter Property="Background" Value="White"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,FallbackValue=False}" Value="True"> + <Setter Property="BorderBrush" Value="Gainsboro"></Setter> + <Setter Property="Background" Value="{StaticResource SideBarBackground}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <Grid> + <DockPanel> + <ContentControl DockPanel.Dock="Left"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <Rectangle/> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel VerticalAlignment="Center"> + <ItemsControl ItemsSource="{Binding LiquidVolumes}" VerticalAlignment="Center"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0"> + <Border.BorderBrush> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Border.BorderBrush> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF6F6F"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Red, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#92FF92"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Green, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#3C7EF4"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Blue, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="255" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <ContentControl Style="{StaticResource colorPicker}"></ContentControl> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Cyan"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Cyan, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Magenta"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Magenta, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Yellow"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Yellow, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Black"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding Black, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0" HideUpDownButtons="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color}"> + </SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="Gray"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding L, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FF8A8A"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding A, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Border BorderThickness="1" Width="50" Height="50" CornerRadius="50" Margin="10 0 0 0" BorderBrush="#FFFF8A"> + <mahapps:NumericUpDown FontSize="14" FontFamily="digital-7" HorizontalAlignment="Center" Value="{Binding B, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="-100" Maximum="100" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <Style TargetType="TextBox"/> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </Border> + + <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color}"> + </SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + + <Grid DockPanel.Dock="Right"> + <Border Style="{StaticResource JobFieldBorder}"> + <StackPanel Margin="5" Width="140"> + <StackPanel Orientation="Horizontal"> + <Image Source="../Images/colorspace.png" Width="24"></Image> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Color Space</TextBlock> + </StackPanel> + <ComboBox ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Adapter.ColorSpaces}" SelectedItem="{Binding ColorSpace}" DisplayMemberPath="Name"></ComboBox> + </StackPanel> + </Border> + </Grid> + <Grid> + <StackPanel VerticalAlignment="Center"> + <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center"><Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> <Run FontFamily="digital-7" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run></TextBlock> + <Slider ValueChanged="Offset_Slider_ValueChanged" IsSnapToTickEnabled="True" TickFrequency="1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Value="{Binding OffsetPercent}"> + <Slider.Minimum> + <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding> + <Binding Path="StopIndex"></Binding> + </MultiBinding> + </Slider.Minimum> + <Slider.Maximum> + <MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding> + </MultiBinding> + </Slider.Maximum> + </Slider> + </StackPanel> + </Grid> + </DockPanel> + </Grid> + </Border> + + <StackPanel> + <Grid VerticalAlignment="Top"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=toggleExpand, Path=IsChecked}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <Grid> + <DataGrid ItemsSource="{Binding LiquidVolumes}" AutoGenerateColumns="False"> + <DataGrid.Columns> + <DataGridTemplateColumn Header="IDS PACK"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Grid x:Name="t0"> + <Polygon x:Name="t1" Points="0,0 20,0 0,20 0,0" Margin="-15 -11 0 0"> + <Polygon.Fill> + <SolidColorBrush x:Name="t2" Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter},FallbackValue={StaticResource dummyColor}}" /> + </Polygon.Fill> + </Polygon> + <TextBlock TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock> + </Grid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="DISPENSER NL / PULSE"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding IdsPack.DispenserType.NlPerPulse,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="LIQUID MAX NL / CM"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding LiquidMaxNanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="VOLUME"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding Volume,StringFormat='0.0'}"></Run> + <Run Text="%" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="FORMULA"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding IdsPack.IdsPackFormula.Name}"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="NANOLITER / SEC"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding NanoliterPerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(nl)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="PULSE / SEC"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <TextBlock VerticalAlignment="Center"> + <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run> + </TextBlock> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + </Grid> + </Grid> + <ToggleButton Margin="5" x:Name="toggleExpand" Style="{StaticResource MaterialDesignFlatToggleButton}" ToolTip="View more" HorizontalAlignment="Right" Padding="0" Width="24" Height="24" VerticalContentAlignment="Center"> + <materialDesign:PackIcon VerticalAlignment="Center"> + <materialDesign:PackIcon.Style> + <Style TargetType="materialDesign:PackIcon"> + <Setter Property="Kind" Value="ArrowDown"></Setter> + <Setter Property="Margin" Value="0"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ToggleButton},Path=IsChecked}" Value="True"> + <Setter Property="Kind" Value="ArrowUp"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </materialDesign:PackIcon.Style> + </materialDesign:PackIcon> + </ToggleButton> + </StackPanel> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ListBox> + </Grid> + </DockPanel> + </Grid> + </DockPanel> + </Grid> + </DockPanel> + </Grid> + </Grid> + + <Grid Height="60" Grid.Row="1"> + <DockPanel> + <Grid DockPanel.Dock="Left"> + <StackPanel HorizontalAlignment="Left" Margin="0 0 0 0"> + <TextBlock FontSize="14" Margin="0 20 0 0"> + <Run FontWeight="Bold">ESTIMATED DURATION:</Run> + <Run FontSize="18" Foreground="{StaticResource AccentColorBrush}" FontStyle="Italic" FontFamily="digital-7">00:00:00</Run> + </TextBlock> + </StackPanel> + </Grid> + + <Grid DockPanel.Dock="Right"> + <StackPanel Orientation="Horizontal"> + <Button Height="40" Width="170"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ClockFast" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">START</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Grid> + + <Grid> + <Border VerticalAlignment="Center" Height="10" Margin="20 0 20 0" BorderBrush="Gainsboro" BorderThickness="1"> + <Grid> + <ItemsControl ItemsSource="{Binding SelectedJob.Segments}" x:Name="jobBrushList"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel Orientation="Horizontal"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid> + <Grid.Width> + <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> + <Binding Path="Length"></Binding> + </MultiBinding> + </Grid.Width> + <Rectangle> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> + <LinearGradientBrush.GradientStops> + <MultiBinding Converter="{StaticResource SegmentToGradientStopsConverterMulti}"> + <Binding Path="."></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding> + </MultiBinding> + </LinearGradientBrush.GradientStops> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </Grid> + </Border> + </Grid> + </DockPanel> + </Grid> + </Grid> + </Grid> + + <Grid Grid.Column="1" Margin="10 0 0 0" Width="340"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Grid Margin="5 0 0 0"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> + <Image Source="../Images/camera.png" Width="42"></Image> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">USB CAMERAS</TextBlock> + </StackPanel> + <UniformGrid Rows="3"> + <Border RenderOptions.BitmapScalingMode="Fant"> + <Border.Background> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> + </Border.Background> + + <Grid> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 1</TextBlock> + </Label> + </Grid> + </Border> + <Border RenderOptions.BitmapScalingMode="Fant"> + <Border.Background> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> + </Border.Background> + + <Grid> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 2</TextBlock> + </Label> + </Grid> + </Border> + <Border RenderOptions.BitmapScalingMode="Fant"> + <Border.Background> + <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush> + </Border.Background> + + <Grid> + <Label Margin="22 17 0 0" Style="{StaticResource graphLabel}"> + <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 3</TextBlock> + </Label> + </Grid> + </Border> + </UniformGrid> + </DockPanel> + </Grid> + + </Grid> + + </Grid> + + <Grid Grid.Row="1" Grid.ColumnSpan="2" Background="{StaticResource SideBarBackground}"> + <Grid Margin="10 70 10 10"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="350"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <DockPanel> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Top"> + <Image Source="../Images/graphs.png" Width="42"></Image> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">AVAILABLE GRAPHS</TextBlock> + </StackPanel> + <ScrollViewer Margin="0 5 0 0" VerticalScrollBarVisibility="Auto"> + <ItemsControl Margin="0 0 5 0" ItemsSource="{Binding AvailableSensors}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="2" IsItemsHost="True"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:Sensor}"> + <Border dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}" Margin="5" CornerRadius="3" Height="120" BorderThickness="1" BorderBrush="Silver" ClipToBounds="True"> + <Border.Background> + <ImageBrush ImageSource="../Images/line_graph.png" Stretch="Fill"></ImageBrush> + </Border.Background> + <Grid> + <Label HorizontalAlignment="Left" VerticalAlignment="Top" Style="{StaticResource graphLabel}"> + <TextBlock Foreground="DimGray" VerticalAlignment="Center" Text="{Binding Description}"></TextBlock> + </Label> + </Grid> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </DockPanel> + </Grid> + + <Grid> + <Grid Margin="0 0 10 0" Style="{StaticResource droppableGrid}" dragAndDrop:DragAndDropService.Drop="OnDropAvailableSensor"> + <Border> + <ItemsControl ItemsSource="{Binding Graphs}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid IsItemsHost="True"> + <UniformGrid.Style> + <Style TargetType="UniformGrid"> + <Setter Property="Columns" Value="1"></Setter> + <Setter Property="Rows" Value="1"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=3}" Value="True"> + <Setter Property="Columns" Value="{Binding Graphs.Count}"></Setter> + <Setter Property="Rows" Value="1"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=2}" Value="True"></Condition> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=5}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Columns" Value="2"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=4}" Value="True"></Condition> + <Condition Binding="{Binding Graphs.Count,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=7}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Columns" Value="3"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </MultiDataTrigger> + <DataTrigger Binding="{Binding Graphs.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=6}" Value="True"> + <Setter Property="Columns" Value="4"></Setter> + <Setter Property="Rows" Value="2"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </UniformGrid.Style> + </UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> + </Border> + <Grid> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Graphs.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock Foreground="Silver" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="30">DRAG & DROP GRAPHS</TextBlock> + </Grid> + </Grid> + </Grid> + </Grid> + + <Border VerticalAlignment="Top" Height="50" CornerRadius="0 0 50 50"> + <Border.Effect> + <DropShadowEffect BlurRadius="30" ShadowDepth="20" Opacity="0.2" /> + </Border.Effect> + <Border.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Color="White" Offset="0" /> + <GradientStop Color="#FFE6E6E6" Offset="1"/> + + </LinearGradientBrush> + </Border.Background> + + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 0 120 0"> + <ToggleButton x:Name="chkGraphs" IsChecked="True"></ToggleButton> + <TextBlock VerticalAlignment="Center" Margin="5 -1 0 0" Foreground="Gray">Show Graphs</TextBlock> + </StackPanel> + </Border> + </Grid> + + <Grid Grid.ColumnSpan="3" Background="White" Visibility="Collapsed"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.5"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="0" Duration="00:00:0.5"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40">MONITORING</TextBlock> + </Grid> + </Grid> + </Grid> + </Grid> + + <Grid Background="{StaticResource SideBarBackground}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Width" Value="550"></Setter> + <Setter Property="LayoutTransform"> + <Setter.Value> + <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="1" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleX" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <ScrollViewer VerticalScrollBarVisibility="Auto" FlowDirection="RightToLeft"> + <materialDesign:Card Background="{StaticResource SideBarBackground}" FlowDirection="LeftToRight"> + <StackPanel> + <Expander Header="MACHINE" IsExpanded="True" Background="{StaticResource SideBarBackground}"> + <StackPanel Margin="0 0 0 0"> + <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Machine" Margin="40 0 40 0"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <designer:MachineView Width="540" IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> + <Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">EDIT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Expander> + + <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + + <Expander Header="MEDIA" Background="{StaticResource SideBarBackground}" IsExpanded="True"> + <StackPanel> + <ComboBox DockPanel.Dock="Top" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding SelectedRML}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Thread" Margin="40 0 40 0"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + + <Button DockPanel.Dock="Bottom" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">EDIT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Expander> + + <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + + <Expander Background="{StaticResource SideBarBackground}" IsExpanded="True"> + <Expander.HeaderTemplate> + <DataTemplate> + <TextBlock><Run>LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> + </DataTemplate> + </Expander.HeaderTemplate> + + <Grid> + <StackPanel Margin="40 0 40 0"> + <ItemsControl ItemsSource="{Binding LiquidTypesRmls}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True"></WrapPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> + <StackPanel Margin="0 0 10 20"> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidType.Name}"></TextBlock> + <Grid Width="60" Height="50" Margin="0 5 0 0"> + <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> + <shapes:Hexagon.Fill> + <LinearGradientBrush Opacity="0.7" > + <GradientStop Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + <GradientStop Color="White" Offset="1"/> + </LinearGradientBrush> + </shapes:Hexagon.Fill> + </shapes:Hexagon> + + <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> + </Grid> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Button Command="{Binding SaveLiquidFactorsCommand}" HorizontalAlignment="Right" Margin="0 10 -20 20" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Harddisk"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">SAVE</TextBlock> + </StackPanel> + </Button> + </StackPanel> + + <Grid Height="150" Background="{StaticResource SideBarBackground}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> + </Grid> + </Grid> + </Expander> + + + </StackPanel> + </materialDesign:Card> + </ScrollViewer> + + <Rectangle HorizontalAlignment="Right" Stroke="#CECECE" StrokeThickness="1"></Rectangle> + </Grid> + + <Button Background="{StaticResource SideBarBackground}" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0"> + <Border CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#C6C0C0"> + <Grid> + <TextBlock Foreground="#FF7272" Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> + <TextBlock.LayoutTransform> + <RotateTransform Angle="270"></RotateTransform> + </TextBlock.LayoutTransform> + </TextBlock> + </Grid> + </Border> + </Button> + </Grid> + + <dragAndDrop:DraggingSurface x:Name="draggingSurface" /> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs index 6ebfd9832..c76cf657f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs @@ -12,6 +12,10 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Integration.Observables; +using Tango.DragAndDrop; +using Tango.MachineStudio.Developer.Converters; +using Tango.MachineStudio.Developer.ViewModels; namespace Tango.MachineStudio.Developer.Views { @@ -20,9 +24,74 @@ namespace Tango.MachineStudio.Developer.Views /// </summary> public partial class MainView : UserControl { + private MainViewVM _vm; + + public DraggingSurface DraggingSurface + { + get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); } + set { SetValue(DraggingSurfaceProperty, value); } + } + public static readonly DependencyProperty DraggingSurfaceProperty = + DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null)); + public MainView() { InitializeComponent(); + + DraggingSurface = draggingSurface; + this.Loaded += (x, y) => + { + _vm = DataContext as MainViewVM; + }; + + chkGraphs.Checked += (x, y) => { graphRowDefinition.Height = new GridLength(440, GridUnitType.Pixel); }; + chkGraphs.Unchecked += (x, y) => { graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel); }; + } + + private void OnDropAvailableSensor(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is Sensor) + { + _vm.OnDropAvailableSensor(e.Draggable.DataContext as Sensor); + } + } + + private void ColorPickerCombo_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e) + { + UpdateGradientBrushDisplay(); + } + + private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) + { + UpdateGradientBrushDisplay(); + } + + private void UpdateGradientBrushDisplay() + { + if (_vm.SelectedSegment != null) + { + SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter(); + GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection; + gradientBrush.GradientStops = stops; + jobBrushList.UpdateLayout(); + } + else + { + gradientBrush.GradientStops = new GradientStopCollection(); + } + } + + private void OnBrushStopBorderDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is BrushStop) + { + _vm.OnDropBrushStop(e.Draggable.DataContext as BrushStop, e.Droppable.DataContext as BrushStop); + } + } + + private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + UpdateGradientBrushDisplay(); } } } |
