|
@@ -0,0 +1,408 @@
|
|
|
+using Aitex.Core.Common;
|
|
|
+using Aitex.Core.UI.MVVM;
|
|
|
+using MECF.Framework.Common.CommonData.Metal;
|
|
|
+using MECF.Framework.Common.CommonData.PlatingCell;
|
|
|
+using MECF.Framework.Common.CommonData.PowerSupplier;
|
|
|
+using MECF.Framework.Common.DataCenter;
|
|
|
+using MECF.Framework.Common.OperationCenter;
|
|
|
+using MECF.Framework.Common.Persistent.Reservoirs;
|
|
|
+using MECF.Framework.Common.RecipeCenter;
|
|
|
+using MECF.Framework.Common.ToolLayout;
|
|
|
+using MECF.Framework.Common.Utilities;
|
|
|
+using Prism.Mvvm;
|
|
|
+using System;
|
|
|
+using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
+using System.Text;
|
|
|
+using System.Threading.Tasks;
|
|
|
+using System.Windows.Input;
|
|
|
+using System.Windows.Threading;
|
|
|
+
|
|
|
+namespace PunkHPX8_MainPages.ViewModels
|
|
|
+{
|
|
|
+ public class PlatingCellHomePageViewModel : BindableBase
|
|
|
+ {
|
|
|
+ #region 常量
|
|
|
+ private const string PERSISTENT_VALUE = "PersistentValue";
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region 内部变量
|
|
|
+
|
|
|
+ #region Common
|
|
|
+ /// <summary>
|
|
|
+ /// 模块名称
|
|
|
+ /// </summary>
|
|
|
+ private string _module;
|
|
|
+ /// <summary>
|
|
|
+ /// 当前选择Recipe节点
|
|
|
+ /// </summary>
|
|
|
+ private RecipeNode _selectedRecipeNode;
|
|
|
+ /// <summary>
|
|
|
+ /// PlatingCellData
|
|
|
+ /// </summary>
|
|
|
+ private PlatingCellData _platingCellCommonData;
|
|
|
+ /// <summary>
|
|
|
+ /// Persistent
|
|
|
+ /// </summary>
|
|
|
+ private PlatingCellPersistentValue _platingCellPersistent;
|
|
|
+ /// <summary>
|
|
|
+ /// platingCellItem
|
|
|
+ /// </summary>
|
|
|
+ private PlatingCellItem _metalItem;
|
|
|
+ /// <summary>
|
|
|
+ /// WaferSize
|
|
|
+ /// </summary>
|
|
|
+ private WaferSize _selectedWaferSize = 0;
|
|
|
+ /// <summary>
|
|
|
+ /// Wafer Size List
|
|
|
+ /// </summary>
|
|
|
+ private List<int> _waferSizeList = new List<int>();
|
|
|
+ /// <summary>
|
|
|
+ /// 页面功能启用
|
|
|
+ /// </summary>
|
|
|
+ private bool _isEnabled;
|
|
|
+ /// <summary>
|
|
|
+ /// AutoMode页面功能启用
|
|
|
+ /// </summary>
|
|
|
+ private bool _isAutoEnabled;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// SeqRecipe
|
|
|
+ /// </summary>
|
|
|
+ private string _seqRecipe;
|
|
|
+
|
|
|
+
|
|
|
+ #region 系统数据
|
|
|
+ /// <summary>
|
|
|
+ /// 定时器
|
|
|
+ /// </summary>
|
|
|
+ DispatcherTimer _timer;
|
|
|
+ /// <summary>
|
|
|
+ /// 查询后台数据集合
|
|
|
+ /// </summary>
|
|
|
+ private List<string> _rtDataKeys = new List<string>();
|
|
|
+ /// <summary>
|
|
|
+ /// rt查询key数值字典
|
|
|
+ /// </summary>
|
|
|
+ private Dictionary<string, object> _rtDataValueDic = new Dictionary<string, object>();
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region platingCell
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeContent
|
|
|
+ /// </summary>
|
|
|
+ private string _recipeContent;
|
|
|
+ /// <summary>
|
|
|
+ /// TimeRemaining
|
|
|
+ /// </summary>
|
|
|
+ private double _timeRemaining;
|
|
|
+ /// <summary>
|
|
|
+ /// OfTotalTime
|
|
|
+ /// </summary>
|
|
|
+ private double _totalTime;
|
|
|
+ /// <summary>
|
|
|
+ /// OperatingMode
|
|
|
+ /// </summary>
|
|
|
+ private string _operatingMode;
|
|
|
+ /// <summary>
|
|
|
+ /// State
|
|
|
+ /// </summary>
|
|
|
+ private string _state;
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeMode
|
|
|
+ /// </summary>
|
|
|
+ private string _recipeMode;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region dep recipe
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeModuleName
|
|
|
+ /// </summary>
|
|
|
+ private string _recipeModuleName;
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeType
|
|
|
+ /// </summary>
|
|
|
+ private string _recipeType;
|
|
|
+ /// <summary>
|
|
|
+ /// AchievedRunRecipeCycle
|
|
|
+ /// </summary>
|
|
|
+ private int _achievedRunRecipeCycle;
|
|
|
+ /// <summary>
|
|
|
+ /// 当前Recipe
|
|
|
+ /// </summary>
|
|
|
+ private string _currentRecipe;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region UI Related
|
|
|
+ /// <summary>
|
|
|
+ /// IsErrorState
|
|
|
+ /// </summary>
|
|
|
+ private bool _isErrorState;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region PowerSupplier
|
|
|
+ /// <summary>
|
|
|
+ /// PowerSuplier数据
|
|
|
+ /// </summary>
|
|
|
+ private PowerSupplierData _powerSupplierData;
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ #region 属性
|
|
|
+
|
|
|
+ #region Common
|
|
|
+ /// <summary>
|
|
|
+ /// PlatingCellData
|
|
|
+ /// </summary>
|
|
|
+ public PlatingCellData PlatingCellCommonData
|
|
|
+ {
|
|
|
+ get { return _platingCellCommonData; }
|
|
|
+ set { SetProperty(ref _platingCellCommonData, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Persistent
|
|
|
+ /// </summary>
|
|
|
+ public PlatingCellPersistentValue PlatingCellPersistent
|
|
|
+ {
|
|
|
+ get { return _platingCellPersistent; }
|
|
|
+ set { SetProperty(ref _platingCellPersistent, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 模块名称
|
|
|
+ /// </summary>
|
|
|
+ public string Module
|
|
|
+ {
|
|
|
+ get { return _module; }
|
|
|
+ set { SetProperty(ref _module, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 当前选择Recipe节点
|
|
|
+ /// </summary>
|
|
|
+ public RecipeNode SelectedRecipeNode
|
|
|
+ {
|
|
|
+ get { return _selectedRecipeNode; }
|
|
|
+ set { SetProperty(ref _selectedRecipeNode, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// WaferSize
|
|
|
+ /// </summary>
|
|
|
+ public WaferSize SelectedWaferSize
|
|
|
+ {
|
|
|
+ get { return _selectedWaferSize; }
|
|
|
+ set { SetProperty(ref _selectedWaferSize, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// WaferSizeList
|
|
|
+ /// </summary>
|
|
|
+ public List<int> WaferSizeList
|
|
|
+ {
|
|
|
+ get { return _waferSizeList; }
|
|
|
+ set { SetProperty(ref _waferSizeList, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 页面功能启用
|
|
|
+ /// </summary>
|
|
|
+ public bool IsEnabled
|
|
|
+ {
|
|
|
+ get { return _isEnabled; }
|
|
|
+ set { SetProperty(ref _isEnabled, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// AutoMode页面功能启用
|
|
|
+ /// </summary>
|
|
|
+ public bool IsAutoEnabled
|
|
|
+ {
|
|
|
+ get { return _isAutoEnabled; }
|
|
|
+ set { SetProperty(ref _isAutoEnabled, value); }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+
|
|
|
+ /// SeqRecipe
|
|
|
+ /// </summary>
|
|
|
+ public string SeqRecipe
|
|
|
+ {
|
|
|
+ get { return _seqRecipe; }
|
|
|
+ set { SetProperty(ref _seqRecipe, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ #region PlatingCell
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeContent
|
|
|
+ /// </summary>
|
|
|
+ public string RecipeContent
|
|
|
+ {
|
|
|
+ get { return _recipeContent; }
|
|
|
+ set { SetProperty(ref _recipeContent, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// TimeRemaining
|
|
|
+ /// </summary>
|
|
|
+ public double TimeRemaining
|
|
|
+ {
|
|
|
+ get { return _timeRemaining; }
|
|
|
+ set { SetProperty(ref _timeRemaining, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// TotalTime
|
|
|
+ /// </summary>
|
|
|
+ public double TotalTime
|
|
|
+ {
|
|
|
+ get { return _totalTime; }
|
|
|
+ set { SetProperty(ref _totalTime, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// OperatingMode
|
|
|
+ /// </summary>
|
|
|
+ public string OperatingMode
|
|
|
+ {
|
|
|
+ get { return _operatingMode; }
|
|
|
+ set { SetProperty(ref _operatingMode, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// State
|
|
|
+ /// </summary>
|
|
|
+ public string State
|
|
|
+ {
|
|
|
+ get { return _state; }
|
|
|
+ set { SetProperty(ref _state, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeMode
|
|
|
+ /// </summary>
|
|
|
+ public string RecipeMode
|
|
|
+ {
|
|
|
+ get { return _recipeMode; }
|
|
|
+ set { SetProperty(ref _recipeMode, value); }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Metal recipe
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeModuleName
|
|
|
+ /// </summary>
|
|
|
+ public string RecipeModuleName
|
|
|
+ {
|
|
|
+ get { return _recipeModuleName; }
|
|
|
+ set { SetProperty(ref _recipeModuleName, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// RecipeType
|
|
|
+ /// </summary>
|
|
|
+ public string RecipeType
|
|
|
+ {
|
|
|
+ get { return _recipeType; }
|
|
|
+ set { SetProperty(ref _recipeType, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Run Recipe已经完成的次数
|
|
|
+ /// </summary>
|
|
|
+ public int AchievedRunRecipeCycle
|
|
|
+ {
|
|
|
+ get { return _achievedRunRecipeCycle; }
|
|
|
+ set { SetProperty(ref _achievedRunRecipeCycle, value); }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 当前Recipe
|
|
|
+ /// </summary>
|
|
|
+ public string CurrentRecipe
|
|
|
+ {
|
|
|
+ get { return _currentRecipe; }
|
|
|
+ set { SetProperty(ref _currentRecipe, value); }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region UI Related
|
|
|
+ /// <summary>
|
|
|
+ /// IsErrorState
|
|
|
+ /// </summary>
|
|
|
+ public bool IsErrorState
|
|
|
+ {
|
|
|
+ get { return _isErrorState; }
|
|
|
+ set { SetProperty(ref _isErrorState, value); }
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// SidA PowerSuplier数据
|
|
|
+ /// </summary>
|
|
|
+ public PowerSupplierData PowerSupplierData
|
|
|
+ {
|
|
|
+ get { return _powerSupplierData; }
|
|
|
+ set { SetProperty(ref _powerSupplierData, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region Command指令
|
|
|
+ public ICommand InitializeCommand { get; set; }
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 构造函数
|
|
|
+ /// </summary>
|
|
|
+ public PlatingCellHomePageViewModel()
|
|
|
+ {
|
|
|
+ InitializeCommand = new DelegateCommand<object>(InitializeAction);
|
|
|
+ WaferSizeList.Add((int)WaferSize.WS8);
|
|
|
+ WaferSizeList.Add((int)WaferSize.WS12);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 加载数据
|
|
|
+ /// </summary>
|
|
|
+ public void LoadData(string systemName)
|
|
|
+ {
|
|
|
+ Module = systemName;
|
|
|
+ RecipeModuleName = "DEP Recipe";
|
|
|
+ RecipeType = "dep";
|
|
|
+ _rtDataKeys.Clear();
|
|
|
+ _rtDataKeys.Add($"{Module}.FsmState");
|
|
|
+ if (_timer == null)
|
|
|
+ {
|
|
|
+ _timer = new DispatcherTimer();
|
|
|
+ _timer.Interval = TimeSpan.FromMilliseconds(200);
|
|
|
+ _timer.Tick += Timer_Tick;
|
|
|
+ }
|
|
|
+ _timer.Start();
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 定时器执行
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="sender"></param>
|
|
|
+ /// <param name="e"></param>
|
|
|
+ private void Timer_Tick(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ if (_rtDataKeys.Count != 0)
|
|
|
+ {
|
|
|
+ _rtDataValueDic = QueryDataClient.Instance.Service.PollData(_rtDataKeys);
|
|
|
+ if (_rtDataValueDic != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// 隐藏
|
|
|
+ /// </summary>
|
|
|
+ public void Hide()
|
|
|
+ {
|
|
|
+ if (_timer != null)
|
|
|
+ {
|
|
|
+ _timer.Stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
+ /// Initialize Action
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="param"></param>
|
|
|
+ private void InitializeAction(object param)
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{Module}.InitializeAll");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|