BoatElevatorSettingViewModel.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. using MECF.Framework.UI.Client.CenterViews.Dialogs;
  2. using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using FurnaceUI.Models;
  11. namespace FurnaceUI.Views.Recipes
  12. {
  13. public class BoatElevatorSettingViewModel : FurnaceUIViewModelBase
  14. {
  15. public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式
  16. private bool _rotateDirectionCW;
  17. public bool RotateDirectionCW
  18. {
  19. get { return _rotateDirectionCW; }
  20. set { _rotateDirectionCW = value;
  21. NotifyOfPropertyChange(nameof(RotateDirectionCW));
  22. }
  23. }
  24. private bool _rotateDirectionCWW;
  25. public bool RotateDirectionCCW
  26. {
  27. get { return _rotateDirectionCWW; }
  28. set
  29. {
  30. _rotateDirectionCWW = value;
  31. NotifyOfPropertyChange(nameof(RotateDirectionCCW));
  32. }
  33. }
  34. private Step _SelectedRecipeStep = new Step();
  35. public Step SelectedRecipeStep
  36. {
  37. get { return _SelectedRecipeStep; }
  38. set { _SelectedRecipeStep = value;NotifyOfPropertyChange(nameof(SelectedRecipeStep)); }
  39. }
  40. private bool _ratateAxisSpeedEditEnabled;
  41. public bool RatateAxisSpeedEditEnabled
  42. {
  43. get => _ratateAxisSpeedEditEnabled;
  44. set
  45. {
  46. _ratateAxisSpeedEditEnabled = value;
  47. NotifyOfPropertyChange(nameof(RatateAxisSpeedEditEnabled));
  48. }
  49. }
  50. protected override void OnViewLoaded(object view)
  51. {
  52. base.OnViewLoaded(view);
  53. //RatateAxisSpeedEditEnabled = SelectedRecipeStep.RotatePosition == "Interval" ? true : false;
  54. //if (!string.IsNullOrEmpty(SelectedRecipeStep.RotateDirection))
  55. //{
  56. // if (SelectedRecipeStep.RotateDirection == "CW")
  57. // {
  58. // _rotateDirectionCW = true;
  59. // _rotateDirectionCWW = false;
  60. // }
  61. // else
  62. // {
  63. // _rotateDirectionCW = false;
  64. // _rotateDirectionCWW = true;
  65. // }
  66. //}
  67. }
  68. public void ZAxisPositionSetCmd(string strValue)
  69. {
  70. //SelectedRecipeStep.ZAxisPosition = strValue;
  71. }
  72. public void RotationPositionSetCmd(string strValue)
  73. {
  74. //SelectedRecipeStep.RotatePosition = strValue;
  75. //RatateAxisSpeedEditEnabled = SelectedRecipeStep.RotatePosition == "Interval" ? true : false;
  76. }
  77. public void RotationDirectionSetCmd(string strValue)
  78. {
  79. if (strValue == "CW")
  80. {
  81. //SelectedRecipeStep.RotateDirection = strValue;
  82. _rotateDirectionCW = true;
  83. _rotateDirectionCWW= false;
  84. }
  85. else
  86. {
  87. //SelectedRecipeStep.RotateDirection = strValue;
  88. _rotateDirectionCW = false;
  89. _rotateDirectionCWW = true;
  90. }
  91. }
  92. public void ClosedCmd()
  93. {
  94. (GetView() as Window).DialogResult = false;
  95. }
  96. public void SAVECmd()
  97. {
  98. (GetView() as Window).DialogResult = true;
  99. }
  100. }
  101. }