aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs44
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml2
2 files changed, 29 insertions, 17 deletions
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 1f4040460..7cd328e7b 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
@@ -20,6 +20,7 @@ using Tango.PPC.UI.Models;
using System.Timers;
using System.Windows.Threading;
using System.Diagnostics;
+using Tango.PMR.Printing;
namespace Tango.PPC.UI.ViewModels
{
@@ -62,13 +63,6 @@ namespace Tango.PPC.UI.ViewModels
set
{
_runningJobStatus = value;
- IsDyeingProcess = (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null);
- if (_runningJobStatus != null && _runningJobStatus.CurrentSegment != null)
- {
- var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex);
- if (segment != null)
- CurrentBrushStop = segment.FirstBrushStop;
- }
RaisePropertyChangedAuto();
}
}
@@ -128,13 +122,12 @@ namespace Tango.PPC.UI.ViewModels
}
private BrushStop _currentBrushStop;
-
public BrushStop CurrentBrushStop
{
get { return _currentBrushStop; }
set
{
- if (_currentBrushStop != value)
+ // if (_currentBrushStop != value)
{
_currentBrushStop = value;
OnUpdateCurrentBrush();
@@ -143,6 +136,8 @@ namespace Tango.PPC.UI.ViewModels
}
}
+ public JobBrushStop JobBrushStop { get; set; }
+
public double CyanOutput
{
get { return GetVolumeLiquidType(LiquidTypes.Cyan); }
@@ -202,7 +197,7 @@ namespace Tango.PPC.UI.ViewModels
public TimeSpan FullInkTimer
{
get { return _timer; }
- set { _timer = value; RaisePropertyChangedAuto();}
+ set { _timer = value; RaisePropertyChangedAuto(); }
}
@@ -260,7 +255,7 @@ namespace Tango.PPC.UI.ViewModels
Max = x.MidTankType.LiterCapacity,
IDSPack = x,
}).OrderBy(y => y.IDSPack.LiquidType.Code).ToList();
- // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
+ // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged;
}
@@ -385,10 +380,27 @@ namespace Tango.PPC.UI.ViewModels
private void JobHandler_StatusChanged(object sender, RunningJobStatus e)
{
- InvokeUI(() =>
+ //InvokeUI(() =>
+ //{
+
+
+ RunningJobStatus = e;
+ IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null);
+ if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null)
{
- RunningJobStatus = e;
- });
+ var segment = Job.Segments.FirstOrDefault(x => x.SegmentIndex == _runningJobStatus.CurrentSegment.SegmentIndex);
+ if (segment != null)
+ {
+
+ if (_handler.JobTicket.Segments.Count > 0)
+ {
+ JobBrushStop = _handler.JobTicket.Segments[Job.OrderedSegments.IndexOf(segment)].BrushStops.First();
+ }
+
+ CurrentBrushStop = segment.FirstBrushStop;
+ }
+ }
+ //});
}
private void JobHandler_CanCancelChanged(object sender, EventArgs e)
@@ -439,9 +451,9 @@ namespace Tango.PPC.UI.ViewModels
private double GetVolumeLiquidType(LiquidTypes liquidType)
{
- if (CurrentBrushStop != null && CurrentBrushStop.LiquidVolumes != null && CurrentBrushStop.LiquidVolumes.Count > 0)
+ if (JobBrushStop != null && JobBrushStop.Dispensers != null && JobBrushStop.Dispensers.Count > 0)
{
- var lt = CurrentBrushStop.LiquidVolumes.FirstOrDefault(x => x.LiquidType == liquidType);
+ var lt = JobBrushStop.Dispensers.FirstOrDefault(x => x.DispenserLiquidType == (DispenserLiquidType)liquidType);
if (lt != null)
{
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 998ab7db4..383ce77e6 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MachineStatusView.xaml
@@ -163,7 +163,7 @@
<Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
<Rectangle Width="10" Height="2" Stroke="{StaticResource TangoTextWatermarkBrush}"></Rectangle>
</UniformGrid>
- <Image Source="../Images/Overview Icons/error.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Margin="0 4 0 0" Visibility="Visible"/>
+ <Image Source="../Images/Overview Icons/error.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Margin="0 4 0 0" Visibility="{Binding MidTankEmpty, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<Image Source="../Images/Overview Icons/Warning.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Visibility="Collapsed"/>
<Image Source="../Images/Overview Icons/UpdateInk.png" Stretch="Fill" VerticalAlignment="Top" Width="24" Height="24" Visibility="Collapsed"/>
</Grid>