终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

80 řádky
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.MorkSUpgradedVer.Model;
  10. using System.Windows;
  11. namespace BPASmartClient.MorkSUpgradedVer.ViewModel
  12. {
  13. public class DebugViewModel : NotifyBase
  14. {
  15. public DebugViewModel()
  16. {
  17. InitCommand = new BPARelayCommand(() => {
  18. ActionManage.GetInstance.Send("InitDevice");
  19. ActionManage.GetInstance.Send("初始化设定煮面时间");
  20. });
  21. SimOrderCommand = new BPARelayCommand(() =>
  22. {
  23. new MorksSimorderModel() { Bowloc = this.BowlLoc, NoodleLoc = this.NoodleLoc }.Publish();
  24. });
  25. SimOrderRandomCommand = new BPARelayCommand(() =>
  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 BPARelayCommand(() =>
  34. {
  35. TaskManage.GetInstance.StopTask("ForOrder");
  36. MessageLog.GetInstance.Show("停止模拟随机订单");
  37. });
  38. EnableLacalSimOrder = new BPARelayCommand(() =>
  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 BPARelayCommand InitCommand { get; set; }
  46. public BPARelayCommand SimOrderCommand { get; set; }
  47. public BPARelayCommand SimOrderRandomCommand { get; set; }
  48. public BPARelayCommand SimOrderRandomCloseCommand { get; set; }
  49. public BPARelayCommand 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 = 11;
  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. }