示例#1
0
        public void SetProcessParameterValueTest()
        {
            Brew   brew      = new Brew("01/01/2016", "Maltina", "258");
            string paramName = MashCopperProcessParameters.MashingInStartTime.ToString();

            brew.SetProcessParameterValue(ProcessEquipment.MashCopper, paramName, "12:00");

            string paramValue = brew.GetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInStartTime.ToString());

            Assert.AreEqual("12:00", paramValue);
        }
        public void DatasourceSaveBrewTestCase()
        {
            //CreateAndAddPeriodTestCase();

            XlDatasource xlDatasource = new XlDatasource(connectionString, templateFilePath);

            xlDatasource.LoadPeriods();

            Brew brew = new Brew("01.01.2018", "Amstel", "AM18007");

            brew.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInStartTime.ToString(), "01.01.2018 12:00:00");
            brew.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInEndTime.ToString(), "01.01.2018 12:40:00");

            string month = brew.Month;

            xlDatasource.SaveBrew(brew);
            Period period = xlDatasource.GetPeriod(brew);

            Assert.AreEqual("2018-January", period.PeriodName);
        }
        public void PeriodUpdateBrewTestCase()
        {
            //CreateAndAddPeriodTestCase();

            XlDatasource xlDatasource = new XlDatasource(connectionString, templateFilePath);

            xlDatasource.LoadPeriods();

            Brew brew = new Brew("01.01.2018", "Amstel", "AM18007");

            brew.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInStartTime.ToString(), "01.01.2018 12:00:00");
            brew.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInEndTime.ToString(), "01.01.2018 12:30:00");

            Period period       = xlDatasource.GetPeriod("2018", Month.January);
            int    oldBrewCount = period.Brews.Count;

            period.UpdateBrew(brew);

            Assert.AreEqual("2018-January", period.PeriodName);
            Assert.AreEqual(oldBrewCount, period.Brews.Count);
        }
        private void SetCastingStartTime(string endTime, WortCopper wortCopper, Brew brew,
                                         WortCopperProcessParameters paramToCheck,
                                         WortCopperProcessParameters paramToChange,
                                         IWortCopperState newState)
        {
            string brandName = brew.BrandName;
            string wortCopperParamToCheckValue = brew.GetProcessParameterValue(ProcessEquipment.WortCopper,
                                                                               paramToCheck.ToString());

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

                //Set new state
                wortCopper.SetState(newState);
                //Console.WriteLine("New state is: " + newStateString);
            }
        }
        protected void SetProcessStepEndTime(string endTime, MashTun mashTun, Brew brew,
                                             MashTunProcessParameters paramToCheck,
                                             MashTunProcessParameters paramToChange,
                                             IMashTunState newState)
        {
            string brandName         = brew.BrandName;
            string paramToCheckValue = brew.GetProcessParameterValue(ProcessEquipment.MashTun,
                                                                     paramToCheck.ToString());

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

                //Set new state
                //string newStateString =
                mashTun.SetState(newState);
                //Console.WriteLine("New state is: " + newStateString);
            }
        }
示例#6
0
        protected void SetProcessStepEndTime(string endTime, Whirlpool wortCopper, Brew brew,
                                             WhirlpoolProcessParameters paramToCheck,
                                             WhirlpoolProcessParameters paramToChange,
                                             IWhirlpoolState newState)
        {
            string brandName         = brew.BrandName;
            string paramToCheckValue = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool,
                                                                     paramToCheck.ToString());

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

                //Set new state
                //string newStateString =
                wortCopper.SetState(newState);
                //Console.WriteLine("New state is: " + newStateString);
            }
        }
        public void SetProcessStepEndTimeTestCase()
        {
            Brew       brew       = new Brew("01/01/2016", "Maltina", "258");
            MashCopper mashCopper = new MashCopper(brew);

            brew.SetProcessParameterValue(ProcessEquipment.MashCopper,
                                          MashCopperProcessParameters.HeatingUp1EndTime.ToString(),
                                          "10:00");

            string checkValue = brew.GetProcessParameterValue(ProcessEquipment.MashCopper,
                                                              MashCopperProcessParameters.HeatingUp1EndTime.ToString());


            MashCopperRest1State mashCopperRest1State = new MashCopperRest1State();
            //mashCopperRest1State.SetEndTime("12:00", mashCopper, brew);



            string paraValue = brew.GetProcessParameterValue(ProcessEquipment.MashCopper,
                                                             MashCopperProcessParameters.Rest1EndTime.ToString());

            Assert.AreEqual("12:00", paraValue);
        }
 public void SetSacharificationRestTemperature(string temperature, MashTun mashTun, Brew brew)
 {
     brew.SetProcessParameterValue(ProcessEquipment.MashTun,
                                   MashTunProcessParameters.SacharificationRestTemperature.ToString(),
                                   temperature);
 }
示例#9
0
 public void SetProteinRestTemperature(string temperature, MashCopper mashCopper, Brew brew)
 {
     brew.SetProcessParameterValue(ProcessEquipment.MashCopper,
                                   MashCopperProcessParameters.ProteinRestTemperature.ToString(),
                                   temperature);
 }
