Beispiel #1
0
    public void Compute(Preset preset, Logger logger, PerformanceReport report, bool write = false,
                        double[] angles = null)
    {
        const string method = nameof(Compute);

        logger.Log(Logger.EventType.Info, $"{Scope(method)}: Shader adapter built." +
                   $" preset set to = {mainPanel.preset}");
        _shaderAdapter = _builder
                         .SetLogger(logger)
                         .SetWriteFactors(write)
                         .SetPerformanceReport(report)
                         .SetProperties(preset)
                         .SetAngles(angles)
                         .AutoSetShader()
                         .Build();
        _shaderAdapter.SetStatus(ref status);
        _shaderAdapter.Execute();
    }
Beispiel #2
0
    private void GenerateTestData(Logger logger, List <Preset> presets, List <AbsorptionProperties.Mode> modes)
    {
        const string method = nameof(GenerateTestData);

        // Backup and modify flag.
        var clippingBackup = Settings.flags.clipAngles;

        Settings.flags.clipAngles = false;

        // generate and save test dataset.
        var step = 0;

        foreach (var mode in modes)
        {
            foreach (var preset in presets)
            {
                preset.properties.absorption.mode = mode;
                preset.metadata.pathOutputData    = "B";
                _shaderAdapter = _builder
                                 .SetLogger(logger)
                                 .SetWriteFactors(true)
                                 .SetProperties(preset)
                                 .AutoSetShader()
                                 .Build()
                ;
                _shaderAdapter.SetStatus(ref status);

                ++step;
                logger.Log(Logger.EventType.Test,
                           $"{Scope(method)}: " +
                           $"Shader adapter built. ({step}/{presets.Count*modes.Count})" +
                           $" preset set to = {preset.metadata.saveName}");
                _shaderAdapter.Execute();
                logger.Log(Logger.EventType.Test,
                           $"{Scope(method)}: Shader adapter executed. ({step}/{presets.Count * modes.Count})");
                _shaderAdapter.SetStatusMessage(
                    $"{Scope(method)}: Step {step}/6: preset {preset.metadata.saveName}, {mode}");
            }
        }

        Settings.flags.clipAngles = clippingBackup;
    }