1 | /* -------------------------------------------------------------------------
|
---|
2 | * BKG NTRIP Server
|
---|
3 | * -------------------------------------------------------------------------
|
---|
4 | *
|
---|
5 | * Class: main
|
---|
6 | *
|
---|
7 | * Purpose: Application starts here
|
---|
8 | *
|
---|
9 | * Author: L. Mervart
|
---|
10 | *
|
---|
11 | * Created: 29-Mar-2008
|
---|
12 | *
|
---|
13 | * Changes:
|
---|
14 | *
|
---|
15 | * -----------------------------------------------------------------------*/
|
---|
16 |
|
---|
17 | #include <iostream>
|
---|
18 |
|
---|
19 | #include "bns.h"
|
---|
20 | #include "bnswindow.h"
|
---|
21 | #include "bnsutils.h"
|
---|
22 | #include "bnsapp.h"
|
---|
23 | #include "bnssettings.h"
|
---|
24 |
|
---|
25 | using namespace std;
|
---|
26 |
|
---|
27 | // Main Program
|
---|
28 | /////////////////////////////////////////////////////////////////////////////
|
---|
29 | int main(int argc, char *argv[]) {
|
---|
30 |
|
---|
31 | QString confFileName;
|
---|
32 |
|
---|
33 | // Command-Line Options
|
---|
34 | // --------------------
|
---|
35 | bool GUIenabled = true;
|
---|
36 |
|
---|
37 | for (int ii = 1; ii < argc; ii++) {
|
---|
38 | if (QByteArray(argv[ii]) == "-nw") {
|
---|
39 | GUIenabled = false;
|
---|
40 | }
|
---|
41 | if (ii + 1 < argc) {
|
---|
42 | if (QByteArray(argv[ii]).indexOf("-conf") != -1) {
|
---|
43 | confFileName = QString(argv[ii+1]);
|
---|
44 | }
|
---|
45 | }
|
---|
46 | }
|
---|
47 | if (argc == 2 && GUIenabled) {
|
---|
48 | confFileName = QString(argv[1]);
|
---|
49 | }
|
---|
50 |
|
---|
51 | // Main Qt Class
|
---|
52 | // -------------
|
---|
53 | //QApplication app(argc, argv, GUIenabled);
|
---|
54 | bnsApp app(argc, argv, GUIenabled);
|
---|
55 |
|
---|
56 | app.setApplicationName("BNS");
|
---|
57 | app.setOrganizationName("BKG");
|
---|
58 | app.setOrganizationDomain("www.bkg.bund.de");
|
---|
59 | app.setConfFileName( confFileName );
|
---|
60 |
|
---|
61 | // Interactive Mode - open the main window
|
---|
62 | // ---------------------------------------
|
---|
63 | if (GUIenabled) {
|
---|
64 | bnsWindow* bnsWin = new bnsWindow();
|
---|
65 | bnsWin->show();
|
---|
66 | }
|
---|
67 |
|
---|
68 | // Non-Interactive (Batch) Mode
|
---|
69 | // ----------------------------
|
---|
70 | else {
|
---|
71 | t_bns* bns = new t_bns();
|
---|
72 | bns->start();
|
---|
73 | }
|
---|
74 |
|
---|
75 | return app.exec();
|
---|
76 | }
|
---|