コード例 #1
0
        public string SurfaceFilePath(OmaReaderSingleResult OmaReaderSingleResult)
        {
            string tmpPath  = TempSurfaceFilePath(OmaReaderSingleResult);
            string filePath = Path.ChangeExtension(tmpPath, Extension);

            return(filePath);
        }
コード例 #2
0
        public string TempSurfaceFilePath(OmaReaderSingleResult OmaReaderSingleResult)
        {
            side   side    = OmaReaderSingleResult is OmaReaderLeftResult ? side.LEFT : side.RIGHT;
            string tmpPath = Path.Combine(SurfaceDirectory, GetFileName(OmaReaderSingleResult.Result, side));

            return(tmpPath);
        }
コード例 #3
0
        public void Write(OmaReaderSingleResult OmaReaderSingleResult, computeLensResponseDTO computeLensResponse, string surfaceFile, IFilePathOmaBuilder filePathBuilder)
        {
            switch (OmaReaderSingleResult)
            {
            case OmaReaderLeftResult OmaReaderLeftResult:
                Write(OmaReaderLeftResult.Result, null, computeLensResponse, null, surfaceFile, null, filePathBuilder);
                break;

            case OmaReaderRightResult OmaReaderRightResult:
                Write(null, OmaReaderRightResult.Result, null, computeLensResponse, null, surfaceFile, filePathBuilder);
                break;
            }
        }
コード例 #4
0
        public void Write(OmaReaderSingleResult OmaReaderSingleResult, computeLensResponseDTO computeLensResponseDTO)
        {
            side   side    = OmaReaderSingleResult is OmaReaderLeftResult ? side.LEFT : side.RIGHT;
            string tmpPath = TempSurfaceFilePath(OmaReaderSingleResult);

            File.Delete(tmpPath);
            Write(tmpPath, computeLensResponseDTO, side);
            string filePath = SurfaceFilePath(OmaReaderSingleResult);

            File.Delete(filePath);
            if (File.Exists(tmpPath))
            {
                File.Move(tmpPath, filePath);
            }
        }
コード例 #5
0
        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);
        }