public void Write(OmaReaderDoubleResult OmaReaderDoubleResult, computeLensResponseDTO leftComputeLensResponseDTO, computeLensResponseDTO rightComputeLensResponseDTO) { SurfaceFiles tmpSurfaceFiles = TempSurfaceFilesPath(OmaReaderDoubleResult); string leftTmpPath = tmpSurfaceFiles.LeftSurfaceFile; string rightTmpPath = tmpSurfaceFiles.RightSurfaceFile; File.Delete(leftTmpPath); File.Delete(rightTmpPath); Write(rightTmpPath, rightComputeLensResponseDTO, side.RIGHT); Write(leftTmpPath, leftComputeLensResponseDTO, side.LEFT); SurfaceFiles surfaceFiles = SurfaceFilesPath(OmaReaderDoubleResult); string leftFilePath = surfaceFiles.LeftSurfaceFile; string rightFilePath = surfaceFiles.RightSurfaceFile; File.Delete(leftFilePath); File.Delete(rightFilePath); if (File.Exists(leftTmpPath)) { File.Move(leftTmpPath, leftFilePath); } if (File.Exists(rightTmpPath)) { File.Move(rightTmpPath, rightFilePath); } }
public SurfaceFiles SurfaceFilesPath(OmaReaderDoubleResult OmaReaderDoubleResult) { SurfaceFiles tmpSurfaceFiles = TempSurfaceFilesPath(OmaReaderDoubleResult); SurfaceFiles surfaceFiles = new SurfaceFiles(Path.ChangeExtension(tmpSurfaceFiles.RightSurfaceFile, Extension), Path.ChangeExtension(tmpSurfaceFiles.LeftSurfaceFile, Extension)); return(surfaceFiles); }
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); }
public SurfaceFiles TempSurfaceFilesPath(OmaReaderDoubleResult OmaReaderDoubleResult) { string leftTmpPath = Path.Combine(SurfaceDirectory, GetFileName(OmaReaderDoubleResult.Left, side.LEFT)); string rightTmpPath = Path.Combine(SurfaceDirectory, GetFileName(OmaReaderDoubleResult.Right, side.RIGHT)); SurfaceFiles tmpSurfaceFiles = new SurfaceFiles(rightTmpPath, leftTmpPath); return(tmpSurfaceFiles); }
public void Write(OmaReaderDoubleResult OmaReaderDoubleResult, computeLensResponseDTO leftComputeLensResponse, computeLensResponseDTO rightComputeLensResponse, string leftSurfaceFilePath, string rightSurfaceFilePath, IFilePathOmaBuilder filePathBuilder) { Write(OmaReaderDoubleResult.Left, OmaReaderDoubleResult.Right, leftComputeLensResponse, rightComputeLensResponse, leftSurfaceFilePath, rightSurfaceFilePath, filePathBuilder); }