using MECF.Framework.Common.OperationCenter; using Prism.Commands; using Prism.Mvvm; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Venus_MainPages.ViewModels { public class ButterflyValveViewModel : BindableBase { #region 私有字段 private string ModuleName = "PMA"; private bool m_IsPositionMode; private int? m_SetValue; private int? m_FeedBackValue; #endregion #region 属性 public bool IsPositionMode { get { return m_IsPositionMode; } set { SetProperty(ref m_IsPositionMode, value); } } public int? SetValue { get { return m_SetValue; } set { SetProperty(ref m_SetValue, value); } } public int? FeedBackValue { get { return m_FeedBackValue; } set { SetProperty(ref m_FeedBackValue, value); } } #endregion #region 命令 private DelegateCommand _SetCommand; public DelegateCommand SetCommand => _SetCommand ?? (_SetCommand = new DelegateCommand(OnSet)); #endregion #region 命令方法 private void OnSet() { if (IsPositionMode == true) { InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetPVPostion",SetValue); } else { InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetPVPressure",SetValue); } } #endregion } }