| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 | 
							- using Caliburn.Micro;
 
- using Caliburn.Micro.Core;
 
- using Aitex.Core.Common.DeviceData;
 
- using Aitex.Core.UI.ControlDataContext;
 
- using Aitex.Core.Util;
 
- using MECF.Framework.Common.DataCenter;
 
- using MECF.Framework.Common.OperationCenter;
 
- using FurnaceUI.Models;
 
- using FurnaceUI.Views.Editors;
 
- using System.Collections.ObjectModel;
 
- using System.Collections.Generic;
 
- using System.Threading.Tasks;
 
- using System.Reflection;
 
- using System;
 
- using Aitex.Core.RT.Log;
 
- using System.Linq;
 
- using System.Windows;
 
- using Aitex.Core.RT.SCCore;
 
- using MECF.Framework.Common.SubstrateTrackings;
 
- using OpenSEMI.ClientBase;
 
- using DocumentFormat.OpenXml.Office.Word;
 
- using RecipeEditorLib.RecipeModel.Params;
 
- namespace FurnaceUI.Views.Maintenances
 
- {
 
-     public class LPSensorViewModel : FurnaceModuleUIViewModelBase
 
-     {
 
-         public bool IsManagerPermission { get => this.Permission == 3; }
 
-         [Subscription("Rt.Status")]
 
-         public string RtStatus { get; set; }
 
-         public bool IsEnableManualOperation => IsSystemStaus;
 
-         public bool IsSystemStaus => (RtStatus != "AutoRunning");
 
-         #region stage sensors
 
-         //[Subscription("System.SensorStation17Presence.DeviceData")]
 
-         //public AITSensorData SensorStation17Presence { get; set; }
 
-         //[Subscription("System.SensorStation18Presence.DeviceData")]
 
-         //public AITSensorData SensorStation18Presence { get; set; }
 
-         //[Subscription("System.SensorStation17APresence.DeviceData")]
 
-         //public AITSensorData SensorStation17APresence { get; set; }
 
-         //[Subscription("System.SensorStation18APresence.DeviceData")]
 
-         //public AITSensorData SensorStation18APresence { get; set; }
 
-         //[Subscription("System.Valve1EX.DeviceData")]
 
-         //public AITSensorData Valve1EX { get; set; }
 
-         //[Subscription("System.Valve1RE.DeviceData")]
 
-         //public AITSensorData Valve1RE { get; set; }
 
-         //[Subscription("System.Valve2EX.DeviceData")]
 
-         //public AITSensorData Valve2EX { get; set; }
 
-         //[Subscription("System.Valve2RE.DeviceData")]
 
-         //public AITSensorData Valve2RE { get; set; }
 
-         [Subscription("LP1.Status")]
 
-         public string LP1State { get; set; }
 
-         [Subscription("LP2.Status")]
 
-         public string LP2State { get; set; }
 
-         [Subscription("LP3.Status")]
 
-         public string LP3State { get; set; }
 
-         [Subscription("LP4.Status")]
 
-         public string LP4State { get; set; }
 
-         [Subscription("LP1.AccessMode")]
 
-         public string LP1AccessMode { get; set; }
 
-         [Subscription("LP2.AccessMode")]
 
-         public string LP2AccessMode { get; set; }
 
-         [Subscription("LP3.AccessMode")]
 
-         public string LP3AccessMode { get; set; }
 
-         [Subscription("LP4.AccessMode")]
 
-         public string LP4AccessMode { get; set; }
 
-         [Subscription("LP1.DeviceStatus")]
 
-         public string LP1DeviceStatus { get; set; }
 
-         [Subscription("LP2.DeviceStatus")]
 
-         public string LP2DeviceStatus { get; set; }
 
-         [Subscription("LP3.DeviceStatus")]
 
-         public string LP3DeviceStatus { get; set; }
 
-         [Subscription("LP4.DeviceStatus")]
 
-         public string LP4DeviceStatus { get; set; }
 
-         [Subscription("LP1.Carrier")]
 
-         public CarrierInfo LP1CarrierInfo { get; set; }
 
-         [Subscription("LP2.Carrier")]
 
-         public CarrierInfo LP2CarrierInfo { get; set; }
 
-         [Subscription("LP3.Carrier")]
 
-         public CarrierInfo LP3CarrierInfo { get; set; }
 
-         [Subscription("LP4.Carrier")]
 
-         public CarrierInfo LP4CarrierInfo { get; set; }
 
-         #endregion
 
-         private int _tabSelectIndex = 0;
 
-         public int TabSelectIndex
 
-         {
 
-             get => _tabSelectIndex;
 
-             set
 
-             {
 
-                 _tabSelectIndex = value;
 
-                 NotifyOfPropertyChange(nameof(TabSelectIndex));
 
-             }
 
-         }
 
-         private bool _lP4BorderVisibility = true;
 
-         public bool LP4BorderVisibility
 
-         {
 
-             get => _lP4BorderVisibility;
 
-             set
 
-             {
 
-                 _lP4BorderVisibility = value;
 
-                 NotifyOfPropertyChange(nameof(LP4BorderVisibility));
 
-             }
 
-         }
 
-         private bool _lP3BorderVisibility = true;
 
-         public bool LP3BorderVisibility
 
-         {
 
-             get => _lP3BorderVisibility;
 
-             set
 
-             {
 
-                 _lP3BorderVisibility = value;
 
-                 NotifyOfPropertyChange(nameof(LP3BorderVisibility));
 
-             }
 
-         }
 
-         private bool _lP2BorderVisibility = true;
 
-         public bool LP2BorderVisibility
 
-         {
 
-             get => _lP2BorderVisibility;
 
-             set
 
-             {
 
-                 _lP2BorderVisibility = value;
 
-                 NotifyOfPropertyChange(nameof(LP2BorderVisibility));
 
-             }
 
-         }
 
-         private bool _lP1BorderVisibility = true;
 
-         public bool LP1BorderVisibility
 
-         {
 
-             get => _lP1BorderVisibility;
 
-             set
 
-             {
 
-                 _lP1BorderVisibility = value;
 
-                 NotifyOfPropertyChange(nameof(LP1BorderVisibility));
 
-             }
 
-         }
 
-         //     public ObservableCollection<SensorViewItem> LPSensors { get; set; } = new ObservableCollection<SensorViewItem>();
 
-         public LPSensorViewModel()
 
-         {
 
-         }
 
-         protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
 
-         {
 
-             base.InvokeAfterUpdateProperty(data);
 
-         }
 
-         //protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
 
-         //{
 
-         //    base.InvokeBeforeUpdateProperty(data);
 
-         //}
 
-         //public override void UpdateSubscribe(Dictionary<string, object> data, object target, string module = null)
 
-         //{
 
-         //    Parallel.ForEach(target.GetType().GetProperties().Where(_hasSubscriptionAttribute),
 
-         //         property =>
 
-         //         {
 
-         //             PropertyInfo pi = (PropertyInfo)property;
 
-         //             SubscriptionAttribute subscription = property.GetCustomAttributes(false).First(_isSubscriptionAttribute) as SubscriptionAttribute;
 
-         //             string key = subscription.ModuleKey;
 
-         //             key = module == null ? key : string.Format("{0}.{1}", module, key);
 
-         //             if (_subscribedKeys.Contains(key) && data.ContainsKey(key))
 
-         //             {
 
-         //                 try
 
-         //                 {
 
-         //                     var convertedValue = Convert.ChangeType(data[key], pi.PropertyType);
 
-         //                     var originValue = Convert.ChangeType(pi.GetValue(target, null), pi.PropertyType);
 
-         //                     if ((convertedValue as AITSensorData) != null && originValue != convertedValue)
 
-         //                     {
 
-         //                         pi.SetValue(target, convertedValue, null);
 
-         //                         //if ((convertedValue as AITSensorData).DeviceName.ToLower().Contains(_para))
 
-         //                         //{
 
-         //                         Update(LPSensors, convertedValue as AITSensorData);
 
-         //                         //}
 
-         //                     }
 
-         //                 }
 
-         //                 catch (Exception ex)
 
-         //                 {
 
-         //                     LOG.Error("由RT返回的数据更新失败" + key, ex);
 
-         //                 }
 
-         //             }
 
-         //         });
 
-         //    base.UpdateSubscribe(data, target, module);
 
-         //}
 
-         //private void Update(ObservableCollection<SensorViewItem> sensors, object obj)
 
-         //{
 
-         //    AITSensorData data = obj as AITSensorData;
 
-         //    if (data != null && sensors.Count > 0)
 
-         //    {
 
-         //        var item = sensors.SingleOrDefault(x => x.Name == data.DeviceName);
 
-         //        if (item != null)
 
-         //        {
 
-         //            item.Value = data.Value;
 
-         //        }
 
-         //    }
 
-         //}
 
-         [Subscription("LP1.CarrierId")]
 
-         public string LP1CarrierInfoCarrierId { get; set; }
 
-         [Subscription("LP2.CarrierId")]
 
-         public string LP2CarrierInfoCarrierId { get; set; }
 
-         [Subscription("LP3.CarrierId")]
 
-         public string LP3CarrierInfoCarrierId { get; set; }
 
-         [Subscription("LP4.CarrierId")]
 
-         public string LP4CarrierInfoCarrierId { get; set; }
 
-         public void DoLoadPortCmd(string deviceName, string cmd)
 
-         {
 
-             if (cmd == "SetAMHS" && deviceName == "LP1" && LP1CarrierInfo != null && !LP1CarrierInfo.IsEmpty)
 
-             {
 
-                 DialogBox.ShowWarning($"{deviceName} change to auto failed, for FOUP present");
 
-                 return;
 
-             }
 
-             if (cmd == "SetAMHS" && deviceName == "LP2" && LP2CarrierInfo != null && !LP2CarrierInfo.IsEmpty)
 
-             {
 
-                 DialogBox.ShowWarning($"{deviceName} change to auto failed, for FOUP present");
 
-                 return;
 
-             }
 
-             if (cmd == "SetAMHS" && deviceName == "LP3" && LP3CarrierInfo != null && !LP3CarrierInfo.IsEmpty)
 
-             {
 
-                 DialogBox.ShowWarning($"{deviceName} change to auto failed, for FOUP present");
 
-                 return;
 
-             }
 
-             if (cmd == "SetAMHS" && deviceName == "LP4" && LP4CarrierInfo != null && !LP4CarrierInfo.IsEmpty)
 
-             {
 
-                 DialogBox.ShowWarning($"{deviceName} change to auto failed, for FOUP present");
 
-                 return;
 
-             }
 
-             InvokeClient.Instance.Service.DoOperation($"{deviceName}.{cmd}");
 
-         }
 
-         public void Home(object para)
 
-         {
 
-             if (!DialogBox.Confirm($"Are you sure  want to {para} Home?"))
 
-                 return;
 
-             InvokeClient.Instance.Service.DoOperation($"{para}.Home", "");
 
-         }
 
-         public void SetClamp(object para)
 
-         {
 
-             if (!DialogBox.Confirm($"Are you sure  want to {para} Unload?"))
 
-                 return;
 
-             InvokeClient.Instance.Service.DoOperation($"{para}.Unload", "");
 
-         }
 
-         public void SetRelease(object para)
 
-         {
 
-             if (!DialogBox.Confirm($"Are you sure  want to {para} Load?"))
 
-                 return;
 
-             InvokeClient.Instance.Service.DoOperation($"{para}.Load", "");
 
-         }
 
-         public void ReadCarrierId(string moduleID)
 
-         {
 
-             if (!DialogBox.Confirm($"Are you sure  want to {moduleID} ReadCarrierId?"))
 
-                 return;
 
-             InvokeClient.Instance.Service.DoOperation($"{moduleID}.ReadCarrierId");
 
-         }
 
-         public void ClosedCmd()
 
-         {
 
-             (GetView() as Window).Close();
 
-         }
 
-     }
 
- }
 
 
  |