private static void FillBasicColumns(IExcelSheet sheet, ParametersPack args, ref int currentColumnIndex) { int rowIndex = 1; var sampleSizeColumnIndex = currentColumnIndex++.AsEnum <ExcelColumnIndex>(); sheet[sampleSizeColumnIndex, rowIndex].SetValue(ExcelStringsPhaseTwo.SampleSizeColumnName); var theoreticalMinColumnIndex = currentColumnIndex++.AsEnum <ExcelColumnIndex>(); sheet[theoreticalMinColumnIndex, rowIndex].SetValue(ExcelStringsPhaseTwo.TheoreticalMinColumnName); var theoreticalAverageColumnIndex = currentColumnIndex++.AsEnum <ExcelColumnIndex>(); sheet[theoreticalAverageColumnIndex, rowIndex].SetValue(ExcelStringsPhaseTwo.TheoreticalAverageColumnName); var theoreticalMaxColumnIndex = currentColumnIndex++.AsEnum <ExcelColumnIndex>(); sheet[theoreticalMaxColumnIndex, rowIndex].SetValue(ExcelStringsPhaseTwo.TheoreticalMaxColumnName); ++rowIndex; for (int launchesNumber = args.StartValue; launchesNumber <= args.ExtrapolationSegmentValue; launchesNumber += args.Step) { sheet[sampleSizeColumnIndex, rowIndex].SetValue(launchesNumber); string minFormula = ManualFormulaProvider.Min( sheet, sampleSizeColumnIndex, rowIndex, args.AlgorithmType ); sheet[theoreticalMinColumnIndex, rowIndex].SetFormula(minFormula); string averageFormula = ManualFormulaProvider.Average( sheet, sampleSizeColumnIndex, rowIndex, args.AlgorithmType ); sheet[theoreticalAverageColumnIndex, rowIndex].SetFormula(averageFormula); string maxFormula = ManualFormulaProvider.Max( sheet, sampleSizeColumnIndex, rowIndex, args.AlgorithmType ); sheet[theoreticalMaxColumnIndex, rowIndex].SetFormula(maxFormula); ++rowIndex; } sheet.AutoSizeColumn(sampleSizeColumnIndex); sheet.AutoSizeColumn(theoreticalMinColumnIndex); sheet.AutoSizeColumn(theoreticalAverageColumnIndex); sheet.AutoSizeColumn(theoreticalMaxColumnIndex); }
private static void FillAdditionalParametersColumns(IExcelSheet sheet, ParametersPack args) { // Descriptive cells. sheet[ExcelColumnIndex.I, 1].SetValue(ExcelStringsPhaseOnePartTwo.AdditionalParametersColumnName); sheet[ExcelColumnIndex.I, 2].SetValue(ExcelStringsPhaseOnePartTwo.InputDataSize); sheet[ExcelColumnIndex.I, 3].SetValue(ExcelStringsPhaseOnePartTwo.MinFunc); sheet[ExcelColumnIndex.I, 4].SetValue(ExcelStringsPhaseOnePartTwo.AverageFunc); sheet[ExcelColumnIndex.I, 5].SetValue(ExcelStringsPhaseOnePartTwo.MaxFunc); sheet[ExcelColumnIndex.I, 6].SetValue(ExcelStringsPhaseOnePartTwo.ExperimentsNumber); sheet[ExcelColumnIndex.I, 7].SetValue(ExcelStringsPhaseOnePartTwo.ConfidenceFactor); sheet[ExcelColumnIndex.I, 8].SetValue(ExcelStringsPhaseOnePartTwo.SignificanceLevel); sheet[ExcelColumnIndex.I, 9].SetValue(ExcelStringsPhaseOnePartTwo.Epsilon); sheet.AutoSizeColumn(ExcelColumnIndex.I); // Value cells. sheet[ExcelColumnIndex.J, 1].SetValue(ExcelStringsPhaseOnePartTwo.AdditionalParametersValuesColumnName); sheet[ExcelColumnIndex.J, 2].SetValue(args.StartValue); string minFormula = ManualFormulaProvider.Min( sheet, ExcelColumnIndex.J, 2, args.AlgorithmType ); sheet[ExcelColumnIndex.J, 3].SetFormula(minFormula); string averageFormula = ManualFormulaProvider.Average( sheet, ExcelColumnIndex.J, 2, args.AlgorithmType ); sheet[ExcelColumnIndex.J, 4].SetFormula(averageFormula); string maxFormula = ManualFormulaProvider.Max( sheet, ExcelColumnIndex.J, 2, args.AlgorithmType ); sheet[ExcelColumnIndex.J, 5].SetFormula(maxFormula); sheet[ExcelColumnIndex.J, 6].SetValue(args.LaunchesNumber); sheet[ExcelColumnIndex.J, 7].SetValue(double.Parse(ExcelStringsPhaseOnePartTwo.ConfidenceFactorValue)); string formulaJ8 = string.Format( ExcelStringsPhaseOnePartTwo.SignificanceLevelFormula, sheet[ExcelColumnIndex.J, 7].Address ); sheet[ExcelColumnIndex.J, 8].SetFormula(formulaJ8); sheet[ExcelColumnIndex.J, 9].SetValue(double.Parse(ExcelStringsPhaseOnePartTwo.EpsilonValue)); sheet.AutoSizeColumn(ExcelColumnIndex.J); }