private void _OpenMenuItem_Click(object sender, EventArgs e) { try { if (_FolderBrowserDialog.ShowDialog() == DialogResult.OK) { FileManager fm = new FileManager(); _Model1 = fm.LoadModel(_FolderBrowserDialog.SelectedPath + @"\clean.xml"); _Model2 = fm.LoadModel(_FolderBrowserDialog.SelectedPath + @"\dirty.xml"); _Nicotine = new Nicotine(_Model1, 0, _Model2, 24); _Scene.Model = _Nicotine.Smoke(0.01); _Screen = new Screen(pictureBox1.CreateGraphics(), pictureBox1.Width, pictureBox1.Height, _ProgressBar); ShowScene(); } } catch (Exception exception) { MessageBox.Show(exception.ToString(), "Ошибка!"); } }
private void Smoke(object sender, EventArgs e) { try { double t = _SmokingTimeTB.Value; if (_SmokingTimeTB.Value == 0) { t = 0.01; } _Scene.Model = _Nicotine.Smoke(t); _Screen.DrawScene(_Scene); } catch { MessageBox.Show("Ошибка моделирования!"); } }