| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using Aitex.Core.RT.Log;using MECF.Framework.Common.Routine;using MECF.Framework.Common.Equipment;using MECF.Framework.Common.Jobs;using Venus_Core;namespace Aitex.Core.RT.Routine{    public interface IRoutine    {        RState Start(params object[] objs);        RState Monitor();        void Abort();    }    public interface ICycle : IRoutine    {         SequenceLLInOutPath LLInOutPath { get; }         bool HasJobRunning { get; }         RState CycleState { get; }        bool AbortJob(string jobName,out string reason);        bool StopJob(string jobName,out string reason);        bool ResumeJob(string jobName,out string reason);        bool PauseJob(string jobName,out string reason);        bool StartJob(string jobName,out string reason);        bool CreateJob(Dictionary<string, object> param,out string reason);        void Clear();        bool ManualReturnWafer(object[] objs);        RState CheckManualReturnWafer();        RState ReturnAllWafers();        bool CheckJobJustDone(out string sJobName);        bool CheckAllJobDone();    }    public class ModuleRoutineBase    {        public ModuleName Module { get; set; }        public string Name { get; set; }        public bool NullFun() => true;        protected RoutineRunner Runner = new RoutineRunner();        protected readonly int _delay_5ms = 5;        protected readonly int _delay_50ms = 50;        protected readonly int _delay_1s = 1000;        protected readonly int _delay_2s = 2000;        protected readonly int _delay_3s = 3000;        protected readonly int _delay_4s = 4000;        protected readonly int _delay_5s = 5000;        protected readonly int _delay_10s = 10000;        protected readonly int _delay_20s = 20000;        protected readonly int _delay_30s = 30000;        protected readonly int _delay_60s = 60000;        protected readonly int _delay_2m = 120000;        protected readonly int _delay_3m = 180000;        protected readonly int _delay_5m = 300000;        public ModuleRoutineBase(ModuleName module)        {            Module = module;            Runner.Reset();        }        protected void Notify(string message)        {            LOG.Write(eEvent.EV_ROUTINE_NOTIFY, Module, Name, message);        }        protected void Warn(string warningMessage)        {            LOG.Write(eEvent.WARN_ROUTER, Module, Name, warningMessage);        }        protected void Stop(string failReason)        {            LOG.Write(eEvent.ERR_ROUTINE_FAILED, Module, Name, failReason);        }        public void Reset()        {            Runner.Reset();        }    }}
 |