Browse Source

1.修改日志目录(日志压缩)
2.修改process history 显示lot id
3.Event log 显示30条

JET-YDB\JET-YANGDB 6 months ago
parent
commit
baa9d17f70

+ 3 - 1
FrameworkLocal/Common/Log/LogCleaner.cs

@@ -15,6 +15,7 @@ namespace MECF.Framework.Common.Log
     public class LogCleaner
     {
         PeriodicJob _threadDeleteLogs;
+        private string _logFilePath;
 
         /// <summary>
         /// LogCleaner 构造函数
@@ -39,6 +40,7 @@ namespace MECF.Framework.Common.Log
             {
                 SingleLogFileMaxSize = SC.GetValue<int>("System.SingleLogFileMaxSize");
             }
+            _logFilePath = SC.GetStringValue("System.LogFilePath");
         }
 
         /// <summary>
@@ -87,7 +89,7 @@ namespace MECF.Framework.Common.Log
             try
             {
 
-                string path = PathManager.GetLogDir();
+                string path = PathManager.IsValidDirectoryPath(_logFilePath) ? _logFilePath : PathManager.GetLogDir();
                 FileInfo[] fileInfos;
                 DirectoryInfo curFolderInfo = new DirectoryInfo(path);
                 fileInfos = curFolderInfo.GetFiles();

+ 4 - 0
FrameworkLocal/Common/Log/LogManager.cs

@@ -36,6 +36,10 @@ namespace Aitex.Core.RT.Log
 
             //LOG.Write($"RT {s1} launch ...");
         }
+        public void InitLogDirectory()
+        {
+            _writer.SetLogDirectory();
+        }
         private TypedLogWriter _logger;
         public void Initialize(string Type)
         {

+ 24 - 0
FrameworkLocal/Common/Log/LogWriter.cs

@@ -4,6 +4,10 @@ using System.Linq;
 using System.Text;
 using log4net.Core;
 using System.Reflection;
+using Aitex.Core.RT.SCCore;
+using Aitex.Common.Util;
+using log4net.Appender;
+using log4net.Config;
 
 namespace Aitex.Core.RT.Log
 {
@@ -17,6 +21,26 @@ namespace Aitex.Core.RT.Log
             defaultLogger = log4net.Core.LoggerManager.GetLogger(Assembly.GetExecutingAssembly(), "CommonLogger");
         }
 
+        public void SetLogDirectory()
+        {
+            var _logFilePath = SC.GetStringValue("System.LogFilePath");
+            if (PathManager.IsValidDirectoryPath(_logFilePath) && defaultLogger != null)
+            {
+                _logFilePath = _logFilePath.Trim('\\') + @"\log";
+                Array.ForEach(defaultLogger.Repository.GetAppenders(), p =>
+                {
+                    var appender = (RollingFileAppender)p;
+                    if (appender != null)
+                    {
+                        appender.File = _logFilePath;
+                        appender.ActivateOptions();
+                        BasicConfigurator.Configure(appender);
+                    }
+                });
+                LOG.Write($"RT launch:set log directory");
+            }
+        }
+
         string FormatLogString(LogItem logItem)
         {
             string fileName = string.Empty;

+ 11 - 0
FrameworkLocal/Common/Utilities/PathManager.cs

@@ -5,6 +5,7 @@ using System.Text;
 using System.Configuration;
 using System.IO;
 using System.Reflection;
+using System.Text.RegularExpressions;
 
 namespace Aitex.Common.Util
 {
@@ -81,6 +82,16 @@ namespace Aitex.Common.Util
             return ret;
         }
 
+        public static bool IsValidDirectoryPath(string path)
+        {
+            if (string.IsNullOrWhiteSpace(path)) return false;
+            var drive = DriveInfo.GetDrives().FirstOrDefault(p => p.Name == Path.GetPathRoot(path));
+            if (drive == null || !drive.IsReady) return false;
+            string pattern = @"^[a-zA-Z]:\\(?:[^\\:*?""<>|\r\n]+\\)*[^\\:*?""<>|\r\n]*$";
+            Regex regex = new Regex(pattern);
+            return regex.IsMatch(path);
+        }
+
         static string _appPath;
     }
 }

+ 4 - 4
FrameworkLocal/UIClient/ClientViews/DataLogs/Event/EventViewModel.cs

@@ -203,11 +203,11 @@ namespace MECF.Framework.UI.Client.CenterViews.DataLogs.Event
 
 
             PerPageItems = new ObservableCollection<PerPageItem>();
-            PerPageItems.Add(new PerPageItem() { Value = "All" });
+            //PerPageItems.Add(new PerPageItem() { Value = "All" });
             PerPageItems.Add(new PerPageItem() { Value = "30" });
-            PerPageItems.Add(new PerPageItem() { Value = "300" });
-            PerPageItems.Add(new PerPageItem() { Value = "3000" });
-            PerPageItems.Add(new PerPageItem() { Value = "30000" });
+            //PerPageItems.Add(new PerPageItem() { Value = "300" });
+            //PerPageItems.Add(new PerPageItem() { Value = "3000" });
+            //PerPageItems.Add(new PerPageItem() { Value = "30000" });
 
             _selectedPerPage = PerPageItems[0];
 

+ 1 - 0
Mars/EfemDualRT/Config/System.sccfg

