终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

98 lignes
3.5 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.MorkSVer3.Model;
  10. using System.Windows;
  11. namespace BPASmartClient.MorkSVer3.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; }
  51. set {
  52. if (value <=3 && value >=1)
  53. {
  54. _mNoodleLoc = value;
  55. }
  56. else
  57. { _mNoodleLoc = 1; }
  58. OnPropertyChanged(); } }
  59. private int _mNoodleLoc = 1;
  60. public int BowlLoc { get { return _mBowlLoc; } set {
  61. if (value == 10 ||value ==11)
  62. {
  63. _mBowlLoc = value;
  64. }
  65. else
  66. {
  67. _mBowlLoc = 11;
  68. }
  69. OnPropertyChanged(); } }
  70. private int _mBowlLoc = 11;
  71. public bool IsNoodPositon { get { return _isNoodPositon; } set { _isNoodPositon = value; OnPropertyChanged(); } }
  72. private bool _isNoodPositon = false;
  73. public bool IsBowPositon { get { return _isBowPositon; } set { _isBowPositon = value; OnPropertyChanged(); } }
  74. private bool _isBowPositon = false;
  75. public bool LocalSimOrder { get { return _localSimOrder; } set { _localSimOrder = value; OnPropertyChanged(); } }
  76. private bool _localSimOrder = Global.EnableLocalSimOrder;
  77. public Visibility VisibilitySimOrder { get { return _visibilitySimOrder; } set { _visibilitySimOrder = value; OnPropertyChanged(); } }
  78. private Visibility _visibilitySimOrder;
  79. }
  80. }