コード例 #1
0
        private static ExcelContextForPhaseTwo <IAnalysisPhaseTwo> CreateExcelContext(
            AnalysisContext context)
        {
            IFunctionSelector goonessOfFit = AnalysisHelper.CreateGoodnessOfFit(
                context.GoodnessOfFit
                );

            Func <ParametersPack, IAnalysisPhaseTwo> analysisFactory =
                args => AnalysisHelper.CreateAnalysisPhaseTwo(context.PhaseTwo, goonessOfFit, args);

            return(ExcelContextForPhaseTwo <IAnalysisPhaseTwo> .CreateFor(
                       analysisContext : context,
                       sheetName : ExcelHelper.CreateSheetName(PhaseNumber),
                       analysisFactory : analysisFactory
                       ));
        }
コード例 #2
0
        private async Task PerformOneIterationASync(
            ExcelContextForPhaseTwo <IAnalysisPhaseTwo> excelContext, FileObject fileObject)
        {
            _logger.Info("Awaiting an opportunity to start processing of algorithm results.");

            // Lock data processing to avoid corrupted results in the final Excel file.
            using (await _asyncLock.EnterAsync())
            {
                _logger.Info(
                    "Processing began for algorithm results for one iteration of phase two."
                    );

                _excelWrapperForPhaseTwo.ApplyAnalysisAndSaveDataOneIteration(
                    data: fileObject.Data.GetData(item => item.operationNumber),
                    excelContext: excelContext,
                    dataFilename: fileObject.Data.Name
                    );

                _logger.Info(
                    "Processing finished for algorithm results for one iteration of phase two."
                    );
            }
        }