123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- using System;
- using System.Windows;
- using System.Windows.Input;
- using Aitex.Core.RT.Log;
- using MECF.Framework.Common.DataCenter;
- using OpenSEMI.ClientBase;
- using OpenSEMI.ClientBase.Command;
- namespace VirgoUI.Client.Dialog
- {
- public class WaferTransferDialogViewModel : DialogViewModel<WaferTransferCondition>
- {
- #region properties
- private WaferTransferCondition _Conditions;
- public WaferTransferCondition Conditions
- {
- get { return _Conditions; }
- set { _Conditions = value; }
- }
- private string _ConfirmText;
- public string ConfirmText
- {
- get { return _ConfirmText; }
- set { _ConfirmText = value; }
- }
- public bool DisplayPassAlignerCondition { get; set; }
- public bool DisplayPassCoolingCondition { get; set; }
- private string _ChamberTemperatureText;
- public string ChamberTemperatureText
- {
- get { return _ChamberTemperatureText; }
- set { _ChamberTemperatureText = value; }
- }
- #endregion
- #region Command
- private ICommand _TransferCommand;
- public ICommand TransferCommand
- {
- get
- {
- if (this._TransferCommand == null)
- this._TransferCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnTransferCommand(arg));
- return this._TransferCommand;
- }
- }
- private ICommand _BtnCancelCommand;
- public ICommand CancelCommand
- {
- get
- {
- if (this._BtnCancelCommand == null)
- this._BtnCancelCommand = new BaseCommand<EventCommandParameter<object, RoutedEventArgs>>((EventCommandParameter<object, RoutedEventArgs> arg) => this.OnCancelCommand(arg));
- return this._BtnCancelCommand;
- }
- }
- #endregion
- #region Function
- protected override void OnInitialize()
- {
- base.OnInitialize();
- }
- public WaferTransferDialogViewModel(string message, bool displayPassAlignerCondition, bool displayPassCoolingCondition, string chamberLabel)
- {
- this.DisplayName = "Wafer Transfer Dialog";
- ConfirmText = message;
- Conditions = new WaferTransferCondition();
- ChamberTemperatureText = chamberLabel;
- DisplayPassAlignerCondition = displayPassAlignerCondition;
- DisplayPassCoolingCondition = displayPassCoolingCondition;
- try
- {
- var defaultAutoAlign = QueryDataClient.Instance.Service.GetConfig("System.AutoAlignManualTransfer");
- if (!displayPassAlignerCondition)
- defaultAutoAlign = false;
- var defaultPassCooling = QueryDataClient.Instance.Service.GetConfig("System.AutoPassCooling");
- if (!displayPassCoolingCondition)
- defaultPassCooling = false;
- Conditions.IsPassAligner = false;
- Conditions.IsPassCooling = defaultPassCooling == null || (bool)defaultPassCooling;
- //var alignerAngle = QueryDataClient.Instance.Service.GetConfig("Aligner.DefaultNotchDegree");
- //var coolingTime = QueryDataClient.Instance.Service.GetConfig("LoadLock.DefaultCoolingTime");
- //Conditions.AlignerAngle = (int)((double)alignerAngle);
- //Conditions.CoolingTime = (int)coolingTime;
- //ChamberTemperatureText = chamberLabel;
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- }
-
- }
-
- private void OnTransferCommand(EventCommandParameter<object, RoutedEventArgs> arg)
- {
- DialogResult = Conditions;
- TryClose(true);
- }
- private void OnCancelCommand(EventCommandParameter<object, RoutedEventArgs> arg)
- {
- TryClose(false);
- }
- #endregion
- }
- }
|