aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-24 17:55:26 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-24 17:55:26 +0300
commita2fc839fd0715353fb532a0a67882bc26b6744c8 (patch)
tree8a7117006fc9528b68b91326ccbf0534a00df46a /Software/Visual_Studio/PPC
parent3d1002b25ebc05c88336dc56ec03f627fd49d200 (diff)
downloadTango-a2fc839fd0715353fb532a0a67882bc26b6744c8.tar.gz
Tango-a2fc839fd0715353fb532a0a67882bc26b6744c8.zip
Implemented job length factor !
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/RunningJobViewer.xaml6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml42
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml1
4 files changed, 42 insertions, 13 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml
index d49e37d9d..e7a416623 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml
@@ -33,7 +33,7 @@
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
- <Binding Path="Length"></Binding>
+ <Binding Path="LengthWithFactor"></Binding>
</MultiBinding>
</Grid.Width>
@@ -48,7 +48,7 @@
</Style.Triggers>
</Style>
</TextBlock.Style>
- <Run Text="{Binding Length,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run>
+ <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run>
</TextBlock>
</Grid>
</DataTemplate>
@@ -80,7 +80,7 @@
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
- <Binding Path="Length"></Binding>
+ <Binding Path="LengthWithFactor"></Binding>
</MultiBinding>
</Grid.Width>
<Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/RunningJobViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/RunningJobViewer.xaml
index 09f0d6d3f..a0bc6c1d9 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/RunningJobViewer.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/RunningJobViewer.xaml
@@ -34,7 +34,7 @@
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="RunningJobStatus.CurrentUnitTotalProgress"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
- <Binding Path="Length"></Binding>
+ <Binding Path="LengthWithFactor"></Binding>
</MultiBinding>
</Grid.Width>
@@ -49,7 +49,7 @@
</Style.Triggers>
</Style>
</TextBlock.Style>
- <Run Text="{Binding Length,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run>
+ <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0}"></Run><Run Text="m"></Run>
</TextBlock>
</Grid>
</DataTemplate>
@@ -81,7 +81,7 @@
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="RunningJobStatus.CurrentUnitTotalProgress"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
- <Binding Path="Length"></Binding>
+ <Binding Path="LengthWithFactor"></Binding>
</MultiBinding>
</Grid.Width>
<Rectangle Fill="{Binding SegmentBrush}"></Rectangle>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
index 8933940b2..834143bea 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
@@ -489,7 +489,7 @@
<Run Text="Length (m):"></Run>
</TextBlock>
- <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" />
+ <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" />
<Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" />
</StackPanel>
@@ -528,12 +528,40 @@
<localControls:JobSummeryViewer DataContext="{Binding Job}" />
</Grid>
- <Grid Margin="0 30 0 0">
- <TextBlock>
- <Run Text="Job length (m):"></Run>
- <Run Text="{Binding Job.Length,Mode=OneWay}"></Run>
- </TextBlock>
- </Grid>
+ <DockPanel Margin="0 30 0 0" LastChildFill="False">
+
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center">
+ <TextBlock>
+ <Run Text="Job length (m):"></Run>
+ <Run Text="{Binding Job.Length,Mode=OneWay}"></Run>
+ </TextBlock>
+ <TextBlock Foreground="{StaticResource TangoGrayTextBrush}">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ <Run>(</Run><Run Text="{Binding Job.Length,Mode=OneWay}"></Run><Run>+</Run><Run Text="{Binding Job.LengthPercentageFactor,Mode=OneWay}"></Run><Run>%</Run><Run>)</Run>
+ </TextBlock>
+ </StackPanel>
+
+ <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0">
+ <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}">
+ <Run Text="Factor: +"></Run>
+ </TextBlock>
+
+ <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="30" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" />
+
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock>
+
+ <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" />
+ </StackPanel>
+ </DockPanel>
</StackPanel>
</StackPanel>
</Border>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
index 1a8bfa15d..1d94b5c67 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
@@ -40,6 +40,7 @@
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
<converters:TimeSpanToTwoDigitsTimeConverter x:Key="TimeSpanToTwoDigitsTimeConverter" />
<converters:TimeSpanToLabelConverter x:Key="TimeSpanToLabelConverter" />
+ <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter" />
<Style TargetType="FrameworkElement">
<Setter Property="TextElement.FontFamily" Value="{StaticResource TangoFlexoFontFamily}"></Setter>