コード例 #1
0
 private void run_btn_Click(object sender, EventArgs e)
 {
     if (run_btn.Text == "Start")
     {
         todo = int.Parse(numruns_txt.Text);
         if (todo < 1)
         {
             todo = 1;
             numruns_txt.Text = "1";
         }
         int iter = int.Parse(iter_txt.Text);
         conf = new Configuration(2, 4, 2, 4, new char[] { 'a', 'b' }, iter, 0.5, 256, 256);
         mylyap.Initialise(conf);
         mylyap.Generate();
         run_btn.Text = "Stop";
     }
     else
     {
         mylyap.Stop();
         run_btn.Text = "Start";
     }
 }
コード例 #2
0
        public override void Initialise(Configuration conf)
        {
            base.Initialise(conf);

            _Columns = new Bitmap[_PicWidth];
            _Images = new Bitmap[_PicDepth];
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: IJMacD/Lyapunov-C-sharp
        void Generate()
        {
            for (int i = 0; i < System.Environment.ProcessorCount; i++)
            {
                if (Lyaps.Count < i + 1)
                {
                    Generator l = new LyapunovGenerator();
                    if (l != null)
                    {
                        InitLyap(l);
                        Lyaps.Add(l);
                    }
                }
            }

            if (_output_pb.BackgroundImage != null) _output_pb.BackgroundImage.Dispose();

            //CreateForegroundBitmap();

            PicWidth = _output_pb.Width;
            PicHeight = _output_pb.Height;

            progress = 0;
            toolStripStatusLabel1.Text = "Generating...";
            //toolStripProgressBar1.Maximum = PicWidth;
            toolStripProgressBar1.Value = 0;

            _Image = new Bitmap(PicWidth, PicHeight);
            _output_pb.BackgroundImage = _Image;
            _output_pb.Refresh();

            for (int j = 0; j < Lyaps.Count; j++)
            {
                double deltaX = (XMax - XMin) / Lyaps.Count;
                double xmin = XMin + (j * deltaX);
                double xmax = XMin + ((j + 1) * deltaX);
                int width = (int)(PicWidth / Lyaps.Count);
                int startX = (int)(PicWidth / Lyaps.Count * j);
                if (Lyaps[j] == null)
                {
                    Lyaps[j] = new LyapunovGenerator();
                    InitLyap(Lyaps[j]);
                }
                Configuration conf = new Configuration(xmin, xmax, YMin, YMax, Pattern, Iterations, InitX, width, PicHeight, startX);
                Lyaps[j].Initialise(conf);
                Lyaps[j].Generate();
            }
        }
コード例 #4
0
        public void Initialise(Configuration conf)
        {
            base.Initialise(conf);

            _Columns = new Bitmap[_PicWidth];
            _Images = new Bitmap[_PicDepth];

            SendWork();
        }
コード例 #5
0
ファイル: Generator.cs プロジェクト: IJMacD/Lyapunov-C-sharp
 public virtual void Initialise(Configuration conf)
 {
     _conf = conf;
     _XMin = conf.XMin;
     _XMax = conf.XMax;
     _YMin = conf.YMin;
     _YMax = conf.YMax;
     _ZMin = conf.ZMin;
     _ZMax = conf.ZMax;
     _Pattern = conf.Pattern;
     _Iterations = conf.Iterations;
     _InitX = conf.InitX;
     _PicWidth = conf.PicWidth;
     _PicHeight = conf.PicHeight;
     _PicDepth = conf.PicDepth;
     _StartCol = conf.StartCol;
 }