示例#1
0
 public void SetState(IMashCopperState newState)
 {
     _currentState = newState;
     _currentState.OnEntry(this, _brew);
     PrintCurrentState();
     //return _currentState.ToString();
 }
示例#2
0
 public void SetEndTime(string paramText, string endTime, MashCopper mashCopper, Brew brew)
 {
     if (paramText.Equals("Protein Rest Time - Finish"))
     {
         MashCopperProcessParameters paramToCheck  = MashCopperProcessParameters.MashingInEndTime;
         MashCopperProcessParameters paramToChange = MashCopperProcessParameters.ProteinRestEndTime;
         IMashCopperState            newState      = mashCopper.HeatingUp1State;
         SetProcessStepEndTime(endTime, mashCopper, brew, paramToCheck, paramToChange, newState);
     }
 }
 public void SetEndTime(string paramText, string endTime, MashCopper mashCopper, Brew brew)
 {
     if (paramText.Equals("Mash Transfer to MT - Finish"))
     {
         MashCopperProcessParameters paramToCheck  = MashCopperProcessParameters.Rest2EndTime;
         MashCopperProcessParameters paramToChange = MashCopperProcessParameters.TransferToMtEndTime;
         IMashCopperState            newState      = mashCopper.IdleState;
         SetProcessStepEndTime(endTime, mashCopper, brew, paramToCheck, paramToChange, newState);
     }
 }
示例#4
0
 public void SetEndTime(string paramText, string endTime, MashCopper mashCopper, Brew brew)
 {
     if (paramText.Equals("Heating Time - Finish 2"))
     {
         MashCopperProcessParameters paramToCheck  = MashCopperProcessParameters.Rest1EndTime;
         MashCopperProcessParameters paramToChange = MashCopperProcessParameters.HeatingUp2EndTime;
         IMashCopperState            newState      = mashCopper.Rest2State;
         SetProcessStepEndTime(endTime, mashCopper, brew, paramToCheck, paramToChange, newState);
     }
 }
示例#5
0
        public MashCopper()
        {
            _brew                       = new Brew();
            _idleState                  = new MashCopperIdleState();
            _mashingInState             = new MashCopperMashingInState();
            _proteinRestState           = new MashCopperProteinRestState();
            _heatingUp1State            = new MashCopperHeatingUp1State();
            _rest1State                 = new MashCopperRest1State();
            _heatingUp2State            = new MashCopperHeatingUp2State();
            _rest2State                 = new MashCopperRest2State();
            _mashTransferToMashTunState = new MashCopperMashTransferToMashTunState();
            //_emptyState = new MashCopperEmptyState();

            _currentState = _idleState;
            //_currentState.InitBrew(this, _brew);
        }
        protected void SetProcessStepEndTime(string endTime, MashCopper mashCopper, Brew brew,
                                             MashCopperProcessParameters paramToCheck,
                                             MashCopperProcessParameters paramToChange,
                                             IMashCopperState newState)
        {
            string brandName         = brew.BrandName;
            string paramToCheckValue = brew.GetProcessParameterValue(ProcessEquipment.MashCopper,
                                                                     paramToCheck.ToString());

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

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