|
@@ -27,6 +27,8 @@ using Venus_Themes.UserControls;
|
|
|
using OpenSEMI.Ctrlib.Controls;
|
|
|
using OpenSEMI.ClientBase;
|
|
|
using MECF.Framework.Common.Equipment;
|
|
|
+using WinInterop = System.Windows.Interop;
|
|
|
+using System.Runtime.InteropServices;
|
|
|
|
|
|
namespace Venus_UI.Views
|
|
|
{
|
|
@@ -38,10 +40,10 @@ namespace Venus_UI.Views
|
|
|
IRegionManager m_regionManager;
|
|
|
IRegionNavigationService m_regionNavigationService;
|
|
|
List<VenusMenu> VenusMenu;
|
|
|
- List<TabControl> centerTabViews=new List<TabControl> ();
|
|
|
- List<Button> buttonList=new List<Button> ();
|
|
|
+ List<TabControl> centerTabViews = new List<TabControl>();
|
|
|
+ List<Button> buttonList = new List<Button>();
|
|
|
DispatcherTimer timer = new DispatcherTimer();
|
|
|
-
|
|
|
+ private bool IsMaxed = false;
|
|
|
public ShellView(IRegionManager regionManager, IRegionNavigationService regionNavigationService)
|
|
|
{
|
|
|
|
|
@@ -63,13 +65,27 @@ namespace Venus_UI.Views
|
|
|
UIEvents.LLEDoorRaiseChangedEvent += UIEvents_LLEDoorRaiseChangedEvent;
|
|
|
|
|
|
UIEvents.ChamberCreateDeleteWaferEvent += UIEvents_ChamberCreateDeleteWaferEvent;
|
|
|
+
|
|
|
+ this.SourceInitialized += (o, e) =>
|
|
|
+ {
|
|
|
+ System.IntPtr handler = (new WinInterop.WindowInteropHelper(this)).Handle;
|
|
|
+ WinInterop.HwndSource.FromHwnd(handler).AddHook(new WinInterop.HwndSourceHook(WindowProc));
|
|
|
+ };
|
|
|
+
|
|
|
+ this.MaxHeight = SystemParameters.WorkArea.Height;
|
|
|
+ ResizeMode = ResizeMode.CanMinimize;
|
|
|
+ this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
void timer_Tick(object sender, EventArgs e)
|
|
|
{
|
|
|
if (Anychange.needchange)
|
|
|
{
|
|
|
Anystationchange(Anychange.menuname, Anychange.args);
|
|
|
- Anychange.needchange=false;
|
|
|
+ Anychange.needchange = false;
|
|
|
}
|
|
|
}
|
|
|
private void Instance_SlotRightClickChangedEvent(OpenSEMI.Ctrlib.Controls.Slot slot)
|
|
@@ -121,13 +137,13 @@ namespace Venus_UI.Views
|
|
|
//from robot to robot is illegal. Must be stop
|
|
|
if (e.TranferFrom.ModuleID == e.TranferTo.ModuleID && (e.TranferTo.ModuleID == ModuleName.EfemRobot.ToString() || e.TranferTo.ModuleID == ModuleName.TMRobot.ToString()))
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
InvokeClient.Instance.Service.DoOperation("System.MoveWafer",
|
|
|
e.TranferFrom.ModuleID, e.TranferFrom.SlotID, e.TranferTo.ModuleID, e.TranferTo.SlotID, alignflag, angel, coolingflag, coolingtime, "");
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -143,12 +159,18 @@ namespace Venus_UI.Views
|
|
|
|
|
|
private void CustomWnd_Loaded(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
- VenusMenu = SerializeHelper.Instance.ReadFromJsonFile<List<VenusMenu>>($"Config/UIMenu.json");
|
|
|
+ var h1 = SystemParameters.WorkArea.Height;
|
|
|
+ var h2 = SystemParameters.PrimaryScreenHeight;
|
|
|
+
|
|
|
+ //this.ResizeMode = ResizeMode.CanResize;
|
|
|
+ //System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / SystemParameters.PrimaryScreenWidth
|
|
|
+
|
|
|
+ VenusMenu = SerializeHelper.Instance.ReadFromJsonFile<List<VenusMenu>>($"Config/UIMenu.json");
|
|
|
int index = 0;
|
|
|
for (int i = 0; i < VenusMenu.Count; i++)
|
|
|
{
|
|
|
if (VenusMenu[i].IsShow == false)
|
|
|
- {
|
|
|
+ {
|
|
|
continue;
|
|
|
}
|
|
|
string[] allModules = QueryDataClient.Instance.Service.GetConfig($"System.InstalledModules").ToString().Split(',');
|
|
@@ -171,39 +193,23 @@ namespace Venus_UI.Views
|
|
|
{
|
|
|
aduRadioButtonIcon.IsChecked = true;
|
|
|
}
|
|
|
- IconElement.SetPathData(aduRadioButtonIcon,(Geometry)aduRadioButtonIcon.FindResource($"Icon_{VenusMenu[i].Id}"));
|
|
|
+ IconElement.SetPathData(aduRadioButtonIcon, (Geometry)aduRadioButtonIcon.FindResource($"Icon_{VenusMenu[i].Id}"));
|
|
|
aduRadioButtonIcon.Content = VenusMenu[i].Name;
|
|
|
aduRadioButtonIcon.Click += AduRadioButtonIcon_Click;
|
|
|
aduRadioButtonIcon.SelectBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#6AD7FF"));
|
|
|
aduRadioButtonIcon.SelectColor = new SolidColorBrush((Colors.Black));
|
|
|
aduRadioButtonIcon.DefaultBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#94BCD7"));
|
|
|
//aduRadioButtonIcon.DefaultBackground = new SolidColorBrush(Colors.DarkGray);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
aduRadioButtonIcon.Width = 180;
|
|
|
- aduRadioButtonIcon.Height= 40;
|
|
|
-
|
|
|
+ aduRadioButtonIcon.Height = 40;
|
|
|
+
|
|
|
//aduRadioButtonIcon.Foreground=Brushes.White;
|
|
|
aduRadioButtonIcon.Tag = index;
|
|
|
index += 1;
|
|
|
Bottom_Frame.Children.Add(aduRadioButtonIcon);
|
|
|
- //if (VenusMenu[i].Id == "PMC")
|
|
|
- //{
|
|
|
- // AduRadioButtonIcon aduRadioButtonIcon2 = new AduRadioButtonIcon();
|
|
|
-
|
|
|
- // IconElement.SetPathData(aduRadioButtonIcon2, (Geometry)aduRadioButtonIcon.FindResource($"Icon_{VenusMenu[i].Id}"));
|
|
|
- // aduRadioButtonIcon2.Content = "PMD";
|
|
|
- // //aduRadioButtonIcon2.Click += AduRadioButtonIcon_Click;
|
|
|
- // aduRadioButtonIcon2.SelectBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#6AD7FF"));
|
|
|
- // aduRadioButtonIcon2.SelectColor = new SolidColorBrush((Colors.Black));
|
|
|
- // aduRadioButtonIcon2.DefaultBackground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#94BCD7"));
|
|
|
- // //aduRadioButtonIcon.DefaultBackground = new SolidColorBrush(Colors.DarkGray);
|
|
|
-
|
|
|
-
|
|
|
- // aduRadioButtonIcon2.Width = 180;
|
|
|
- // aduRadioButtonIcon2.Height = 40;
|
|
|
- // Bottom_Frame.Children.Add(aduRadioButtonIcon2);
|
|
|
- //}
|
|
|
+
|
|
|
TabControl tabControl = new TabControl();
|
|
|
for (int j = 0; j < VenusMenu[i].MenuItem.Count; j++)
|
|
|
{
|
|
@@ -212,7 +218,7 @@ namespace Venus_UI.Views
|
|
|
continue;
|
|
|
}
|
|
|
string className;
|
|
|
- if ((VenusMenu[i].Id == "PMA" || VenusMenu[i].Id == "PMB" || VenusMenu[i].Id == "PMC" || VenusMenu[i].Id == "PMD")&& VenusMenu[i].MenuItem[j].Id== "Operation")
|
|
|
+ if ((VenusMenu[i].Id == "PMA" || VenusMenu[i].Id == "PMB" || VenusMenu[i].Id == "PMC" || VenusMenu[i].Id == "PMD") && VenusMenu[i].MenuItem[j].Id == "Operation")
|
|
|
{
|
|
|
JetChamber jetChamber = (JetChamber)(Convert.ToInt32(QueryDataClient.Instance.Service.GetConfig($"{VenusMenu[i].Id}.ChamberType")));
|
|
|
className = $"Venus_MainPages.Views.Over{jetChamber.ToString()}View";
|
|
@@ -224,20 +230,19 @@ namespace Venus_UI.Views
|
|
|
|
|
|
Type t = Type.GetType($"{className},Venus_MainPages");
|
|
|
var obj = System.Activator.CreateInstance(t);
|
|
|
-
|
|
|
|
|
|
- if (VenusMenu[i].Id=="PMA" || VenusMenu[i].Id == "PMB" || VenusMenu[i].Id == "PMC" || VenusMenu[i].Id == "PMD" || VenusMenu[i].Id == "TM" || VenusMenu[i].Id == "SETM")
|
|
|
- {
|
|
|
+
|
|
|
+ if (VenusMenu[i].Id == "PMA" || VenusMenu[i].Id == "PMB" || VenusMenu[i].Id == "PMC" || VenusMenu[i].Id == "PMD" || VenusMenu[i].Id == "TM" || VenusMenu[i].Id == "SETM")
|
|
|
+ {
|
|
|
MethodInfo methodInfo = t.GetMethod("Init", new Type[] { typeof(string) });
|
|
|
methodInfo?.Invoke(obj, new object[] { VenusMenu[i].Id });
|
|
|
}
|
|
|
tabControl.Items.Add(new TabItem() { Header = VenusMenu[i].MenuItem[j].Name, Content = obj });
|
|
|
}
|
|
|
- centerTabViews.Add(tabControl);
|
|
|
+ centerTabViews.Add(tabControl);
|
|
|
}
|
|
|
Main_Frame.Content = centerTabViews[0];
|
|
|
ModuleManager.Initialize();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public void Anystationchange(string menuviewItem, WaferHistoryWafer queryFilter)
|
|
@@ -300,5 +305,216 @@ namespace Venus_UI.Views
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation($"TM.SetEFEMSlitDoor", obj.ModuleName, obj.IsOpen == "Open" ? true : false);
|
|
|
}
|
|
|
+
|
|
|
+ #region 调用api功能部分
|
|
|
+ void win_SourceInitialized(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ System.IntPtr handle = (new WinInterop.WindowInteropHelper(this)).Handle;
|
|
|
+ WinInterop.HwndSource.FromHwnd(handle).AddHook(new WinInterop.HwndSourceHook(WindowProc));
|
|
|
+ }
|
|
|
+
|
|
|
+ private static System.IntPtr WindowProc(
|
|
|
+ System.IntPtr hwnd,
|
|
|
+ int msg,
|
|
|
+ System.IntPtr wParam,
|
|
|
+ System.IntPtr lParam,
|
|
|
+ ref bool handled)
|
|
|
+ {
|
|
|
+ switch (msg)
|
|
|
+ {
|
|
|
+ case 0x0024:
|
|
|
+ WmGetMinMaxInfo(hwnd, lParam);
|
|
|
+ handled = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (System.IntPtr)0;
|
|
|
+ }
|
|
|
+
|
|
|
+ private static void WmGetMinMaxInfo(System.IntPtr hwnd, System.IntPtr lParam)
|
|
|
+ {
|
|
|
+
|
|
|
+ MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(lParam, typeof(MINMAXINFO));
|
|
|
+
|
|
|
+ // Adjust the maximized size and position to fit the work area of the correct monitor
|
|
|
+ int MONITOR_DEFAULTTONEAREST = 0x00000002;
|
|
|
+ System.IntPtr monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
|
|
+
|
|
|
+ if (monitor != System.IntPtr.Zero)
|
|
|
+ {
|
|
|
+
|
|
|
+ MONITORINFO monitorInfo = new MONITORINFO();
|
|
|
+ GetMonitorInfo(monitor, monitorInfo);
|
|
|
+ RECT rcWorkArea = monitorInfo.rcWork;
|
|
|
+ RECT rcMonitorArea = monitorInfo.rcMonitor;
|
|
|
+ mmi.ptMaxPosition.x = Math.Abs(rcWorkArea.left - rcMonitorArea.left);
|
|
|
+ mmi.ptMaxPosition.y = Math.Abs(rcWorkArea.top - rcMonitorArea.top);
|
|
|
+ mmi.ptMaxSize.x = Math.Abs(rcWorkArea.right - rcWorkArea.left);
|
|
|
+ mmi.ptMaxSize.y = Math.Abs(rcWorkArea.bottom - rcWorkArea.top);
|
|
|
+ }
|
|
|
+
|
|
|
+ Marshal.StructureToPtr(mmi, lParam, true);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// POINT aka POINTAPI
|
|
|
+ /// </summary>
|
|
|
+ [StructLayout(LayoutKind.Sequential)]
|
|
|
+ public struct POINT
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// x coordinate of point.
|
|
|
+ /// </summary>
|
|
|
+ public int x;
|
|
|
+ /// <summary>
|
|
|
+ /// y coordinate of point.
|
|
|
+ /// </summary>
|
|
|
+ public int y;
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// Construct a point of coordinates (x,y).
|
|
|
+ /// </summary>
|
|
|
+ public POINT(int x, int y)
|
|
|
+ {
|
|
|
+ this.x = x;
|
|
|
+ this.y = y;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ [StructLayout(LayoutKind.Sequential)]
|
|
|
+ public struct MINMAXINFO
|
|
|
+ {
|
|
|
+ public POINT ptReserved;
|
|
|
+ public POINT ptMaxSize;
|
|
|
+ public POINT ptMaxPosition;
|
|
|
+ public POINT ptMinTrackSize;
|
|
|
+ public POINT ptMaxTrackSize;
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
|
|
|
+ public class MONITORINFO
|
|
|
+ {
|
|
|
+ /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ public int cbSize = Marshal.SizeOf(typeof(MONITORINFO));
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ public RECT rcMonitor = new RECT();
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ public RECT rcWork = new RECT();
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// </summary>
|
|
|
+ public int dwFlags = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ [StructLayout(LayoutKind.Sequential, Pack = 0)]
|
|
|
+ public struct RECT
|
|
|
+ {
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int left;
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int top;
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int right;
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int bottom;
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public static readonly RECT Empty = new RECT();
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int Width
|
|
|
+ {
|
|
|
+ get { return Math.Abs(right - left); } // Abs needed for BIDI OS
|
|
|
+ }
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public int Height
|
|
|
+ {
|
|
|
+ get { return bottom - top; }
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public RECT(int left, int top, int right, int bottom)
|
|
|
+ {
|
|
|
+ this.left = left;
|
|
|
+ this.top = top;
|
|
|
+ this.right = right;
|
|
|
+ this.bottom = bottom;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public RECT(RECT rcSrc)
|
|
|
+ {
|
|
|
+ this.left = rcSrc.left;
|
|
|
+ this.top = rcSrc.top;
|
|
|
+ this.right = rcSrc.right;
|
|
|
+ this.bottom = rcSrc.bottom;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary> Win32 </summary>
|
|
|
+ public bool IsEmpty
|
|
|
+ {
|
|
|
+ get
|
|
|
+ {
|
|
|
+ // BUGBUG : On Bidi OS (hebrew arabic) left > right
|
|
|
+ return left >= right || top >= bottom;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /// <summary> Return a user friendly representation of this struct </summary>
|
|
|
+ public override string ToString()
|
|
|
+ {
|
|
|
+ if (this == RECT.Empty) { return "RECT {Empty}"; }
|
|
|
+ return "RECT { left : " + left + " / top : " + top + " / right : " + right + " / bottom : " + bottom + " }";
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary> Determine if 2 RECT are equal (deep compare) </summary>
|
|
|
+ public override bool Equals(object obj)
|
|
|
+ {
|
|
|
+ if (!(obj is Rect)) { return false; }
|
|
|
+ return (this == (RECT)obj);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>Return the HashCode for this struct (not garanteed to be unique)</summary>
|
|
|
+ public override int GetHashCode()
|
|
|
+ {
|
|
|
+ return left.GetHashCode() + top.GetHashCode() + right.GetHashCode() + bottom.GetHashCode();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary> Determine if 2 RECT are equal (deep compare)</summary>
|
|
|
+ public static bool operator ==(RECT rect1, RECT rect2)
|
|
|
+ {
|
|
|
+ return (rect1.left == rect2.left && rect1.top == rect2.top && rect1.right == rect2.right && rect1.bottom == rect2.bottom);
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary> Determine if 2 RECT are different(deep compare)</summary>
|
|
|
+ public static bool operator !=(RECT rect1, RECT rect2)
|
|
|
+ {
|
|
|
+ return !(rect1 == rect2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ [DllImport("user32")]
|
|
|
+ internal static extern bool GetMonitorInfo(IntPtr hMonitor, MONITORINFO lpmi);
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ ///
|
|
|
+ /// </summary>
|
|
|
+ [DllImport("User32")]
|
|
|
+ internal static extern IntPtr MonitorFromWindow(IntPtr handle, int flags);
|
|
|
+ #endregion
|
|
|
+
|
|
|
}
|
|
|
}
|