Синтез распознающего автомата

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

Скачать Бесплатно!
Для того чтобы скачать эту работу.
1. Пожалуйста введите слова с картинки:

2. И нажмите на эту кнопку.
закрыть



;>meaningsTable->setColumnCount(1);">= "";>comboSetState->clear();>comboBaseState->clear();>meaningsTable->clear();>meaningsTable->setRowCount(stateSet.count());>meaningsTable->setColumnCount(1);

endStateList=endStateSet.toList(); stateList = stateSet.toList();

= "";(endStateList);(int i = 0; i < endStateList.length(); i++)

lineEndState->setText(str);">{+= endStateList.at(i);>lineEndState->setText(str);

}

= "";(allowedStateList);(int i = 0; i < allowedStateList.length(); i++)

lineAllowedState->setText(str);">{+= allowedStateList.at(i);>lineAllowedState->setText(str);

}

= "";(stateList);(int i = 0; i < stateList.length(); i++)

comboSetState->addItem(stateList.at(i));>comboBaseState->addItem(stateList.at(i));>meaningsTable->setVerticalHeaderItem(i,new">{+= stateList.at(i);>comboSetState->addItem(stateList.at(i));>comboBaseState->addItem(stateList.at(i));>meaningsTable->setVerticalHeaderItem(i, new

meaningsTable->setItem(i,0,newQTableWidgetItem);asd;>>asd;>meaningsTable->item(i,0)->setText(asd);">QTableWidgetItem(stateList.at(i)));>meaningsTable->setItem(i, 0, new QTableWidgetItem);asd;>> asd;>meaningsTable->item(i, 0)->setText(asd);

}>comboBaseState->setCurrentIndex(posa);>lineStateSymbols->setText(str);

= "";>comboWriteSymbol->clear();>comboSpaceSymbol->clear();

symbolsList=symbolsSet.toList();(symbolsList);(inti=0;i symbolsList = symbolsSet.toList();(symbolsList);(int i = 0; i < symbolsList.length(); i++)

comboWriteSymbol->addItem(symbolsList.at(i));>comboSpaceSymbol->addItem(symbolsList.at(i));">{+= symbolsList.at(i);>comboWriteSymbol->addItem(symbolsList.at(i));>comboSpaceSymbol->addItem(symbolsList.at(i));

}>comboSpaceSymbol->setCurrentIndex(posc);>lineInputSymbols->setText(str);= true;>resetState();

}

MainWindow::on_save_triggered()

{fileName = QFileDialog::getSaveFileName(this,

trUtf8("Сохранить таблицу"),

"",("Таблицы правил (*.tbl)"));file( fileName );( !file.open( QIODevice::WriteOnly ) );

stream( &file );.setVersion( QDataStream::Qt_4_2 );

rows = ui->ruleTable->rowCount();columns = ui->ruleTable->columnCount();currentIndex() << ui-

>comboSpaceSymbol->currentIndex();<< endStateSet << allowedStateSet;str;(int i = -1; i < rows; i++)(int j = -1; j < columns; j++)

{(i > -1 && j > -1)

{= ui->ruleTable->item(i, j)->text();<< str;

}

{(i == -1 && j > -1)

{= ui->ruleTable->horizontalHeaderItem(j)->text();<< str;

}(j == -1 && i > -1)

{= ui->ruleTable->verticalHeaderItem(i)->text();<< str;

}(i == -1 && j == -1)

{= "";<< str;

}

}

}

(int i = 0; i text();

}

MainWindow::on_buttonSetString_clicked()

{.clear();(int i = 0; i text().length(); i++)

lineInputString->text().at(i)))">{(symbolsSet.contains(ui->lineInputString->text().at(i)))

{.append(ui->lineInputString->text().at(i));

}

}>resetState();>widget->setResultText(QString(""));stateChanged();

}

MainWindow::on_ruleTable_cellPressed(int row, int column)

