123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using System.ComponentModel;
- using System.Windows.Input;
- using Aitex.Core.Common.DeviceData;
- using DocumentFormat.OpenXml.Presentation;
- using MECF.Framework.Common.OperationCenter;
- using MECF.Framework.UI.Client.CenterViews.Editors;
- using OpenSEMI.ClientBase;
- namespace MECF.Framework.UI.Client.Ctrlib.UnitControls
- {
- public class AITMicrowaveSettingDialogViewModel : DialogViewModel<string>, INotifyPropertyChanged
- {
- public AITMicrowaveSettingDialogViewModel(string dialogName = "")
- {
- this.DisplayName = dialogName;
- }
- private AITRfData _data;
- public AITRfData DeviceData
- {
- get
- {
- return _data;
- }
- set
- {
- _data = value;
-
- NotifyOfPropertyChange(nameof(DeviceData));
- }
- }
- private string _setPoint;
- public string InputSetPoint
- {
- get { return _setPoint; }
- set
- {
- _setPoint = value;
- NotifyOfPropertyChange(nameof(InputSetPoint));
- }
- }
- private bool _enableOk;
- public bool IsEnableOk
- {
- get
- {
- return _enableOk;
- }
- set
- {
- _enableOk = value;
- NotifyOfPropertyChange(nameof(IsEnableOk));
- }
- }
-
- public bool IsEnablePowerOn
- {
- get
- {
- return DeviceData != null && !DeviceData.IsRfOn;
- }
- }
- public bool IsEnablePowerOff
- {
- get
- {
- return DeviceData != null && DeviceData.IsRfOn;
- }
- }
- public bool IsEnableHeatOn
- {
- get
- {
- if (DeviceData == null || !DeviceData.AttrValue.ContainsKey("HeatOnSetPoint"))
- return false;
- return !(bool)DeviceData.AttrValue["HeatOnSetPoint"];
- }
- }
- public bool IsEnableHeatOff
- {
- get
- {
- if (DeviceData == null || !DeviceData.AttrValue.ContainsKey("HeatOnSetPoint"))
- return false;
- return (bool)DeviceData.AttrValue["HeatOnSetPoint"];
- }
- }
- public bool IsHeatOn
- {
- get
- {
- if (DeviceData == null || !DeviceData.AttrValue.ContainsKey("HeatOnComplete"))
- return false;
- return (bool)DeviceData.AttrValue["HeatOnComplete"];
- }
- }
- public void Cancel()
- {
- IsCancel = true;
- TryClose(false);
- }
- protected override void OnViewLoaded(object view)
- {
- base.OnViewLoaded(view);
-
- }
- public void SetPower()
- {
- InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.{AITRfOperation.SetPower}", InputSetPoint);
- }
- public void SetPowerOn()
- {
- InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.{AITRfOperation.SetPowerOnOff}", "true");
- }
- public void SetPowerOff()
- {
- InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.{AITRfOperation.SetPowerOnOff}", "false");
- }
- public void SetHeatOn()
- {
- InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.{AITRfOperation.SetHeatOnOff}", "true");
- }
- public void SetHeatOff()
- {
- InvokeClient.Instance.Service.DoOperation($"{DeviceData.Module}.{DeviceData.DeviceName}.{AITRfOperation.SetHeatOnOff}", "false");
- }
- }
- }
|