Browse Source

add EfemRobotArmType control

intern04 1 week ago
parent
commit
d3a5b3c320

+ 54 - 58
VirgoUI/Models/Controls/EFEMFrontView.xaml

@@ -6,11 +6,11 @@
              xmlns:local="clr-namespace:VirgoUI.Client.Models.Controls"
              xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
              xmlns:cal="http://www.caliburn.org"     
-             xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation" >
+             xmlns:ctrl="http://OpenSEMI.Ctrlib.com/presentation">
     <Grid x:Name="EFEM" HorizontalAlignment="Center" VerticalAlignment="Center">
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"/>
-            <RowDefinition />
+            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <TextBlock Text="Robot Side View" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" VerticalAlignment="Center" HorizontalAlignment="Center">
             <TextBlock.Style>
@@ -31,64 +31,60 @@
                         <BlurEffect Radius="15"/>
                     </Rectangle.Effect>
                 </Rectangle>
-                <Grid Margin="0,10">
-                    <Grid.RowDefinitions>
-                        <RowDefinition Height="30"/>
-                        <RowDefinition Height="30"/>
-                    </Grid.RowDefinitions>
-                    <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="42"/>
-                        <ColumnDefinition />
-                    </Grid.ColumnDefinitions>
-                    <TextBlock Text="Upper" FontFamily="Arial" FontSize="12" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
-                    <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
-                        <ctrl:Slot ViewType="Front" x:Name="EFEMUpper" DataContext="{Binding UnitData.WaferManager.Wafers[1],RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" WaferStatus="{Binding WaferStatus}" SlotID="{Binding SlotID}" ModuleID="{Binding ModuleID}" SourceName="{Binding SourceName}" HorizontalAlignment="Center" VerticalAlignment="Top">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SlotMouseButtonDown">
-                                    <cal:ActionMessage MethodName="OnMouseUp">
-                                        <cal:Parameter Value="$source" />
-                                        <cal:Parameter Value="$eventargs" />
-                                    </cal:ActionMessage>
-                                </i:EventTrigger>
-                                <i:EventTrigger EventName="WaferTransferStarted">
-                                    <cal:ActionMessage MethodName="OnWaferTransfer">
-                                        <cal:Parameter Value="$eventargs" />
-                                    </cal:ActionMessage>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ctrl:Slot>
-                        <Rectangle Width="30" Height="3" Fill="{DynamicResource FOUP_PathBG}" Margin="0,2,0,0">
-                            <Rectangle.Effect>
-                                <DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
-                            </Rectangle.Effect>
-                        </Rectangle>
-                    </StackPanel>
-                    <TextBlock Grid.Row="1" Text="Lower" FontFamily="Arial" FontSize="12" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Right" VerticalAlignment="Center"/>
-                    <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
-                        <ctrl:Slot ViewType="Front" x:Name="EFEMLower" DataContext="{Binding UnitData.WaferManager.Wafers[0],RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" WaferStatus="{Binding WaferStatus}" SlotID="{Binding SlotID}" ModuleID="{Binding ModuleID}" SourceName="{Binding SourceName}" HorizontalAlignment="Center" VerticalAlignment="Top">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SlotMouseButtonDown">
-                                    <cal:ActionMessage MethodName="OnMouseUp">
-                                        <cal:Parameter Value="$source" />
-                                        <cal:Parameter Value="$eventargs" />
-                                    </cal:ActionMessage>
-                                </i:EventTrigger>
-                                <i:EventTrigger EventName="WaferTransferStarted">
-                                    <cal:ActionMessage MethodName="OnWaferTransfer">
-                                        <cal:Parameter Value="$eventargs" />
-                                    </cal:ActionMessage>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ctrl:Slot>
-                        <Rectangle Width="30" Height="3" Fill="{DynamicResource FOUP_PathBG}" Margin="0,2,0,0">
-                            <Rectangle.Effect>
-                                <DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
-                            </Rectangle.Effect>
-                        </Rectangle>
+                <Grid Margin="0,10" Height="Auto">
+                    <StackPanel>
+                        <Grid Height="30" Visibility="{Binding UpperArmVisibility}">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="42"/>
+                                <ColumnDefinition />
+                            </Grid.ColumnDefinitions>
+                            <TextBlock Text="Upper" FontFamily="Arial" FontSize="12" 
+                                      Foreground="{DynamicResource FG_Black}" 
+                                      HorizontalAlignment="Right" VerticalAlignment="Center"/>
+                            <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
+                                <ctrl:Slot ViewType="Front" x:Name="EFEMUpper" 
+                                          DataContext="{Binding UnitData.WaferManager.Wafers[1]}"
+                                          WaferStatus="{Binding WaferStatus}" 
+                                          SlotID="{Binding SlotID}" 
+                                          ModuleID="{Binding ModuleID}" 
+                                          SourceName="{Binding SourceName}" 
+                                          HorizontalAlignment="Center" VerticalAlignment="Top">
+                                </ctrl:Slot>
+                                <Rectangle Width="30" Height="3" Fill="{DynamicResource FOUP_PathBG}" Margin="0,2,0,0">
+                                    <Rectangle.Effect>
+                                        <DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
+                                    </Rectangle.Effect>
+                                </Rectangle>
+                            </StackPanel>
+                        </Grid>
+
+                        <Grid Height="30" Visibility="{Binding LowerArmVisibility}">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="42"/>
+                                <ColumnDefinition />
+                            </Grid.ColumnDefinitions>
+                            <TextBlock Text="Lower" FontFamily="Arial" FontSize="12" 
+                                      Foreground="{DynamicResource FG_Black}" 
+                                      HorizontalAlignment="Right" VerticalAlignment="Center"/>
+                            <StackPanel Grid.Column="1" VerticalAlignment="Center" Margin="0,0,5,0">
+                                <ctrl:Slot ViewType="Front" x:Name="EFEMLower" 
+                                          DataContext="{Binding UnitData.WaferManager.Wafers[0]}"
+                                          WaferStatus="{Binding WaferStatus}" 
+                                          SlotID="{Binding SlotID}" 
+                                          ModuleID="{Binding ModuleID}" 
+                                          SourceName="{Binding SourceName}" 
+                                          HorizontalAlignment="Center" VerticalAlignment="Top">
+                                </ctrl:Slot>
+                                <Rectangle Width="30" Height="3" Fill="{DynamicResource FOUP_PathBG}" Margin="0,2,0,0">
+                                    <Rectangle.Effect>
+                                        <DropShadowEffect Direction="270" BlurRadius="0" ShadowDepth="1"/>
+                                    </Rectangle.Effect>
+                                </Rectangle>
+                            </StackPanel>
+                        </Grid>
                     </StackPanel>
                 </Grid>
             </Grid>
         </Border>
     </Grid>
