aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
index a111d3be2..6039dafb8 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs
@@ -10,9 +10,10 @@ using Tango.PPC.Common.Navigation;
namespace Tango.PPC.Jobs.ViewModels
{
- public class JobProgressViewVM : PPCViewModel, INavigationResultProvider<Object, Job>
+ public class JobProgressViewVM : PPCViewModel
{
private Job _job;
+
public Job Job
{
get { return _job; }
@@ -32,21 +33,21 @@ namespace Tango.PPC.Jobs.ViewModels
}
- public void OnNavigationObjectReceived(Job job)
+ public override void OnApplicationStarted()
{
- Job = job;
- var jobHandler = ApplicationManager.ConnectedMachine.Print(Job, Adapter.ProcessParametersTables.First());
- jobHandler.StatusChanged += JobHandler_StatusChanged;
+ ApplicationManager.ConnectedMachineChanged += ApplicationManager_ConnectedMachineChanged;
}
- public object GetNavigationResult()
+ private void ApplicationManager_ConnectedMachineChanged(object sender, IMachineOperator e)
{
- return null;
+ e.PrintingStarted -= PrintingStarted;
+ e.PrintingStarted += PrintingStarted;
}
- public override void OnApplicationStarted()
+ private void PrintingStarted(object sender, JobHandler jobHandler)
{
-
+ Job = jobHandler.Job;
+ jobHandler.StatusChanged += JobHandler_StatusChanged;
}
private void JobHandler_StatusChanged(object sender, RunningJobStatus e)