/* NAME: Kirill Vasil'evich Timofeev, 322
 * ASGN: N1
 */

#include "View.h"
#include "Controller.h"
#include <QtCore/QTextStream>
#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
QTextStream in(stdin),out(stdout);

View::View()
{
}

View::~View()
{
}

Console::Console()
{
}

Console::~Console()
{
}

void Console::showMessage(const QString msg, const bool b,QImage* temp)
{
    out << msg << endl;
}

QString Console::message(QString msg)
{

    QString newStr;
    do
    {
        showMessage(msg);
        in >> newStr;
        //out << newStr;
    }
    while (newStr.isEmpty());

    return newStr;
}

void Console::mesBox(char*)
{
}

void Console::controlActions(Controller *tr, char* temp)
{
    switch (temp[0])
    {

       case 't':
          tr->training();     // Тренеровка
       break;

       case 'i':
          tr->serIn();     // Поиск в изображении с учетом ранее полученной модели
       break;

       case 'd':
          tr->serDir();     // Поиск в директории с учетом ранее полученной модели
       break;

       case 'c':
          tr->PRcount();     // Посчитать точность и полноту
       break;

       default: tr->exit(); // выход

    }
}


