终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

80 lines
3.2 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(() => {
  21. ActionManage.GetInstance.Send("InitDevice");
  22. ActionManage.GetInstance.Send("初始化设定煮面时间");
  23. });
  24. SimOrderCommand = new RelayCommand(() =>
  25. {
  26. new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();
  27. });
  28. SimOrderRandomCommand = new RelayCommand(() =>
  29. {
  30. int NoodPosition = 0;
  31. int BowPosion = 0;
  32. NoodPosition = IsNoodPositon == true ? 0 : NoodleLoc;
  33. BowPosion = IsBowPositon == true ? 0 : BowlLoc;
  34. ActionManage.GetInstance.Send("EnableForOrder", new object[] { NoodPosition, BowPosion });
  35. });
  36. SimOrderRandomCloseCommand = new RelayCommand(() =>
  37. {
  38. ThreadManage.GetInstance().StopTask("ForOrder");
  39. MessageLog.GetInstance.Show("停止模拟随机订单");
  40. });
  41. EnableLacalSimOrder = new RelayCommand(() =>
  42. {
  43. Global.EnableLocalSimOrder = LocalSimOrder;
  44. VisibilitySimOrder = LocalSimOrder == true ? Visibility.Visible : Visibility.Collapsed;
  45. });
  46. VisibilitySimOrder = LocalSimOrder == true? Visibility.Visible : Visibility.Collapsed;
  47. }
  48. public RelayCommand InitCommand { get; set; }
  49. public RelayCommand SimOrderCommand { get; set; }
  50. public RelayCommand SimOrderRandomCommand { get; set; }
  51. public RelayCommand SimOrderRandomCloseCommand { get; set; }
  52. public RelayCommand EnableLacalSimOrder { get; set; }
  53. public int NoodleLoc { get { return _mNoodleLoc; } set { _mNoodleLoc = value; OnPropertyChanged(); } }
  54. private int _mNoodleLoc = 1;
  55. public int BowlLoc { get { return _mBowlLoc; } set { _mBowlLoc = value; OnPropertyChanged(); } }
  56. private int _mBowlLoc = 10;
  57. public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } }
  58. private bool _isNoodPositon = false;
  59. public bool IsBowPositon { get { return _isBowPositon; } set { _isBowPositon = value; OnPropertyChanged(); } }
  60. private bool _isBowPositon = false;
  61. public bool LocalSimOrder { get { return _localSimOrder; } set { _localSimOrder = value; OnPropertyChanged(); } }
  62. private bool _localSimOrder = Global.EnableLocalSimOrder;
  63. public Visibility VisibilitySimOrder { get { return _visibilitySimOrder; } set { _visibilitySimOrder = value; OnPropertyChanged(); } }
  64. private Visibility _visibilitySimOrder;
  65. }
  66. }