@@ -24,6 +24,7 @@
 
     <config default="true" name="EnableDataClean" description="启用数据库自动删除n天前记录" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
     <config default="60" name="DataKeepDays" description="数据库数据保留天数" max="365" min="10" paramter="" tag="" unit="" type="Integer" />
+    <config default="" name="LogFilePath" description="Log File Path" max="" min="" paramter="" tag=""  unit="" type="String" />
     <config default="60" name="LogsSaveDays" description="Log文件保留天数" max="365" min="10" paramter="" tag="" unit="" type="Integer" />
     <config default="false" name="IsEnableCompressLogFileFunc" description="启用压缩log文件功能" max="0" min="0" paramter="" tag="" unit="" type="Bool" />
     <config default="200" name="SingleLogFileMaxSize" description="单个log文件最大字节数(MB),大于将被压缩" max="1000" min="50" paramter="" tag="" unit="" type="Integer" />

+ 2 - 0
Mars/EfemDualRT/Instances/ToolLoader.cs

@@ -55,6 +55,8 @@ namespace EfemDualRT.Instances
 
             Singleton<SystemConfigManager>.Instance.Initialize(PathManager.GetCfgDir() + "System.sccfg");
 
+            Singleton<LogManager>.Instance.InitLogDirectory();
+
             Singleton<DataManager>.Instance.Initialize();
 
             RecipeFileManager.Instance.Initialize(new JetVirgoPMRecipeFileContext());

+ 0 - 2
Mars/EfemDualSchedulerLib/AutoTransfer.cs

@@ -5838,7 +5838,6 @@ namespace EfemDualSchedulerLib
                                     {
                                         if (CheckWaferNeedGotoPM(pjSlotWafer.Item1, pjSlotWafer.Item2, ModuleName.PMA))
                                         {
-                                            if (!CheckWaferPmTemperatureIsOk(pjSlotWafer.Item1, pjSlotWafer.Item2)) break;
                                             return new SlotItem(pjSlotWafer.Item1, pjSlotWafer.Item2);
                                         }
                                     }
@@ -5846,7 +5845,6 @@ namespace EfemDualSchedulerLib
                                     {
                                         if (CheckWaferNeedGotoPM(pjSlotWafer.Item1, pjSlotWafer.Item2, ModuleName.PMB))
                                         {
-                                            if (!CheckWaferPmTemperatureIsOk(pjSlotWafer.Item1, pjSlotWafer.Item2)) break;
                                             return new SlotItem(pjSlotWafer.Item1, pjSlotWafer.Item2);
                                         }
                                     }

+ 4 - 6
Mars/EfemDualUI/Views/History/ProcessHistory/ProcessHistoryViewModel.cs

@@ -284,8 +284,7 @@ namespace EfemDualUI.Views.History.ProcessHistory
 
             try
             {
-                string sql = $"SELECT * FROM \"process_data\" where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
-
+                string sql = $"SELECT waferData.lot_id AS wafer_lot_id,processdata.* FROM process_data processdata LEFT JOIN wafer_data waferData ON processdata.wafer_data_guid=waferData.guid  where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
                 if (!string.IsNullOrEmpty(SelectedValuePM))
                 {
                     string[] pms = SelectedValuePM.Split(',');
@@ -323,7 +322,7 @@ namespace EfemDualUI.Views.History.ProcessHistory
                         item.Chamber = dbData.Rows[i]["process_in"].ToString();
                         item.Status = dbData.Rows[i]["process_status"].ToString();
                         item.SlotID = dbData.Rows[i]["slot_id"].ToString();
-                        item.LotID = dbData.Rows[i]["lot_id"].ToString();
+                        item.LotID = dbData.Rows[i]["wafer_lot_id"].ToString();
                         if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))
                             item.StartTime = ((DateTime)dbData.Rows[i]["process_begin_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
                         if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
@@ -658,8 +657,7 @@ namespace EfemDualUI.Views.History.ProcessHistory
 
             try
             {
-                string sql = $"SELECT * FROM \"process_data\" where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
-
+                string sql = $"SELECT waferData.lot_id AS wafer_lot_id,processdata.* FROM process_data processdata LEFT JOIN wafer_data waferData ON processdata.wafer_data_guid=waferData.guid  where \"process_begin_time\" >='{StartDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' and \"process_begin_time\" <='{EndDateTime.ToString("yyyy/MM/dd HH:mm:ss.fff")}' ";
                 if (!string.IsNullOrEmpty(SelectedValuePM))
                 {
                     string[] pms = SelectedValuePM.Split(',');
@@ -697,7 +695,7 @@ namespace EfemDualUI.Views.History.ProcessHistory
                         item.Chamber = dbData.Rows[i]["process_in"].ToString();
                         item.Status = dbData.Rows[i]["process_status"].ToString();
                         item.SlotID = dbData.Rows[i]["slot_id"].ToString();
-                        item.LotID = dbData.Rows[i]["lot_id"].ToString();
+                        item.LotID = dbData.Rows[i]["wafer_lot_id"].ToString();
                         if (!dbData.Rows[i]["process_end_time"].Equals(DBNull.Value))
                             item.EndTime = ((DateTime)dbData.Rows[i]["process_end_time"]).ToString("yyyy-MM-dd HH:mm:ss.fff");
                         if (!dbData.Rows[i]["process_begin_time"].Equals(DBNull.Value))