Example #1
0
        //upload current automaton in GUI to data
        private void button1_Click(object sender, EventArgs e)
        {
            textBox12.Text = string.Empty;
            textBox11.Text = string.Empty;
            textBox17.Text = string.Empty;
            textBox19.Text = string.Empty;
            Automaton tmpAutomaton = new Automaton();

            tmpAutomaton = Data.userInput(textBox8.Text, textBox9.Text, textBox15.Text, textBox16.Text, textBox10.Text, textBox11.Text);
            bool flag = true;

            if (!ErrorCheck.checkInitial(tmpAutomaton))
            {
                textBox19.AppendText("Initial state not found within automaton states");
                flag = false;
            }
            if (!ErrorCheck.checkAccepting(tmpAutomaton))
            {
                textBox19.AppendText("Accepting state not found within automaton states");
                flag = false;
            }
            if (!ErrorCheck.checkTransitions(tmpAutomaton))
            {
                textBox19.AppendText("Transition element not found within automaton states or alphabet");
                flag = false;
            }

            if (flag)
            {
                finiteAutomaton = tmpAutomaton;
            }
        }