{= row;= column;inSymbol = ui->ruleTable->horizontalHeaderItem(column)->text().at(0);curState = ui->ruleTable->verticalHeaderItem(row)->text().at(0);ruleSym = ui->ruleTable->item(row, column)->text().at(0);ruleState = ui->ruleTable->item(row, column)->text().at(2);>currentInputSymbol->setText(inSymbol);>currentMachineState->setText(curState);

(int i = 0; i setCurrentIndex(i);

(int i = 0; i setCurrentIndex(i);

(ui->ruleTable->item(row, column)->text().at(1) == QString("L").at(0))

{>comboMoveTo->setCurrentIndex(0);

}

{(ui->ruleTable->item(row, column)->text().at(1) == QString("R").at(0))>comboMoveTo->setCurrentIndex(2);>comboMoveTo->setCurrentIndex(1);

}

}

MainWindow::setRules()

{(ui->comboWriteSymbol->count() != 0 && ui->comboSetState->count() != 0)

{result = " ";[0] = ui->comboWriteSymbol->itemText(ui->comboWriteSymbol->currentIndex()).at(0);[2] = ui->comboSetState->itemText(ui->comboSetState->currentIndex()).at(0);(ui->comboMoveTo->currentIndex() == 0)[1] = QString("L").at(0);if (ui->comboMoveTo->currentIndex() == 2)[1] = QString("R").at(0);[1] = QString("H").at(0);

>ruleTable->item(currentX, currentY)->setText(result);

}

}

MainWindow::on_comboWriteSymbol_currentIndexChanged(int index)

{

}

MainWindow::on_comboMoveTo_currentIndexChanged(int index)

{

}

MainWindow::on_comboSetState_currentIndexChanged(int index)

{

}

MainWindow::on_comboSpaceSymbol_currentIndexChanged(int index)

{(index != -1)>widget->setSpaceSymbol(ui->comboSpaceSymbol->itemText(ui->comboSpaceSymbol->currentIndex()).at(0));

}

MainWindow::on_buttonStep_clicked()

{>step();

}

MainWindow::on_buttonStartStop_clicked()

{(ready)

{(running)

{= false;.stop();>buttonStartStop->setText(trUtf8("Старт"));

}

{= true;.start();>buttonStartStop->setText(trUtf8("Стоп"));

}

}

}

MainWindow::on_horizontalSlider_sliderMoved(int position)

{.setInterval(position);

}MainWindow::on_buttonReset_clicked()

{= 0;= 0;>widget->setResultText(QString(""));= ui->comboBaseState->itemText(ui->comboBaseState->currentIndex()).at(0);stateChanged();

}

MainWindow::on_lineEndState_editingFinished()

{.clear();str;(int i = 0; i text().length(); i++)

lineEndState->text().at(i)))">{(stateSet.contains(ui->lineEndState->text().at(i)))

{+= ui->lineEndState->text().at(i);+= ui->lineEndState->text().at(i);

}

}>lineEndState->setText(str);

}

MainWindow::isAllowedState(const QChar c)

{allowedStateSet.contains(c);

}

MainWindow::getMeaningByState(const QChar c)

{(int i = 0; i rowCount(); i++)

{(ui->meaningsTable->verticalHeaderItem(i)->text().at(0) == c)

{str = ui->meaningsTable->item(i, 0)->text();str;

}

}

}

MainWindow::on_lineAllowedState_editingFinished()

{.clear();(int i = 0; i text().length(); i++)

lineAllowedState->text().at(i)))">{(stateSet.contains(ui->lineAllowedState->text().at(i)))

{+= ui->lineAllowedState->text().at(i);

}

}

}

MainWindow::on_pushButton_clicked()

{>setRules();

}

MainWindow::on_about_triggered()

setIconPixmap(QPixmap::fromImage(QImage(":/images/about.png")));>setText(QString(trUtf8(":\n4-78-102012")));>setWindowTitle(QString(trUtf8("")));>show();">{*box = new QMessageBox;>setIconPixmap(QPixmap::fromImage(QImage(":/images/about.png")));>setText(QString(trUtf8("Автор: Протозанов Евгений\nИжГТУ 4-78-10 2012")));>setWindowTitle(QString(trUtf8("Машина Тьюринга")));>show();

}

MainWindow::on_about_Qt_triggered()

{::aboutQt(this, trUtf8("О Qt"));

}

 

4.Реализация visualization.cpp

 

#include

#include

#include

#include

#include "visualisation.h"

::visualisation(QWidget *parent) :(parent)

{

}

visualisation::paintEvent(QPaintEvent *)

{spacerX = (this->width() - 620)/2;spacerY = (this->height() - 100)/2;*painter = new QPainter();>begin(this);>save();>setRenderHint(QPainter::Antialiasing);>setFont(QFont("", 14));

//=======================================mid = 15*floor(*fakePos/15);real_mid = *real

s