示例#10
0
        //public int GetBrewingFormSheetColumnNumber(IBrew brew)
        //{
        //    using (xlPackage = new ExcelPackage(fileInfo))
        //    {
        //        xlBrewingFormWorksheet = xlPackage.Workbook.Worksheets[brewingFormSheetName];

        //        for (int column = 3; column <= xlBrewingFormWorksheet.Dimension.Columns; column++)
        //        {
        //            if (xlBrewingFormWorksheet.Cells[4, column].Value != null && brew.BrewNumber == xlBrewingFormWorksheet.Cells[4, column].Value.ToString())
        //            {
        //                return column;
        //            }
        //        }
        //        return 0;
        //    }
        //}

        private Brew GetBrewParametersFromWorkSheet(IBrew brew)
        {
            int  columnIndex        = GetColumnNumber(brew);
            Brew brewWithParameters = new Brew();

            using (xlPackage = new ExcelPackage(fileInfo))
            {
                xlRawDataWorksheet = xlPackage.Workbook.Worksheets[rawDataSheetName];

                if (columnIndex > 0)
                {
                    ExcelWorksheet rawDataWorksheet = xlPackage.Workbook.Worksheets[rawDataSheetName];
                    // Get Headers
                    string startDate  = rawDataWorksheet.Cells[2, columnIndex].Value.ToString();
                    string brandName  = rawDataWorksheet.Cells[3, columnIndex].Value.ToString();
                    string brewNumber = rawDataWorksheet.Cells[4, columnIndex].Value.ToString();
                    string startTime  = rawDataWorksheet.Cells[5, columnIndex].Value.ToString();

                    brewWithParameters = new Brew(startDate, brandName, brewNumber);
                    //brew.StartTime = startTime;

                    // Get process parameter values
                    // Mash Copper process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInStartTime.ToString(), rawDataWorksheet.Cells[6, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.MashingInEndTime.ToString(), rawDataWorksheet.Cells[7, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.ProteinRestEndTime.ToString(), rawDataWorksheet.Cells[8, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp1EndTime.ToString(), rawDataWorksheet.Cells[9, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.Rest1EndTime.ToString(), rawDataWorksheet.Cells[10, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp2EndTime.ToString(), rawDataWorksheet.Cells[11, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.Rest2EndTime.ToString(), rawDataWorksheet.Cells[12, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.TransferToMtEndTime.ToString(), rawDataWorksheet.Cells[13, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.ProteinRestTemperature.ToString(), rawDataWorksheet.Cells[14, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp1Temperature.ToString(), rawDataWorksheet.Cells[15, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp2Temperature.ToString(), rawDataWorksheet.Cells[16, columnIndex].Value.ToString());

                    // Mash Tun process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.MashingInStartTime.ToString(), rawDataWorksheet.Cells[17, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.MashingInEndTime.ToString(), rawDataWorksheet.Cells[18, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.ProteinRestEndTime.ToString(), rawDataWorksheet.Cells[19, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.SacharificationRestEndTime.ToString(), rawDataWorksheet.Cells[20, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.HeatingUpEndTime.ToString(), rawDataWorksheet.Cells[21, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.MashTunReadyAt.ToString(), rawDataWorksheet.Cells[22, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.ProteinRestTemperature.ToString(), rawDataWorksheet.Cells[23, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.SacharificationRestTemperature.ToString(), rawDataWorksheet.Cells[24, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.HeatingUpTemperature.ToString(), rawDataWorksheet.Cells[25, columnIndex].Value.ToString());

                    // Mash Filter process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.PrefillingStartTime.ToString(), rawDataWorksheet.Cells[26, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.PrefillingEndTime.ToString(), rawDataWorksheet.Cells[27, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.WeakWortTransferEndTime.ToString(), rawDataWorksheet.Cells[28, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.MainMashFiltrationEndTime.ToString(), rawDataWorksheet.Cells[29, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.SpargingEndTime.ToString(), rawDataWorksheet.Cells[30, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.SpargingToWWTEndTime.ToString(), rawDataWorksheet.Cells[31, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.ExtraSpargingEndTime.ToString(), rawDataWorksheet.Cells[32, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.DrippingEndTime.ToString(), rawDataWorksheet.Cells[33, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.SpentGrainDischargeEndTime.ToString(), rawDataWorksheet.Cells[34, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.MashFilter, MashFilterProcessParameters.ReadyAtTime.ToString(), rawDataWorksheet.Cells[35, columnIndex].Value.ToString());

                    // Holding Vessel process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.FillingStartTime.ToString(), rawDataWorksheet.Cells[36, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.TransferToWcEndTime.ToString(), rawDataWorksheet.Cells[37, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.EmptyAtTime.ToString(), rawDataWorksheet.Cells[38, columnIndex].Value.ToString());

                    // Wort Copper process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.HeatingStartTime.ToString(), rawDataWorksheet.Cells[39, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.HeatingStartTime.ToString(), rawDataWorksheet.Cells[40, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.BoilingEndTime.ToString(), rawDataWorksheet.Cells[41, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.ExtraBoilingEndTime.ToString(), rawDataWorksheet.Cells[42, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.CastingStartTime.ToString(), rawDataWorksheet.Cells[43, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.CastingEndTime.ToString(), rawDataWorksheet.Cells[44, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.VolumeBeforeBoiling.ToString(), rawDataWorksheet.Cells[45, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.VolumeAfterBoiling.ToString(), rawDataWorksheet.Cells[46, columnIndex].Value.ToString());

                    // Whirpool process parameters
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CastingStartTime.ToString(), rawDataWorksheet.Cells[47, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CastingEndTime.ToString(), rawDataWorksheet.Cells[48, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.RestingEndTime.ToString(), rawDataWorksheet.Cells[49, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CoolingEndTime.ToString(), rawDataWorksheet.Cells[50, columnIndex].Value.ToString());
                    brewWithParameters.SetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.ReadyAtTime.ToString(), rawDataWorksheet.Cells[51, columnIndex].Value.ToString());
                }

                return(brewWithParameters);
            }
        }
示例#11
0
 public void SetHeatingUpTemperature(string temperature, MashTun mashTun, Brew brew)
 {
     brew.SetProcessParameterValue(ProcessEquipment.MashTun,
                                   MashTunProcessParameters.HeatingUpTemperature.ToString(),
                                   temperature);
 }