using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; using Tango.Core; using Tango.Core.Commands; using Tango.Integration.Operation; namespace Tango.PPC.UI.Models { public class JerricanLevelModel : ExtendedObject { public RelayCommand PressedCommand { get; set; } public event EventHandler PressedEvent; public double Max { get; set; } private double _level; public double Level { get { return _level; } set { _level = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsMidTankLow)); } } private bool _bJerricanPresent; public bool JerricanPresent { get { return _bJerricanPresent; } set { _bJerricanPresent = value; RaisePropertyChangedAuto(); } } private bool _fillingTimeoutError; public bool FillingTimeoutError { get { return _fillingTimeoutError; } set { _fillingTimeoutError = value; RaisePropertyChangedAuto(); } } private bool _midTankEmpty; public bool MidTankEmpty { get { return _midTankEmpty; } set { _midTankEmpty = value; RaisePropertyChangedAuto(); } } private bool _midTankRefillPumpActive; public bool MidTankRefillPumpActive { get { return _midTankRefillPumpActive; } set { _midTankRefillPumpActive = value; RaisePropertyChangedAuto(); } } public bool IsMidTankLow { get { return Level <= 0.5; } } private TimeSpan _remainingTimeoutError_; public TimeSpan RemainingTimeoutError { get { return _remainingTimeoutError_; } set { _remainingTimeoutError_ = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(HasRemainingTimeoutError)); } } public bool HasRemainingTimeoutError { get { return RemainingTimeoutError > TimeSpan.Zero; } } public IdsPack IDSPack { get; set; } public JerricanLevelModel() { //RemainingTimeoutError = new TimeSpan(1,2,0); JerricanPresent = true; //FillingTimeoutError = MidTankEmpty = MidTankRefillPumpActive = false; PressedCommand = new RelayCommand(() => PressedEvent?.Invoke(this, this)); } } }