终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

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