diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml | 339 |
1 files changed, 210 insertions, 129 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml index cc0b43e48..1542adf49 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml @@ -5,9 +5,51 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + + <UserControl.Resources> + <sharedConverters:ColorToIntegerConverter x:Key="ColorToIntegerConverter" /> + + <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.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> + </UserControl.Resources> + <Grid> <Grid> <Grid.ColumnDefinitions> @@ -25,137 +67,51 @@ </Image> <Canvas> - <Grid Canvas.Top="410" Canvas.Left="420" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="310" Height="90"> - <UniformGrid Columns="8"> - <Grid Margin="2"> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FF00E8FF"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FFD900FF"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FFFAFF00"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="Black"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="White"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant" Margin="2"></Image> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant" Margin="2"></Image> - <Image Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant" Margin="2"></Image> - </UniformGrid> - <Rectangle VerticalAlignment="Bottom" Stroke="#202020" StrokeThickness="1"> + <Grid Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> + <ItemsControl ItemsSource="{Binding Configuration.IdsPacks}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="8"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <UniformGrid Columns="1" Rows="2"> + <Grid Margin="2" Style="{StaticResource draggableGrid}" dragAndDrop:DragAndDropService.Drop="OnDroppedDispenser"> + <Image IsHitTestVisible="False" Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> + <Rectangle IsHitTestVisible="False" Margin="14 25 13 34"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> + <GradientStop Offset="0" Color="Transparent" /> + <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + + <Grid Margin="2" Style="{StaticResource draggableGrid}"> + <Image IsHitTestVisible="False" Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> + <Rectangle IsHitTestVisible="False" Margin="4 25 4 1"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> + <GradientStop Offset="0" Color="Transparent" /> + <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + </UniformGrid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Rectangle VerticalAlignment="Bottom" Stroke="DimGray" StrokeThickness="1"> <Rectangle.Effect> - <DropShadowEffect></DropShadowEffect> + <DropShadowEffect ShadowDepth="1" Opacity="1" Color="Black" /> </Rectangle.Effect> </Rectangle> </Grid> - <Grid Width="310" Height="90" Canvas.Top="314" Canvas.Left="420"> - <UniformGrid Columns="8"> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="14 25 13 34"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FF00E8FF"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="14 25 13 34"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FFA800FF"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="14 25 13 34"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="#FFE9FF00"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle Margin="14 25 13 34"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="Black"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - </Grid> - <Grid Margin="2"> - <Image Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - </Grid> - </UniformGrid> - </Grid> - <Grid Width="100" Height="100" Canvas.Left="70" Canvas.Top="331"> <Image Source="../Images/ti-tm4c129x.png" RenderOptions.BitmapScalingMode="Fant"></Image> </Grid> @@ -188,11 +144,136 @@ </Viewbox> </Grid> - <Grid Grid.Column="1" Background="#F6F6F6"> + <Grid Grid.Column="1"> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="60"/> + </Grid.RowDefinitions> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> + <Grid> + <materialDesign:Card Margin="10,10,10,0" Background="{DynamicResource MaterialDesignBackground}"> + <StackPanel> + <Expander HorizontalAlignment="Stretch" Header="Dispensers" IsExpanded="True"> + <ListBox ItemsSource="{Binding Adapter.DispensersViewSource}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="1"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> + <StackPanel Orientation="Horizontal" Margin="2 5"> + <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/injection.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding DispenserTypes.Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray" Margin="0 2 0 0"><Run Text="{Binding SerialNumber}"></Run></TextBlock> + </StackPanel> + </StackPanel> + + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> + <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Cartridge Types"> + <ListBox ItemsSource="{Binding Adapter.CartridgeTypesViewSource}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="1"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> + <StackPanel Orientation="Horizontal" Margin="2 5"> + <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/cartridge.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + </StackPanel> + </StackPanel> + + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> + <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Mid Tank Types"> + <ListBox ItemsSource="{Binding Adapter.MidTankTypesViewSource}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="1"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> + <StackPanel Orientation="Horizontal" Margin="2 5"> + <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/tank.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + </StackPanel> + </StackPanel> + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> + <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Liquid Types"> + <ListBox ItemsSource="{Binding Adapter.LiquidTypesViewSource}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="1"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> + <StackPanel Orientation="Horizontal" Margin="2 5"> + <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/liquid.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + <Rectangle Height="5" Width="170"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </StackPanel> + </StackPanel> + + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> + </StackPanel> + </materialDesign:Card> + </Grid> + </ScrollViewer> + + <Grid Grid.Row="1" Margin="10"> + <Button Height="40" Command="{Binding SaveCommand}">SAVE</Button> + </Grid> </Grid> </Grid> - + <dragAndDrop:DraggingSurface x:Name="dragSufrace" /> </Grid> </UserControl> |
