MfcSettingDialogViewModel.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System.ComponentModel;
  2. using System.Windows.Input;
  3. using Aitex.Core.Common.DeviceData;
  4. using MECF.Framework.Common.OperationCenter;
  5. using MECF.Framework.UI.Client.CenterViews.Editors;
  6. using OpenSEMI.ClientBase;
  7. namespace MECF.Framework.UI.Client.Ctrlib.UnitControls
  8. {
  9. public class MfcSettingDialogViewModel : DialogViewModel<string>, INotifyPropertyChanged
  10. {
  11. public MfcSettingDialogViewModel(string dialogName = "")
  12. {
  13. this.DisplayName = dialogName;
  14. }
  15. private AITMfcData _data;
  16. public AITMfcData DeviceData
  17. {
  18. get
  19. {
  20. return _data;
  21. }
  22. set
  23. {
  24. _data = value;
  25. NotifyOfPropertyChange(nameof(DeviceData));
  26. }
  27. }
  28. private string _setPoint;
  29. public string InputSetPoint
  30. {
  31. get { return _setPoint; }
  32. set
  33. {
  34. _setPoint = value;
  35. NotifyOfPropertyChange(nameof(InputSetPoint));
  36. }
  37. }
  38. private bool _enableOk;
  39. public bool IsEnableOk
  40. {
  41. get
  42. {
  43. return _enableOk;
  44. }
  45. set
  46. {
  47. _enableOk = value;
  48. NotifyOfPropertyChange(nameof(IsEnableOk));
  49. }
  50. }
  51. public void Cancel()
  52. {
  53. IsCancel = true;
  54. TryClose(false);
  55. }
  56. protected override void OnViewLoaded(object view)
  57. {
  58. base.OnViewLoaded(view);
  59. MfcSettingDialogView v = (MfcSettingDialogView)view;
  60. }
  61. public void OK()
  62. {
  63. InvokeClient.Instance.Service.DoOperation($"{DeviceData.UniqueName}.{AITMfcOperation.Ramp}", InputSetPoint, 0);
  64. //this.DialogResult = string.Empty;
  65. //IsCancel = false;
  66. //TryClose(true);
  67. }
  68. }
  69. }