Bladeren bron

add pause/resume
revise waferhistory ui

chenzk 1 dag geleden
bovenliggende
commit
6de2319620

+ 17 - 0
CyberX8_MainPages/ViewModels/EfemViewModel.cs

@@ -757,6 +757,14 @@ namespace CyberX8_MainPages.ViewModels
         private DelegateCommand _safeCloseCommand;
         public DelegateCommand SafeCloseCommand =>
             _safeCloseCommand ?? (_safeCloseCommand = new DelegateCommand(OnSafeClose));
+
+
+        private DelegateCommand _pauseCommand;
+        public DelegateCommand PauseCommand =>
+            _pauseCommand ?? (_pauseCommand = new DelegateCommand(OnPauseAction));
+        private DelegateCommand _resumeCommand;
+        public DelegateCommand ResumeCommand =>
+            _resumeCommand ?? (_resumeCommand = new DelegateCommand(OnResumeAction));
         #endregion
 
         #region 构造函数
@@ -995,6 +1003,15 @@ namespace CyberX8_MainPages.ViewModels
             InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.SafeClose");
         }
 
+        private void OnPauseAction() 
+        { 
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Pause");
+        }
+        private void OnResumeAction()
+        {
+            InvokeClient.Instance.Service.DoOperation($"{ModuleName.EFEM}.Resume");
+        }
+
         private void OnAlign1Align()
         { 
             InvokeClient.Instance.Service.DoOperation($"{ModuleName.Aligner1}.{EfemOperation.Align}",0, AlignValue);

+ 16 - 14
CyberX8_MainPages/ViewModels/WaferHistoryDBViewModel.cs

@@ -21,7 +21,7 @@ using QiHe.CodeLib;
 
 namespace CyberX8_MainPages.ViewModels
 {
-    public class WaferHistoryDBViewModel:BindableBase
+    public class WaferHistoryDBViewModel : BindableBase
     {
         private ObservableCollection<WaferHistoryMovement> _movements = new ObservableCollection<WaferHistoryMovement>();
         public ObservableCollection<WaferHistoryMovement> Movements
@@ -182,17 +182,17 @@ namespace CyberX8_MainPages.ViewModels
 
         private Dictionary<string, string> _mapGasNameKey = new Dictionary<string, string>()
         {
-            {"PMA.MfcGas1.GasName", "PMA.IoMfc.MfcGas1"},
-            {"PMA.MfcGas2.GasName", "PMA.IoMfc.MfcGas2"},
-            {"PMA.MfcGas3.GasName", "PMA.IoMfc.MfcGas3"},
-            {"PMA.MfcGas4.GasName", "PMA.IoMfc.MfcGas4"},
-            {"PMA.MfcGas5.GasName", "PMA.IoMfc.MfcGas5"},
-
-            {"PMB.MfcGas1.GasName", "PMB.IoMfc.MfcGas1"},
-            {"PMB.MfcGas2.GasName", "PMB.IoMfc.MfcGas2"},
-            {"PMB.MfcGas3.GasName", "PMB.IoMfc.MfcGas3"},
-            {"PMB.MfcGas4.GasName", "PMB.IoMfc.MfcGas4"},
-            {"PMB.MfcGas5.GasName", "PMB.IoMfc.MfcGas5"},
+            //{"PMA.MfcGas1.GasName", "PMA.IoMfc.MfcGas1"},
+            //{"PMA.MfcGas2.GasName", "PMA.IoMfc.MfcGas2"},
+            //{"PMA.MfcGas3.GasName", "PMA.IoMfc.MfcGas3"},
+            //{"PMA.MfcGas4.GasName", "PMA.IoMfc.MfcGas4"},
+            //{"PMA.MfcGas5.GasName", "PMA.IoMfc.MfcGas5"},
+
+            //{"PMB.MfcGas1.GasName", "PMB.IoMfc.MfcGas1"},
+            //{"PMB.MfcGas2.GasName", "PMB.IoMfc.MfcGas2"},
+            //{"PMB.MfcGas3.GasName", "PMB.IoMfc.MfcGas3"},
+            //{"PMB.MfcGas4.GasName", "PMB.IoMfc.MfcGas4"},
+            //{"PMB.MfcGas5.GasName", "PMB.IoMfc.MfcGas5"},
         };
 
         //protected override void OnActivate()
@@ -388,8 +388,10 @@ namespace CyberX8_MainPages.ViewModels
 
             //string sql = $"select data.*,process_data.process_status from (SELECT * FROM wafer_data,lot_wafer_data where lot_wafer_data.lot_data_guid = '{lotGuid}' and lot_wafer_data.wafer_data_guid = wafer_data.guid order by wafer_data.create_time ASC; as data )" +
             //    $" LEFT JOIN process_data ON process_data.wafer_data_guid=data.wafer_id";
-            string sql = $"SELECT wafer_data.*,lot_wafer_data.*,process_data.process_status as status FROM wafer_data LEFT JOIN lot_wafer_data ON lot_wafer_data.wafer_data_guid = wafer_data.guid " +
-                        $"LEFT JOIN process_data ON process_data.wafer_data_guid = wafer_data.guid where lot_wafer_data.lot_data_guid = '{whItem.ID}' order by wafer_data.create_time ASC";
+            //string sql = $"SELECT wafer_data.*,lot_wafer_data.*,process_data.process_status as status FROM wafer_data LEFT JOIN lot_wafer_data ON lot_wafer_data.wafer_data_guid = wafer_data.guid " +
+            //            $"LEFT JOIN process_data ON process_data.wafer_data_guid = wafer_data.guid where lot_wafer_data.lot_data_guid = '{whItem.ID}' order by wafer_data.create_time ASC";
+            string sql = $"SELECT wafer_data.*,lot_wafer_data.*,wafer_data.process_status as status,wafer_data.reason FROM wafer_data LEFT JOIN lot_wafer_data ON lot_wafer_data.wafer_data_guid = wafer_data.guid " +
+                       $"LEFT JOIN process_data ON process_data.wafer_data_guid = wafer_data.guid where lot_wafer_data.lot_data_guid = '{whItem.ID}' order by wafer_data.create_time ASC";
             Wafers.Clear();
             //Application.Current.Dispatcher.BeginInvoke(new Action(() =>
             //{

+ 8 - 5
CyberX8_MainPages/Views/EfemView.xaml

@@ -134,14 +134,17 @@
         <GroupBox Header="Door" Background="{DynamicResource Table_BG_Content}" Width="500" Height="120" Canvas.Left="1020" Canvas.Top="525" HorizontalAlignment="Center" VerticalAlignment="Top">
             <Grid>
                 <Ellipse Width="16" Height="16"  Fill="{Binding DoorUnlock, Converter={StaticResource boolToColor}}"   Stroke="Silver" Margin="40,-30,432,14"/>
-                <customControls:PathButton Content="Open" Height="33" Width="120"  Command="{Binding DoorUnlockCommand}" Margin="91,-40,277,5"/>
-                <customControls:PathButton Content="Clock" Height="33" Width="120" Margin="262,-40,106,5" Command="{Binding DoorLockCommand}"/>
+                <customControls:PathButton Content="Open" Height="33"  Command="{Binding DoorUnlockCommand}" Margin="76,10,346,55"/>
+                <customControls:PathButton Content="Close" Height="33" Margin="160,10,254,55" Command="{Binding DoorLockCommand}"/>
                 <userControls:LockControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="442,11,0,0" IsLocked="{Binding IsDoorLocked}"/>
 
-                <customControls:PathButton Content="SafeOpen" Height="33" Width="120"  Command="{Binding SafeOpenCommand}" Margin="91,60,277,5"/>
-                <customControls:PathButton Content="SafeClose" Height="33" Width="120" Margin="262,60,106,5" Command="{Binding SafeCloseCommand}"/>
+                <customControls:PathButton Content="Pause" Height="33"  Command="{Binding PauseCommand}" Margin="252,10,153,55"/>
+                <customControls:PathButton Content="Resume" Height="33" Margin="347,10,64,55" Command="{Binding ResumeCommand}"/>
+
+                <customControls:PathButton Content="SafeOpen" Height="33"  Command="{Binding SafeOpenCommand}" Margin="76,60,256,5"/>
+                <customControls:PathButton Content="SafeClose" Height="33" Margin="255,60,67,5" Command="{Binding SafeCloseCommand}"/>
             </Grid>
-            
+
         </GroupBox>
         <Grid Canvas.Top="253" Canvas.Left="1020" Width="500" HorizontalAlignment="Center" VerticalAlignment="Top">
             <Grid.RowDefinitions>

+ 10 - 0
CyberX8_MainPages/Views/WaferHistoryDBView.xaml

@@ -54,6 +54,16 @@
             <Grid x:Key="WaferLayout">
                 <DataGrid ItemsSource="{Binding Wafers}"   IsReadOnly="True"  AutoGenerateColumns="False" RowHeight="25" 
                           CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" FontFamily="Arial" FontSize="14" >
+                    <DataGrid.RowStyle>
+                        <Style TargetType="DataGridRow">
+                            <Style.Triggers>
+                                <DataTrigger Binding="{Binding Status}" Value="Failed">
+                                    <Setter Property="Background" Value="Red"/>
+                                    <Setter Property="Foreground" Value="White"/>
+                                </DataTrigger>
+                            </Style.Triggers>
+                        </Style>
+                    </DataGrid.RowStyle>
                     <DataGrid.Columns>
                         <DataGridTextColumn Header="Lot ID" Width="60*" Binding="{Binding LotID}" />
                         <DataGridTextColumn Header="Slot ID" Width="50*" Binding="{Binding SlotID}" />

+ 13 - 0
CyberX8_RT/Modules/EFEM/EfemEntity.cs

@@ -360,6 +360,9 @@ namespace CyberX8_RT.Modules
             OP.Subscribe($"{Name}.SafeOpen", (cmd, args) => { return SafeOpenAction(args); });
             OP.Subscribe($"{Name}.SafeClose", (cmd, args) => { return SafeCloseAction(args); });
 
+            OP.Subscribe($"{Name}.Pause", (cmd, args) => { return Pause(args); });
+            OP.Subscribe($"{Name}.Resume", (cmd, args) => { return Resume(args); });
+
             DATA.Subscribe($"{Name}.FsmState", () => ((STATE)fsm.State).ToString(),SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Name}.FsmPrevState", () => ((STATE)fsm.PrevState).ToString(), SubscriptionAttribute.FLAG.IgnoreSaveDB);
             DATA.Subscribe($"{Name}.FsmLastMessage", GetFsmLastMessage, SubscriptionAttribute.FLAG.IgnoreSaveDB);
@@ -617,6 +620,16 @@ namespace CyberX8_RT.Modules
             _lpms[2].PostMsg(LoadPortModule.MSG.EnterIdle);
         }
 
+        private bool Resume(object[] param)
+        {
+            return _efem.Resume();
+        }
+
+        private bool Pause(object[] param)
+        {
+            return _efem.Pause();
+        }
+
         private bool fnHomeRobot(object[] param)
         {
             return _homeRoutine.Start(ModuleName.EfemRobot) == RState.Running;