Browse Source

add VCE Module in UI && fix bug in SE Cycle

zhouhr 1 year ago
parent
commit
49815fb19f

+ 4 - 1
.gitignore

@@ -4,4 +4,7 @@ Debug
 Release
 x64
 /Venus/Venus_Setup/Output/
-/Venus/Framework/Output/
+/Venus/Framework/Output/
+/Venus/Venus_MainPages/*.bak
+/Venus/Venus_RT/Config/TM/VenusSE/*.xml
+/Venus/Venus_RT/*.bak

+ 1 - 0
Venus/Framework/RTModuleLibrary/VceModules/VceModuleBase.cs

@@ -40,6 +40,7 @@ namespace MECF.Framework.RT.ModuleLibrary.VceModules
             //isJobDone = true;
         }
 
+        public virtual bool OutDoorIsOpen { get; set; }
         //IModuleDevice
         public abstract bool IsConnected { get; }
         public abstract bool IsReady { get; }

+ 25 - 0
Venus/Venus_Core/RtState.cs

@@ -191,4 +191,29 @@ namespace Venus_Core
         Ungripping,
         Fliping,
     }
+
+    public enum VceSTATE
+    {
+        Init,//初始化
+        Idle,//空闲
+        Error,//错误
+        Homing,//home操作 对应HM
+        DoorOpenning,//开门操作 对应DC
+        DoorClosing,//关门操作 对应DO
+        Loading,//取cassette操作 包括开门关门 对应LOAD,
+        UnLoading,
+        Mapping,//扫片
+        ReadingMap, //对应MP 包括三种格式 hex binary 智能(只有智能模式可以判断复杂情况)
+        Goting,//指定槽到达窗口 对应 GC
+        GotingLP,
+        Resetting,//重置
+        LoadingWithoutSMIF,//没有SMIF的load
+        LoadPreparing,//准备
+        SafeLoading,
+        SafeUnloading,
+        Pumping,
+        Venting,
+        Unknown
+    }
+
 }

+ 41 - 0
Venus/Venus_MainPages/Converters/VCEStateConverter.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+using Venus_Core;
+
+namespace Venus_MainPages.Converters
+{
+    public class VCEStateConverter : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+
+            VceSTATE currentState = (VceSTATE)Enum.Parse(typeof(VceSTATE), value.ToString());
+            switch (currentState)
+            {
+                case VceSTATE.Init:
+                    return new SolidColorBrush(Colors.Yellow);
+
+                case VceSTATE.Idle:
+                    return new SolidColorBrush(Colors.WhiteSmoke);
+
+                case VceSTATE.Error:
+                    return new SolidColorBrush(Colors.Red);
+
+                default:
+                    return new SolidColorBrush(Colors.Lime);
+
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            return null;
+        }
+    }
+}

+ 1 - 0
Venus/Venus_MainPages/Venus_MainPages.csproj

@@ -137,6 +137,7 @@
     <Compile Include="Converters\PMStateConverter.cs" />
     <Compile Include="Converters\SystemStateConverter.cs" />
     <Compile Include="Converters\TMStateConverter.cs" />
+    <Compile Include="Converters\VCEStateConverter.cs" />
     <Compile Include="MainPageModule.cs" />
     <Compile Include="PMS\IUiRecipeManager.cs" />
     <Compile Include="PMS\UiRecipeManager.cs" />

+ 8 - 1
Venus/Venus_MainPages/ViewModels/VenusSeOperationOverViewModel.cs

@@ -52,6 +52,7 @@ namespace Venus_MainPages.ViewModels
         private double m_PMAPercent;
         private double m_PMBPercent;
         private double m_PMCPercent;
+        private double m_VCEPercent;
         private int m_PickNum;
         private RecipeResult m_PMARecipeResult;
         private RecipeResult m_PMBRecipeResult;
@@ -92,6 +93,11 @@ namespace Venus_MainPages.ViewModels
             get { return m_PMCPercent; }
             set { SetProperty(ref m_PMCPercent, value); }
         }
+        public double VCEPercent
+        {
+            get { return m_VCEPercent; }
+            set { SetProperty(ref m_VCEPercent, value); }
+        }
         public int PickNum
         {
             get { return m_PickNum; }
@@ -490,6 +496,7 @@ namespace Venus_MainPages.ViewModels
             m_RtDataKeys.Add($"SETM.PMASlitDoorClosed");
             m_RtDataKeys.Add($"SETM.PMBSlitDoorClosed");
             m_RtDataKeys.Add($"SETM.PMCSlitDoorClosed");
+            m_RtDataKeys.Add($"SETM.VCEPressure.Value");
             m_RtDataKeys.Add($"VCE1.VCEOutDoorClosed");
             m_RtDataKeys.Add($"SEScheduler.CycledWafer");
             m_RtDataKeys.Add($"SEScheduler.CycleSetPoint");
@@ -621,7 +628,7 @@ namespace Venus_MainPages.ViewModels
                 PMBDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMBSlitDoorClosed");
                 PMCDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "SETM.PMCSlitDoorClosed");
                 VCEOutDoorIsOpen = !CommonFunction.GetValue<bool>(RtDataValues, "VCE1.VCEOutDoorClosed");
-
+                VCEPercent = CommonFunction.GetValue<double>(RtDataValues, "SETM.VCEPressure.Value") * 248 / 760000;
                 if (PMAIsInstalled == true)
                 {
                     PMAModuleInfo = ModuleManager.ModuleInfos["PMA"];

+ 1 - 2
Venus/Venus_MainPages/Views/SeTMView.xaml

@@ -129,8 +129,7 @@
                     <userControls:TMChamber Panel.ZIndex="1" ModuleName="PMB" x:Name="PMB" Canvas.Top="45"   Canvas.Left="409" Width="100" Height="100"  DoorIsOpen="{Binding RtDataValues[PMB.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMBWafer}" PMVisibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                     <userControls:TMChamber Panel.ZIndex="1" ModuleName="PMC" x:Name="PMC" Canvas.Top="174"   Canvas.Left="642" Width="102" Height="102" RotateTransformValue="90" DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMCWafer}" PMVisibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                     <!--<userControls:TMChamber ModuleName="PMC" x:Name="PMC" Canvas.Top="155"  Canvas.Left="680" Width="140" Height="140" RotateTransformValue="90"  DoorIsOpen="{Binding RtDataValues[PMC.IsSlitDoorClosed],Converter={StaticResource BoolToBool}}" RobotWafer="{Binding PMCWafer}" PMVisibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>-->
-                    <TextBlock Canvas.Top="535" Canvas.Left="435" Text="Vce" FontSize="25" FontWeight="Normal" HorizontalAlignment="Center" VerticalAlignment="Top"></TextBlock>
-                    <userControls:Vce Canvas.Top="360" Canvas.Left="355" Width="200" Height="180" HorizontalAlignment="Center" VerticalAlignment="Top"></userControls:Vce>
+                    <userControls:Vce VCEName="Vce" Canvas.Top="360" Canvas.Left="355" Width="200" Height="180" HorizontalAlignment="Center" VerticalAlignment="Top"></userControls:Vce>
                     <userControls:EFEMFrontView UnitData="{Binding TMModuleInfo}" Title="SeTM Robot"      Canvas.Top="180" Canvas.Left="20"/>
 
                 </Canvas>

+ 3 - 1
Venus/Venus_MainPages/Views/TopView.xaml

@@ -23,6 +23,8 @@
         <converters2:SystemStateConverter x:Key="SystemStateConverter"/>
         <converters2:EFEMStateConverter x:Key="EFEMStateConverter"/>
         <converters2:IsOnlineToColorConverter x:Key="IsOnlineConverter"/>
+        <converters2:VCEStateConverter x:Key="VCEStateConverter"/>
+        
     </UserControl.Resources>
 
     <Canvas Background="{StaticResource Login_BG}">
@@ -46,7 +48,7 @@
             </Grid.ColumnDefinitions>
             <userControls:StateTitle Title="System"                 TextBoxValue="{Binding RtDataValues[SYSTEM.FsmState]}" TextBoxColor="{Binding RtDataValues[SYSTEM.FsmState],Converter={StaticResource SystemStateConverter}}" LabelColor="{Binding RtDataValues[System.IsAutoMode],Converter={StaticResource IsOnlineConverter}}"/>
 
-            <userControls:StateTitle Title="VCE1"  Grid.Column="3"  TextBoxValue="{Binding RtDataValues[VCE1.FsmState]}"   Visibility="{Binding VCE1IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
+            <userControls:StateTitle Title="VCE1"  Grid.Column="3"  TextBoxValue="{Binding RtDataValues[VCE1.FsmState]}"   TextBoxColor="{Binding RtDataValues[VCE1.FsmState],Converter={StaticResource VCEStateConverter}}" Visibility="{Binding VCE1IsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
 
             <userControls:StateTitle Title="EFEM"  Grid.Column="3"  TextBoxValue="{Binding RtDataValues[EFEM.FsmState]}"   TextBoxColor="{Binding RtDataValues[EFEM.FsmState],Converter={StaticResource EFEMStateConverter}}"     LabelColor="{Binding RtDataValues[EFEM.IsOnline],Converter={StaticResource IsOnlineConverter}}"  Visibility="{Binding EFEMIsInstalled,Converter={StaticResource bool2VisibilityConverter}}" />
             <userControls:StateTitle Title="LLA"   Grid.Column="1"  TextBoxValue="{Binding RtDataValues[LLA.FsmState]}"    TextBoxColor="{Binding RtDataValues[LLA.FsmState],Converter={StaticResource LLStateConverter}}"        LabelColor="{Binding RtDataValues[LLA.IsOnline],Converter={StaticResource IsOnlineConverter}}"     Visibility="{Binding LLAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>

File diff suppressed because it is too large
+ 2 - 4
Venus/Venus_MainPages/Views/VenusSeOperationOverView.xaml


+ 35 - 2
Venus/Venus_RT/Config/System.sccfg

@@ -283,8 +283,21 @@
 		<config default="50"  name="WithPMPressureDifference"   nameView="TM PM Pressure Difference"   description="TM和PM压差" max="100" min="0" paramter="" tag="" unit="mTorr" type="Integer" />
 		<config default="0" name="SingleArmOption"   nameView="Single Arm Option"   description="0, both; 1, Blade1; 2, Blade2" max="2" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="0" name="QueryAWCOption"   nameView="Query AWC Option"   description="0, None; 1, Only TMPick Open; 2, Only TMPlace Open; 3, Both Open" max="3" min="0" paramter="" tag="" unit="" type="Integer" />
-		<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
+		<configs name="TM_MFC1" nameView="MFC1" >
+			<config default="true" name="Enable" nameView="Enable" description="Enable gas 1 or not" tag="" unit="" type="Bool" />
+			<config default="O2" name="GasName" nameView="Gas Name" description="Name of NO.1 gas stick" tag="" unit="" type="String" />
+			<config default="100" name="MfcN2Scale" nameView="MFC N2 Scale" description="Max scale by N2 tuning" max="10000" min="0" tag="" unit="sccm" type="Integer" />
+			<config default="1" name="MfcScaleFactor" nameView="MFC Scale Factor" description="Scale factor" max="10" min="0" tag="" unit="sccm" type="Double" />
+			<config default="100" name="DefaultSetPoint" nameView="Default Set Point" description="default setpoint" max="1000" min="0" tag="" unit="sccm" type="Integer" />
+			<config default="1" name="FlowRegulationFactor" nameView="Flow Regulation Factor" description="flow regulation factor" max="10" min="0" tag="" unit="sccm" type="Integer" />
+			<config default="true" name="MfcEnableAlarm" nameView="MFC Enable Alarm" description="" max="1" min="0" paramter="" tag="" unit="" type="Bool" />
+			<config default="10" name="MfcAlarmRange" nameView="MFC Alarm Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
+			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
+			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 
+		</configs>
 		<configs name="DryPump" nameView="Dry Pump" >
 			<config default="1" name="MFG" nameView="MFG" description="厂商, 1:Sky; 2:Edwards" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
 			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
@@ -315,7 +328,11 @@
 		<config default="760000" name="ATMTargetPressure" nameView="VCE ATM Target Pressure" description="TM ATM Target Pressure" max="760000" min="0" paramter="" tag="" unit="mTorr" type="Double" />
 		<config default="25" name="SlotNumber" nameView="VCE SlotNumber" description="槽位个数" max="99" min="0" paramter="" tag="" unit="" type="Integer" />
 		<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
-
+		<configs name="SMIF" nameView="SMIF" >
+			<config default="1" name="Manufacturer" nameView="Manufacturer" description="厂商, 1:Fortrend;" max="2" min="1" paramter="" tag="" unit="" type="Integer" />
+			<config default="1" name="CommunicationType" nameView="Communication Type" description="0:Analogue; 1:RS232; 2:Ethernet" max="10" min="0" paramter="" tag="" unit="" type="Integer" />
+			<config default="COM24" name="Port" nameView="Port" description="serial port" max="" min="" paramter="" tag="" unit="" type="String" />
+		</configs>
 	</configs>
 
 	<!--PMA-->
@@ -646,6 +663,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas10" nameView="MFC Gas10" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 10 or not" tag="" unit="" type="Bool" />
@@ -659,6 +677,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas11" nameView="MFC Gas8" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 11 or not" tag="" unit="" type="Bool" />
@@ -672,6 +691,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas12" nameView="MFC Gas12" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 12 or not" tag="" unit="" type="Bool" />
@@ -685,6 +705,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcN2" nameView="MFC N2" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable N2 or not" tag="" unit="" type="Bool" />
@@ -1242,6 +1263,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas10" nameView="MFC Gas10" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 10 or not" tag="" unit="" type="Bool" />
@@ -1255,6 +1277,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas11" nameView="MFC Gas8" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 11 or not" tag="" unit="" type="Bool" />
@@ -1268,6 +1291,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas12" nameView="MFC Gas12" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 12 or not" tag="" unit="" type="Bool" />
@@ -1281,6 +1305,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcN2" nameView="MFC N2" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable N2 or not" tag="" unit="" type="Bool" />
@@ -1838,6 +1863,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas10" nameView="MFC Gas10" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 10 or not" tag="" unit="" type="Bool" />
@@ -1851,6 +1877,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas11" nameView="MFC Gas8" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 11 or not" tag="" unit="" type="Bool" />
@@ -1864,6 +1891,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas12" nameView="MFC Gas12" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 12 or not" tag="" unit="" type="Bool" />
@@ -1877,6 +1905,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcN2" nameView="MFC N2" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable N2 or not" tag="" unit="" type="Bool" />
@@ -2434,6 +2463,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas10" nameView="MFC Gas10" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 10 or not" tag="" unit="" type="Bool" />
@@ -2447,6 +2477,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas11" nameView="MFC Gas8" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 11 or not" tag="" unit="" type="Bool" />
@@ -2460,6 +2491,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcGas12" nameView="MFC Gas12" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable gas 12 or not" tag="" unit="" type="Bool" />
@@ -2473,6 +2505,7 @@
 			<config default="10" name="MfcAlarmTime" nameView="MFC Alarm Time" description="Mfc Alarm Time" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
 			<config default="10" name="MfcWarningRange" nameView="MFC Warning Range" description="" max="200" min="0" paramter="" tag="" unit="sccm" type="Integer" />
 			<config default="10" name="MfcWarningTime" nameView="MFC Warning Time" description="" max="60" min="0" paramter="" tag="" unit="second" type="Integer" />
+			<config default="0" name="MFCWriteMode" nameView="MFCWriteMode" description=" 0:Flow; 1:Percent" max="1" min="0" paramter="" tag="" unit="" type="Integer" />
 		</configs>
 		<configs name="MfcN2" nameView="MFC N2" >
 			<config default="true" name="Enable" nameView="Enable" description="Enable N2 or not" tag="" unit="" type="Bool" />

+ 75 - 149
Venus/Venus_RT/Devices/SMIF/FortrendPLUS500.cs

@@ -1,9 +1,14 @@
-using Aitex.Core.RT.Log;
+using Aitex.Core.RT.DataCenter;
+using Aitex.Core.RT.Log;
 using Aitex.Core.RT.SCCore;
 using MECF.Framework.Common.Communications;
 using MECF.Framework.Common.Equipment;
+using MECF.Framework.RT.ModuleLibrary.Commons;
 using SecsGem.Core;
+using SecsGemSerial.Application;
 using SecsGemSerial.Core;
+using SecsGemSerial.Core.EnumData;
+using SecsGemSerial.Core.Model;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -14,7 +19,7 @@ using System.Threading.Tasks;
 
 namespace Venus_RT.Devices.SMIF
 {
-    
+
     /// <summary>
     /// Fortrend PLUS 500
     /// Loader/Unloader
@@ -22,122 +27,25 @@ namespace Venus_RT.Devices.SMIF
     /// </summary>
     public class FortrendPLUS500
     {
-        //private readonly Dictionary<FunctionType, StreamType> SFPair = new Dictionary<FunctionType, StreamType>()
-        //{
-        //    //s1
-        //    { FunctionType.Abort,StreamType.SMIFState},
-        //    { FunctionType.Online,StreamType.SMIFState},
-        //    { FunctionType.OnlineData,StreamType.SMIFState},
-        //    { FunctionType.Map,StreamType.SMIFState},
-        //    { FunctionType.MapData,StreamType.SMIFState},
-        //    { FunctionType.Status,StreamType.SMIFState},
-        //    { FunctionType.StatusData,StreamType.SMIFState},
-
-        //    //s2
-        //    { FunctionType.SetReport,StreamType.SMIFControl},
-        //    { FunctionType.SetReportACK,StreamType.SMIFControl},
-        //    { FunctionType.ResetORInit,StreamType.SMIFControl},
-        //    { FunctionType.ResetORInitACK,StreamType.SMIFControl},
-        //    { FunctionType.RemoteCommand,StreamType.SMIFControl},
-        //    { FunctionType.RemoteCommandData,StreamType.SMIFControl},
-        //    { FunctionType.CheckProto,StreamType.SMIFControl},
-        //    { FunctionType.CheckProtoData,StreamType.SMIFControl},
-
-        //    //s3
-        //    { FunctionType.AccessMode,StreamType.LP},
-        //    { FunctionType.AccessModeACK,StreamType.LP},
-
-        //    //s4
-        //    {FunctionType.ReadTag,StreamType.TAG},
-        //    {FunctionType.ReadTagData,StreamType.TAG},
-        //    {FunctionType.WriteTag,StreamType.TAG},
-        //    {FunctionType.WriteTagData,StreamType.TAG},
-
-        //    //s5
-        //    {FunctionType.AlarmData,StreamType.ALARM },
-        //    {FunctionType.AlarmACK,StreamType.ALARM },
-        //    {FunctionType.SetAlarm,StreamType.ALARM },
-        //    {FunctionType.SetAlarmACK,StreamType.ALARM },
-
-        //    //s6
-        //    {FunctionType.DataSend,StreamType.DVDATA},
-        //    {FunctionType.DataSendACK,StreamType.DVDATA},
-
-        //    //s9
-        //    {FunctionType.UnrecognizedDeviceID,StreamType.COMMANDERROR},
-        //    {FunctionType.UnrecognizedStream,StreamType.COMMANDERROR},
-        //    {FunctionType.UnrecognizedFunction,StreamType.COMMANDERROR},
-        //    {FunctionType.IllegalData,StreamType.COMMANDERROR},
-            
-        //};
-
-        //public enum FunctionType
-        //{
-        //    Abort = 0,
-
-        //    Online = 1,
-        //    OnlineData = 2,
-            
-        //    Map = 3,
-        //    MapData = 4,
-            
-        //    Status = 5,
-        //    StatusData = 6,
-            
-        //    SetReport = 15,
-        //    SetReportACK = 16,
-
-        //    ResetORInit = 19,
-        //    ResetORInitACK = 20,
-
-        //    RemoteCommand = 21,
-        //    RemoteCommandData = 22,
-
-        //    CheckProto = 25,
-        //    CheckProtoData = 26,
-
-        //    AccessMode = 27,
-        //    AccessModeACK = 27,
-
-        //    ReadTag = 101,
-        //    ReadTagData = 102,
-
-        //    WriteTag = 103,
-        //    WriteTagData = 104,
-
-        //    AlarmData = 1,
-        //    AlarmACK = 2,
-
-        //    SetAlarm = 3,
-        //    SetAlarmACK = 4,
-
-        //    DataSend = 3,
-        //    DataSendACK = 4,
-
-        //    UnrecognizedDeviceID = 1,
-        //    UnrecognizedStream = 3,
-        //    UnrecognizedFunction = 5,
-        //    IllegalData = 7,
-        //}
 
         public enum StreamType
         {
-             SMIFState = 1,
-             SMIFControl = 2,
-             LP = 3,
-             TAG = 4,
-             ALARM = 5,
-             DVDATA = 6,
-             COMMANDERROR = 9,
-             RFIDCOMMAND= 18,
-             SMARTTAG8400COMMAND = 100,
+            SMIFState = 1,
+            SMIFControl = 2,
+            LP = 3,
+            TAG = 4,
+            ALARM = 5,
+            DVDATA = 6,
+            COMMANDERROR = 9,
+            RFIDCOMMAND = 18,
+            SMARTTAG8400COMMAND = 100,
         }
 
 
         private AsyncSerialPort _serialport;
         private string _portname;
         //connect status
-        public bool IsConnected;        
+        public bool IsConnected;
         //online status
         public bool IsOnline;
         //Load
@@ -147,92 +55,110 @@ namespace Venus_RT.Devices.SMIF
         //Error
         public bool IsError;
 
-        private SecsGemSerial.Application.SecsGemSerialApplication _serial = null;
+        private SecsGemSerialApplication _serial = null;
+
+        private ModuleName _smifbelong;
 
         /// <summary>
         /// 构造函数
         /// </summary>
-        /// <param name="DEVICEBelong">从属的设备 如VCE1 LP1</param>
-        public FortrendPLUS500(ModuleName DEVICEBelong)
+        /// <param name="VCEName">从属的设备 如VCE1 LP1</param>
+        public FortrendPLUS500(ModuleName VCEName)
         {
-            _portname = SC.GetStringValue($"{DEVICEBelong}.SMIF.PortNumber");
-            //_serialport = new AsyncSerialPort(_portname, 9600, 8,Parity.None,StopBits.One);
-            //_serialport.Open();
-            //_serialport.OnDataChanged += OnSMIFDataChanged;
+            _smifbelong = VCEName;
+            _portname = SC.GetStringValue($"{VCEName}.SMIF.Port");
             SerialOptions serialOptions = new SerialOptions()
             {
-                Port=_portname==null? "COM81":_portname,
-                BaudRate=9600,
-                DataBits=8,
-                Parity=Parity.None,
-                StopBits=StopBits.One,
+                Port = _portname ?? "COM81",
+                BaudRate = 9600,
+                DataBits = 8,
+                Parity = Parity.None,
+                StopBits = StopBits.One,
             };
             GlobalData.DeviceId = 0;
-            SecsGemSerial.Core.SecsGemSerialOptions secsGemSerialOptions = new SecsGemSerial.Core.SecsGemSerialOptions()
+            SecsGemSerialOptions secsGemSerialOptions = new SecsGemSerialOptions()
             {
-                DeviceId=GlobalData.DeviceId
+                DeviceId = GlobalData.DeviceId
             };
-            _serial = new SecsGemSerial.Application.SecsGemSerialApplication(DEVICEBelong.ToString(), serialOptions, secsGemSerialOptions);
+            
+            _serial = new SecsGemSerialApplication(VCEName.ToString(), serialOptions, secsGemSerialOptions);
             _serial.OnAlarm += _serial_OnAlarm;
         }
 
         private void _serial_OnAlarm(string alarm)
         {
-            Console.WriteLine(alarm);
+            //Console.WriteLine(alarm);
+            LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"SMIF({_smifbelong}) received Alarm:{alarm}");
         }
 
         public void Initialize()
         {
             _serial.Initialize();
+            _serial.RemoteControl(out string reason);
         }
 
-        //检查传入SxFy是否定义在字典中
-        //private bool CheckStreamFunctionPair(string sfstring)
-        //{
-        //    string[] sfcodes = sfstring.Split('S','F');
-        //    if (sfcodes.Length == 2
-        //        && Enum.TryParse(Convert.ToInt32(sfcodes[0]).ToString(), out StreamType snum)
-        //        && Enum.IsDefined(typeof(StreamType),snum)
-        //        && Enum.TryParse(Convert.ToInt32(sfcodes[1]).ToString(), out FunctionType fnum)
-        //        && Enum.IsDefined(typeof(FunctionType), fnum)
-        //        && SFPair.TryGetValue(fnum,out StreamType _snum)
-        //        && _snum == snum)
-        //    {
-        //        return true;
-        //    }
-        //    return false;
-        //}
 
         private void OnSMIFDataChanged(string oneLineMessage)
         {
-            
+        }
+
+        public void Query()
+        {
+            SmifData smifdata = _serial.QueryAllSvids(out string reason);
+            List<EnumSlot> mapdata = smifdata?.WaferMap;
+            int? wafercount = smifdata?.WaferCount;
+            E84Signals SmifIO = smifdata?.E84Signals;
+        }
+
+        public void Home()
+        {
+            if (!_serial.RemoteCommand(EnumRemoteCmd.HomeSmif, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Home Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Home Command to SMIF({_smifbelong})");
         }
 
         public void Load()
         {
-            
+            if (!_serial.RemoteCommand(EnumRemoteCmd.StartLoadOpenCycle, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Load Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Load Command to SMIF({_smifbelong})");
         }
 
         public void Unload()
         {
-            
+            if (!_serial.RemoteCommand(EnumRemoteCmd.StartUnloadCloseCycle, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unload Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLoad Command to SMIF({_smifbelong})");
         }
 
         public void Lock()
         {
-            
+            if (!_serial.RemoteCommand(EnumRemoteCmd.KeepPrtLocked, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Lock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send Lock Command to SMIF({_smifbelong})");
         }
 
         public void Unlock()
         {
-
+            if (!_serial.RemoteCommand(EnumRemoteCmd.UnlockPort, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unlock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLock Command to SMIF({_smifbelong})");
         }
 
-        public void ReadMap()
-        { 
-
+        public void Reset()
+        {
+            if (!_serial.RemoteCommand(EnumRemoteCmd.HomeSmif, out string reason))
+                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, _smifbelong, $"Send Unlock Command Failed for {reason}!Please Check SMIF({_smifbelong})");
+            else
+                LOG.Write(eEvent.EV_VCE_COMMON_INFO, _smifbelong, $"Send UnLock Command to SMIF({_smifbelong})");
         }
 
+
         /// <summary>
         /// 中断SMIF正在执行的操作
         /// </summary>

+ 11 - 0
Venus/Venus_RT/Devices/VCE/HongHuVce.cs

@@ -162,6 +162,9 @@ namespace Venus_RT.Devices.VCE
                 return slot;
             }
         }
+
+        private bool _OutDoorIsOpen = false;
+        public override bool OutDoorIsOpen => _OutDoorIsOpen;
         #endregion
 
         //传入slot数量
@@ -244,6 +247,14 @@ namespace Venus_RT.Devices.VCE
                                 break;
                             //设备执行完毕
                             case "_BKGRDY":
+                                if (_currentVceMessage.Command == VceCommand.DoorOpen)
+                                {
+                                    _OutDoorIsOpen = true;
+                                }
+                                if (_currentVceMessage.Command == VceCommand.DoorClose)
+                                {
+                                    _OutDoorIsOpen = false;
+                                }
                                 LOG.Write(eEvent.EV_VCE_COMMON_INFO, _moduleName, $"vce {_currentVceMessage.Head} over");
                                 _status = RState.End;
                                 break;

+ 6 - 1
Venus/Venus_RT/Modules/SETMCycle.cs

@@ -74,6 +74,7 @@ namespace Venus_RT.Modules
         private int CycledWafer => _currentWafer + _pastWafer;
         private int _currentWafer;
         private int _pastWafer;
+        private bool _IsFirstLot = true;
 
         private bool IsSequenceCycle = false; //判断是否跑货
 
@@ -142,7 +143,11 @@ namespace Venus_RT.Modules
 
                 cj.StartTime = DateTime.Now;
 
-                _dbCallback.LotCreated(cj);
+                if (_IsFirstLot)
+                {
+                    _dbCallback.LotCreated(cj);
+                    _IsFirstLot = false;
+                }
                 _faCallback.JobStarted(cj, GetFirstProcessJob(cj));
 
                 int maxslot = 0;

+ 45 - 0
Venus/Venus_RT/Modules/SMIF/SMIFEntity.cs

@@ -0,0 +1,45 @@
+using Aitex.Core.RT.Fsm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Venus_RT.Devices.SMIF
+{
+    /// <summary>
+    /// SMIF主要功能 用于自动化的Cassette传送
+    /// 主要功能包括Load Unload HOME等
+    /// </summary>
+    public class SMIFEntity : Entity, IModuleEntity
+    {
+
+        public bool IsInit => throw new NotImplementedException();
+
+        public bool IsBusy => throw new NotImplementedException();
+
+        public bool IsIdle => throw new NotImplementedException();
+
+        public bool IsError => throw new NotImplementedException();
+
+        public SMIFEntity()
+        {
+
+        }
+
+        public bool Check(int msg, out string reason, params object[] args)
+        {
+            throw new NotImplementedException();
+        }
+
+        public bool CheckAcked(int msg)
+        {
+            throw new NotImplementedException();
+        }
+
+        public int Invoke(string function, params object[] args)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 2 - 2
Venus/Venus_RT/Modules/TM/VenusEntity/SETMEntity.cs

@@ -105,8 +105,8 @@ namespace Venus_RT.Modules.TM.VenusEntity
             get { return !IsInit && !IsError && !IsIdle; }
         }
 
-        public bool VCEIsATM => _tm.IsTMATM;
-        public bool TMIsATM  => _tm.IsVCEATM;
+        public bool VCEIsATM => _tm.IsVCEATM;
+        public bool TMIsATM  => _tm.IsTMATM;
 
         public bool TMIsVAC => _tm.IsTMVAC;
         public bool VCEIsVAC => _tm.IsVCEVAC;

+ 25 - 11
Venus/Venus_RT/Modules/VCE/UnloadRoutine.cs

@@ -1,5 +1,6 @@
 using Aitex.Core.RT.Device;
 using Aitex.Core.RT.Log;
+using Aitex.Core.RT.OperationCenter;
 using Aitex.Core.RT.Routine;
 using Aitex.Core.RT.SCCore;
 using Aitex.Core.Util;
@@ -23,6 +24,7 @@ namespace Venus_RT.Modules.VCE
     {
         public enum UnloadStep
         {
+            CloseDoor,
             Vent,
             GotoUnload,
             OpenOutDoor,
@@ -32,7 +34,7 @@ namespace Venus_RT.Modules.VCE
         int _timeout;
         SEMFVentRoutine ventRoutine;
 
-        public UnloadRoutine(ModuleName module,VceModuleBase vce) : base(module)
+        public UnloadRoutine(ModuleName module, VceModuleBase vce) : base(module)
         {
             _vce = vce;
             ventRoutine = new SEMFVentRoutine(DEVICE.GetDevice<HongHuTM>("SETM"), module);
@@ -42,24 +44,36 @@ namespace Venus_RT.Modules.VCE
         {
             _timeout = SC.GetValue<int>($"{Module}.MotionTimeout") * 1000;
             //if vce inner door not close cannot dot it as it will vent
-            if (!Singleton<RouteManager>.Instance.seTM.IsVCESlitDoorClosed)
-            {
-                LOG.Write(eEvent.ERR_VCE_COMMON_Failed, Module, $"VCE Inner Door is open! Please close it First!");
-                return RState.Failed;
-            }
+            //if (!Singleton<RouteManager>.Instance.seTM.IsVCESlitDoorClosed)
+            //{
+            //    LOG.Write(eEvent.ERR_VCE_COMMON_Failed, Module, $"VCE Inner Door is open! Please close it First!");
+            //    return RState.Failed;
+            //}
             Reset();
-            return Runner.Start(Module,"VCE Unload Routine");
+            return Runner.Start(Module, "VCE Unload Routine");
         }
 
         public RState Monitor()
         {
-            Runner.Run(UnloadStep.Vent,                 Vent,               CheckVentOver)
-                  .Run(UnloadStep.GotoUnload,           GotoUnload,         CheckVceIdle,       _timeout)
-                  .Run(UnloadStep.OpenOutDoor,          OpenOutDoor,        CheckVceIdle,       _timeout)
-                  .End(UnloadStep.NotifyOver,           NullFun,            100);
+            Runner.Run(UnloadStep.CloseDoor, CloseDoor, CheckDoorIsClose)
+                  .Run(UnloadStep.Vent, Vent, CheckVentOver)
+                  .Run(UnloadStep.GotoUnload, GotoUnload, CheckVceIdle, _timeout)
+                  .Run(UnloadStep.OpenOutDoor, OpenOutDoor, CheckVceIdle, _timeout)
+                  .End(UnloadStep.NotifyOver, NullFun, 100);
             return Runner.Status;
         }
 
+        private bool CloseDoor()
+        {
+            OP.DoOperation("SETM.SetSlitDoor", ModuleName.VCE1, false);
+            return true;
+        }
+
+        private bool CheckDoorIsClose()
+        {
+            return Singleton<RouteManager>.Instance.seTM.IsVCESlitDoorClosed;
+        }
+
         private bool CheckVentOver()
         {
             RState ret = ventRoutine.Monitor();

+ 1 - 36
Venus/Venus_RT/Modules/VCE/VceEntity.cs

@@ -25,29 +25,6 @@ using Venus_RT.Modules.TM.VenusEntity;
 namespace Venus_RT.Modules.VCE
 {
     #region 状态和消息
-    public enum VceSTATE
-    {
-        Init,//初始化
-        Idle,//空闲
-        Error,//错误
-        Homing,//home操作 对应HM
-        DoorOpenning,//开门操作 对应DC
-        DoorClosing,//关门操作 对应DO
-        Loading,//取cassette操作 包括开门关门 对应LOAD,
-        UnLoading,
-        Mapping,//扫片
-        ReadingMap, //对应MP 包括三种格式 hex binary 智能(只有智能模式可以判断复杂情况)
-        Goting,//指定槽到达窗口 对应 GC
-        GotingLP,
-        Resetting,//重置
-        LoadingWithoutSMIF,//没有SMIF的load
-        LoadPreparing,//准备
-        SafeLoading,
-        SafeUnloading,
-        Pumping,
-        Venting,
-        Unknown
-    }
 
     public enum VceMSG
     {
@@ -77,7 +54,6 @@ namespace Venus_RT.Modules.VCE
     {
         private ModuleName _modulename;
         private readonly VceModuleBase _vce;
-        private bool _vceoutdoorclosed;
 
         public bool IsIdle => fsm.State == (int)VceSTATE.Idle;
 
@@ -87,7 +63,7 @@ namespace Venus_RT.Modules.VCE
 
         public bool IsError => fsm.State == (int)VceSTATE.Error;
 
-        public bool VCEOutDoorClosed => _vceoutdoorclosed;
+        public bool VCEOutDoorClosed => !_vce.OutDoorIsOpen;
 
         private int currentSlot;
         private int targetSlot;
@@ -102,7 +78,6 @@ namespace Venus_RT.Modules.VCE
         	currentSlot = 0;
             _modulename = moduleName;
             _vce = new HongHuVce(25, _modulename);
-            _vceoutdoorclosed = true;//初始状态outdoor是关闭
 
             _loadRoutine = new LoadRoutine(_modulename,_vce);
             _prepareRoutine = new LoadPrepareRoutine(_modulename,_vce);
@@ -419,11 +394,6 @@ namespace Venus_RT.Modules.VCE
                 return false;
             }
 
-            if (_vce.Status == RState.End)
-            {
-                _vceoutdoorclosed = false;
-            }
-
             return _vce.Status == RState.End;
         }
 
@@ -439,11 +409,6 @@ namespace Venus_RT.Modules.VCE
                 PostMsg(VceMSG.Error);
                 return false;
             }
-            //关门成功
-            if (_vce.Status == RState.End)
-            {
-                _vceoutdoorclosed = true;
-            }
 
             return _vce.Status == RState.End;
         }

+ 1 - 0
Venus/Venus_RT/Venus_RT.csproj

@@ -178,6 +178,7 @@
     <Compile Include="Devices\SkyPump.cs" />
     <Compile Include="Devices\SMCChiller.cs" />
     <Compile Include="Devices\SMIF\FortrendPLUS500.cs" />
+    <Compile Include="Modules\SMIF\SMIFEntity.cs" />
     <Compile Include="Devices\TM\HongHuTM.cs" />
     <Compile Include="Devices\TM\ITransferRobot.cs" />
     <Compile Include="Devices\TM\JetTM.cs" />

+ 57 - 0
Venus/Venus_Themes/UserControls/Vce.xaml

@@ -10,7 +10,22 @@
     <UserControl.Resources>
         
         <converters:BoolToBool x:Key="BoolToBool"/>
+        <Storyboard x:Key="WaterStoryboard">
+            <PointAnimation Storyboard.TargetName="bs_Water" Storyboard.TargetProperty="Point1" From="15,-10" To="15,10" Duration="00:00:1" AutoReverse="True" RepeatBehavior="Forever"></PointAnimation>
+            <PointAnimation Storyboard.TargetName="bs_Water" Storyboard.TargetProperty="Point2" From="35,10" To="35,-10" Duration="00:00:2.5" AutoReverse="True" RepeatBehavior="Forever"></PointAnimation>
+        </Storyboard>
+        <Storyboard x:Key="WaterWidth">
+            <DoubleAnimation Storyboard.TargetName="rec_Water" Storyboard.TargetProperty="Height" Duration="0:0:0.3">
+
+            </DoubleAnimation>
+        </Storyboard>
     </UserControl.Resources>
+    <UserControl.Triggers>
+        <EventTrigger RoutedEvent="Loaded">
+            <BeginStoryboard Storyboard="{StaticResource WaterStoryboard}"></BeginStoryboard>
+            <BeginStoryboard Storyboard="{StaticResource WaterWidth}"></BeginStoryboard>
+        </EventTrigger>
+    </UserControl.Triggers>
     <Viewbox>
         <Canvas Height="120" Width="200">
             <Canvas.Background>
@@ -59,6 +74,48 @@
                     </Rectangle.Style>
                 </Rectangle>
             </Border>
+            <Border Canvas.Top="129" Canvas.Left="-5" Height="44" Width="270" Background="Transparent" BorderBrush="Black" CornerRadius="3" BorderThickness="3" Visibility="{Binding ElementName=vceChamber,Path=IsVenting,Converter={StaticResource bool2VisibilityConverter}}">
+                <Border.RenderTransform>
+                    <ScaleTransform ScaleX="0.77" ScaleY="0.58"></ScaleTransform>
+                </Border.RenderTransform>
+                <Border Background="Transparent" BorderBrush="Gray" CornerRadius="1" BorderThickness="1">
+                        <StackPanel Margin="-160,0,0,0" Height="44">
+
+                            <StackPanel   Width="49" Margin="-40 0 45 10">
+                                <StackPanel.RenderTransform>
+                                    <RotateTransform Angle="-90" CenterX="19.5" CenterY="10"></RotateTransform>
+                                </StackPanel.RenderTransform>
+                                <!--矩形-->
+                            <Rectangle x:Name="rec_Water"  Fill="#42a5f5" Height="{Binding ElementName=vceChamber,Path=PercentValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="50" Margin="-20,6,0,0"/>
+                                <!--水波-->
+                                <Path Fill="#42a5f5" Margin="0,0,0,-1" Height="20" Stretch="Fill">
+                                    <Path.RenderTransform>
+                                        <RotateTransform Angle="180" CenterX="19.5" CenterY="10"></RotateTransform>
+                                    </Path.RenderTransform>
+                                    <Path.Data>
+                                        <PathGeometry>
+                                            <PathFigure StartPoint="0,0">
+                                                <BezierSegment x:Name="bs_Water" Point1="15,-5" Point2="35,5"  Point3="50,0"></BezierSegment>
+                                                <PolyLineSegment Points="50,10 0,10"></PolyLineSegment>
+                                            </PathFigure>
+                                        </PathGeometry>
+                                    </Path.Data>
+                                </Path>
+                            </StackPanel>
+                        </StackPanel>
+                    </Border>
+                </Border>
+                
+            <StackPanel Width="200" Canvas.Top="130" HorizontalAlignment="Center" VerticalAlignment="Center">
+                <TextBlock Canvas.Top="130" Canvas.Left="90" TextAlignment="Center" FontSize="20" FontWeight="Normal">
+                    <TextBlock.Text>
+                        <MultiBinding  StringFormat=" {0}({1}mtorr)">
+                            <Binding  ElementName="vceChamber" Path="VCEName"></Binding>
+                            <Binding  ElementName="vceChamber" Path="PressureValue"></Binding>
+                        </MultiBinding>
+                    </TextBlock.Text>
+                </TextBlock>
+            </StackPanel>
         </Canvas>
     </Viewbox>
 </UserControl>

+ 48 - 0
Venus/Venus_Themes/UserControls/Vce.xaml.cs

@@ -9,6 +9,7 @@ using System.Windows.Data;
 using System.Windows.Documents;
 using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Media.Animation;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
@@ -34,5 +35,52 @@ namespace Venus_Themes.UserControls
             set => SetValue(VCEOutDoorIsOpenProperty, value);
         }
 
+        public static readonly DependencyProperty IsVentingProperty = DependencyProperty.Register(
+    "IsVenting", typeof(bool), typeof(Vce));
+        public bool IsVenting
+        {
+
+            get => (bool)GetValue(IsVentingProperty);
+            set => SetValue(IsVentingProperty, value);
+        }
+
+
+        public static readonly DependencyProperty VCENameProperty = DependencyProperty.Register("VCEName", typeof(string), typeof(Vce));
+        public string VCEName
+        {
+            get => (string)GetValue(VCENameProperty);
+            set => SetValue(VCENameProperty, value);
+        }
+
+        public static readonly DependencyProperty PressureValueProperty = DependencyProperty.Register(
+       "PressureValue", typeof(double), typeof(Vce));
+
+        public double PressureValue
+        {
+            get { return (double)this.GetValue(PressureValueProperty); }
+            set { this.SetValue(PressureValueProperty, value); }
+        }
+
+        public static readonly DependencyProperty PercentValueProperty = DependencyProperty.Register(
+       "PercentValue", typeof(double), typeof(Vce), new PropertyMetadata(0.0, OnDataChanged));
+        private static void OnDataChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            if (d is Vce chamber)
+            {
+
+                DoubleAnimation doubleAnimation = new DoubleAnimation((double)e.OldValue, (double)e.NewValue, new Duration(TimeSpan.FromSeconds(1)));
+                chamber.rec_Water.BeginAnimation(HeightProperty, doubleAnimation);
+            }
+        }
+        public double PercentValue
+        {
+            get { return (double)GetValue(PercentValueProperty); }
+            set
+            {
+
+                SetValue(PercentValueProperty, value);
+            }
+        }
+
     }
 }