private void Write(OmaReaderDoubleResult OmaReaderDoubleResult, computeLensResponseDTO left, computeLensResponseDTO right, OmaEvent OmaEvent) { AbstractSurfaceOmaWriter <threeDimensionalPointDTO> surfaceOmaWriter; switch (Enum.TryParse(configuration.AppSettings.Settings[OUTPUT_FORMAT].Value, out OutputFormat outputFormat) ? outputFormat : OutputFormat.sdf) { case OutputFormat.sdf: surfaceOmaWriter = SDFWriter; break; case OutputFormat.hmf: surfaceOmaWriter = HMFWriter; break; default: surfaceOmaWriter = XYZWriter; break; } surfaceOmaWriter.Write(OmaReaderDoubleResult, left, right); SurfaceFiles surfaceFiles = surfaceOmaWriter.SurfaceFilesPath(OmaReaderDoubleResult); IFilePathOmaBuilder filePathOmaBuilder; if (surfaceFiles.LeftSurfaceFile.Equals(surfaceFiles.RightSurfaceFile)) { filePathOmaBuilder = new SingleFilePathOmaBuilder(surfaceFiles.LeftSurfaceFile); } else { filePathOmaBuilder = new DoubleFilePathOmaBuilder(surfaceFiles.RightSurfaceFile, surfaceFiles.LeftSurfaceFile); } AnalysisWriter.Write(OmaReaderDoubleResult, left, right); OmaWriter.Write(OmaReaderDoubleResult, left, right, surfaceFiles.LeftSurfaceFile, surfaceFiles.RightSurfaceFile, filePathOmaBuilder); Logger.LogEvent(OmaEvent, EventLogEntryType.Information, EventTypes.Result); }
private void Write(OmaReaderSingleResult OmaReaderSingleResult, computeLensResponseDTO response, OmaEvent OmaEvent) { AbstractSurfaceOmaWriter <threeDimensionalPointDTO> surfaceOmaWriter; OutputFormat outputFormat; outputFormat = Enum.TryParse(configuration.AppSettings.Settings[OUTPUT_FORMAT].Value, out outputFormat) ? outputFormat : OutputFormat.sdf; switch (outputFormat) { case OutputFormat.sdf: surfaceOmaWriter = SDFWriter; break; case OutputFormat.hmf: surfaceOmaWriter = HMFWriter; break; default: surfaceOmaWriter = XYZWriter; break; } surfaceOmaWriter.Write(OmaReaderSingleResult, response); string surfaceFilePath = surfaceOmaWriter.SurfaceFilePath(OmaReaderSingleResult); IFilePathOmaBuilder filePathOmaBuilder; switch (outputFormat) { case OutputFormat.sdf: filePathOmaBuilder = new SingleFilePathOmaBuilder(surfaceFilePath); break; default: switch (OmaReaderSingleResult) { case OmaReaderLeftResult OmaReaderLeftResult: filePathOmaBuilder = new DoubleFilePathOmaBuilder(null, surfaceFilePath); break; default: filePathOmaBuilder = new DoubleFilePathOmaBuilder(surfaceFilePath, null); break; } break; } AnalysisWriter.Write(OmaReaderSingleResult, response); OmaWriter.Write(OmaReaderSingleResult, response, surfaceFilePath, filePathOmaBuilder); Logger.LogEvent(OmaEvent, EventLogEntryType.Information, EventTypes.Result); }