Esempio n. 1
0
        private void ApplyRGSettings()
        {
            var alpha = double.Parse(txtAlpha.Text);
            var n     = double.Parse(txtN.Text);

            RgSettings.Build(alpha, n);
        }
Esempio n. 2
0
        private void InitializeConfiguration()
        {
            var conf = ConfigurationManager.AppSettings;

            float.TryParse(conf["Alpha"], out _alpha);
            float.TryParse(conf["N"], out _n);
            int.TryParse(conf["Iterations"], out _iterations);
            float.TryParse(conf["ParabolaA"], out _parabolaA);
            float.TryParse(conf["ParabolaB"], out _parabolaB);
            float.TryParse(conf["ParabolaC"], out _parabolaC);
            RgSettings.Build(_alpha, _n);
        }
Esempio n. 3
0
        private static void ReadConfig(IEnumerable <string> args)
        {
            var alpha = 1.7;
            var n     = 2d;

            AMin        = -10;
            AMax        = 10;
            AStep       = 1;
            Sz          = 10000;
            X           = -1;
            Y           = -1;
            W           = 2;
            H           = 2;
            Dynamics    = true;
            SingleCurve = false;
            POpts       = new ParallelOptions {
                MaxDegreeOfParallelism = Environment.ProcessorCount
            };
            foreach (var s in args)
            {
                var parts = s.Split(new[] { '=' }, StringSplitOptions.RemoveEmptyEntries);
                var cfg   = parts[0];
                var val   = parts.Length == 2 ? parts[1] : string.Empty;
                switch (cfg)
                {
                case "singlecurve":
                    SingleCurve = true;
                    break;

                case "a":
                    alpha = double.Parse(val);
                    break;

                case "n":
                    n = double.Parse(val);
                    break;

                case "amin":
                    AMin = double.Parse(val);
                    break;

                case "amax":
                    AMax = double.Parse(val);
                    break;

                case "astep":
                    AStep = double.Parse(val);
                    break;

                case "sz":
                    Sz = int.Parse(val);
                    break;

                case "p":
                    POpts = new ParallelOptions {
                        MaxDegreeOfParallelism = int.Parse(val)
                    };
                    break;

                case "nodynamics":
                    Dynamics = false;
                    break;

                case "x":
                    X = double.Parse(val);
                    break;

                case "y":
                    Y = double.Parse(val);
                    break;

                case "w":
                    W = double.Parse(val);
                    break;

                case "h":
                    H = double.Parse(val);
                    break;
                }
            }
            OnePixelX = W / Sz;
            OnePixelY = H / Sz;
            RgSettings.Build(alpha, n);
        }