aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
diff options
context:
space:
mode:
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.xaml79
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs5
2 files changed, 68 insertions, 16 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 ae57c2d25..f716b6228 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
@@ -53,6 +53,7 @@
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
<localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
<localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" />
+ <localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" />
<SolidColorBrush x:Key="SideBarBackground" Color="White">
@@ -806,21 +807,43 @@
</Button>
</StackPanel>
</Border>
- <ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0">
+ <ListBox ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" Margin="0 10 0 0" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
- <Grid>
- <StackPanel Orientation="Horizontal">
+ <DockPanel>
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
<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>
+
+ <ItemsControl HorizontalAlignment="Right" ItemsSource="{Binding Segments}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
+
+ </StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Border Width="25" Height="25" Margin="10 0 0 0" BorderThickness="1" BorderBrush="DimGray" CornerRadius="3">
+ <Border.Background>
+ <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
+ <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>
+ </Border.Background>
+ </Border>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
@@ -956,13 +979,32 @@
</StackPanel>
</Border>
- <ListBox SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}">
+ <ListBox SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" HorizontalContentAlignment="Stretch">
<ListBox.ItemTemplate>
<DataTemplate>
- <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
+ <DockPanel>
+ <StackPanel Orientation="Horizontal" Margin="0 5 0 0" DockPanel.Dock="Left">
<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>
+
+ <ItemsControl ItemsSource="{Binding BrushStops}" HorizontalAlignment="Right" Margin="0 5 0 0">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center"></StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Ellipse Width="8" Height="8" Stroke="DimGray" Margin="5 0 0 0">
+ <Ellipse.Fill>
+ <SolidColorBrush Color="{Binding Color}" />
+ </Ellipse.Fill>
+ </Ellipse>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </DockPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
@@ -1232,8 +1274,22 @@
</Grid>
<Grid>
<StackPanel VerticalAlignment="Center">
- <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center"><Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run> <Run FontFamily="{StaticResource 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}">
+ <StackPanel.Style>
+ <Style TargetType="StackPanel">
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.SelectedSegment.BrushStops.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=1}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <TextBlock Width="150" TextAlignment="Center" HorizontalAlignment="Center">
+ <Run FontWeight="Bold" FontStyle="Italic" Text="OFFSET:"></Run>
+ <Run FontFamily="{StaticResource digital-7}" Text="{Binding OffsetPercent,StringFormat={}{0:F1}%}"></Run>
+ <Run Foreground="Gray" FontSize="9" Text="{Binding OffsetMeters,Mode=OneWay,StringFormat={} ( {0:F1}m )}"></Run>
+ </TextBlock>
+ <Slider ValueChanged="Offset_Slider_ValueChanged" SmallChange="0.1" IsSnapToTickEnabled="True" TickFrequency="0.1" Margin="0 5 0 0" HorizontalAlignment="Center" Width="150" Value="{Binding OffsetPercent}" IsEnabled="{Binding IsMiddle}">
<Slider.Minimum>
<MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="min">
<Binding Path="."></Binding>
@@ -1243,8 +1299,9 @@
</Slider.Minimum>
<Slider.Maximum>
<MultiBinding Converter="{StaticResource BrushStopToOffsetLimitConverter}" ConverterParameter="max">
- <Binding Path="."></Binding>
+ <Binding Path="." Delay="500"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=UserControl,Mode=FindAncestor}" Path="DataContext.SelectedSegment"></Binding>
+ <Binding Path="StopIndex"></Binding>
</MultiBinding>
</Slider.Maximum>
</Slider>
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 be24711c1..c8d37d9aa 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
@@ -110,11 +110,6 @@ namespace Tango.MachineStudio.Developer.Views
}
}
- private void ColorPickerCombo_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e)
- {
-
- }
-
private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
UpdateGradientBrushDisplay();