aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-30 20:38:49 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-30 20:38:49 +0200
commit2fa92ca3654ebb274482f9bad86231028d357e5a (patch)
tree2d5bbce513317f05f82726b74b0ad6cf78db96f6 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
parentd3ba251f01ae987a14b6379e733a06dbcd77f9e4 (diff)
downloadTango-2fa92ca3654ebb274482f9bad86231028d357e5a.tar.gz
Tango-2fa92ca3654ebb274482f9bad86231028d357e5a.zip
Started working on job brush display.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml54
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs1
2 files changed, 49 insertions, 6 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 6e4d69d05..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
@@ -37,11 +37,16 @@
<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>
@@ -599,7 +604,7 @@
<Setter Property="BorderBrush" Value="{StaticResource SideBarBackground}"></Setter>
<Setter Property="Background" Value="White"></Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
+ <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>
@@ -838,10 +843,10 @@
<DataGridTemplateColumn Header="IDS PACK">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
- <Grid>
- <Polygon Points="0,0 20,0 0,20 0,0" Margin="-15 -11 0 0">
+ <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 Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}" />
+ <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>
@@ -964,7 +969,45 @@
</Grid>
<Grid>
- <Rectangle VerticalAlignment="Center" Height="10" Margin="20 0 20 0" Stroke="Gainsboro" StrokeThickness="1"></Rectangle>
+ <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>
@@ -1313,7 +1356,6 @@
<TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox>
</Grid>
- <!--<mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MaxNlPerCm,Mode=TwoWay}"></mahapps:NumericUpDown>-->
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
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 c9796fbe2..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
@@ -73,6 +73,7 @@ namespace Tango.MachineStudio.Developer.Views
SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter();
GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection;
gradientBrush.GradientStops = stops;
+ jobBrushList.UpdateLayout();
}
else
{