-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
45 lines (36 loc) · 1.46 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
#include "mainwindow.h"
#include <QApplication>
#include <QObject>
#include <QDebug>
#include <QLoggingCategory>
#include "adatahub.h"
#include "masterconfig.h"
#include "trb3datareader.h"
#include "trb3signalextractor.h"
#include "adispatcher.h"
#include "ahldfileprocessor.h"
#include "anetworkmodule.h"
#include "ascriptmanager.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//SUPPRESS WARNINGS about ssl
QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");
MasterConfig Config;
ADataHub DataHub(Config);
Trb3dataReader Reader(&Config);
Trb3signalExtractor Extractor(&Config, &Reader);
AHldFileProcessor HldFileProcessor(Config, Reader, Extractor, DataHub);
AScriptManager ScriptManager;
ANetworkModule Network(&ScriptManager);
ADispatcher Dispatcher(&Config, &Reader, &Extractor, &Network);
MainWindow MW(&Config, &Dispatcher, &DataHub, &Reader, &Extractor, HldFileProcessor, Network);
MW.show();
QObject::connect(&Dispatcher, &ADispatcher::RequestUpdateGui, &MW, &MainWindow::UpdateGui);
QObject::connect(&Dispatcher, &ADispatcher::RequestReadGuiFromJson, &MW, &MainWindow::ReadGUIfromJson);
QObject::connect(&Dispatcher, &ADispatcher::RequestWriteGuiToJson, &MW, &MainWindow::WriteGUItoJson);
QObject::connect(&Dispatcher, &ADispatcher::RequestWriteWindowSettings, &MW, &MainWindow::SaveWindowSettings);
Dispatcher.LoadAutosaveConfig();
MW.UpdateGui();
return a.exec();
}