aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs59
1 files changed, 9 insertions, 50 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 7cd328e7b..a47b68a4f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MachineStatusViewVM.cs
@@ -15,7 +15,6 @@ using Tango.PPC.Common.Diagnostics;
using Tango.PPC.Jobs;
using Tango.PPC.Jobs.NavigationObjects;
using Tango.PPC.Jobs.Views;
-using Tango.PPC.Maintenance.Models;
using Tango.PPC.UI.Models;
using System.Timers;
using System.Windows.Threading;
@@ -31,10 +30,6 @@ namespace Tango.PPC.UI.ViewModels
[TangoInject]
public IDiagnosticsFrameProvider DefaultDiagnosticsFrameProvider { get; set; }
- private DispatcherTimer _ink_timer;
- private Stopwatch _stopwatch;
-
-
private JobHandler _handler;
private Job _job;
@@ -127,7 +122,7 @@ namespace Tango.PPC.UI.ViewModels
get { return _currentBrushStop; }
set
{
- // if (_currentBrushStop != value)
+ // if (_currentBrushStop != value)
{
_currentBrushStop = value;
OnUpdateCurrentBrush();
@@ -183,8 +178,8 @@ namespace Tango.PPC.UI.ViewModels
// get { return GetVolumeLiquidType(LiquidTypes.Lubricant); }
//}
- private List<MidTankLevelModel> _midTankLevels;
- public List<MidTankLevelModel> MidTankLevels
+ private List<JerricanLevelModel> _midTankLevels;
+ public List<JerricanLevelModel> MidTankLevels
{
get { return _midTankLevels; }
set { _midTankLevels = value; RaisePropertyChangedAuto(); }
@@ -192,15 +187,6 @@ namespace Tango.PPC.UI.ViewModels
public MachineOverviewModel OverviewModel { get; set; }
- private TimeSpan _timer;
-
- public TimeSpan FullInkTimer
- {
- get { return _timer; }
- set { _timer = value; RaisePropertyChangedAuto(); }
- }
-
-
#endregion
#region Commands
@@ -227,9 +213,7 @@ namespace Tango.PPC.UI.ViewModels
public MachineStatusViewVM()
{
- _ink_timer = new DispatcherTimer();
- _ink_timer.Interval = TimeSpan.FromSeconds(1);
- _ink_timer.Tick += _ink_timer_Tick;
+
StopCommand = new RelayCommand(StopJob, () => CanStopped());
AbortCommand = new RelayCommand(AbortJob, () => CanStopped());
@@ -250,13 +234,14 @@ namespace Tango.PPC.UI.ViewModels
{
base.OnApplicationReady();
- MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure).OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel()
+ MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.Where(x => x.MidTankType.HasLevelMeasure || x.MidTankType.Type == MidTankTypes.LubricantMidTank).OrderBy(x => x.PackIndex).Select(x => new JerricanLevelModel()
{
Max = x.MidTankType.LiterCapacity,
IDSPack = x,
- }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList();
- // MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged;
+ }).OrderBy(y => y.IDSPack.LiquidType.PreferredIndex).ToList();
+
MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged;
+
}
#region Events
@@ -280,33 +265,12 @@ namespace Tango.PPC.UI.ViewModels
model.FillingTimeoutError = item.FillingTimeoutError;
model.MidTankEmpty = item.MidTankEmpty;
model.MidTankRefillPumpActive = item.MidTankRefillPumpActive;
- if (model.FillingTimeoutError)
- {
- //StartInkTimer()
- }
+ model.RemainingTimeoutError = TimeSpan.FromSeconds(item.TimerRemainingSeconds);
}
}
}
}
- private void StartInkTimer()
- {
- _stopwatch = Stopwatch.StartNew();
- _ink_timer.Start();
- }
-
- private void StopInkTimer()
- {
- if (_stopwatch.IsRunning)
- {
- _stopwatch.Stop();
- _ink_timer.Stop();
- }
- }
- private void _ink_timer_Tick(object sender, EventArgs e)
- {
- FullInkTimer = _stopwatch.Elapsed;
- }
private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e)
{
//foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink))
@@ -380,10 +344,6 @@ namespace Tango.PPC.UI.ViewModels
private void JobHandler_StatusChanged(object sender, RunningJobStatus e)
{
- //InvokeUI(() =>
- //{
-
-
RunningJobStatus = e;
IsDyeingProcess = (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null);
if (RunningJobStatus != null && RunningJobStatus.CurrentSegment != null)
@@ -400,7 +360,6 @@ namespace Tango.PPC.UI.ViewModels
CurrentBrushStop = segment.FirstBrushStop;
}
}
- //});
}
private void JobHandler_CanCancelChanged(object sender, EventArgs e)