using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Aitex.Core.Util; using Aitex.Core.WCF; using MECF.Framework.Common.CommonData; using MECF.Framework.Common.Equipment; namespace MECF.Framework.Common.ParameterCenter { public class ParameterClient : Singleton { public bool InProcess { get; set; } private IParameterService _service; public IParameterService Service { get { if (_service == null) { if (InProcess) _service = new ParameterService(); else _service = new ParameterServiceClient(); } return _service; } } } public class ParameterServiceClient : ServiceClientWrapper, IParameterService { public ParameterServiceClient() : base("Client_IParameterService", "ParameterService") { } public string LoadParameter(ModuleName chamId, string recipeName) { string result = null; Invoke(svc => { result = svc.LoadParameter(chamId, recipeName); }); return result; } public Tuple LoadRunTimeParameterInfo(ModuleName chamId) { Tuple result = null; Invoke(svc => { result = svc.LoadRunTimeParameterInfo(chamId); }); return result; } public IEnumerable GetParameters(ModuleName chamId, bool includeUsedRecipe) { IEnumerable result = null; Invoke(svc => { result = svc.GetParameters(chamId, includeUsedRecipe); }); return result; } public string GetXmlParameterList(ModuleName chamId, bool includeUsedParameter) { string result = null; Invoke(svc => { result = svc.GetXmlParameterList(chamId, includeUsedParameter); }); return result; } public bool DeleteParameter(ModuleName chamId, string recipeName) { bool result = false; Invoke(svc => { result = svc.DeleteParameter(chamId, recipeName); }); return result; } public bool DeleteFolder(ModuleName chamId, string folderName) { bool result = false; Invoke(svc => { result = svc.DeleteFolder(chamId, folderName); }); return result; } public bool SaveAsParameter(ModuleName chamId, string recipeName, string recipeContent) { bool result = false; Invoke(svc => { result = svc.SaveAsParameter(chamId, recipeName, recipeContent); }); return result; } public bool SaveParameter(ModuleName chamId, string recipeName, string recipeContent) { bool result = false; Invoke(svc => { result = svc.SaveParameter(chamId, recipeName, recipeContent); }); return result; } public bool CreateFolder(ModuleName chamId, string folderName) { bool result = false; Invoke(svc => { result = svc.CreateFolder(chamId, folderName); }); return result; } public bool RenameParameter(ModuleName chamId, string oldName, string newName) { bool result = false; Invoke(svc => { result = svc.RenameParameter(chamId, oldName, newName); }); return result; } public bool BackupParameter(string fileOriginalPath, string fileDestinationPath, bool isSaveLinkRecipe, List recipeNames) { bool result = false; Invoke(svc => { result = svc.BackupParameter(fileOriginalPath, fileDestinationPath, isSaveLinkRecipe,recipeNames); }); return result; } public bool CheckBackParameterIsLinkParameter(string fileOriginalPath, List recipeNames) { bool result = false; Invoke(svc => { result = svc.CheckBackParameterIsLinkParameter(fileOriginalPath, recipeNames); }); return result; } public List RestoreParameterFolderList() { List result = new List(); Invoke(svc => { result = svc.RestoreParameterFolderList(); }); return result; } public string GetXmlRestoreParameterList(string fileType, bool includeUsedRecipe) { string result = null; Invoke(svc => { result = svc.GetXmlRestoreParameterList(fileType, includeUsedRecipe); }); return result; } public string LoadRestoreParameter(string pathName, string recipeName) { string result = null; Invoke(svc => { result = svc.LoadRestoreParameter(pathName, recipeName); }); return result; } public bool RestoreParameter(string chamId,bool isSaveLink, List recipeNames) { bool result = false; Invoke(svc => { result = svc.RestoreParameter(chamId, isSaveLink,recipeNames); }); return result; } public bool SigRestoreParameter(string chamId, List recipeNames) { bool result = false; Invoke(svc => { result = svc.SigRestoreParameter(chamId, recipeNames); }); return result; } public bool RenameFolder(ModuleName chamId, string oldName, string newName) { bool result = false; Invoke(svc => { result = svc.RenameFolder(chamId, oldName, newName); }); return result; } public string GetParameterFormatXml(string chamId) { string result = null; Invoke(svc => { result = svc.GetParameterFormatXml(chamId); }); return result; } public Dictionary> GetGroupParameterTemplate() { Dictionary> result = null; Invoke(svc => { result = svc.GetGroupParameterTemplate(); }); return result; } public string GetParameterTemplate(ModuleName chamId) { string result = string.Empty; Invoke(svc => { result = svc.GetParameterTemplate(chamId); }); return result; } public string GetParameterByBarcode(ModuleName chamId, string barcode) { string result = string.Empty; Invoke(svc => { result = svc.GetParameterByBarcode(chamId, barcode); }); return result; } #region extended recipe interface public string LoadParameterByPath(string pathName, string recipeName) { string result = null; Invoke(svc => { result = svc.LoadParameterByPath(pathName, recipeName); }); return result; } public Tuple LoadRunTimeParameterInfoByPath(string pathName) { Tuple result = null; Invoke(svc => { result = svc.LoadRunTimeParameterInfoByPath(pathName); }); return result; } public IEnumerable GetParametersByPath(string pathName, bool includeUsedRecipe) { IEnumerable result = null; Invoke(svc => { result = svc.GetParametersByPath(pathName, includeUsedRecipe); }); return result; } public string GetXmlParameterListByPath(string pathName, bool includeUsedRecipe) { string result = null; Invoke(svc => { result = svc.GetXmlParameterListByPath(pathName, includeUsedRecipe); }); return result; } public List GetFileNodeParameterListByPath(string pathName) { List result = null; Invoke(svc => { result = svc.GetFileNodeParameterListByPath(pathName); }); return result; } public bool DeleteParameterByPath(string pathName, string recipeName) { bool result = false; Invoke(svc => { result = svc.DeleteParameterByPath(pathName, recipeName); }); return result; } public bool DeleteFolderByPath(string pathName, string folderName) { bool result = false; Invoke(svc => { result = svc.DeleteFolderByPath(pathName, folderName); }); return result; } public bool SaveAsParameterByPath(string pathName, string recipeName, string recipeContent) { bool result = false; Invoke(svc => { result = svc.SaveAsParameterByPath(pathName, recipeName, recipeContent); }); return result; } public bool SaveParameterByPath(string pathName, string recipeName, string recipeContent) { bool result = false; Invoke(svc => { result = svc.SaveParameterByPath(pathName, recipeName, recipeContent); }); return result; } public bool CreateFolderByPath(string pathName, string folderName) { bool result = false; Invoke(svc => { result = svc.CreateFolderByPath(pathName, folderName); }); return result; } public bool RenameParameterByPath(string pathName, string oldName, string newName) { bool result = false; Invoke(svc => { result = svc.RenameParameterByPath(pathName, oldName, newName); }); return result; } public bool RenameFolderByPath(string pathName, string oldName, string newName) { bool result = false; Invoke(svc => { result = svc.RenameFolderByPath(pathName, oldName, newName); }); return result; } public string GetParameterFormatXmlByPath(string pathName) { string result = null; Invoke(svc => { result = svc.GetParameterFormatXmlByPath(pathName); }); return result; } public string GetParameterTemplateByPath(string pathName) { string result = string.Empty; Invoke(svc => { result = svc.GetParameterTemplateByPath(pathName); }); return result; } public string GetParameterByBarcodeByPath(string pathName, string barcode) { string result = string.Empty; Invoke(svc => { result = svc.GetParameterByBarcodeByPath(pathName, barcode); }); return result; } public List CheckParameter(string prefix, string recipeName) { List result = null; Invoke(svc => { result = svc.CheckParameter(prefix, recipeName); }); return result; } public bool GetParameterChecked(string prefix, string recipeName) { bool result = false; Invoke(svc => { result = svc.GetParameterChecked(prefix, recipeName); }); return result; } #endregion } }