using Aitex.Core.Common.DeviceData; using Aitex.Core.RT.SCCore; using ExcelLibrary.BinaryFileFormat; using MECF.Framework.Common.DataCenter; using MECF.Framework.Common.OperationCenter; using Prism.Commands; using Prism.Mvvm; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Threading; using Unity; using Venus_Core; using Venus_MainPages.Unity; using Venus_Themes.CustomControls; using Venus_Themes.UserControls; using VenusCommon; namespace Venus_MainPages.ViewModels { public class DETMOperationViewModel : BindableBase { #region 私有变量 private bool m_TMValveN2IsOpen; private bool m_TMSoftPumpIsOpen; private bool m_TMSoftVentIsOpen; private bool m_TMFastPumpIsOpen; private bool m_TMFastVentIsOpen; private bool m_VCEASoftPumpIsOpen; private bool m_VCEASoftVentIsOpen; private bool m_VCEAFastPumpIsOpen; private bool m_VCEAFastVentIsOpen; private bool m_VCEBSoftPumpIsOpen; private bool m_VCEBSoftVentIsOpen; private bool m_VCEBFastPumpIsOpen; private bool m_VCEBFastVentIsOpen; private bool m_PMAIsInstalled; private bool m_PMBIsInstalled; private bool m_PMCIsInstalled; private bool m_PMDIsInstalled; private bool m_VCEAIsInstalled; private bool m_VCEBIsInstalled; private bool m_VCEADoorIsOpen; private bool m_VCEBDoorIsOpen; private bool m_PMADoorIsOpen; private bool m_PMBDoorIsOpen; private bool m_PMCDoorIsOpen; private bool m_PMDDoorIsOpen; private bool m_VCEAOutDoorIsOpen; private bool m_VCEBOutDoorIsOpen; private bool m_TMIsVAC; private bool m_TMIsATM; private bool m_VCEAIsVAC; private bool m_VCEAIsATM; private bool m_VCEBIsVAC; private bool m_VCEBIsATM; private int m_GoToSlotNumber; private bool m_TMIsOnline; private Dictionary m_RtDataValues = new Dictionary(); private List m_RtDataKeys = new List(); #endregion #region 暴露变量 private ObservableCollection m_TMLeakCheckResultList = new ObservableCollection(); public ObservableCollection TMLeakCheckResultList { get { return m_TMLeakCheckResultList; } set { SetProperty(ref m_TMLeakCheckResultList, value); } } private ObservableCollection m_VCEALeakCheckResultList = new ObservableCollection(); public ObservableCollection VCEALeakCheckResultList { get { return m_VCEALeakCheckResultList; } set { SetProperty(ref m_VCEALeakCheckResultList, value); } } private ObservableCollection m_VCEBLeakCheckResultList = new ObservableCollection(); public ObservableCollection VCEBLeakCheckResultList { get { return m_VCEBLeakCheckResultList; } set { SetProperty(ref m_VCEBLeakCheckResultList, value); } } private PMLeakCheckResult m_VCEACurrentLeakCheckResultItem = new PMLeakCheckResult(); public PMLeakCheckResult VCEACurrentLeakCheckResultItem { get { return m_VCEACurrentLeakCheckResultItem; } set { SetProperty(ref m_VCEACurrentLeakCheckResultItem, value); } } private PMLeakCheckResult m_VCEBCurrentLeakCheckResultItem = new PMLeakCheckResult(); public PMLeakCheckResult VCEBCurrentLeakCheckResultItem { get { return m_VCEBCurrentLeakCheckResultItem; } set { SetProperty(ref m_VCEBCurrentLeakCheckResultItem, value); } } private PMLeakCheckResult m_TMCurrentLeakCheckResultItem = new PMLeakCheckResult(); public PMLeakCheckResult TMCurrentLeakCheckResultItem { get { return m_TMCurrentLeakCheckResultItem; } set { SetProperty(ref m_TMCurrentLeakCheckResultItem, value); } } private bool _TMCheckFlag = false; private string m_TMCurrentState; public string TMCurrentState { get { return m_TMCurrentState; } set { if (m_TMCurrentState == null && !_TMCheckFlag) { _TMCheckFlag = true; var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("TM"); if (AllLeakCheckDa != null) { TMLeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } if ((m_TMCurrentState == "Leakchecking") && value == "Idle") { var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("TM"); if (AllLeakCheckDa != null) { TMLeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } SetProperty(ref m_TMCurrentState, value); } } private bool _VCEACheckFlag = false; private string m_VCEACurrentState; public string VCEACurrentState { get { return m_VCEACurrentState; } set { if (m_VCEACurrentState == null && !_VCEACheckFlag) { _VCEACheckFlag = true; var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("VCEA"); if (AllLeakCheckDa != null) { VCEALeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } if ((m_VCEACurrentState == "LeakChecking") && value == "Idle") { var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("VCEA"); if (AllLeakCheckDa != null) { VCEALeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } SetProperty(ref m_VCEACurrentState, value); } } private bool _VCEBCheckFlag = false; private string m_VCEBCurrentState; public string VCEBCurrentState { get { return m_VCEBCurrentState; } set { if (m_VCEBCurrentState == null && !_VCEBCheckFlag) { _VCEBCheckFlag = true; var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("VCEB"); if (AllLeakCheckDa != null) { VCEBLeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } if ((m_VCEBCurrentState == "LeakChecking") && value == "Idle") { var AllLeakCheckDa = QueryDataClient.Instance.Service.GetPMLeakCheckResult("VCEB"); if (AllLeakCheckDa != null) { VCEBLeakCheckResultList = new ObservableCollection(AllLeakCheckDa); } } SetProperty(ref m_VCEBCurrentState, value); } } public bool TMValveN2IsOpen { get => m_TMValveN2IsOpen; set => SetProperty(ref m_TMValveN2IsOpen, value); } public bool TMSoftPumpIsOpen { get => m_TMSoftPumpIsOpen; set => SetProperty(ref m_TMSoftPumpIsOpen, value); } public bool TMSoftVentIsOpen { get => m_TMSoftVentIsOpen; set => SetProperty(ref m_TMSoftVentIsOpen, value); } public bool TMFastPumpIsOpen { get => m_TMFastPumpIsOpen; set => SetProperty(ref m_TMFastPumpIsOpen, value); } public bool TMFastVentIsOpen { get => m_TMFastVentIsOpen; set => SetProperty(ref m_TMFastVentIsOpen, value); } public bool VCEASoftPumpIsOpen { get => m_VCEASoftPumpIsOpen; set => SetProperty(ref m_VCEASoftPumpIsOpen, value); } public bool VCEASoftVentIsOpen { get => m_VCEASoftVentIsOpen; set => SetProperty(ref m_VCEASoftVentIsOpen, value); } public bool VCEAFastPumpIsOpen { get => m_VCEAFastPumpIsOpen; set => SetProperty(ref m_VCEAFastPumpIsOpen, value); } public bool VCEAFastVentIsOpen { get => m_VCEAFastVentIsOpen; set => SetProperty(ref m_VCEAFastVentIsOpen, value); } public bool VCEBSoftPumpIsOpen { get => m_VCEBSoftPumpIsOpen; set => SetProperty(ref m_VCEBSoftPumpIsOpen, value); } public bool VCEBSoftVentIsOpen { get => m_VCEBSoftVentIsOpen; set => SetProperty(ref m_VCEBSoftVentIsOpen, value); } public bool VCEBFastPumpIsOpen { get => m_VCEBFastPumpIsOpen; set => SetProperty(ref m_VCEBFastPumpIsOpen, value); } public bool VCEBFastVentIsOpen { get => m_VCEBFastVentIsOpen; set => SetProperty(ref m_VCEBFastVentIsOpen, value); } public bool TMIsVAC { get => m_TMIsVAC; set => SetProperty(ref m_TMIsVAC, value); } public bool TMIsATM { get => m_TMIsATM; set => SetProperty(ref m_TMIsATM, value); } public bool VCEAIsVAC { get => m_VCEAIsVAC; set => SetProperty(ref m_VCEAIsVAC, value); } public bool VCEBIsVAC { get => m_VCEBIsVAC; set => SetProperty(ref m_VCEBIsVAC, value); } public bool VCEAIsATM { get => m_VCEAIsATM; set => SetProperty(ref m_VCEAIsATM, value); } public bool VCEBIsATM { get => m_VCEBIsATM; set => SetProperty(ref m_VCEBIsATM, value); } public bool PMAIsInstalled { get => m_PMAIsInstalled; set => SetProperty(ref m_PMAIsInstalled, value); } public bool PMBIsInstalled { get => m_PMBIsInstalled; set => SetProperty(ref m_PMBIsInstalled, value); } public bool PMCIsInstalled { get => m_PMCIsInstalled; set => SetProperty(ref m_PMCIsInstalled, value); } public bool PMDIsInstalled { get => m_PMDIsInstalled; set => SetProperty(ref m_PMDIsInstalled, value); } public bool VCEAIsInstalled { get => m_VCEAIsInstalled; set => SetProperty(ref m_VCEAIsInstalled, value); } public bool VCEBIsInstalled { get => m_VCEBIsInstalled; set => SetProperty(ref m_VCEBIsInstalled, value); } public int GoToSlotNumber { get => m_GoToSlotNumber; set => SetProperty(ref m_GoToSlotNumber, value); } public Dictionary RtDataValues { get { return m_RtDataValues; } set { SetProperty(ref m_RtDataValues, value); } } //public bool TMIsOFFline => !TMIsOnline; public bool VCEADoorIsOpen { get => m_VCEADoorIsOpen; set => SetProperty(ref m_VCEADoorIsOpen, value); } public bool VCEBDoorIsOpen { get => m_VCEBDoorIsOpen; set => SetProperty(ref m_VCEBDoorIsOpen, value); } public bool PMADoorIsOpen { get => m_PMADoorIsOpen; set => SetProperty(ref m_PMADoorIsOpen, value); } public bool PMBDoorIsOpen { get => m_PMBDoorIsOpen; set => SetProperty(ref m_PMBDoorIsOpen, value); } public bool PMCDoorIsOpen { get => m_PMCDoorIsOpen; set => SetProperty(ref m_PMCDoorIsOpen, value); } public bool PMDDoorIsOpen { get => m_PMDDoorIsOpen; set => SetProperty(ref m_PMDDoorIsOpen, value); } public bool VCEAOutDoorIsOpen { get => m_VCEAOutDoorIsOpen; set => SetProperty(ref m_VCEAOutDoorIsOpen, value); } public bool VCEBOutDoorIsOpen { get => m_VCEBOutDoorIsOpen; set => SetProperty(ref m_VCEBOutDoorIsOpen, value); } #endregion #region 构造函数 public DETMOperationViewModel() { addDataKeys(); string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(','); PMAIsInstalled = allModules.Contains("PMA"); PMBIsInstalled = allModules.Contains("PMB"); PMCIsInstalled = allModules.Contains("PMC"); PMDIsInstalled = allModules.Contains("PMD"); VCEAIsInstalled = allModules.Contains("VCEA"); VCEBIsInstalled = allModules.Contains("VCEB"); RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys); //2023/10/20 朱永吉 郭治川 取消N2 valve 动画保持流的状态 TMValveN2IsOpen = true; TMSoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMSoftPumpValve.IsOpen"); TMSoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMSoftVentValve.IsOpen"); TMFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMFastPumpValve.IsOpen"); TMFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMFastVentValve.IsOpen"); VCEASoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEASoftPumpValve.IsOpen"); VCEASoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEASoftVentValve.IsOpen"); VCEAFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEAFastPumpValve.IsOpen"); VCEAFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEAFastVentValve.IsOpen"); VCEBSoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBSoftPumpValve.IsOpen"); VCEBSoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBSoftVentValve.IsOpen"); VCEBFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBFastPumpValve.IsOpen"); VCEBFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBFastVentValve.IsOpen"); TMIsVAC = CommonFunction.GetValue(RtDataValues, "TM.TMVACSensor.Value"); TMIsATM = CommonFunction.GetValue(RtDataValues, "TM.TMIsATM"); //VCEAIsVAC = CommonFunction.GetValue(RtDataValues, "TM.VCEAVACSensor.Value"); //VCEBIsVAC = CommonFunction.GetValue(RtDataValues, "TM.VCEAVACSensor.Value"); VCEAIsATM = CommonFunction.GetValue(RtDataValues, "TM.VCEAIsATM"); VCEBIsATM = CommonFunction.GetValue(RtDataValues, "TM.VCEBIsATM"); VCEADoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.VCEASlitDoorClosed"); VCEBDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.VCEBSlitDoorClosed"); PMADoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMASlitDoorClosed"); PMBDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMBSlitDoorClosed"); PMCDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMCSlitDoorClosed"); PMDDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMDSlitDoorClosed"); VCEAOutDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "VCEA.VCEOutDoorClosed"); VCEBOutDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "VCEB.VCEOutDoorClosed"); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(0.5); timer.Tick += timer_Tick; timer.Start(); } #endregion #region 公共方法 private DelegateCommand _ControlValveCommand; public DelegateCommand ControlValveCommand => _ControlValveCommand ?? (_ControlValveCommand = new DelegateCommand(OnControlValve)); private DelegateCommand _LeakCheck; public DelegateCommand LeakCheck => _LeakCheck ?? (_LeakCheck = new DelegateCommand(OnLeakCheck)); private DelegateCommand _ControlSlitDoorCommand; public DelegateCommand ControlSlitDoorCommand => _ControlSlitDoorCommand ?? (_ControlSlitDoorCommand = new DelegateCommand(OnControlSlitDoor)); private DelegateCommand _MapCommand; public DelegateCommand MapCommand => _MapCommand ?? (_MapCommand = new DelegateCommand(OnMap)); private DelegateCommand _GoToLoadCommand; public DelegateCommand GoToLoadCommand => _GoToLoadCommand ?? (_GoToLoadCommand = new DelegateCommand(OnGoToLoad)); private DelegateCommand _GoToSlotCommand; public DelegateCommand GoToSlotCommand => _GoToSlotCommand ?? (_GoToSlotCommand = new DelegateCommand(OnGoToSlot)); private DelegateCommand _OpenDoorCommand; public DelegateCommand OpenDoorCommand => _OpenDoorCommand ?? (_OpenDoorCommand = new DelegateCommand(OnOpenDoor)); private DelegateCommand _CloseDoorCommand; public DelegateCommand CloseDoorCommand => _CloseDoorCommand ?? (_CloseDoorCommand = new DelegateCommand(OnCloseDoor)); private DelegateCommand _HOMECommand; public DelegateCommand HOMECommand => _HOMECommand ?? (_HOMECommand = new DelegateCommand(OnHome)); private DelegateCommand _DETMPumpCommand; public DelegateCommand DETMPumpCommand => _DETMPumpCommand ?? (_DETMPumpCommand = new DelegateCommand(OnSetDEPump)); private DelegateCommand _VCEAPumpCommand; public DelegateCommand VCEAPumpCommand => _VCEAPumpCommand ?? (_VCEAPumpCommand = new DelegateCommand(OnSetVCEAPump)); private DelegateCommand _PumpDown; public DelegateCommand PumpDown => _PumpDown ?? (_PumpDown = new DelegateCommand(OnPumpDown)); private DelegateCommand _Vent; public DelegateCommand Vent => _Vent ?? (_Vent = new DelegateCommand(OnVent)); private DelegateCommand _tmhome; public DelegateCommand TmHome => _tmhome ?? (_tmhome = new DelegateCommand(tmhome)); private DelegateCommand _abort; public DelegateCommand Abort => _abort ?? (_abort = new DelegateCommand(abort)); private DelegateCommand _TMSetOnline; public DelegateCommand TMSetOnline => _TMSetOnline ?? (_TMSetOnline = new DelegateCommand(TmSetOnline)); private DelegateCommand _TMSetOffline; public DelegateCommand TMSetOffline => _TMSetOffline ?? (_TMSetOffline = new DelegateCommand(TmSetOffline)); private DelegateCommand _VCEHome; public DelegateCommand VCEHome => _VCEHome ?? (_VCEHome = new DelegateCommand(vceHome)); private DelegateCommand _VCEClear; public DelegateCommand VCEClear => _VCEClear ?? (_VCEClear = new DelegateCommand(vceClear)); private DelegateCommand _VCEAbort; public DelegateCommand VCEAbort => _VCEAbort ?? (_VCEAbort = new DelegateCommand(vceAbort)); private DelegateCommand _VCESetOnline; public DelegateCommand VCESetOnline => _VCESetOnline ?? (_VCESetOnline = new DelegateCommand(vceOnline)); private DelegateCommand _VCESetOffline; public DelegateCommand VCESetOffline => _VCESetOffline ?? (_VCESetOffline = new DelegateCommand(vceOffline)); #endregion #region 私有方法 private void addDataKeys() { m_RtDataKeys.Add($"TM.TMSoftPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.TMSoftVentValve.IsOpen"); m_RtDataKeys.Add($"TM.TMFastPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.TMFastVentValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEASoftPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEBSoftPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEASoftVentValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEBSoftVentValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEAFastPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEBFastPumpValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEAFastVentValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEBFastVentValve.IsOpen"); m_RtDataKeys.Add($"TM.VCEASlitDoorClosed"); m_RtDataKeys.Add($"TM.VCEBSlitDoorClosed"); m_RtDataKeys.Add($"TM.PMASlitDoorClosed"); m_RtDataKeys.Add($"TM.PMBSlitDoorClosed"); m_RtDataKeys.Add($"TM.PMCSlitDoorClosed"); m_RtDataKeys.Add($"TM.PMDSlitDoorClosed"); m_RtDataKeys.Add($"TM.TMVACSensor.Value"); m_RtDataKeys.Add($"LP1.CassettePlaced"); m_RtDataKeys.Add($"LP2.CassettePlaced"); m_RtDataKeys.Add($"TM.TMIsATM"); m_RtDataKeys.Add($"TM.VCEAIsATM"); m_RtDataKeys.Add($"TM.VCEBIsATM"); m_RtDataKeys.Add($"TM.IsOnline"); m_RtDataKeys.Add($"TM.IsOffline"); m_RtDataKeys.Add($"TM.FsmState"); m_RtDataKeys.Add($"VCEA.FsmState"); m_RtDataKeys.Add($"VCEB.FsmState"); m_RtDataKeys.Add($"VCEA.IsOnline"); m_RtDataKeys.Add($"VCEA.IsOffline"); m_RtDataKeys.Add($"VCEB.IsOnline"); m_RtDataKeys.Add($"VCEB.IsOffline"); m_RtDataKeys.Add($"TM.PumpIsRunning"); m_RtDataKeys.Add($"VCEA.PumpIsRunning"); m_RtDataKeys.Add($"TM.TMPipelinePressure.Value"); m_RtDataKeys.Add($"TM.VCEPipelinePressure.Value"); m_RtDataKeys.Add($"TM.TMPressure.Value"); m_RtDataKeys.Add($"TM.VCEAPressure.Value"); m_RtDataKeys.Add($"TM.VCEBPressure.Value"); m_RtDataKeys.Add($"VCEA.VCEOutDoorClosed"); m_RtDataKeys.Add($"VCEB.VCEOutDoorClosed"); m_RtDataKeys.Add($"TM.TM_MFC1.FeedBack"); m_RtDataKeys.Add($"TM.TM_MFC1.SetPoint"); } private void timer_Tick(object sender, EventArgs e) { RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys); TMSoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMSoftPumpValve.IsOpen"); TMSoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMSoftVentValve.IsOpen"); TMFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMFastPumpValve.IsOpen"); TMFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.TMFastVentValve.IsOpen"); VCEASoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEASoftPumpValve.IsOpen"); VCEASoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEASoftVentValve.IsOpen"); VCEAFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEAFastPumpValve.IsOpen"); VCEAFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEAFastVentValve.IsOpen"); VCEBSoftPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBSoftPumpValve.IsOpen"); VCEBSoftVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBSoftVentValve.IsOpen"); VCEBFastPumpIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBFastPumpValve.IsOpen"); VCEBFastVentIsOpen = CommonFunction.GetValue(RtDataValues, "TM.VCEBFastVentValve.IsOpen"); VCEADoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.VCEASlitDoorClosed"); VCEBDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.VCEBSlitDoorClosed"); PMADoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMASlitDoorClosed"); PMBDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMBSlitDoorClosed"); PMCDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "TM.PMCSlitDoorClosed"); VCEAOutDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "VCEA.VCEAOutDoorClosed"); VCEBOutDoorIsOpen = !CommonFunction.GetValue(RtDataValues, "VCEB.VCEBOutDoorClosed"); TMIsVAC = (CommonFunction.GetValue(RtDataValues, "TM.TMPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"TM.VACTargetPressure"))); TMIsATM = CommonFunction.GetValue(RtDataValues, "TM.TMIsATM"); VCEAIsVAC = (CommonFunction.GetValue(RtDataValues, "TM.VCEAPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEA.VACTargetPressure"))); VCEBIsVAC = (CommonFunction.GetValue(RtDataValues, "TM.VCEBPressure.Value") < Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"VCEB.VACTargetPressure"))); VCEAIsATM = CommonFunction.GetValue(RtDataValues, "TM.VCEAIsATM"); VCEBIsATM = CommonFunction.GetValue(RtDataValues, "TM.VCEBIsATM"); TMCurrentState = CommonFunction.GetValue(RtDataValues, "TM.FsmState"); VCEACurrentState = CommonFunction.GetValue(RtDataValues, "VCEA.FsmState"); VCEBCurrentState = CommonFunction.GetValue(RtDataValues, "VCEB.FsmState"); } private void TmSetOnline() { InvokeClient.Instance.Service.DoOperation("TM.Online"); } private void TmSetOffline() { InvokeClient.Instance.Service.DoOperation("TM.Offline"); } private void vceHome(object obj) { InvokeClient.Instance.Service.DoOperation($"{obj}.HOME"); } private void vceClear(object obj) { InvokeClient.Instance.Service.DoOperation($"{obj}.ClearError"); } private void vceAbort(object obj) { InvokeClient.Instance.Service.DoOperation($"{obj}.Abort"); } private void tmhome() { InvokeClient.Instance.Service.DoOperation("TM.Home"); } private void abort() { InvokeClient.Instance.Service.DoOperation("TM.Abort"); } private void OnVent(object obj) { InvokeClient.Instance.Service.DoOperation($"{obj}.Vent"); } private void OnPumpDown(object obj) { InvokeClient.Instance.Service.DoOperation($"{obj}.PumpDown"); } private void OnSetDEPump(object obj) { bool.TryParse(obj.ToString(), out bool Open); InvokeClient.Instance.Service.DoOperation("TM.ControlPump", Open); } private void OnSetVCEAPump(object obj) { bool.TryParse(obj.ToString(), out bool Open); InvokeClient.Instance.Service.DoOperation("VCEA.ControlPump", Open); } private void OnHome(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.HOME"); } private void OnOpenDoor(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.DoorOpen"); } private void OnCloseDoor(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.DoorClose"); } private void OnMap(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.Map"); } private void OnGoToLoad(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.GotoLP"); } private void OnGoToSlot(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.Goto", GoToSlotNumber); } private void OnControlValve(object obj) { CommonValveControl commonValveControl = (CommonValveControl)obj; if (commonValveControl.IsCanEdit == true) { InvokeClient.Instance.Service.DoOperation($"TM.{commonValveControl.Tag}Valve.{AITValveOperation.GVTurnValve}", !commonValveControl.Status); } } private void vceOnline(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.Online"); } private void vceOffline(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.Offline"); } public void OnLeakCheck(object chamber) { InvokeClient.Instance.Service.DoOperation($"{chamber}.LeakCheck", chamber); } private void OnControlSlitDoor(object obj) { string Module = obj.ToString().Split(',')[0]; bool.TryParse(obj.ToString().Split(',')[1], out bool Open); InvokeClient.Instance.Service.DoOperation($"TM.SetSlitDoor", Module, Open); } #endregion } }