예제 #1
0
 public void SetState(IHoldingVesselState newState)
 {
     _currentState = newState;
     _currentState.OnEntry(this, _brew);
     PrintCurrentState();
     //return _currentState.ToString();
 }
예제 #2
0
 public void SetEndTime(string paramText, string endTime, HoldingVessel holdingVessel, Brew brew)
 {
     if (paramText.Equals("Holding Vessle empty at - Finish"))
     {
         HoldingVesselProcessParameters paramToCheck  = HoldingVesselProcessParameters.TransferToWcEndTime;
         HoldingVesselProcessParameters paramToChange = HoldingVesselProcessParameters.EmptyAtTime;
         IHoldingVesselState            newState      = holdingVessel.IdleState;
         SetProcessStepEndTime(endTime, holdingVessel, brew, paramToCheck, paramToChange, newState);
     }
 }
예제 #3
0
        public HoldingVessel()
        {
            _brew         = new Brew();
            _idleState    = new HoldingVesselIdleState();
            _fillingState = new HoldingVesselFillingState();
            //_transferToWcState = new HoldingVesselTransferToWcState();
            _rinsingState = new HoldingVesselRinsingState();

            _currentState = _idleState;
        }
 public void SetEndTime(string paramText, string endTime, HoldingVessel holdingVessel, Brew brew)
 {
     if (paramText.Equals("Transfer Time (WC) - Finish"))
     {
         HoldingVesselProcessParameters paramToCheck  = HoldingVesselProcessParameters.FillingStartTime;
         HoldingVesselProcessParameters paramToChange = HoldingVesselProcessParameters.TransferToWcEndTime;
         IHoldingVesselState            newState      = holdingVessel.RinsingState;
         SetProcessStepEndTime(endTime, holdingVessel, brew, paramToCheck, paramToChange, newState);
     }
 }
예제 #5
0
        public HoldingVessel(Brew brew)
        {
            _brew         = brew;
            _idleState    = new HoldingVesselIdleState();
            _fillingState = new HoldingVesselFillingState();
            //_transferToWcState = new HoldingVesselTransferToWcState();
            _rinsingState = new HoldingVesselRinsingState();

            _currentState = _idleState;
            _currentState.InitBrew(this, _brew);
        }
예제 #6
0
        protected void SetProcessStepEndTime(string endTime, HoldingVessel holdingVessel, Brew brew,
                                             HoldingVesselProcessParameters paramToCheck,
                                             HoldingVesselProcessParameters paramToChange,
                                             IHoldingVesselState newState)
        {
            string brandName         = brew.BrandName;
            string paramToCheckValue = brew.GetProcessParameterValue(ProcessEquipment.HoldingVessel,
                                                                     paramToCheck.ToString());

            //Complete process step
            if (brandName.Length > 0 &&
                paramToCheckValue.Length > 0)
            {
                Brew   nBrew     = holdingVessel.Brew;
                string paramName = paramToChange.ToString();
                nBrew.SetProcessParameterValue(ProcessEquipment.HoldingVessel, paramName, endTime);

                //Set new state
                //string newStateString =
                holdingVessel.SetState(newState);
                //Console.WriteLine("New state is: " + newStateString);
            }
        }