123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Aitex.Core.RT.Fsm;
- using Aitex.Core.Common;
- using Aitex.Core.RT.DataCenter;
- using Aitex.Core.RT.Event;
- using Aitex.Core.RT.OperationCenter;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using Aitex.Core.Util;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.SubstrateTrackings;
- using Venus_Core;
- using Venus_RT.Modules.PMs;
- namespace Venus_RT.Modules
- {
- class RouteManager : Entity, IEntity
- {
- public enum MSG
- {
- MoveWafer,
- ReturnWafer,
- HomeUnit,
- PauseAuto,
- ResumeAuto,
- Stop,
- StartCycle,
- HOME,
- RESET,
- ABORT,
- ERROR,
- SetAutoMode,
- SetManualMode,
- ResetIdleCleanTime,
- ResetIdlePurgeTime,
- CreateJob,
- PauseJob,
- ResumeJob,
- StartJob,
- StopJob,
- AbortJob,
- JobDone,
- CassetteLeave, //For unload light control off afer job done
- Map,
- ReturnAllWafer,
- }
- public PMEntity PMA { get; private set; }
- public PMEntity PMB { get; private set; }
- public string Name { get; set; }
- public RouteManager()
- {
- if (SC.GetValue<bool>("System.PMAIsInstalled"))
- PMA = new PMEntity(ModuleName.PMA);
- if (SC.GetValue<bool>("System.PMBIsInstalled"))
- PMB = new PMEntity(ModuleName.PMB);
- fsm = new StateMachine<RouteManager>(Name, (int)RtState.Init, 200);
- }
- public bool Check(int msg, out string reason, params object[] args)
- {
- if (!fsm.FindTransition(fsm.State, msg))
- {
- reason = String.Format("{0} is in {1} state,can not do {2}", Name, 0, (MSG)msg);
- return false;
- }
- if (msg == (int)MSG.StartCycle)
- {
- //if (!IsAutoMode)
- {
- reason = String.Format("can not do {0}, isn't auto mode.", msg.ToString());
- return false;
- }
- }
- reason = "";
- return true;
- }
- protected override bool Init()
- {
- PMA?.Initialize();
- PMB?.Initialize();
- return true;
- }
- }
- }
|