#include "UpdateController.h"
#include "dataparser.h"
#include "externalexecuter.h"
#include "screenchecker.h"

#include <QCoreApplication>
#include <QDebug>
#include <QObject>
#include <nonblockedinput.h>
#include <tcpclient.h>
#include <QTextCodec>
#include <QProcess>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    setlocale(LC_ALL,"Russian");

    NonBlockedInput cli;
    TCPClient *client = new TCPClient;
    DataParser *parser = new DataParser;
    UpdateController *updateController = new UpdateController(parser);
    RecognizeSystem *recognizeSystem = new RecognizeSystem;
    ScreenChecker *screenChecker = new ScreenChecker;
    ExternalExecuter *externalExecuter = new ExternalExecuter;


    client->Initialize(updateController,recognizeSystem,externalExecuter);
    recognizeSystem->Initialize(updateController);

    QObject::connect(&cli,&NonBlockedInput::LineIsRead,client,&TCPClient::onMessageEntered);

    //screenChecker->Check();
    return a.exec();

}
