12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Xml;
- using Aitex.Common.Util;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.Log;
- using Aitex.Core.Util;
- using MECF.Framework.Common.RecipeCenter;
- namespace VirgoRT.Modules.PMs
- {
- public class VirgoSequenceFileContext : ISequenceFileContext
- {
- public string GetConfigXml()
- {
- try
- {
- string configContent = PathManager.GetCfgDir() + @"\SequenceFormat.xml";
- XmlDocument xmlDom = new XmlDocument();
- xmlDom.Load(configContent);
- CustomSequenceItem(xmlDom);
- return xmlDom.OuterXml;
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- return "";
- }
- }
- public virtual bool Validation(string content)
- {
- try
- {
- XmlDocument xmlDom = new XmlDocument();
- xmlDom.LoadXml(content);
- CustomValidation(xmlDom);
- return CustomValidation(xmlDom);
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- EV.PostWarningLog("Recipe", "sequence file not valid, " + ex.Message);
- return false;
- }
- }
- public bool EnableEdit(string sequencePathName)
- {
- if (Singleton<RouteManager>.Instance.CheckSequenceUsedInJob(sequencePathName))
- {
- EV.PostWarningLog("System", "Sequence is used in auto running jobs, can not be modified");
- return false;
- }
- return true;
- }
- public virtual void CustomSequenceItem(XmlDocument xmlContent)
- {
- }
- public virtual bool CustomValidation(XmlDocument xmlContent)
- {
- return true;
- }
- }
- }
|