-
-</UserControl>
+</UserControl>

+ 56 - 2
VirgoUI/Models/Controls/EFEMFrontView.xaml.cs

@@ -13,6 +13,7 @@ using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 using OpenSEMI.ClientBase;
+using VirgoUI.Client.Models.Platform.EFEM;
 
 namespace VirgoUI.Client.Models.Controls
 {
@@ -42,6 +43,59 @@ namespace VirgoUI.Client.Models.Controls
         }
         public static readonly DependencyProperty ShowTitleProperty =
             DependencyProperty.Register("ShowTitle", typeof(bool), typeof(EFEMFrontView), new UIPropertyMetadata(true));
-        #endregion  
-    }
+        #endregion
+
+    //#region UpperArmVisibility (DependencyProperty)
+    //public Visibility UpperArmVisibility
+    //{
+    //    get { return (Visibility)GetValue(UpperArmVisibilityProperty); }
+    //    set { SetValue(UpperArmVisibilityProperty, value); }
+    //}
+    //public static readonly DependencyProperty UpperArmVisibilityProperty =
+    //    DependencyProperty.Register("UpperArmVisibility", typeof(Visibility), typeof(EFEMFrontView), new UIPropertyMetadata(Visibility.Visible));
+    //#endregion
+
+    //#region LowerArmVisibility (DependencyProperty)
+    //public Visibility LowerArmVisibility
+    //{
+    //    get { return (Visibility)GetValue(LowerArmVisibilityProperty); }
+    //    set { SetValue(LowerArmVisibilityProperty, value); }
+    //}
+    //public static readonly DependencyProperty LowerArmVisibilityProperty =
+    //    DependencyProperty.Register("LowerArmVisibility", typeof(Visibility), typeof(EFEMFrontView), new UIPropertyMetadata(Visibility.Visible));
+    //#endregion
+
+    //#region ArmType (DependencyProperty)
+    //public int ArmType
+    //{
+    //    get { return (int)GetValue(ArmTypeProperty); }
+    //    set { SetValue(ArmTypeProperty, value); }
+    //}
+    //public static readonly DependencyProperty ArmTypeProperty =
+    //    DependencyProperty.Register("ArmType", typeof(int), typeof(EFEMFrontView), new UIPropertyMetadata(1, OnArmTypeChanged));
+
+    //private static void OnArmTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+    //{
+    //    var control = d as EFEMFrontView;
+    //    if (control != null)
+    //    {
+    //        control.UpdateArmVisibility();
+    //    }
+    //}
+
+    //private void UpdateArmVisibility()
+    //{
+    //    if (ArmType == 2)
+    //    {
+    //        UpperArmVisibility = Visibility.Collapsed;
+    //        LowerArmVisibility = Visibility.Visible;
+    //    }
+    //    else
+    //    {
+    //        UpperArmVisibility = Visibility.Visible;
+    //        LowerArmVisibility = Visibility.Visible;
+    //    }
+    //}
+    //#endregion
+}
 }

