Browse Source

增加拖片功能

zhouhr 1 year ago
parent
commit
ba61077913

+ 8 - 0
Venus/Venus_Core/GlobalEvents.cs

@@ -5,14 +5,22 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
+
 namespace Venus_Core
 {
     public static class VenusGlobalEvents 
     {
         public static event Action<Slot> SlotRightClickChangedEvent;
+        public static event Action<DragDropEventArgs> SlotWaferTransferEvent;
         public static void OnSlotRightClickChanged(Slot slot)
         {
             SlotRightClickChangedEvent?.Invoke(slot);
         }
+
+        public static void OnSlotWaferTransfer(DragDropEventArgs e)
+        {
+            SlotWaferTransferEvent?.Invoke(e);
+        }
+
     }
 }

+ 10 - 1
Venus/Venus_Themes/UserControls/FOUPFrontView.xaml.cs

@@ -1,4 +1,6 @@
 
+using System.Diagnostics;
+using System;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -42,7 +44,14 @@ namespace Venus_Themes.UserControls
 
         private void Slot_WaferTransferStarted(object sender, DragDropEventArgs e)
         {
-
+            try
+            {
+                VenusGlobalEvents.OnSlotWaferTransfer(e);
+            }
+            catch (Exception ex)
+            {
+                Trace.WriteLine(ex);
+            }
         }
     }
 }

+ 1 - 1
Venus/Venus_Themes/UserControls/WaferCtrl.xaml

@@ -9,7 +9,7 @@
              xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation">
     <Grid RenderTransformOrigin="0.5,0.5">
         <ctrl:Slot ViewType="Top" WaferStatus="{Binding WaferStatus}" SlotID="{Binding SlotID}" ModuleID="{Binding ModuleID}" SourceName="{Binding SourceName}" 
-                       DataContext="{Binding WaferData,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"  HorizontalAlignment="Center" VerticalAlignment="Center"  SlotMouseButtonDown="Slot_SlotMouseButtonDown">
+                       DataContext="{Binding WaferData,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"  HorizontalAlignment="Center" VerticalAlignment="Center"  SlotMouseButtonDown="Slot_SlotMouseButtonDown" WaferTransferStarted="OnWaferTransfer">
  
         </ctrl:Slot>
         

+ 14 - 0
Venus/Venus_Themes/UserControls/WaferCtrl.xaml.cs

@@ -3,6 +3,7 @@ using OpenSEMI.ClientBase;
 using OpenSEMI.Ctrlib.Controls;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -42,5 +43,18 @@ namespace Venus_Themes.UserControls
         {
             VenusGlobalEvents.OnSlotRightClickChanged(sender as Slot);
         }
+
+        private void OnWaferTransfer(object sender, DragDropEventArgs e)
+        {
+            try
+            {
+                VenusGlobalEvents.OnSlotWaferTransfer(e);
+            }
+            catch (Exception ex)
+            {
+                Trace.WriteLine(ex);
+            }
+        }
+
     }
 }

+ 9 - 0
Venus/Venus_UI/Views/ShellView.xaml.cs

@@ -16,6 +16,7 @@ using System.Reflection;
 using Venus_MainPages.Unity;
 using MECF.Framework.Common.DataCenter;
 using Aitex.Core.RT.SCCore;
+using MECF.Framework.Common.OperationCenter;
 
 namespace Venus_UI.Views
 {
@@ -40,6 +41,7 @@ namespace Venus_UI.Views
             m_regionManager.RegisterViewWithRegion("TopRegion", typeof(Venus_MainPages.Views.TopView));
 
             VenusGlobalEvents.SlotRightClickChangedEvent += Instance_SlotRightClickChangedEvent;
+            VenusGlobalEvents.SlotWaferTransferEvent += Instance_SlotStartTransferEvent;
 
         }
         private void Instance_SlotRightClickChangedEvent(OpenSEMI.Ctrlib.Controls.Slot slot)
@@ -55,6 +57,13 @@ namespace Venus_UI.Views
                 return;
             }
         }
+
+        private void Instance_SlotStartTransferEvent(OpenSEMI.Ctrlib.Controls.DragDropEventArgs e)
+        {
+            InvokeClient.Instance.Service.DoOperation("System.MoveWafer",
+                e.TranferFrom.ModuleID,e.TranferFrom.SlotID, e.TranferTo.ModuleID, e.TranferTo.SlotID,false,1,false,1,"");
+        }
+
         private void CustomWnd_Loaded(object sender, RoutedEventArgs e)
         {
             VenusMenu = SerializeHelper.Instance.ReadFromJsonFile<List<VenusMenu>>($"Config/VenusMenu.json");