// // -------------------------- LOAD ------------------------------------- // private void Form1_Load(object sender, EventArgs e) { tabControl.SelectedTab = tabControl.TabPages[2]; tabControlFractals.SelectedTab = tabControlFractals.TabPages[0]; functionlist = new Dictionary<String, TransferFunction>(); functionlist.Add("Linear", new Linear()); functionlist.Add("Binary Unipolar", new BinaryUnipolar()); functionlist.Add("Binary Bipolar", new BinaryBipolar()); functionlist.Add("Logistic", new Logistic()); functionlist.Add("Hyperbolic Tangent", new HyperbolicTangent()); functionlist.Add("Gaussian", new Gaussian()); columnFunction.DataSource = functionlist.Keys.ToList<String>(); //add default row AddNewLayer(); //clear charts chartLSP.ChartAreas.Clear(); chartLSP.Series.Clear(); chartStatus.Series.Clear(); chartStatus.ChartAreas.Clear(); // hopfield stuff for (int i = 0; i < hop.Width * hop.Height; i++) hopimage.Add(0); cmbHopfieldSymbols.DataSource = Hopfield.Symbols.Keys.ToList<char>(); btnHopfieldClear_Click(sender, e); // fractal stuff /*cmbFractalExamples.DataSource = Fractal.Examples.Keys.ToList<String>(); cmbFractalExamples.SelectedIndex = 1; */ fractal = new Fractal(/*Fractals.Configuration.IFSTree(Fractal.Width, Fractal.Height)*/); DrawFractal(picFractalsPicture, fractal); UpdateFractalGrid(); // CA stuff gol = new GOL(picCAWorld.Width, picCAWorld.Height, (int)numCAPixel.Value); picCAWorld.Image = new Bitmap(picCAWorld.Width, picCAWorld.Height); using (Graphics g = Graphics.FromImage(picCAWorld.Image)) g.Clear(Color.Black); cellstochange = new List<Tuple<int, int>>(); }
private void numCAPixel_ValueChanged(object sender, EventArgs e) { gol = new GOL(picCAWorld.Width, picCAWorld.Height, (int)numCAPixel.Value); }
private void btnCALoad_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read, FileShare.Read); gol = (GOL)formatter.Deserialize(stream); stream.Close(); picCAWorld.Image = gol.GetBitmap(); picCAWorld.Invalidate(); timerCA.Tag = "on"; btnCARun_Click(sender, e); } }