|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using BPASmartClient.Helper;
- using BPASmartClient.Model;
- using Microsoft.Toolkit.Mvvm.ComponentModel;
- using Microsoft.Toolkit.Mvvm.Input;
- using BPASmartClient.EventBus;
- using BPASmartClient.MorkSUpgradedVer.Model;
- using System.Windows;
- using BPASmartClient.Message;
-
- namespace BPASmartClient.MorkSUpgradedVer.ViewModel
- {
- public class DebugViewModel : ObservableObject
- {
- public DebugViewModel()
- {
- InitCommand = new RelayCommand(() => {
- ActionManage.GetInstance.Send("InitDevice");
- ActionManage.GetInstance.Send("初始化设定煮面时间");
- });
- SimOrderCommand = new RelayCommand(() =>
- {
- new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();
-
- });
- SimOrderRandomCommand = new RelayCommand(() =>
- {
- int NoodPosition = 0;
- int BowPosion = 0;
- NoodPosition = IsNoodPositon == true ? 0 : NoodleLoc;
- BowPosion = IsBowPositon == true ? 0 : BowlLoc;
- ActionManage.GetInstance.Send("EnableForOrder", new object[] { NoodPosition, BowPosion });
- });
- SimOrderRandomCloseCommand = new RelayCommand(() =>
- {
- ThreadManage.GetInstance().StopTask("ForOrder");
- MessageLog.GetInstance.Show("停止模拟随机订单");
- });
- EnableLacalSimOrder = new RelayCommand(() =>
- {
- Global.EnableLocalSimOrder = LocalSimOrder;
- VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed;
- });
- VisibilitySimOrder = LocalSimOrder == true? Visibility.Visible : Visibility.Collapsed;
- }
-
- public RelayCommand InitCommand { get; set; }
-
- public RelayCommand SimOrderCommand { get; set; }
-
- public RelayCommand SimOrderRandomCommand { get; set; }
-
- public RelayCommand SimOrderRandomCloseCommand { get; set; }
-
- public RelayCommand 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 = 10;
-
- 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;
- }
- }
|