-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.cpp
62 lines (57 loc) · 2.11 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <QApplication>
#include <QTime>
#include <QMainWindow>
#include <QDebug>
#include <QFile>
#include <QDir>
#include <QList>
#include <QDebug>
#include "mainwindow.h"
#include "formgraph.h"
const QString MILI = "/MiliMatrix.txt";
const QString MURA = "/MuraMatrix.txt";
const QString FOR_PROGRAMM = "/graph.txt";
const QString SELECTED_FILE = FOR_PROGRAMM;
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MainWindow *m = new MainWindow;
// QFile in(QCoreApplication::applicationDirPath() + SELECTED_FILE);
// if (!in.open(QIODevice::ReadOnly | QIODevice::Text))
// {
// qDebug() << QString("Запуск без файла %1.").arg(SELECTED_FILE);
// qDebug() << "Директория,откуда запускается программа: "
// << QCoreApplication::applicationDirPath() << endl;
// m->show();
// return app.exec();
//// return 101;
// }
// QTextStream stream(&in);
// QStringList source;
// while (true) {
// QString line = stream.readLine();
// if (line.isEmpty()) {
// break;
// }
// source.append(line);
// }
// // Заглушка! Всегда type = matrix
// source.insert(Automata::FormatFile::FORMAT, "1");
// // Вставляем кол-во строк. У Мура на одну строку больше.
// if (source.at(Automata::FormatFile::TYPE).toInt() == Automata::Mili::Type) {
// source.insert(Automata::FormatFile::ROWS, QString("%1")
// .arg(source.at(Automata::FormatFile::COLUMNS).toInt()));
// } else if (source.at(Automata::FormatFile::TYPE).toInt() == Automata::Mura::Type) {
// source.insert(Automata::FormatFile::ROWS, QString("%1")
// .arg(source.at(Automata::FormatFile::COLUMNS).toInt() + 1));
// } else {
// qDebug() << "main : Automata::FormatFile::TYPE error";
// return 102;
// }
// if (!m->formGraph->CreateAutomat(source)) {
// qDebug() << "main : !widget->CreateAutomat(source))";
// return 103;
// }
m->show();
return app.exec();
}