Browse Source

增加LOG模块中特定eEvent id触发委托函数 && 移除UI中触发PMError && add SE TM Cycle throughput && fix vcedoor not show

zhouhr 1 year ago
parent
commit
376ce10782

+ 10 - 1
Venus/Framework/Common/Log/LOG.cs

@@ -20,6 +20,12 @@ namespace Aitex.Core.RT.Log
         }
 
         public static ICommonLog InnerLogger { set;  private get; }
+        public static Action<ModuleName> PMErrorInterrupt;
+        public static void onErrorInterrupt(ModuleName module)
+        {
+            if (PMErrorInterrupt != null && ModuleHelper.IsPm(module))
+                PMErrorInterrupt(module);
+        }
 
         private static void Debug(string message)
         {
@@ -74,8 +80,11 @@ namespace Aitex.Core.RT.Log
         }
         public static void Write(eEvent id, ModuleName module, params string[] values)
         {
+            //U can Add here to postmsg(MSG.Error) to target entity by the func
+            //if (id == eEvent.ERR_DEVICE_INFO)
+            //    onErrorInterrupt(module);
 
-           var logItem= LogDefineManager.LogItems?.Where(x => x.Id == id).FirstOrDefault();
+            var logItem= LogDefineManager.LogItems?.Where(x => x.Id == id).FirstOrDefault();
             if (logItem != null)
             {
                 var item1 = logItem.Id;

+ 26 - 0
Venus/Venus_MainPages/ViewModels/SeTMViewModel.cs

@@ -88,6 +88,11 @@ namespace Venus_MainPages.ViewModels
             get { return m_PMBWafer; }
             set { SetProperty(ref m_PMBWafer, value); }
         }
+        public WaferInfo PMCWafer
+        {
+            get { return m_PMCWafer; }
+            set { SetProperty(ref m_PMCWafer, value); }
+        }
 
         public bool VCE1DoorIsOpen
         {
@@ -490,6 +495,27 @@ namespace Venus_MainPages.ViewModels
         private void Timer_Tick(object sender, EventArgs e)
         {
             TMModuleInfo = ModuleManager.ModuleInfos["TMRobot"];
+            if (VCE1IsInstalled)
+            { 
+            
+            }
+
+            if (PMAIsInstalled == true)
+            {
+                ModuleInfo PMAModuleInfo = ModuleManager.ModuleInfos["PMA"];
+                PMAWafer = PMAModuleInfo.WaferManager.Wafers[0];
+            }
+            if (PMBIsInstalled == true)
+            {
+                ModuleInfo PMBModuleInfo = ModuleManager.ModuleInfos["PMB"];
+                PMBWafer = PMBModuleInfo.WaferManager.Wafers[0];
+            }
+            if (PMCIsInstalled == true)
+            {
+                ModuleInfo PMCModuleInfo = ModuleManager.ModuleInfos["PMC"];
+                PMCWafer = PMCModuleInfo.WaferManager.Wafers[0];
+            }
+
             RtDataValues = QueryDataClient.Instance.Service.PollData(m_RtDataKeys);
             VCE1DoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.VCESlitDoorClosed");
             PMADoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMASlitDoorClosed");

+ 4 - 4
Venus/Venus_MainPages/ViewModels/TopViewModel.cs

@@ -428,10 +428,10 @@ namespace Venus_MainPages.ViewModels
                         if (eventItem.Level == EventLevel.Alarm)
                         {
                             alarmQuery.Enqueue(eventItem);
-                            if (stopEntityId.Contains(eventItem.Id) && eventItem.Source.Contains("PM"))
-                            {
-                                InvokeClient.Instance.Service.DoOperation($"{eventItem.Source}.PmError");
-                            }
+                            //if (stopEntityId.Contains(eventItem.Id) && eventItem.Source.Contains("PM"))
+                            //{
+                            //    InvokeClient.Instance.Service.DoOperation($"{eventItem.Source}.PmError");
+                            //}
                         }
                         if (alarmQuery.Count > 0)
                         {

+ 1 - 0
Venus/Venus_MainPages/ViewModels/VenusSeOperationOverViewModel.cs

@@ -423,6 +423,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"SEScheduler.CycledWafer");
             m_RtDataKeys.Add($"SEScheduler.CycleSetPoint");
             m_RtDataKeys.Add($"SEScheduler.CycleCount");
+            m_RtDataKeys.Add($"SEScheduler.ThroughPut");
             
         }
 

+ 11 - 9
Venus/Venus_MainPages/Views/SeTMView.xaml

@@ -114,18 +114,20 @@
                 <Canvas Canvas.Top="100" Width="450" Height="800">
 
                     <userControls:VenusSETM
-                                        VCEIsInstalled="{Binding VCEIsInstalled }" 
-                                        PMAIsInstalled="{Binding  PMAIsInstalled}"
-                                        PMBIsInstalled="{Binding  PMBIsInstalled}" 
-                                        PMCIsInstalled="{Binding  PMCIsInstalled}"
-                                        VCEDoorIsOpen = "{Binding VCE1DoorIsOpen}"
-                                        PMADoorIsOpen = "{Binding PMADoorIsOpen}"
-                                        PMBDoorIsOpen = "{Binding PMBDoorIsOpen}"
-                                        PMCDoorIsOpen = "{Binding PMCDoorIsOpen}"
-                                        VPAIsShow="true" Panel.ZIndex="99"
+                        VCEIsInstalled="{Binding VCE1IsInstalled }" 
+                        PMAIsInstalled="{Binding  PMAIsInstalled}"
+                        PMBIsInstalled="{Binding  PMBIsInstalled}" 
+                        PMCIsInstalled="{Binding  PMCIsInstalled}"
+                        VCEDoorIsOpen = "{Binding VCE1DoorIsOpen}"
+                        PMADoorIsOpen = "{Binding PMADoorIsOpen}"
+                        PMBDoorIsOpen = "{Binding PMBDoorIsOpen}"
+                        PMCDoorIsOpen = "{Binding PMCDoorIsOpen}"
+                        VPAIsShow="true" Panel.ZIndex="99"
                         Width="140" Height="140" Canvas.Top="140" Canvas.Left="372" ></userControls:VenusSETM>
+
                     <userControls:TMChamber Panel.ZIndex="1" ModuleName="PMA" x:Name="PMA" Canvas.Top="275"  Canvas.Left="277" Width="100" Height="100" RotateTransformValue="-90"  DoorIsOpen="{Binding RtDataValues[PMA.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMAWafer}" PMVisibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
                     <userControls:TMChamber Panel.ZIndex="1" ModuleName="PMB" x:Name="PMB" Canvas.Top="45"   Canvas.Left="409" Width="100" Height="100"  DoorIsOpen="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMBWafer}" PMVisibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
+                    <userControls:TMChamber Panel.ZIndex="1" ModuleName="PMC" x:Name="PMC" Canvas.Top="174"   Canvas.Left="642" Width="102" Height="102" RotateTransformValue="90" DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMBWafer}" PMVisibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                     <!--<userControls:TMChamber ModuleName="PMC" x:Name="PMC" Canvas.Top="155"  Canvas.Left="680" Width="140" Height="140" RotateTransformValue="90"  DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMCWafer}" PMVisibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>-->
                     <TextBlock Canvas.Top="535" Canvas.Left="435" Text="Vce" FontSize="25" FontWeight="Normal" HorizontalAlignment="Center" VerticalAlignment="Top"></TextBlock>
                     <userControls:Vce Canvas.Top="360" Canvas.Left="355" Width="200" Height="180" HorizontalAlignment="Center" VerticalAlignment="Top"></userControls:Vce>

+ 10 - 2
Venus/Venus_MainPages/Views/VenusSeOperationOverView.xaml

@@ -195,7 +195,7 @@
             <!-- Cycle information-->
             <Canvas Canvas.Top="690" Canvas.Left="1550">
                 <Border BorderBrush="#4e6a8a" BorderThickness="2" Padding="10" CornerRadius="7">
-                    <Grid Width="200" Height="70">
+                    <Grid Width="200" Height="100">
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="*"></ColumnDefinition>
                             <ColumnDefinition Width="*"></ColumnDefinition>
@@ -204,6 +204,7 @@
                             <RowDefinition Height="*"></RowDefinition>
                             <RowDefinition Height="*"></RowDefinition>
                             <RowDefinition Height="*"></RowDefinition>
+                            <RowDefinition Height="*"></RowDefinition>
                         </Grid.RowDefinitions>
                         <TextBlock Grid.ColumnSpan="2" Text="Cycle Information" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,3"/>
                         <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1">
@@ -221,7 +222,14 @@
                                 <TextBlock  Text="/" Foreground="{DynamicResource FG_Black}"></TextBlock>
                                 <TextBlock  Text="{Binding RtDataValues[SEScheduler.CycleSetPoint]}" Foreground="{DynamicResource FG_Black}"></TextBlock>
                             </StackPanel>
-                            
+                        </Border>
+                        <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="3" Padding="5,1">
+                            <TextBlock Text="Throughput" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14" FontFamily="Arial" VerticalAlignment="Center"/>
+                        </Border>
+                        <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="3" Grid.Column="1" Padding="5,1">
+                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
+                                <TextBlock  Text="{Binding RtDataValues[SEScheduler.ThroughPut]}" Foreground="{DynamicResource FG_Black}"></TextBlock>
+                            </StackPanel>
                         </Border>
                     </Grid>
                 </Border>

+ 13 - 1
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -24,6 +24,7 @@ using Venus_RT.Modules.PMs;
 using MECF.Framework.Common.Routine;
 using Aitex.Core.RT.Log;
 using MECF.Framework.Common.DBCore;
+using System.Reflection;
 
 namespace Venus_RT.Modules.PMs
 {
@@ -632,12 +633,23 @@ namespace Venus_RT.Modules.PMs
 
             OP.Subscribe($"{Module}.{RtOperation.PmOnline}", (cmd, args) => CheckToPostMessage((int)MSG.Online));
             OP.Subscribe($"{Module}.{RtOperation.PmOffline}", (cmd, args) => CheckToPostMessage((int)MSG.Offline));
-            OP.Subscribe($"{Module}.{RtOperation.PmError}", (cmd, args) => CheckToPostMessage((int)MSG.Error));
+            //OP.Subscribe($"{Module}.{RtOperation.PmError}", (cmd, args) => CheckToPostMessage((int)MSG.Error));
 
 
+            LOG.PMErrorInterrupt += (pmname)=> PMErrorInterrupt(pmname);
+
             return true;
         }
 
+        private void PMErrorInterrupt(ModuleName pmname)
+        {
+            if (pmname == Module)
+            {
+                LOG.Write(eEvent.ERR_PM, Module, $"Device Error Happend! {Module} Crash!");
+                CheckToPostMessage((int)MSG.Error);
+            }
+        }
+
         private bool ManualEndStep()
         {
             _processRoutine.isMaualEndStep = true;

+ 9 - 3
Venus/Venus_RT/Modules/SETMCycle.cs

@@ -66,6 +66,9 @@ namespace Venus_RT.Modules
         private List<MoveItem> _moveQueue = new List<MoveItem>();
         private List<MovingStatus> movingStatus = new List<MovingStatus>();
 
+        private double _throughput = 0;
+        private DateTime _starttime;
+
         public int? CycleIndex;
 
         private int CycledWafer => _currentWafer + _pastWafer;
@@ -102,6 +105,7 @@ namespace Venus_RT.Modules
             DATA.Subscribe("SEScheduler.CycledWafer", ()=> CycledWafer );
             DATA.Subscribe("SEScheduler.CycleSetPoint", ()=> CycleNum);
             DATA.Subscribe("SEScheduler.CycleCount", ()=> CycleIndex);
+            DATA.Subscribe("SEScheduler.ThroughPut", ()=> _throughput);
     }
 
         #endregion
@@ -165,6 +169,7 @@ namespace Venus_RT.Modules
             }
 
 
+            _starttime = DateTime.Now;
             _cycleState = RState.Running;
         }
         //processJob(sequence num) ControlJob(1)
@@ -378,7 +383,7 @@ namespace Venus_RT.Modules
         }
         #endregion
 
-        #region
+        #region 推进|检查|计数
         private void CheckCycleDone()
         {
 
@@ -391,7 +396,8 @@ namespace Venus_RT.Modules
                 if(WaferManager.Instance.CheckHasWafer(ModuleName.VCE1,index) && movingStatus[index] == MovingStatus.Idle)
                     _currentWafer ++;
             }
-
+            //throughput = CycledWafer/time, time(h)
+            _throughput = Math.Round(CycledWafer /  (DateTime.Now - _starttime).TotalSeconds * 3600,2);
             //how to confirm a sequence is over?
             //3、wafer is all in vce
             //2、all status is over => idle
@@ -885,7 +891,7 @@ namespace Venus_RT.Modules
         #endregion
 
 
-        #region 检查函数
+        #region 搜索函数
 
         //回到的槽位确认 采用补进方式即自底向上填
         private List<int> GetReadyInSlot(ModuleName module, int slotCount)