Пример #1
0
        /// <summary>
        /// </summary>
        /// <param name="aeqp"/>
        /// <param name="hb"/>
        /// <param name="state"/>
        /// <param name="handled"/>
        public void PROCESS_STATE_CHANGED0(AoEquipment aeqp, IHandlingBatch hb, ProcessStates state, ref bool handled)
        {
            try
            {
                string status = string.Empty;
                if (state == ProcessStates.LastLoading || state == ProcessStates.LastUnloading)
                {
                    status = LoadingStates.BUSY.ToString();
                }
                else if (state == ProcessStates.StartSetup || state == ProcessStates.EndSetup)
                {
                    status = LoadingStates.SETUP.ToString();
                }

                if (string.IsNullOrEmpty(status))
                {
                    return;
                }

                SimulationHelper.CollectEqpPlan(hb, aeqp, status);
            }
            catch (Exception e)
            {
                WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0}   MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name));
            }
        }
 public ProcessControlBlock(string pid, Priorities priority)
 {
     Pid            = pid;
     Priority       = priority;
     StatusType     = ProcessStates.Ready;
     Children       = new List <ProcessControlBlock>();
     OtherResources = new List <KeyValuePair <ResourceControlBlock, int> >();
 }
Пример #3
0
 public static bool TrySetState(ProcessStates state, object sender)
 {
     if (_owner != null && _owner != sender)
     {
         return(false);
     }
     _owner       = sender;
     CurrentState = state;
     return(true);
 }
Пример #4
0
        ProcessStates _GetNextProcessState(ProcessAction action, Processing ap)
        {
            int           channelProcess = ap.ProcessTotalLayer;
            ProcessStates state          = ProcessStates.Unaudit;
            int           currentProcess = 0;

            if (ap != null)
            {
                currentProcess = int.Parse(ap.CurLayerNO);
            }
            switch (action)
            {
            case ProcessAction.Next:
                if (currentProcess == 8)
                {
                    currentProcess = 1;
                }
                else
                {
                    currentProcess = currentProcess + 1;
                }
                break;

            case ProcessAction.Previous:
                currentProcess = currentProcess - 1;
                break;

            case ProcessAction.Restart:
                currentProcess = 0;
                break;

            case ProcessAction.SubmitSite:
                currentProcess = 1;
                state          = (ProcessStates)currentProcess;
                return(state);

                break;

            default:
                break;
            }
            if (currentProcess > channelProcess)
            {
                currentProcess = (int)ProcessStates.EndAudit;
            }
            if (currentProcess < 0)
            {
                currentProcess = 0;
            }

            state = (ProcessStates)currentProcess;
            return(state);
        }
Пример #5
0
 public void Set(ProcessStates state, string strError = "")
 {
     State = state;
     if (LastErrors.Count >= 8)
     {
         LastErrors.RemoveAt(0);
     }
     LastErrors.Add(new ProcessMessage()
     {
         When = DateTime.Now, Msg = strError
     });
 }
        /// <summary>
        /// Business or validation rule implementation.
        /// </summary>
        /// <param name="context">Rule context object.</param>
        protected override void Execute(RuleContext context)
        {
            var process = context.Target as ProcessEdit;

            if (process == null)
                return;

            IProcessStates states = new ProcessStates();

            if (process.IsStateEnabled)
                states = process.StateList;

            var configs = (ProcessSecurityConfigEditList)context.InputPropertyValues[PrimaryProperty];

            if (configs == null)
                return;

            var nonAllStateConfigs = configs.Where(c => c.StateGuid != Constants.AllStatesGuid).ToList();

            if ((from cfg in nonAllStateConfigs let foundState = states.Any(state => state.Guid == cfg.StateGuid) where foundState == false select cfg).Any())
            {
                context.AddErrorResult(PrimaryProperty, LanguageService.Translate("Rule_InvalidSecurityConfigurations"));
            }
        }
Пример #7
0
 public ProcessState(ProcessStates State, string Description)
 {
     this.State       = State;
     this.Description = Description;
 }