瀏覽代碼

fix exception:
1.socket exception cause by cometRF
2.cannot access configfile caused by SystemConfigManager
3.file path don't exist caused by SchedulerPM

hecl 1 年之前
父節點
當前提交
9a410e084a

+ 3 - 2
Venus/Framework/Common/SCCore/SystemConfigManager.cs

@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Net.Security;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
@@ -151,7 +152,7 @@ namespace MECF.Framework.Common.SCCore
             {
                 var _sc_stream = File.Open(xmlFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);
                 xml.Load(_sc_stream);
-
+                _sc_stream.Close();
                 XmlNodeList nodeConfigs = xml.SelectNodes("root/configs");
                 foreach (XmlElement nodeConfig in nodeConfigs)
                 {
@@ -241,7 +242,7 @@ namespace MECF.Framework.Common.SCCore
                     XmlDocument xmlData = new XmlDocument();
                     var _sc_stream = File.Open(_scDataFile, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read);
                     xmlData.Load(_sc_stream);
-
+                    _sc_stream.Close();
                     XmlNodeList scdatas = xmlData.SelectNodes("root/scdata");
                     foreach (XmlElement nodedata in scdatas)
                     {

+ 1 - 1
Venus/Venus_MainPages/Views/OverVenusDEView.xaml

@@ -1669,7 +1669,7 @@
         <Ellipse Width="20" Height="20" Fill="{Binding BRFData.IsRfOn,Converter={StaticResource boolToColor}}"  Canvas.Left="500" Canvas.Top="514" Stroke="Silver" StrokeThickness="2" HorizontalAlignment="Center" VerticalAlignment="Top"/>
         <Button Height="20" Width="100" Content="BRF ON/OFF" Canvas.Left="530" Canvas.Top="514" Command="{Binding SetBRfCommand}"  Style="{StaticResource SysBtnStyle}"  IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
         <!--<Ellipse Width="20" Height="20" Fill="{Binding MagnetData.IsMagnetOn,Converter={StaticResource boolToColor}}"  Canvas.Left="501" Canvas.Top="374" Stroke="Silver" StrokeThickness="2" HorizontalAlignment="Left" VerticalAlignment="Top"/>-->
-        <Button Height="20" Width="100" Content="Set Magnet" Canvas.Left="530" Canvas.Top="374" Command="{Binding SetMagnetCommand}"  Style="{StaticResource SysBtnStyle}"  IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
+        <Button Height="20" Width="100" Content="SET MAGNET" Canvas.Left="530" Canvas.Top="374" Command="{Binding SetMagnetCommand}"  Style="{StaticResource SysBtnStyle}"  IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}" HorizontalAlignment="Center" VerticalAlignment="Top"/>
 
         <Ellipse Width="20" Height="20" Fill="{Binding ESCHVData.IsOn,Converter={StaticResource boolToColor}}" Canvas.Left="501" Canvas.Top="247" Stroke="Silver" StrokeThickness="2"/>
         <Button Height="20" Width="100" Content="HV ON/OFF" Canvas.Left="531" Canvas.Top="247" Command="{Binding HVCommand}" CommandParameter="True" Style="{StaticResource SysBtnStyle}"  IsEnabled="{Binding IsAutoMode,Converter={StaticResource BoolToBool}}"/>

+ 5 - 1
Venus/Venus_RT/Devices/CometRF.cs

@@ -446,7 +446,11 @@ namespace Venus_RT.Devices
                 }
 
             });
-            thread.Start();
+            if (IsConnected)
+            {
+                thread.Start();
+            }
+            
             return true;
         }
 

+ 2 - 0
Venus/Venus_RT/Devices/IODevices/IoMagnet.cs

@@ -211,10 +211,12 @@ namespace Venus_RT.Devices.IODevices
         }
         public void Reset()
         {
+            _SetRealFloat(_aoMagnetintensity, 0);
         }
 
         public void Terminate()
         {
+            _SetRealFloat(_aoMagnetintensity, 0);
         }
     }
 }

+ 9 - 5
Venus/Venus_RT/Modules/Schedulers/SchedulerPM.cs

@@ -425,13 +425,17 @@ namespace Venus_RT.Scheduler
 
             // validate the idle clean recipe name
             string path = Path.Combine("Recipes", Module.ToString(), "Clean", $"{_idleCleanRecipe}.rcp");
-            string recipeContent = RecipeFileManager.Instance.LoadRecipeByPath(path);
-            
-            Recipe recipe = Recipe.Load(recipeContent);
-            if (recipe == null)
+            if (File.Exists(path))
             {
-                _idleCleanRecipe = string.Empty;
+                string recipeContent = RecipeFileManager.Instance.LoadRecipeByPath(path);
+
+                Recipe recipe = Recipe.Load(recipeContent);
+                if (recipe == null)
+                {
+                    _idleCleanRecipe = string.Empty;
+                }
             }
+
         }
 
         public void WaferProcessDone()