void Lyap_PicCompleted(object src, EventArgs e) { if (progressBar3.Value + 1 < progressBar3.Maximum) { progressBar3.Value++; LyapunovGenerator lyap = (LyapunovGenerator)src; //Lyaps[0].Image.Save(textBox1.Text + lyap.InitX + ".jpg"); if (Confs.Count > 0) { lyap.Initialise(Confs[0]); lyap.Generate(); Confs.RemoveAt(0); } else { //completed = true; label16.Text = ""; progressBar1.Value = 0; progressBar2.Value = 0; progressBar3.Value = 0; string msgText = "Completed in: " + CalcDuration(); MessageBox.Show(msgText); //if (textBox1.Text == "") saveFileDialog1.ShowDialog(); //MessageBox.Show("Completed!"); } } }
private void NextConf(LyapunovGenerator lyap) { if (Confs.Count > 0) { if (!lyap.Working) { lyap.Initialise(Confs[0]); lyap.Generate(); Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; } } }
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"; } }
private void NextConf(LyapunovGenerator lyap) { if (Confs.Count > 0) { if (!lyap.Working) { if (System.IO.File.Exists(Confs[0]._path + "\\" + Confs[0]._z + "\\" + Confs[0]._x + "_" + Confs[0]._y + ".png")) { Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; NextConf(lyap); } else { try { if (!System.IO.Directory.Exists(Confs[0]._path + "\\" + Confs[0]._z)) { System.IO.Directory.CreateDirectory(Confs[0]._path + "\\" + Confs[0]._z); } System.IO.Stream str = System.IO.File.Create(Confs[0]._path + "\\" + Confs[0]._z + "\\" + Confs[0]._x + "_" + Confs[0]._y + ".png"); str.Dispose(); } catch { Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; NextConf(lyap); } lyap.Initialise(Confs[0]); lyap.Generate(); Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; } } } }
private void NextConf(LyapunovGenerator lyap) { if (Confs.Count > 0) { if (!lyap.Working) { if (System.IO.File.Exists(Confs[0]._path + "\\" + Confs[0]._z + "\\" + Confs[0]._x + "_" + Confs[0]._y + ".png")) { Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; NextConf(lyap); } else { try { if (!System.IO.Directory.Exists(Confs[0]._path + "\\" + Confs[0]._z)) System.IO.Directory.CreateDirectory(Confs[0]._path + "\\" + Confs[0]._z); System.IO.Stream str = System.IO.File.Create(Confs[0]._path + "\\" + Confs[0]._z + "\\" + Confs[0]._x + "_" + Confs[0]._y + ".png"); str.Dispose(); } catch { Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; NextConf(lyap); } lyap.Initialise(Confs[0]); lyap.Generate(); Confs.RemoveAt(0); lbl_count.Text = Confs.Count.ToString() + " pictures to generate"; } } } }