using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using BPA.Helper; using BPASmartClient.Model; using BPA.Helper; using BPASmartClient.MorkSUpgradedVer.Model; using System.Windows; namespace BPASmartClient.MorkSUpgradedVer.ViewModel { public class DebugViewModel : NotifyBase { public DebugViewModel() { InitCommand = new BPARelayCommand(() => { ActionManage.GetInstance.Send("InitDevice"); ActionManage.GetInstance.Send("初始化设定煮面时间"); }); SimOrderCommand = new BPARelayCommand(() => { new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish(); }); SimOrderRandomCommand = new BPARelayCommand(() => { int NoodPosition = 0; int BowPosion = 0; NoodPosition = IsNoodPositon == true ? 0 : NoodleLoc; BowPosion = IsBowPositon == true ? 0 : BowlLoc; ActionManage.GetInstance.Send(new object[] { NoodPosition, BowPosion }, "EnableForOrder"); }); SimOrderRandomCloseCommand = new BPARelayCommand(() => { TaskManage.GetInstance.StopTask("ForOrder"); MessageLog.GetInstance.Show("停止模拟随机订单"); }); EnableLacalSimOrder = new BPARelayCommand(() => { Global.EnableLocalSimOrder = LocalSimOrder; VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed; }); VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed; } public BPARelayCommand InitCommand { get; set; } public BPARelayCommand SimOrderCommand { get; set; } public BPARelayCommand SimOrderRandomCommand { get; set; } public BPARelayCommand SimOrderRandomCloseCommand { get; set; } public BPARelayCommand EnableLacalSimOrder { get; set; } public int NoodleLoc { get { return _mNoodleLoc; } set { _mNoodleLoc = value; OnPropertyChanged(); } } private int _mNoodleLoc = 1; public int BowlLoc { get { return _mBowlLoc; } set { _mBowlLoc = value; OnPropertyChanged(); } } private int _mBowlLoc = 11; public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } } private bool _isNoodPositon = false; public bool IsBowPositon { get { return _isBowPositon; } set { _isBowPositon = value; OnPropertyChanged(); } } private bool _isBowPositon = false; public bool LocalSimOrder { get { return _localSimOrder; } set { _localSimOrder = value; OnPropertyChanged(); } } private bool _localSimOrder = Global.EnableLocalSimOrder; public Visibility VisibilitySimOrder { get { return _visibilitySimOrder; } set { _visibilitySimOrder = value; OnPropertyChanged(); } } private Visibility _visibilitySimOrder; } }