Esempio n. 1
0
        private void enterSMILEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            smilesInput smiles = new smilesInput();

            smiles.ShowDialog();
            if (string.IsNullOrEmpty(smiles.SMILES))
            {
                return;
            }
            this.molecule = new ChemInfo.Molecule(smiles.SMILES);
            this.dataGridView1.Rows.Clear();
            if (molecule == null)
            {
                return;
            }
            this.moleculeViewer1.Molecule     = this.molecule;
            this.propertyGrid1.SelectedObject = this.molecule;
            foreach (System.Data.DataRow dr in app_functionalgroup.Rows)
            {
                string smarts = dr["Smarts"].ToString();
                if (!string.IsNullOrEmpty(smarts))
                {
                    this.molecule.FindFunctionalGroup(dr);
                }
            }

            this.textBox1.Text = Newtonsoft.Json.JsonConvert.SerializeObject(this.molecule, Newtonsoft.Json.Formatting.Indented);
            foreach (string group in this.molecule.FunctionalGroups)
            {
                this.functionalGroupComboBox.Items.Add(group);
            }
        }
Esempio n. 2
0
        private void enterSMILEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            smilesInput smiles = new smilesInput();

            smiles.ShowDialog();
            if (string.IsNullOrEmpty(smiles.SMILES))
            {
                return;
            }
            this.molecule = new ChemInfo.Molecule(smiles.SMILES);
            this.listBox1.Items.Clear();
            if (molecule == null)
            {
                return;
            }
            this.moleculeViewer1.Molecule     = this.molecule;
            this.propertyGrid1.SelectedObject = this.molecule;
            foreach (ChemInfo.FunctionalGroup f in this.fGroups)
            {
                if ((f.Name != "ESTER-SULFIDE") || (f.Name != "KETENIMINE"))
                {
                    this.molecule.FindFunctionalGroup(f);
                }
            }

            this.textBox1.Text = Newtonsoft.Json.JsonConvert.SerializeObject(this.molecule, Newtonsoft.Json.Formatting.Indented);
            foreach (ChemInfo.FunctionalGroup group in this.molecule.FunctionalGroups)
            {
                this.functionalGroupComboBox.Items.Add(group.Name);
            }
            //if (this.molecule.FunctionalGroups.Length > 0)

            //    if (this.molecule.FunctionalGroups[0].NamedReactions.Count > 0)
            //    {
            //        this.pictureBox1.Image = this.molecule.FunctionalGroups[0].NamedReactions[0].ReactionImage[0];
            //        foreach (ChemInfo.Reference r in this.molecule.FunctionalGroups[0].NamedReactions[0].References)
            //        {
            //            this.listBox1.Items.Add(r.ToString());
            //        }
            //    }
        }