+ 51 - 0
VirgoUI/Models/Operate/Overview/OverViewModel.cs

@@ -720,6 +720,57 @@ namespace VirgoUI.Client.Models.Operate
         public bool IsPauseAllEnable => LP1JobStatus == "Executing" || LP2JobStatus == "Executing";
 
         #endregion Scheduler
+        public Visibility LowerArmVisibility
+        {
+            get
+            {
+                try
+                {
+                    var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
+
+                    if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
+                        return Visibility.Visible;
+
+                    var lowerBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.LowerBladeEnable");
+                    if (lowerBladeConfig != null && bool.TryParse(lowerBladeConfig.ToString(), out bool lowerEnabled))
+                    {
+                        return lowerEnabled ? Visibility.Visible : Visibility.Collapsed;
+                    }
+
+                    return Visibility.Collapsed;
+                }
+                catch
+                {
+                    return Visibility.Visible;
+                }
+            }
+        }
+
+        public Visibility UpperArmVisibility
+        {
+            get
+            {
+                try
+                {
+                    var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
+
+                    if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
+                        return Visibility.Visible;
+
+                    var upperBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.UpperBladeEnable");
+                    if (upperBladeConfig != null && bool.TryParse(upperBladeConfig.ToString(), out bool upperEnabled))
+                    {
+                        return upperEnabled ? Visibility.Visible : Visibility.Collapsed;
+                    }
+
+                    return Visibility.Collapsed;
+                }
+                catch
+                {
+                    return Visibility.Visible;
+                }
+            }
+        }
 
         #endregion EFEM
 

+ 1 - 1
VirgoUI/Models/Platform/EFEM/EFEMView.xaml

@@ -38,7 +38,7 @@
                         <parts1:Efem x:Name="mf"  Canvas.Left="70" Canvas.Top="15" Height="608" Width="796"/>
                     </Viewbox>
 
-                    <local:EFEMFrontView UnitData="{Binding EFEM}"  Canvas.Left="-95" Canvas.Top="145"  />
+                    <local:EFEMFrontView UnitData="{Binding EFEM}" Canvas.Left="-95" Canvas.Top="145"  />
 
 
                     <!--<Grid Width="181" Canvas.Left="-16" Canvas.Top="343" >

+ 53 - 0
VirgoUI/Models/Platform/EFEM/EFEMViewModel.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Security.AccessControl;
 using System.Windows;
 using Aitex.Core.Common;
 using Aitex.Core.Common.DeviceData;
@@ -772,6 +773,57 @@ namespace VirgoUI.Client.Models.Platform.EFEM
 
         #endregion Properties
 
+        public Visibility LowerArmVisibility
+        {
+            get
+            {
+                try
+                {
+                    var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
+
+                    if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
+                        return Visibility.Visible;
+
+                    var lowerBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.LowerBladeEnable");
+                    if (lowerBladeConfig != null && bool.TryParse(lowerBladeConfig.ToString(), out bool lowerEnabled))
+                    {
+                        return lowerEnabled ? Visibility.Visible : Visibility.Collapsed;
+                    }
+
+                    return Visibility.Collapsed;
+                }
+                catch
+                {
+                    return Visibility.Visible; 
+                }
+            }
+        }
+
+        public Visibility UpperArmVisibility
+        {
+            get
+            {
+                try
+                {
+                    var armTypeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobotArmType");
+
+                    if (armTypeConfig == null || !int.TryParse(armTypeConfig.ToString(), out int armType) || armType != 2)
+                        return Visibility.Visible;
+
+                    var upperBladeConfig = QueryDataClient.Instance.Service.GetConfig("EFEM.EfemRobot.UpperBladeEnable");
+                    if (upperBladeConfig != null && bool.TryParse(upperBladeConfig.ToString(), out bool upperEnabled))
+                    {
+                        return upperEnabled ? Visibility.Visible : Visibility.Collapsed;
+                    }
+
+                    return Visibility.Collapsed;
+                }
+                catch
+                {
+                    return Visibility.Visible; 
+                }
+            }
+        }
         public EFEMViewModel()
         {
             this.DisplayName = "EFEM";
@@ -792,6 +844,7 @@ namespace VirgoUI.Client.Models.Platform.EFEM
                         });
                 }
             }
+
             var lowerBladeEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"EFEM.EfemRobot.LowerBladeEnable");
             var upperBladeEnable = (bool)QueryDataClient.Instance.Service.GetConfig($"EFEM.EfemRobot.UpperBladeEnable");
             if (!lowerBladeEnable) _blades.Remove("Blade1");