|
@@ -6,6 +6,7 @@ using Aitex.Core.RT.Key;
|
|
|
using Aitex.Core.RT.OperationCenter;
|
|
|
using Aitex.Core.RT.RecipeCenter;
|
|
|
using MECF.Framework.Common.Equipment;
|
|
|
+using Aitex.Core.RT.Log;
|
|
|
|
|
|
namespace MECF.Framework.Common.RecipeCenter
|
|
|
{
|
|
@@ -19,7 +20,7 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public string LoadRecipe(ModuleName chamId, string recipeName)
|
|
|
{
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Read {0} recipe {1}。",chamId, recipeName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Read {0} recipe {1}", chamId, recipeName));
|
|
|
|
|
|
return RecipeFileManager.Instance.LoadRecipe(chamId.ToString(), recipeName, false);
|
|
|
}
|
|
@@ -32,13 +33,10 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool DeleteRecipe(ModuleName chamId, string recipeName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
//if (!ChamberOperationService.IsSuperEnter()) return false;
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Delete {0} recipe {1}。",chamId, recipeName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Delete {0} recipe {1}", chamId, recipeName));
|
|
|
return RecipeFileManager.Instance.DeleteRecipe(chamId.ToString(), recipeName);
|
|
|
}
|
|
|
|
|
@@ -75,12 +73,9 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool RenameRecipe(ModuleName chamId, string oldName, string newName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Rename {0} recipe {1}为{2}。",chamId, oldName, newName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Rename {0} recipe {1}为{2}", chamId, oldName, newName));
|
|
|
//if (!ChamberOperationService.IsSuperEnter()) return false;
|
|
|
return RecipeFileManager.Instance.RenameRecipe(chamId.ToString(), oldName, newName);
|
|
|
}
|
|
@@ -93,13 +88,10 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool DeleteFolder(ModuleName chamId, string folderName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
//if (!ChamberOperationService.IsSuperEnter()) return false;
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Delete {0} recipe folder {1}。",chamId, folderName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Delete {0} recipe folder {1}", chamId, folderName));
|
|
|
return RecipeFileManager.Instance.DeleteFolder(chamId.ToString(), folderName);
|
|
|
}
|
|
|
|
|
@@ -112,12 +104,9 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool SaveRecipe(ModuleName chamId, string recipeName, string recipeContent)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Modify and save {0} recipe {1}。",chamId, recipeName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save {0} recipe {1}", chamId, recipeName));
|
|
|
return RecipeFileManager.Instance.SaveRecipe(chamId.ToString(), recipeName, recipeContent, false, false);
|
|
|
}
|
|
|
|
|
@@ -129,12 +118,9 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool MoveRecipeFile(ModuleName chamId, string recipeName, string tragetFolderName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Move {0} recipe {1}。", chamId, recipeName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Move {0} recipe {1}", chamId, recipeName));
|
|
|
return RecipeFileManager.Instance.MoveRecipeFile(chamId.ToString(), recipeName, tragetFolderName, false, false);
|
|
|
}
|
|
|
|
|
@@ -147,12 +133,9 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool SaveAsRecipe(ModuleName chamId, string recipeName, string recipeContent)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Modify and save as {0} recipe {1}。",chamId, recipeName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Modify and save as {0} recipe {1}", chamId, recipeName));
|
|
|
return RecipeFileManager.Instance.SaveAsRecipe(chamId.ToString(), recipeName, recipeContent);
|
|
|
}
|
|
|
|
|
@@ -164,12 +147,9 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool CreateFolder(ModuleName chamId, string folderName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Create {0} recipe foler {1}。",chamId, folderName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Create {0} recipe foler {1}", chamId, folderName));
|
|
|
return RecipeFileManager.Instance.CreateFolder(chamId.ToString(), folderName);
|
|
|
}
|
|
|
|
|
@@ -182,15 +162,19 @@ namespace MECF.Framework.Common.RecipeCenter
|
|
|
/// <returns></returns>
|
|
|
public bool RenameFolder(ModuleName chamId, string oldName, string newName)
|
|
|
{
|
|
|
- if (KeyManager.Instance.IsExpired)
|
|
|
- {
|
|
|
- EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
|
|
|
+ if (CheckSoftwareExpired())
|
|
|
return false;
|
|
|
- }
|
|
|
- EV.PostInfoLog(chamId.ToString(), string.Format("Rename {0} recipe folder {1} to {2}。",chamId, oldName, newName));
|
|
|
+ LOG.Write(eEvent.EV_SEQUENCE, ModuleName.System, string.Format("Rename {0} recipe folder {1} to {2}", chamId, oldName, newName));
|
|
|
return RecipeFileManager.Instance.RenameFolder(chamId.ToString(), oldName, newName);
|
|
|
}
|
|
|
|
|
|
+ private bool CheckSoftwareExpired()
|
|
|
+ {
|
|
|
+ bool isExpired = KeyManager.Instance.IsExpired;
|
|
|
+ if (isExpired)
|
|
|
+ LOG.Write(eEvent.WARN_SEQUENCE,ModuleName.System, "Software is expired. Can not do the operation");
|
|
|
+ return isExpired;
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
|
/// get reactor's recipe format define file
|