Beispiel #1
0
 private void cboAutomaton_SelectedIndexChanged(object sender, EventArgs e)
 {
     foreach (Automata a in ams.lista)
     {
         if (a.Name == cboAutomaton.Text)
         {
             current = a;
             break;
         }
     }
     if (sd == null)
     {
         sd = new StatesDiagram();
     }
     sd.createStates(current);
 }
Beispiel #2
0
        private void btnSaveNFA_Click(object sender, EventArgs e)
        {
            if (sd == null)
            {
                sd = new StatesDiagram();
            }

            if (dgvNFAE.DataSource == null)
            {
                MessageBox.Show("escoja un automata");
                return;
            }
            dgvNFA.DataSource = (sd.createNFA((DataTable)dgvNFAE.DataSource, current.Sigma));

            for (int i = 0; i < dgvNFA.Columns.Count; i++)
            {
                dgvNFA.Columns[i].Width = 80;
            }

            dgvDFA.DataSource = sd.createDFA((DataTable)dgvNFA.DataSource, current.Sigma);
        }