aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-05 16:23:05 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2023-09-05 16:58:26 +0300
commitd4ad32f1af66e69d83db5e912c838c980a1083f5 (patch)
treec3ef6646b6899f4e50e9a62b72fec1784f29137d
parentdbb1af0b580ff8880159ffe9f1f430888f3a6819 (diff)
downloadTango-d4ad32f1af66e69d83db5e912c838c980a1083f5.tar.gz
Tango-d4ad32f1af66e69d83db5e912c838c980a1083f5.zip
Resume buttons. Buttons have been added to Machine Status View.
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml40
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs211
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml38
4 files changed, 249 insertions, 42 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
index 123151fcf..345231e57 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/ViewModels/JobViewVM.cs
@@ -1823,7 +1823,7 @@ namespace Tango.PPC.Jobs.ViewModels
{
if (Job != null && HasResumeModel)
{
- if (await NotificationProvider.ShowQuestion("Drop resume information and enable job editing?"))
+ if (await NotificationProvider.ShowQuestion("Are you sure you want to Edit the Job?" + System.Environment.NewLine + "Job progress data will reset."))
{
JobResumeManager.DropResume(Job.Guid);
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
index d6163506f..d348b2cc7 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.JobsV2/Views/JobEurekaView.xaml
@@ -1341,7 +1341,7 @@
</Style>
</touch:TouchIconButton.Style>
</touch:TouchIconButton>-->
- <touch:TouchTextBox IsEnabled="{Binding CanEdit}" Margin="20 6 240 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox>
+ <touch:TouchTextBox IsEnabled="{Binding CanEdit}" Margin="20 6 360 0" Text="{Binding JobModel.Name,FallbackValue='Job Name'}" ToolTip="{Binding JobModel.Name}" VerticalAlignment="Center" FontSize="{StaticResource TangoHeaderFontSize}" FontWeight="SemiBold"></touch:TouchTextBox>
<!--<touch:TouchButton Margin="0 0 0 0" VerticalAlignment="Center" Width="50" Height="50" HorizontalAlignment="Left" EnableDropShadow="False" Background="Transparent" BorderThickness="0" Command="{Binding EditJobDetailsCommand}" Foreground="{StaticResource TangoKeyboardKeyDarkTextBrush}"
components:TransformationHelper.TransformWhenPressed ="False">
<Border Height="24" Width="24" Margin="0 0 0 0" BorderThickness="0" Background="Transparent" HorizontalAlignment="Center">
@@ -1350,8 +1350,9 @@
</touch:TouchButton>-->
</DockPanel>
- <Canvas ClipToBounds="False" HorizontalAlignment="Right" Width="200">
- <touch:TouchButton VerticalAlignment="Center" Height="55" Canvas.Top="10" Width="200" CornerRadius="30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}">
+ <Canvas ClipToBounds="False" HorizontalAlignment="Right" Width="370">
+ <DockPanel HorizontalAlignment="Stretch" Margin="0 10 10 0" LastChildFill="False" Canvas.Right="0">
+ <touch:TouchButton DockPanel.Dock="Right" VerticalAlignment="Center" Height="55" HorizontalAlignment="Right" Width="200" CornerRadius="30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}">
<touch:TouchButton.Style>
<Style TargetType="touch:TouchButton" BasedOn="{StaticResource {x:Type touch:TouchButton}}">
<Setter Property="Content" Value="DYE"></Setter>
@@ -1363,9 +1364,38 @@
</Style>
</touch:TouchButton.Style>
</touch:TouchButton>
- <touch:TouchIconButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Icon="DeleteSweep" VerticalAlignment="Center" BorderThickness="0 0 1 0" BorderBrush="White" Height="55" Canvas.Left="-75" Canvas.Top="10" Background="{StaticResource TangoMidAccentBrush}" Padding="15" Width="100" CornerRadius="30 0 0 30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DropResumeCommand}">
+ <!--<touch:TouchIconButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Icon="DeleteSweep" VerticalAlignment="Center" BorderThickness="0 0 1 0" BorderBrush="White" Height="55" Canvas.Left="-75" Canvas.Top="10" Background="{StaticResource TangoMidAccentBrush}" Padding="15" Width="100" CornerRadius="30 0 0 30" BlurRadius="10" EnableDropShadow="False" Command="{Binding DropResumeCommand}">
- </touch:TouchIconButton>
+ </touch:TouchIconButton>-->
+ <touch:TouchButton Visibility="{Binding HasResumeModel,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 0 0" VerticalAlignment="Center" Height="55" Width="164" CornerRadius="30" Command="{Binding DropResumeCommand}" BorderThickness="0" EnableDropShadow="False" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}" >
+ <StackPanel Orientation="Vertical">
+ <TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom" Text="Edit Job" HorizontalAlignment="Center" Width="80">
+ <TextBlock.Style>
+ <Style TargetType="{x:Type TextBlock}">
+ <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
+ <Setter Property="Foreground" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ <Rectangle Height="3" VerticalAlignment="Bottom" Margin="0 2 0 0" Width="84">
+ <Rectangle.Style>
+ <Style TargetType="{x:Type Rectangle}">
+ <Setter Property="Fill" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Button}}, Path=IsEnabled}" Value="False">
+ <Setter Property="Fill" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Rectangle.Style>
+ </Rectangle>
+ </StackPanel>
+ </touch:TouchButton>
+ </DockPanel>
</Canvas>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
index 131476c9e..937a76f94 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
@@ -27,6 +27,9 @@ using Tango.PPC.UI.Graphs;
using Tango.BL;
using System.Data.Entity;
using System.Windows.Media;
+using Tango.PPC.Common.Resume;
+using Tango.Core.ExtensionMethods;
+using Tango.PPC.Common.Printing;
namespace Tango.PPC.UI.ViewModels
{
@@ -44,6 +47,13 @@ namespace Tango.PPC.UI.ViewModels
Motor = 3
}
+ public enum ShowSetButtonsEnum
+ {
+ ShowDefault,
+ ShowROnErrorsJob,
+ ShowOnCompleteJob
+ }
+
public class TimeToDyeValueItem
{
public DateTime startTime;
@@ -62,6 +72,7 @@ namespace Tango.PPC.UI.ViewModels
};
private DispatcherTimer _productiondata_timer;
+ private bool startingJob = false;
#region Properties
@@ -80,10 +91,11 @@ namespace Tango.PPC.UI.ViewModels
set
{
_job = value;
+ RaisePropertyChangedAuto();
if (_job == null)
IsDyeingProcess = false;
- RaisePropertyChangedAuto();
InvalidateRelayCommands();
+ ShowSetButtons = ShowSetButtonsEnum.ShowDefault;
}
}
@@ -97,6 +109,7 @@ namespace Tango.PPC.UI.ViewModels
set
{
_runningJobStatus = value;
+
RaisePropertyChangedAuto();
}
}
@@ -109,14 +122,14 @@ namespace Tango.PPC.UI.ViewModels
set { _isJobStatusViewEnable = value; RaisePropertyChangedAuto(); }
}
- private bool _isEnabledStopButton;
+ private bool _isPrinting;
/// <summary>
/// Gets or sets a value indicating whether this instance is enabled stop button.
/// </summary>
- public bool IsEnabledStopButton
+ public bool IsPrinting
{
- get { return _isEnabledStopButton; }
- set { _isEnabledStopButton = value; RaisePropertyChangedAuto(); }
+ get { return _isPrinting; }
+ set { _isPrinting = value; RaisePropertyChangedAuto(); }
}
private bool _isSpoolView;
@@ -330,6 +343,29 @@ namespace Tango.PPC.UI.ViewModels
public WpfGraphController<DateTimeDataPoint, DoubleDataPoint> JobController { get; set; }
+ private JobResumeModel _resumeModel;
+ public JobResumeModel ResumeModel
+ {
+ get { return _resumeModel; }
+ set { _resumeModel = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasResumeModel)); }
+ }
+
+ public bool HasResumeModel
+ {
+ get { return ResumeModel != null; }
+ }
+
+ private ShowSetButtonsEnum _showSetButtons;
+
+ public ShowSetButtonsEnum ShowSetButtons
+ {
+ get { return _showSetButtons; }
+ set {
+ _showSetButtons = value;
+ RaisePropertyChangedAuto();}
+ }
+
+
#endregion
#region Commands
@@ -362,6 +398,8 @@ namespace Tango.PPC.UI.ViewModels
public RelayCommand HideJobOutlineCommand { get; set; }
+ public RelayCommand DropResumeCommand { get; set; }
+
#endregion
public MachineStatusViewVM()
@@ -374,10 +412,10 @@ namespace Tango.PPC.UI.ViewModels
StopCommand = new RelayCommand(StopJob, () => CanStopped());
AbortCommand = new RelayCommand(AbortJob, () => CanStopped());
- ResumeCommand = new RelayCommand(ResumeJob, () => CanStopped());
- CaancelJobCommand = new RelayCommand(CaancelJob, () => CanStopped());
- RestartJobCommand = new RelayCommand(RestartJob, () => CanStopped());
- ClearJobCommand = new RelayCommand(ClearJob, () => CanStopped());
+ ResumeCommand = new RelayCommand(ResumeJob, () => MachineProvider.MachineOperator.CanPrint);
+ CaancelJobCommand = new RelayCommand(CaancelJob);
+ RestartJobCommand = new RelayCommand(RestartJob, () => MachineProvider.MachineOperator.CanPrint);
+ ClearJobCommand = new RelayCommand(ClearJob);
GoToJobCommand = new RelayCommand(GoToJob, () => IsEnableGoToJob());
@@ -387,8 +425,10 @@ namespace Tango.PPC.UI.ViewModels
DisplayJobOutlineCommand = new RelayCommand(DisplayJobOutline);
HideJobOutlineCommand = new RelayCommand(HideJobOutline);
+ DropResumeCommand = new RelayCommand(DropResume);
+
IsJobStatusViewEnable = true;
- IsEnabledStopButton = false;
+ IsPrinting = false;
IsSpoolView = false;
IsWeghtView = false;
@@ -399,6 +439,7 @@ namespace Tango.PPC.UI.ViewModels
SelectedStatisticTabIndex = 0;
JobController = CreateController(CreateSeries("Total", GraphHelper.GraphColor.Green));
+ ShowSetButtons = ShowSetButtonsEnum.ShowDefault;
}
public override void OnApplicationReady()
@@ -563,10 +604,15 @@ namespace Tango.PPC.UI.ViewModels
{
MachineProvider.MachineOperator.PrintingStarted += MachineOperator_PrintingStarted;
MachineProvider.MachineOperator.PrintingEnded += MachineOperator_PrintingEnded;
+ MachineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged;
DefaultDiagnosticsFrameProvider.FrameReceived += DefaultDiagnosticsFrameProvider_FrameReceived;
+
+ JobResumeManager.JobResumeUpdated += JobResumeManager_JobResumeUpdated;
+ JobResumeManager.JobResumeDropped += JobResumeManager_JobResumeDropped;
}
+
private void DefaultDiagnosticsFrameProvider_FrameReceived(object sender, PMR.Diagnostics.StartDiagnosticsResponse e)
{
OverviewModel.Update(e, this.Job != null ? Job.Rml : null, null);
@@ -576,13 +622,27 @@ namespace Tango.PPC.UI.ViewModels
{
_handler = e.JobHandler;
Job = e.Job;
+ try
+ {
+ ResumeModel = JobResumeManager.GetJobResumeModel(Job.Guid);
+
+ if (ResumeModel != null)
+ {
+ LogManager.Log($"Job resume info found:\n{ResumeModel.ToJsonString()}");
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error retrieving job resume info from db.");
+ }
+
e.JobHandler.StatusChanged += JobHandler_StatusChanged;
//e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired;
e.JobHandler.Stopped += JobHandler_Stopped;
e.JobHandler.CanCancelChanged += JobHandler_CanCancelChanged;
InvokeUI(() =>
{
- IsEnabledStopButton = true;
+ IsPrinting = true;
StopCommand.RaiseCanExecuteChanged();
AbortCommand.RaiseCanExecuteChanged();
});
@@ -607,7 +667,7 @@ namespace Tango.PPC.UI.ViewModels
LogManager.Log("Printing ended");
InvokeUI(() =>
{
- IsEnabledStopButton = false;
+ IsPrinting = false;
StopCommand.RaiseCanExecuteChanged();
AbortCommand.RaiseCanExecuteChanged();
});
@@ -616,6 +676,15 @@ namespace Tango.PPC.UI.ViewModels
private void JobHandler_StatusChanged(object sender, RunningJobStatus e)
{
RunningJobStatus = e;
+ if(RunningJobStatus != null && RunningJobStatus.IsFailed)
+ {
+ ShowSetButtons = ShowSetButtonsEnum.ShowROnErrorsJob;
+ }
+ else if(RunningJobStatus != null && RunningJobStatus.IsCompleted)
+ {
+ ShowSetButtons = ShowSetButtonsEnum.ShowOnCompleteJob;
+ }
+
IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null);
if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null)
{
@@ -658,12 +727,21 @@ namespace Tango.PPC.UI.ViewModels
{
InvokeUI(() =>
{
- IsEnabledStopButton = _handler.CanCancel;
+ IsPrinting = _handler.CanCancel;
StopCommand.RaiseCanExecuteChanged();
AbortCommand.RaiseCanExecuteChanged();
});
}
+ private void MachineOperator_StatusChanged(object sender, MachineStatuses e)
+ {
+ InvokeUI(() =>
+ {
+ ResumeCommand.RaiseCanExecuteChanged();
+ RestartJobCommand.RaiseCanExecuteChanged();
+ });
+ }
+
#endregion
#region Methods
@@ -721,7 +799,7 @@ namespace Tango.PPC.UI.ViewModels
private bool CanStopped()
{
- return IsEnabledStopButton;
+ return IsPrinting;
}
private void StopJob()
@@ -732,26 +810,92 @@ namespace Tango.PPC.UI.ViewModels
private void AbortJob()
{
_handler?.Cancel();
- //Job = null;
+ if (Job != null && HasResumeModel)
+ {
+ JobResumeManager.DropResume(Job.Guid);
+
+ }
+ }
+
+ private void ResumeJob()
+ {
+ ShowSetButtons = ShowSetButtonsEnum.ShowDefault;
+ if (Job != null && HasResumeModel)
+ {
+ StartJob();
+ }
}
- private void ResumeJob()
+ private async void StartJob()
{
+ if (startingJob) return;
+
+ RunningJobStatus = null;
+
+ try
+ {
+ startingJob = true;
+ LogManager.Log("Start job command pressed. Starting job and navigating to job progress view...");
+
+ var printConfig = new PrintingConfiguration();
+
+ if (HasResumeModel)
+ {
+ printConfig.FirstUnitStartPosition = ResumeModel.FirstUnitStartPosition;
+ printConfig.GlobalStartPosition = ResumeModel.GlobalStartPosition;
+ printConfig.RemainingUnits = ResumeModel.RemainingUnits;
+ }
+ using (var db = ObservablesContext.CreateDefault())
+ {
+ var handler = await PrintingManager.Print(Job, db, printConfig);
+ }
+
+ startingJob = false;
+ }
+ catch (InsufficientLiquidQuantityException)
+ {
+ //Ignore..
+ }
+ catch (OperationCanceledException)
+ {
+ //Ignore..
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Could not start the current job.");
+ await NotificationProvider.ShowError($"{ex.Message}.");
+ }
+ finally
+ {
+ startingJob = false;
+ }
}
private void CaancelJob()
{
- Job = null;
+ ClearJob();
}
private void RestartJob()
{
-
+ ShowSetButtons = ShowSetButtonsEnum.ShowDefault;
+ if (Job != null )
+ {
+ if(HasResumeModel)
+ {
+ DropResume();
+ }
+ RunningJobStatus = null;
+ StartJob();
+ }
}
private void ClearJob()
{
+ ShowSetButtons = ShowSetButtonsEnum.ShowDefault;
+ DropResume();
+ RunningJobStatus = null;
Job = null;
}
@@ -851,5 +995,36 @@ namespace Tango.PPC.UI.ViewModels
}
}
#endregion
+
+ #region Resume
+
+ private void JobResumeManager_JobResumeUpdated(object sender, Common.Resume.JobResumeUpdatedEventArgs e)
+ {
+ if (Job != null && Job.Guid == e.JobGuid)
+ {
+ ResumeModel = e.ResumeModel;
+ }
+ }
+
+ private void JobResumeManager_JobResumeDropped(object sender, Common.Resume.JobResumeDroppedEventArgs e)
+ {
+ if (Job != null && Job.Guid == e.JobGuid)
+ {
+ ResumeModel = null;
+ }
+ }
+
+ private async void DropResume()
+ {
+ if (Job != null && HasResumeModel)
+ {
+ // if (await NotificationProvider.ShowQuestion("Drop resume information and enable job editing?"))
+ {
+ JobResumeManager.DropResume(Job.Guid);
+ }
+ }
+ }
+
+ #endregion
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
index 8f2b49f9e..0436cdab6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -482,8 +482,8 @@
</DockPanel>
<Border Height="2" Background="{StaticResource TangoLightBorderBrush}" VerticalAlignment="Bottom" Margin="0 2 0 0" CornerRadius="2"></Border>
</Grid>
- <StackPanel Orientation="Vertical" Grid.Row="1" Margin="0 11 0 0">
- <DockPanel >
+ <DockPanel Grid.Row="1" Margin="0 11 0 0" HorizontalAlignment="Stretch">
+ <DockPanel DockPanel.Dock="Top">
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" VerticalAlignment="Top" Width="200" MinHeight="30" HorizontalAlignment="Right" Margin="0 0 0 0">
<StackPanel Orientation="Vertical">
<touch:TouchToggleSlider Style="{StaticResource TouchToggleButtonSlider}" Background="{StaticResource TangoMidBackgroundBrush}" CheckedBackground="{StaticResource TangoMidBackgroundBrush}" UncheckedBackground="{StaticResource TangoMidBackgroundBrush}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="20 0 20 0" CornerRadius="17" Height="38" Width="164" ThumbWidth="80" LeftText="1 Set" RightText="1 Spool" ThumbCornerRadius="13" IsChecked="{Binding IsSpoolView}" FontSize="{StaticResource TangoDefaultFontSize}"></touch:TouchToggleSlider>
@@ -491,7 +491,7 @@
</StackPanel>
</StackPanel>
- <UniformGrid x:Name="JobProperties" DockPanel.Dock="Left" Columns="1" Rows="5" HorizontalAlignment="Left" Margin="0 0 0 0" Height="390" VerticalAlignment="Top" MaxWidth="260">
+ <UniformGrid x:Name="JobProperties" DockPanel.Dock="Left" Columns="1" Rows="5" HorizontalAlignment="Left" Margin="0 0 0 0" Height="390" VerticalAlignment="Top" Width="260">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="../Images/Job Issues/thread_type.png" Stretch="None" VerticalAlignment="Top"/>
<StackPanel Orientation="Vertical" Margin="15 0 0 0">
@@ -562,7 +562,7 @@
</StackPanel>
</StackPanel>
</UniformGrid>
- <Grid x:Name="StatusCicle" Background="{StaticResource TangoMidBackgroundBrush}" VerticalAlignment="Top">
+ <Grid x:Name="StatusCicle" Background="{StaticResource TangoMidBackgroundBrush}" VerticalAlignment="Top" HorizontalAlignment="Center">
<StackPanel VerticalAlignment="Center">
<Grid>
<touch:TouchRingProgress Width="364" Height="364" RingThickness="10">
@@ -716,20 +716,22 @@
</StackPanel>
</Grid>
</DockPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Visible">
- <touch:TouchButton Content="Abort" Visibility="Collapsed" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding AbortCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>
+ <Grid DockPanel.Dock="Top" Margin="60 10 0 0" HorizontalAlignment="Center" Visibility="{Binding ShowSetButtons, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter='ShowDefault'}">
+ <!--<touch:TouchButton Content="Abort" Visibility="Collapsed" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding AbortCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>-->
- <touch:TouchButton Content="Stop" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding StopCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
+ <touch:TouchButton Content="Stop" Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding StopCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed">
- <touch:TouchButton Content="Restart" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding RestartJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>
+ </Grid>
+ <UniformGrid DockPanel.Dock="Top" Columns="2" Margin="60 10 0 0" Width="400" HorizontalAlignment="Center"
+ Visibility="{Binding ShowSetButtons, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter='ShowOnCompleteJob'}">
+ <touch:TouchButton Content="Restart" Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding RestartJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>
- <touch:TouchButton Content="Clear" Margin="0 20 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding ClearJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
+ <touch:TouchButton Content="Clear" Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding ClearJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
- </StackPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Visibility="Collapsed" MinWidth="500" VerticalAlignment="Bottom">
- <touch:TouchButton Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding CaancelJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" BorderThickness="0" EnableDropShadow="False" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">
+ </UniformGrid>
+ <UniformGrid DockPanel.Dock="Top" Columns="3" x:Name="ResumeStack" Margin="60 10 0 0" HorizontalAlignment="Center" Width="570" VerticalAlignment="Bottom"
+ Visibility="{Binding ShowSetButtons, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter='ShowROnErrorsJob'}">
+ <touch:TouchButton Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding CaancelJobCommand}" BorderThickness="0" EnableDropShadow="False" Style="{StaticResource TangoLinkButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">
<StackPanel Orientation="Vertical">
<TextBlock Margin="5 0 0 0" FontSize="{StaticResource TangoButtonFontSize}" VerticalAlignment="Bottom" Text="Cancel" HorizontalAlignment="Center" Width="80">
<TextBlock.Style>
@@ -758,11 +760,11 @@
</StackPanel>
</touch:TouchButton>
- <touch:TouchButton Content="Resume" Margin="30 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding ResumeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
- <touch:TouchButton Content="Restart" Margin="30 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding RestartJobCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.IsPrinting}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>
+ <touch:TouchButton Content="Resume" Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding ResumeCommand}" EnableDropShadow="False" Style="{StaticResource SelectedBlueFlatButton}"/>
+ <touch:TouchButton Content="Restart Set" Margin="0 0 0 0" Height="50" Width="164" CornerRadius="30" Command="{Binding RestartJobCommand}" BorderThickness="1" EnableDropShadow="False" Style="{StaticResource BlueFlatButton}"/>
- </StackPanel>
- </StackPanel>
+ </UniformGrid>
+ </DockPanel>
<StackPanel x:Name="Job_Progress" Grid.Row="2" Margin="0 12 0 0" Orientation="Vertical">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Image Source="../Images/Job Issues/Thread.png" Stretch="None" VerticalAlignment="Top"/>