终端一体化运控平台
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

77 行
3.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BPASmartClient.Helper;
  7. using BPASmartClient.Model;
  8. using Microsoft.Toolkit.Mvvm.ComponentModel;
  9. using Microsoft.Toolkit.Mvvm.Input;
  10. using BPASmartClient.EventBus;
  11. using BPASmartClient.MorkS.Model;
  12. using System.Windows;
  13. using BPASmartClient.Message;
  14. namespace BPASmartClient.MorkS.ViewModel
  15. {
  16. public class DebugViewModel : ObservableObject
  17. {
  18. public DebugViewModel()
  19. {
  20. InitCommand = new RelayCommand(() => { ActionManage.GetInstance.Send("InitDevice"); });
  21. SimOrderCommand = new RelayCommand(() =>
  22. {
  23. new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();
  24. });
  25. SimOrderRandomCommand = new RelayCommand(() =>
  26. {
  27. int NoodPosition = 0;
  28. int BowPosion = 0;
  29. NoodPosition = IsNoodPositon == true ? 0 : NoodleLoc;
  30. BowPosion = IsBowPositon == true ? 0 : BowlLoc;
  31. ActionManage.GetInstance.Send("EnableForOrder", new object[] { NoodPosition, BowPosion });
  32. });
  33. SimOrderRandomCloseCommand = new RelayCommand(() =>
  34. {
  35. ThreadManage.GetInstance().StopTask("ForOrder");
  36. MessageLog.GetInstance.Show("停止模拟随机订单");
  37. });
  38. EnableLacalSimOrder = new RelayCommand(() =>
  39. {
  40. Global.EnableLocalSimOrder = LocalSimOrder;
  41. VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed;
  42. });
  43. VisibilitySimOrder = LocalSimOrder == true? Visibility.Visible : Visibility.Collapsed;
  44. }
  45. public RelayCommand InitCommand { get; set; }
  46. public RelayCommand SimOrderCommand { get; set; }
  47. public RelayCommand SimOrderRandomCommand { get; set; }
  48. public RelayCommand SimOrderRandomCloseCommand { get; set; }
  49. public RelayCommand EnableLacalSimOrder { get; set; }
  50. public int NoodleLoc { get { return _mNoodleLoc; } set { _mNoodleLoc = value; OnPropertyChanged(); } }
  51. private int _mNoodleLoc = 1;
  52. public int BowlLoc { get { return _mBowlLoc; } set { _mBowlLoc = value; OnPropertyChanged(); } }
  53. private int _mBowlLoc = 10;
  54. public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } }
  55. private bool _isNoodPositon = false;
  56. public bool IsBowPositon { get { return _isBowPositon; } set { _isBowPositon = value; OnPropertyChanged(); } }
  57. private bool _isBowPositon = false;
  58. public bool LocalSimOrder { get { return _localSimOrder; } set { _localSimOrder = value; OnPropertyChanged(); } }
  59. private bool _localSimOrder = Global.EnableLocalSimOrder;
  60. public Visibility VisibilitySimOrder { get { return _visibilitySimOrder; } set { _visibilitySimOrder = value; OnPropertyChanged(); } }
  61. private Visibility _visibilitySimOrder;
  62. }
  63. }