浏览代码

implement throughput calculation function.

sangwq 1 年之前
父节点
当前提交
09032ffa8c

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

@@ -934,6 +934,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add("Scheduler.CycledCount");
             m_RtDataKeys.Add("Scheduler.CycledWafer");
             m_RtDataKeys.Add("Scheduler.CycleSetPoint");
+            m_RtDataKeys.Add("Scheduler.Throughput");
 
             m_RtDataKeys.Add("LP1.IsLoaded");
             m_RtDataKeys.Add("LP2.IsLoaded");

+ 7 - 0
Venus/Venus_MainPages/Views/OperationOverView.xaml

@@ -488,6 +488,7 @@
                             <RowDefinition Height="25"/>
                             <RowDefinition Height="24"/>
                             <RowDefinition Height="24"/>
+                            <RowDefinition Height="24"/>
 
                         </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"/>
@@ -510,6 +511,12 @@
                                 </TextBlock.Text>
                             </TextBlock>
                         </Border>
+                        <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="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,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="3" Grid.Column="1" Padding="5,1">
+                            <TextBlock Text="{Binding RtDataValues[Scheduler.Throughput]}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="14" FontFamily="Arial" VerticalAlignment="Center"/>
+                        </Border>
                     </Grid>
 
                     <TextBlock Grid.ColumnSpan="2" Text="{Binding ATMModeIsOn}" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,20,0,0"/>

+ 43 - 8
Venus/Venus_RT/Modules/AutoCycle.cs

@@ -113,6 +113,8 @@ namespace Venus_RT.Modules
         private int _cycleSetPoint = 0;
         private int _cycledCount = 0;
         private int _cycledWafer = 0;
+        private float _throughput = 0.0f;
+        private Stopwatch _cycleWatch = new Stopwatch();
 
         public bool HasJobRunning => _lstControlJobs.Count > 0;
 
@@ -138,6 +140,7 @@ namespace Venus_RT.Modules
             DATA.Subscribe("Scheduler.CycledCount", () => _cycledCount,SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe("Scheduler.CycledWafer", () => _cycledWafer, SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe("Scheduler.CycleSetPoint", () => _cycleSetPoint, SubscriptionAttribute.FLAG.IgnoreSaveDB);
+            DATA.Subscribe("Scheduler.Throughput", () => _throughput, SubscriptionAttribute.FLAG.IgnoreSaveDB);
 
 
             DATA.Subscribe("Scheduler.PjIdList", () => Array.ConvertAll(_lstProcessJobs.ToArray(), x => x.InnerId.ToString()).ToList());
@@ -149,6 +152,7 @@ namespace Venus_RT.Modules
             _cycleSetPoint = _isCycleMode ? SC.GetValue<int>("System.CycleCount") : 0;
             _cycledWafer = 0;
             _cycledCount = 0;
+            _cycleWatch.Stop();
 
             return RState.Running;
         }
@@ -486,6 +490,11 @@ namespace Venus_RT.Modules
                 //ResetTraceFlag();
             }
 
+            if(!_cycleWatch.IsRunning)
+            {
+                _cycleWatch.Restart();
+            }
+
             _cycleState = RState.Running;
         }
 
@@ -1009,6 +1018,13 @@ namespace Venus_RT.Modules
 
                 if(ModuleHelper.IsAligner(scheduler.Key))
                 {
+                    if(_atmModules[scheduler.Key].MovingStatus != MovingStatus.Idle)
+                    {
+                        ProcessAlignerTask();
+                        if (_atmModules[scheduler.Key].MovingStatus != MovingStatus.Idle)
+                            return;
+                    }
+
                     if (ProcessAlignerEFEMRobotTask(scheduler.Key))
                         return;
                 }
@@ -1121,16 +1137,31 @@ namespace Venus_RT.Modules
                 }
             }
 
-            var outSlots = ll == ModuleName.LLA ? _LLAOutSlot : _LLBOutSlot;
+            var slotNumber = ll == ModuleName.LLA ? _LLASlotNumber : _LLBSlotNumber;
+            Dictionary<int, long> slot_delays = new Dictionary<int, long>();
+            for (int i = 0; i < slotNumber; i++)
+            {
+                if(IsAtmWaferReadyOut(ll, i))
+                {
+                    slot_delays[i] = _atmSchedulers[ll].WaferArrivedTicks(i);
+                }
+            }
 
