using Aitex.Core.UI.MVVM; using MECF.Framework.Common.CommonData; using MECF.Framework.Common.DataCenter; using MECF.Framework.Common.Equipment; using MECF.Framework.Common.OperationCenter; using OpenSEMI.ClientBase; using Prism.Commands; using Prism.Mvvm; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Venus_Core; using Venus_Themes.CustomControls; using System.Windows.Threading; using Venus_MainPages.Unity; namespace Venus_MainPages.ViewModels { public class VenusSeOperationOverViewModel : BindableBase { #region 私有字段 private ModuleInfo m_VCE1ModuleInfo; private ModuleInfo m_PMAModuleInfo; private ModuleInfo m_PMBModuleInfo; private ModuleInfo m_PMCModuleInfo; private ModuleInfo m_VPAModuleInfo; private int m_VCE1WaferCount; private bool m_PMAIsInstalled; private bool m_PMBIsInstalled; private bool m_PMCIsInstalled; private bool m_VCEIsInstalled; #endregion #region 属性 public ModuleInfo VCE1ModuleInfo { get { return m_VCE1ModuleInfo;} set { SetProperty(ref m_VCE1ModuleInfo, value); } } public ModuleInfo PMAModuleInfo { get { return m_PMAModuleInfo; } set { SetProperty(ref m_PMAModuleInfo, value); } } public ModuleInfo PMBModuleInfo { get { return m_PMBModuleInfo; } set { SetProperty(ref m_PMBModuleInfo, value); } } public ModuleInfo PMCModuleInfo { get { return m_PMCModuleInfo; } set { SetProperty(ref m_PMCModuleInfo, value); } } public ModuleInfo VPAModuleInfo { get { return m_VPAModuleInfo; } set { SetProperty (ref m_VPAModuleInfo, value); } } public bool PMAIsInstalled { get { return m_PMAIsInstalled; } set { SetProperty(ref m_PMAIsInstalled,value); } } public bool PMBIsInstalled { get { return m_PMBIsInstalled; } set { SetProperty(ref m_PMBIsInstalled, value); } } public bool PMCIsInstalled { get { return m_PMCIsInstalled; } set { SetProperty(ref m_PMCIsInstalled, value); } } public bool VCEIsInstalled { get { return m_VCEIsInstalled; } set { SetProperty(ref m_VCEIsInstalled, value); } } public int VCE1WaferCount { get { return m_VCE1WaferCount; } set { SetProperty(ref m_VCE1WaferCount, value); } } #endregion #region 命令 private DelegateCommand _VCEHome; public DelegateCommand VCEHome => _VCEHome ?? (_VCEHome = new DelegateCommand(vceHome)); private DelegateCommand _VCEReadMap; public DelegateCommand VCEReadMap => _VCEReadMap ?? (_VCEReadMap = new DelegateCommand(vceReadMap)); private DelegateCommand _VCELoadPrepare; public DelegateCommand VCELoadPrepare => _VCELoadPrepare ?? (_VCELoadPrepare = new DelegateCommand(vceLoadPrepare)); private DelegateCommand __VCELoad; public DelegateCommand VCELoad => __VCELoad ?? (__VCELoad = new DelegateCommand(vceLoad)); private DelegateCommand _VCEUnLoad; public DelegateCommand VCEUnLoad => _VCEUnLoad ?? (_VCEUnLoad = new DelegateCommand(vceUnLoad)); private DelegateCommand _SMIFLoad; public DelegateCommand SMIFLoad => _SMIFLoad ?? (_SMIFLoad = new DelegateCommand(smifLoad)); private DelegateCommand _SMIFULoad; public DelegateCommand SMIFULoad => _SMIFULoad ?? (_SMIFULoad = new DelegateCommand(smifUnLoad)); #endregion #region 构造函数 public VenusSeOperationOverViewModel() { //页面不刷错的方法 页面中的PM做成List的形式 通过itemsource显示 同时提供各个位置的pm点位 旋转角度 VCE1WaferCount = 25; string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(','); PMAIsInstalled = allModules.Contains("PMA"); PMBIsInstalled = allModules.Contains("PMB"); PMCIsInstalled = allModules.Contains("PMC"); VCEIsInstalled = allModules.Contains("VCE1"); DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(0.1); timer.Tick += Timer_Tick; timer.Start(); } #endregion #region 命令实现 private void vceHome() { InvokeClient.Instance.Service.DoOperation("VCE1.HOME"); } private void vceReadMap() { InvokeClient.Instance.Service.DoOperation("VCE1.ReadMap"); } private void vceLoadPrepare() { } private void vceLoad() { InvokeClient.Instance.Service.DoOperation("VCE1.Load"); } private void vceUnLoad() { } private void smifLoad() { } private void smifUnLoad() { } #endregion #region 私有方法 private void Timer_Tick(object sender, EventArgs e) { if (PMAIsInstalled == true) { PMAModuleInfo = ModuleManager.ModuleInfos["PMA"]; } if (PMBIsInstalled == true) { PMBModuleInfo = ModuleManager.ModuleInfos["PMB"]; } if (PMCIsInstalled == true) { PMCModuleInfo = ModuleManager.ModuleInfos["PMC"]; } if (VCEIsInstalled == true) { VCE1ModuleInfo = ModuleManager.ModuleInfos["VCE1"]; } } #endregion } }