Exemplo n.º 1
0
        private void SetBrewingFormData(IBrew brew, int newColumnIndex)
        {
            using (xlPackage = new ExcelPackage(fileInfo))
            {
                ExcelWorksheet brewingFormWorksheet = xlPackage.Workbook.Worksheets[brewingFormSheetName];

                // Set Headers
                brewingFormWorksheet.Cells[1, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[2, newColumnIndex].Value = brew.StartDate;
                brewingFormWorksheet.Cells[3, newColumnIndex].Value = brew.BrandName;
                brewingFormWorksheet.Cells[4, newColumnIndex].Value = brew.BrewNumber;
                brewingFormWorksheet.Cells[5, newColumnIndex].Value = brew.StartTime;

                // Set process parameter values
                // Mash Copper process parameters
                brewingFormWorksheet.Cells[6, newColumnIndex].Value  = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.MashingInDuration.ToString()]);
                brewingFormWorksheet.Cells[7, newColumnIndex].Value  = "";
                brewingFormWorksheet.Cells[8, newColumnIndex].Value  = brew.GetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.ProteinRestTemperature.ToString());
                brewingFormWorksheet.Cells[9, newColumnIndex].Value  = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.ProteinRestDuration.ToString()]);
                brewingFormWorksheet.Cells[10, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.HeatingUp1Duration.ToString()]);
                brewingFormWorksheet.Cells[11, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp1Temperature.ToString());
                brewingFormWorksheet.Cells[12, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.Rest1Duration.ToString()]);
                brewingFormWorksheet.Cells[13, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.HeatingUp2Duration.ToString()]);
                brewingFormWorksheet.Cells[14, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.MashCopper, MashCopperProcessParameters.HeatingUp2Temperature.ToString());
                brewingFormWorksheet.Cells[15, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashCopperProcessDurations()[MashCopperProcessDurations.Rest2Duration.ToString()]);

                // Mash Tun process parameters
                brewingFormWorksheet.Cells[16, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashTunProcessDurations()[MashTunProcessDurations.MashingInDuration.ToString()]);
                brewingFormWorksheet.Cells[17, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[18, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.ProteinRestTemperature.ToString());
                brewingFormWorksheet.Cells[19, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashTunProcessDurations()[MashTunProcessDurations.ProteinRestDuration.ToString()]);
                brewingFormWorksheet.Cells[20, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashTunProcessDurations()[MashTunProcessDurations.SaccharificationDuration.ToString()]);
                brewingFormWorksheet.Cells[21, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[22, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.SacharificationRestTemperature.ToString());
                brewingFormWorksheet.Cells[23, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashTunProcessDurations()[MashTunProcessDurations.HeatingUpDuration.ToString()]);
                brewingFormWorksheet.Cells[24, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.MashTun, MashTunProcessParameters.HeatingUpTemperature.ToString());
                brewingFormWorksheet.Cells[25, newColumnIndex].Value = "";

                // Mash Filter process parameters
                brewingFormWorksheet.Cells[26, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashFilterProcessDurations()[MashFilterProcessDurations.MainWortFiltrationDuration.ToString()]);
                brewingFormWorksheet.Cells[27, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashFilterProcessDurations()[MashFilterProcessDurations.SpargingRestDuration.ToString()]);
                brewingFormWorksheet.Cells[28, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetMashFilterProcessDurations()[MashFilterProcessDurations.TotalFiltrationDuration.ToString()]);

                // Wort Copper process parameters
                brewingFormWorksheet.Cells[29, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetWortCopperProcessDurations()[WortCopperProcessDurations.HeatToBoilDuration.ToString()]);
                brewingFormWorksheet.Cells[30, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.VolumeBeforeBoiling.ToString());
                brewingFormWorksheet.Cells[31, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.WortCopper, WortCopperProcessParameters.VolumeAfterBoiling.ToString());
                brewingFormWorksheet.Cells[32, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[33, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetWortCopperProcessDurations()[WortCopperProcessDurations.BoilingDuration.ToString()]);

                // Whirpool process parameters
                brewingFormWorksheet.Cells[34, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetWhirlpoolProcessDurations()[WhirlpoolProcessDurations.CastingDuration.ToString()]);
                brewingFormWorksheet.Cells[35, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetWhirlpoolProcessDurations()[WhirlpoolProcessDurations.RestDuration.ToString()]);
                brewingFormWorksheet.Cells[36, newColumnIndex].Value = GetTimeValueOrBlank(brew.GetWhirlpoolProcessDurations()[WhirlpoolProcessDurations.CoolingDuration.ToString()]);
                brewingFormWorksheet.Cells[37, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[38, newColumnIndex].Value = "";
                brewingFormWorksheet.Cells[39, newColumnIndex].Value = "";

                SetNumberFormats(brewingFormWorksheet, newColumnIndex);

                SaveWorkSheet(xlPackage);
            }
        }
Exemplo n.º 2
0
        private void SetRawData(IBrew brew, int newColumnIndex)
        {
            using (xlPackage = new ExcelPackage(fileInfo))
            {
                ExcelWorksheet rawDataWorksheet = xlPackage.Workbook.Worksheets[rawDataSheetName];
                // Set Headers
                rawDataWorksheet.Cells[1, newColumnIndex].Value = "";
                rawDataWorksheet.Cells[2, newColumnIndex].Value = brew.StartDate;
                rawDataWorksheet.Cells[3, newColumnIndex].Value = brew.BrandName;
                rawDataWorksheet.Cells[4, newColumnIndex].Value = brew.BrewNumber;
                rawDataWorksheet.Cells[5, newColumnIndex].Value = brew.StartTime;

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

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

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

                // Holding Vessel process parameters
                rawDataWorksheet.Cells[36, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.FillingStartTime.ToString());
                rawDataWorksheet.Cells[37, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.TransferToWcEndTime.ToString());
                rawDataWorksheet.Cells[38, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.HoldingVessel, HoldingVesselProcessParameters.EmptyAtTime.ToString());

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

                // Whirpool process parameters
                rawDataWorksheet.Cells[47, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CastingStartTime.ToString());
                rawDataWorksheet.Cells[48, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CastingEndTime.ToString());
                rawDataWorksheet.Cells[49, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.RestingEndTime.ToString());
                rawDataWorksheet.Cells[50, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.CoolingEndTime.ToString());
                rawDataWorksheet.Cells[51, newColumnIndex].Value = brew.GetProcessParameterValue(ProcessEquipment.Whirlpool, WhirlpoolProcessParameters.ReadyAtTime.ToString());

                SaveWorkSheet(xlPackage);
            }
        }