-            foreach(var slot in outSlots)
+            slot_delays = slot_delays.OrderByDescending(item => item.Value).ToDictionary(k => k.Key, v => v.Value);
+            if(slot_delays.Count > 0)
             {
-                if(IsAtmWaferReadyOut(ll, slot))
+                var robotHand = GetEFEMRobotFreeHand();
+                if (robotHand != Hand.None)
+                {
+                    _efemMovingItems.Add(new MoveItem(ll, slot_delays.ElementAt(0).Key, ModuleName.EfemRobot, (int)robotHand, robotHand));
+                }
+
+                if(slot_delays.Count > 1)
                 {
-                    var robotHand = GetEFEMRobotFreeHand();
-                    if(robotHand !=  Hand.None)
+                    var secondHand = GetEFEMRobotFreeHand();
+                    if(secondHand != Hand.None)
                     {
-                        _efemMovingItems.Add(new MoveItem(ll, slot, ModuleName.EfemRobot, (int)robotHand, robotHand));
+                        _efemMovingItems.Add(new MoveItem(ll, slot_delays.ElementAt(1).Key, ModuleName.EfemRobot, (int)secondHand, secondHand));
                     }
                 }
             }
@@ -1750,7 +1781,7 @@ namespace Venus_RT.Modules
                             if(!ModuleHelper.IsTMRobot(tar.Key.Module))
                                 _vacSchedulers[tar.Key.Module].WaferArrived(tar.Key.Slot);
 
-                            LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
+                            //LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
                             if (ModuleHelper.IsPm(tar.Key.Module))
                             {
                                 _vacModules[tar.Key.Module].MovingStatus = MovingStatus.WaitProcess;
@@ -1793,7 +1824,7 @@ namespace Venus_RT.Modules
 
                         if (wafer.InnerId == tar.Value)
                         {
-                            LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
+                            //LOG.Write(eEvent.EV_ROUTER, ModuleName.System, $"wafer {wafer.WaferOrigin}: {wafer.InnerId} arrived {tar.Key.Module}{tar.Key.Slot + 1}");
                             // wafer arrive
 
                             if(!ModuleHelper.IsLoadPort(tar.Key.Module) && !ModuleHelper.IsEFEMRobot(tar.Key.Module))
@@ -2072,6 +2103,10 @@ namespace Venus_RT.Modules
                 }
 
                 _cycledWafer = _cycledCount * countPerCycle + countProcessed;
+                if(_cycledWafer >= 25)
+                {
+                    _throughput = (float)(_cycledWafer / _cycleWatch.Elapsed.TotalHours);
+                }
 
                 if (allControlJobComplete)
                 {

+ 10 - 2
Venus/Venus_RT/Modules/PMs/PMEntity.cs

@@ -527,7 +527,9 @@ namespace Venus_RT.Modules.PMs
             Transition(PMState.ReadyForPlace,   MSG.LiftUpWafer,    FnStartLiftUpWafer,     PMState.LiftUpWafer);
             Transition(PMState.LiftUpWafer,     FSM_MSG.TIMER,      FnLiftUpTimeout,        PMState.LiftUpReady);
             Transition(PMState.LiftUpReady,     MSG.PlaceReady,     FnStartFinishPlace,     PMState.FinishPlace);
+            Transition(PMState.PreparePlace,    MSG.Abort,          FnAortPlace,            PMState.Idle);
             Transition(PMState.ReadyForPlace,   MSG.Abort,          FnAortPlace,            PMState.Idle);
+            Transition(PMState.LiftUpReady,     MSG.Abort,          FnAortPlace,            PMState.Idle);
             Transition(PMState.FinishPlace,     FSM_MSG.TIMER,      FnFinishPlaceTimeout,   PMState.Idle);
             
 
@@ -733,6 +735,7 @@ namespace Venus_RT.Modules.PMs
         private bool FnError(object[] objs)
         {
             Running = false;
+            _isOnline = false;
 
             //if (((PMState)fsm.State == PMState.Processing) || ((PMState)fsm.State == PMState.PreProcess)
             //    || ((PMState)fsm.State == PMState.Homing) || ((PMState)fsm.State == PMState.LoadProcessRecipe))
@@ -1134,9 +1137,14 @@ namespace Venus_RT.Modules.PMs
 
         private bool FnRunRecipe(object[] param)
         {
-            //if(_processRoutine.Start(param) == RState.Running)
+            RState ret = _processRoutine.Start(param);
+            if (ret == RState.Failed || ret == RState.Timeout)
+            {
+                PostMsg(MSG.Error);
+                return false;
+            }
 
-            return _processRoutine.Start(param) == RState.Running;
+            return ret == RState.Running;
         }
         private bool FnProcessTimeout(object[] param)
         {