using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Core; using DNAModule.Sunweaver; namespace UI.Winforms.Prsn828 { public partial class SpeciesMutationSettings : Form { public Species choice { get; private set; } public SpeciesMutationSettings() { InitializeComponent(); } public SpeciesMutationSettings(ref Species s) : this() { choice = s; } private void SpeciesMutationSettings_Load(object sender, EventArgs e) { CodulePointCommandsBox.Text = choice.CodulePointMutation.Commands + ""; CodulePointConstantsBox.Text = choice.CodulePointMutation.Constants + ""; CodulePointReferencesBox.Text = choice.CodulePointMutation.References + ""; CodulePointStoresBox.Text = choice.CodulePointMutation.Stores + ""; CodulePointProbabilityBox.Text = choice.CodulePointMutation.Probability + ""; CodulePointMinLengthChooser.Value = choice.CodulePointMutation.MinLength; CodulePointMaxLengthChooser.Value = choice.CodulePointMutation.MaxLength; CoduleInsertionCommandsBox.Text = choice.CoduleInsertionMutation.Commands + ""; CoduleInsertionConstantsBox.Text = choice.CoduleInsertionMutation.Constants + ""; CoduleInsertionReferencesBox.Text = choice.CoduleInsertionMutation.References + ""; CoduleInsertionStoresBox.Text = choice.CoduleInsertionMutation.Stores + ""; CoduleInsertionProbabilityBox.Text = choice.CoduleInsertionMutation.Probability + ""; CoduleInsertionMinLengthChooser.Value = choice.CoduleInsertionMutation.MinLength; CoduleInsertionMaxLengthChooser.Value = choice.CoduleInsertionMutation.MaxLength; CoduleDeletionProbabilityBox.Text = choice.CoduleDeletionMutation.Probability + ""; CoduleDeletionMinLengthChooser.Value = choice.CoduleDeletionMutation.MinLength; CoduleDeletionMaxLengthChooser.Value = choice.CoduleDeletionMutation.MaxLength; CoduleAmplificationProbabilityBox.Text = choice.CoduleAmplificationMutation.Probability + ""; CoduleAmplificationMinLengthChooser.Value = choice.CoduleAmplificationMutation.MinLength; CoduleAmplificationMaxLengthChooser.Value = choice.CoduleAmplificationMutation.MaxLength; CoduleTranslocationProbabilityBox.Text = choice.CoduleTranslocationMutation.Probability + ""; CoduleTranslocationMinLengthChooser.Value = choice.CoduleTranslocationMutation.MinLength; CoduleTranslocationMaxLengthChooser.Value = choice.CoduleTranslocationMutation.MaxLength; } public CodulePointMutation CodulePoint() { return new CodulePointMutation((int)CodulePointMinLengthChooser.Value, (int)CodulePointMaxLengthChooser.Value, Double.Parse(CodulePointProbabilityBox.Text), float.Parse(CodulePointCommandsBox.Text), float.Parse(CodulePointConstantsBox.Text), float.Parse(CodulePointReferencesBox.Text), float.Parse(CodulePointStoresBox.Text)); } public CoduleInsertionMutation CoduleInsertion() { return new CoduleInsertionMutation((int)CoduleInsertionMinLengthChooser.Value, (int)CoduleInsertionMaxLengthChooser.Value, Double.Parse(CoduleInsertionProbabilityBox.Text), float.Parse(CoduleInsertionCommandsBox.Text), float.Parse(CoduleInsertionConstantsBox.Text), float.Parse(CoduleInsertionReferencesBox.Text), float.Parse(CoduleInsertionStoresBox.Text)); } public CoduleDeletionMutation CoduleDeletion() { return new CoduleDeletionMutation((int)CoduleDeletionMinLengthChooser.Value, (int)CoduleDeletionMaxLengthChooser.Value, Double.Parse(CoduleDeletionProbabilityBox.Text), 1, 1, 1, 1); } public CoduleAmplificationMutation CoduleAmplification() { return new CoduleAmplificationMutation((int)CoduleAmplificationMinLengthChooser.Value, (int)CoduleAmplificationMaxLengthChooser.Value, Double.Parse(CoduleAmplificationProbabilityBox.Text)); } public CoduleTranslocationMutation CoduleTranslocation() { return new CoduleTranslocationMutation((int)CoduleTranslocationMinLengthChooser.Value, (int)CoduleTranslocationMaxLengthChooser.Value, Double.Parse(CoduleTranslocationProbabilityBox.Text)); } private void SpeciesMutationSettings_FormClosing(object sender, FormClosingEventArgs e) { choice.CoduleAmplificationMutation = CoduleAmplification(); choice.CoduleTranslocationMutation = CoduleTranslocation(); choice.CodulePointMutation = CodulePoint(); choice.CoduleInsertionMutation = CoduleInsertion(); choice.CoduleDeletionMutation = CoduleDeletion(); } } }