1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Threading;
using Tango.Scripting.Editors.Document;
namespace Tango.Scripting.Editors.Xml
{
/// <summary>
/// Creates object tree from XML document.
/// </summary>
/// <remarks>
/// The created tree fully describes the document and thus the orginal XML file can be
/// exactly reproduced.
///
/// Any further parses will reparse only the changed parts and the existing tree will
/// be updated with the changes. The user can add event handlers to be notified of
/// the changes. The parser tries to minimize the number of changes to the tree.
/// (for example, it will add a single child at the start of collection rather than
/// clearing the collection and adding new children)
///
/// The object tree consists of following types:
/// RawObject - Abstact base class for all types
/// RawContainer - Abstact base class for all types that can contain child nodes
/// RawDocument - The root object of the XML document
/// RawElement - Logical grouping of other nodes together. The first child is always the start tag.
/// RawTag - Represents any markup starting with "<" and (hopefully) ending with ">"
/// RawAttribute - Name-value pair in a tag
/// RawText - Whitespace or character data
///
/// For example, see the following XML and the produced object tree:
/// <![CDATA[
/// <!-- My favourite quote -->
/// <quote author="Albert Einstein">
/// Make everything as simple as possible, but not simpler.
/// </quote>
///
/// RawDocument
/// RawTag "<!--" "-->"
/// RawText " My favourite quote "
/// RawElement
/// RawTag "<" "quote" ">"
/// RawText " "
/// RawAttribute 'author="Albert Einstein"'
/// RawText "\n Make everything as simple as possible, but not simpler.\n"
/// RawTag "</" "quote" ">"
/// ]]>
///
/// The precise content of RawTag depends on what it represents:
/// <![CDATA[
/// Start tag: "<" Name? (RawText+ RawAttribute)* RawText* (">" | "/>")
/// End tag: "</" Name? (RawText+ RawAttribute)* RawText* ">"
/// P.instr.: "<?" Name? (RawText)* "?>"
/// Comment: "<!--" (RawText)* "-->"
/// CData: "<![CDATA[" (RawText)* "]]" ">"
/// DTD: "<!DOCTYPE" (RawText+ RawTag)* RawText* ">" (DOCTYPE or other DTD names)
/// UknownBang: "<!" (RawText)* ">"
/// ]]>
///
/// The type of tag can be identified by the opening backet.
/// There are helpper properties in the RawTag class to identify the type, exactly
/// one of the properties will be true.
///
/// The closing bracket may be missing or may be different for mallformed XML.
///
/// Note that there can always be multiple consequtive RawText nodes.
/// This is to ensure that idividual texts are not too long.
///
/// XML Spec: http://www.w3.org/TR/xml/
/// XML EBNF: http://www.jelks.nu/XML/xmlebnf.html
///
/// Internals:
///
/// "Try" methods can silently fail by returning false.
/// MoveTo methods do not move if they are already at the given target
/// If methods return some object, it must be no-empty. It is up to the caller to ensure
/// the context is appropriate for reading.
///
/// </remarks>
public class AXmlParser
{
<UserControl x:Class="Tango.MachineStudio.Developer.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:dispensing="clr-namespace:Tango.BL.Dispensing;assembly=Tango.BL"
xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels"
xmlns:global="clr-namespace:Tango.MachineStudio.Developer"
mc:Ignorable="d"
d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
<UserControl.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
<converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
<converters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
<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" />
<localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" />
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
<localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
<localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" />
<localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" />
<converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
<converters:IsNotConverter x:Key="IsNotConverter" />
<converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
<converters:MathOperatorConverter x:Key="MathOperatorConverter" />
<SolidColorBrush x:Key="SideBarBackground" Color="{Binding Path=Color, Source={StaticResource SideBarBackgroundBrush}}">
</SolidColorBrush>
<Color x:Key="dummyColor">Transparent</Color>
<ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="dispensing:DispenserStepDivisions"/>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</UserControl.Resources>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<StackPanel>
<Grid Background="#1B1B1B" TextElement.Foreground="Silver">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="0" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding ShowJobStatus}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 0 0 1" Padding="20">
<Grid>
<DockPanel>
<Grid DockPanel.Dock="Left" MinWidth="190" VerticalAlignment="Center" Margin="0 0 0 0">
<StackPanel Orientation="Vertical" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}">
<ProgressBar Foreground="{StaticResource RedBrush300}" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
<TextBlock Margin="0 10 0 0" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" FontStyle="Italic" FontWeight="DemiBold" Foreground="{StaticResource RedBrush300}" TextWrapping="Wrap">
<Run Text="Running '"></Run>
<Run Text="{Binding RunningJob.Name}"></Run>
<Run Text="'..."></Run>
</TextBlock>
</StackPanel>
</Grid>
<StackPanel DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 20 0 0">
<StackPanel Orientation="Horizontal">
<TextBlock VerticalAlignment="Center" FontSize="30" FontFamily="{StaticResource digital-7}" Margin="0 0 40 0" Foreground="{StaticResource RedBrush300}" Width="100" Text="{Binding RunningJobStatus.RemainingTime,StringFormat=hh\\:mm\\:ss}"></TextBlock>
<Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="{StaticResource RedBrush300}" BorderBrush="{StaticResource RedBrush300}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" />
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock>
</StackPanel>
</Button>
</StackPanel>
</StackPanel>
<Grid>
<Grid>
<Border Margin="0 10 0 0" VerticalAlignment="Bottom" Width="1200" BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0" ClipToBounds="False">
<Grid ClipToBounds="False" >
<ItemsControl ClipToBounds="False" x:Name="runningJobBrushList" ItemsSource="{Binding RunningJobStatus.CurrentUnitSegments}" Margin="0 0 60 0">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid ClipToBounds="False">
<Grid.ToolTip>
<ToolTip Background="White" Padding="0" Visibility="{Binding IsInterSegment,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
<Border BorderThickness="1" BorderBrush="{StaticResource DarkGrayBrush}" CornerRadius="3" Padding="5">
<StackPanel Background="White">
<ItemsControl ItemsSource="{Binding BrushStops[0].LiquidVolumes}" VerticalAlignment="Center">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0">
<ContentControl.Foreground>
<SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
</ContentControl.Foreground>
<TextBlock Foreground="{StaticResource DarkGrayBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Volume,StringFormat=0.00}"></TextBlock>
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<DataGrid Margin="0 10 0 0" SelectedIndex="-1" IsReadOnly="True" ItemsSource="{Binding BrushStops[0].LiquidVolumes}" AutoGenerateColumns="False" IsSynchronizedWithCurrentItem="True" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False" Background="Transparent" SelectionUnit="FullRow">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
</Style>
</DataGrid.CellStyle>
<DataGrid.Columns>
<DataGridTemplateColumn Header="IDS PACK">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid x:Name="t0">
<Polygon x:Name="t1" Points="0,0 15,0 0,15 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 FontWeight="SemiBold" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock>
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="IDX">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding IdsPack.PackIndex,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}" VerticalAlignment="Center" HorizontalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="D/F">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock VerticalAlignment="Center">
<Run Text="{Binding NanoliterPerStep,Mode=OneWay,StringFormat='0.00'}"></Run>
<Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="STEP">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Source={StaticResource dispenserDivisions}}" SelectedItem="{Binding DispenserStepDivision,UpdateSourceTrigger=PropertyChanged}" BorderThickness="0">
<ComboBox.ItemContainerStyle>
<Style TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}">
<Setter Property="Background" Value="{StaticResource WhiteBrush100}"></Setter>
</Style>
</ComboBox.ItemContainerStyle>
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="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}"></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="NL / CM">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock VerticalAlignment="Center">
<Run Text="{Binding NanoliterPerCentimeter,Mode=OneWay,StringFormat='0.0'}"></Run>
<Run Text="(nl)" FontSize="9" Foreground="Gray"></Run>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="NL / 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>
<Label VerticalAlignment="Center">
<Label.Style>
<Style TargetType="Label">
<Setter Property="Content">
<Setter.Value>
<TextBlock>
<Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
<Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
</TextBlock>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}">
<Setter Property="Content" Value="Auto"></Setter>
</DataTrigger>
<DataTrigger Binding="{Binding DispenserStepDivision,Converter={StaticResource IsNotConverter},ConverterParameter={x:Static dispensing:DispenserStepDivisions.Auto}}" Value="True">
<Setter Property="Content">
<Setter.Value>
<TextBlock>
<Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
<Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
</TextBlock>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</StackPanel>
</Border>
</ToolTip>
</Grid.ToolTip>
<Grid.Width>
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJobStatus.CurrentUnitTotalProgress"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
<Binding Path="Length"></Binding>
</MultiBinding>
</Grid.Width>
<StackPanel Margin="0 0 0 0" ClipToBounds="False">
<StackPanel Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center">
<Canvas Height="19">
<TextBlock Canvas.Top="0" Canvas.Left="-7" Margin="0 0 0 0" FontSize="10" HorizontalAlignment="Right">
<Run Text="{Binding Length,Mode=OneWay,StringFormat=0}"></Run>
<Run FontSize="7" Text="m"></Run>
</TextBlock>
</Canvas>
<materialDesign:PackIcon HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="12" Height="12">
<materialDesign:PackIcon.RenderTransform>
<RotateTransform Angle="180" />
</materialDesign:PackIcon.RenderTransform>
</materialDesign:PackIcon>
</StackPanel>
<Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center" Fill="{Binding SegmentBrush}">
</Rectangle>
<Grid Height="30">
<TextBlock Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.RunningJobStatus.IsFinalizing, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center" Background="Transparent" FontSize="12" Foreground="{StaticResource RedBrush100}">Finalizing...</TextBlock>
<Canvas Height="30" HorizontalAlignment="Center" Width="80">
<Label Padding="0" Margin="0">
<Label.Style>
<Style TargetType="Label">
<Setter Property="Content" Value="{x:Null}"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Started}" Value="True">
<Setter Property="Content">
<Setter.Value>
<TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="{StaticResource RedBrush300}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock>
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Completed}" Value="True">
<Setter Property="Content">
<Setter.Value>
<materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" />
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
</Label>
</Canvas>
</Grid>
</StackPanel>
<Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25" ></Rectangle>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel Margin="-40 -5 0 0" HorizontalAlignment="Left">
<TextBlock FontSize="14">
<Run Text="0"></Run>
<Run FontSize="13" Text="m"></Run>
</TextBlock>
<materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="20" Height="20">
</materialDesign:PackIcon>
</StackPanel>
<StackPanel Margin="0 -5 -70 0" HorizontalAlignment="Right">
<TextBlock FontSize="14">
<Run Text="{Binding RunningJobStatus.CurrentUnitTotalProgress,Mode=OneWay,StringFormat=N2}"></Run>
<Run FontSize="13" Text="m"></Run>
<Run></Run>
<Run Foreground="{StaticResource RedBrush300}">x</Run><Run Foreground="{StaticResource RedBrush300}" FontSize="16" FontWeight="SemiBold" Text="{Binding RunningJobStatus.RemainingUnits}"></Run>
</TextBlock>
<materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="20" Height="20">
</materialDesign:PackIcon>
</StackPanel>
<Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="1" VerticalAlignment="Center" Height="30" Margin="0 11 60 0">
</Border>
<Canvas x:Name="jobProgressCanvas" Width="{Binding ElementName=runningJobBrushList,Path=ActualWidth}" HorizontalAlignment="Left">
<Grid Canvas.Top="0">
<Canvas.Left>
<MultiBinding Converter="{StaticResource JobProgressToPositionConverter}">
<Binding Path="RunningJobStatus.CurrentUnitTotalProgress" />
<Binding Path="RunningJobStatus.CurrentUnitProgress" />
<Binding ElementName="jobProgressCanvas" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
<materialDesign:PackIcon Kind="MapMarker" Foreground="{StaticResource RedBrush300}" Width="35" Height="35" Margin="-17 0 0 0" />
<TextBlock Margin="-11 -23 0 0" FontSize="16" Foreground="{StaticResource RedBrush300}" VerticalAlignment="Top" Height="18" Text="{Binding RunningJobStatus.Progress,StringFormat=0.0}"></TextBlock>
</Grid>
</Canvas>
</Grid>
</Border>
</Grid>
</Grid>
</DockPanel>
</Grid>
</Border>
<ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar>
</Grid>
<Grid Background="#C1FFC7">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="0" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsJobCompleted}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
<materialDesign:PackIcon Kind="Check" Width="32" Height="32" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Completed Successfully</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
<Button Height="20" Padding="0" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
</StackPanel>
</Button>
</StackPanel>
<Grid>
</Grid>
</DockPanel>
</Border>
</Grid>
<Grid Background="#FF8888">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="0" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsJobFailed}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
<materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Failed To Complete</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
<!--<Button Height="40" Width="170" Command="{Binding ViewResultsCommand}" Background="#303030" BorderBrush="#202020">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ChartLine" />
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">RESULTS</TextBlock>
</StackPanel>
</Button>-->
<Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
</StackPanel>
</Button>
</StackPanel>
<Grid>
</Grid>
</DockPanel>
</Border>
</Grid>
<Grid Background="#FFE388">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="0" />
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding IsJobCanceled}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="1" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="LayoutTransform.ScaleY" To="0" Duration="00:00:0.3" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Left" >
<materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" Foreground="#FF494949"/>
<TextBlock VerticalAlignment="Center" Foreground="#FF494949" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0">
<Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Foreground="#FF494949" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" />
</StackPanel>
</Button>
</StackPanel>
<Grid>
</Grid>
</DockPanel>
</Border>
</Grid>
</StackPanel>
<Grid Grid.Row="1">
<controls:NavigationControl x:Name="NavigationControl" TransitionType="Slide" KeepElementsAttached="True">
<local:MachineJobSelectionView controls:NavigationControl.NavigationName="MachineJobSelectionView" />
<local:JobView controls:NavigationControl.NavigationName="JobView" />
<local:RunningJobView controls:NavigationControl.NavigationName="RunningJobView" />
</controls:NavigationControl>
</Grid>
</Grid>
</Grid>
</UserControl>
|