Line | |
---|
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 <unistd.h>
|
---|
18 | #include <signal.h>
|
---|
19 | #include <iostream>
|
---|
20 |
|
---|
21 | #include "bnsapp.h"
|
---|
22 | #include "bnswindow.h"
|
---|
23 |
|
---|
24 | using namespace std;
|
---|
25 |
|
---|
26 | void catch_signal(int) {
|
---|
27 | cout << "Program Interrupted by Ctrl-C" << endl;
|
---|
28 | ((bnsApp*)qApp)->slotQuit();
|
---|
29 | }
|
---|
30 |
|
---|
31 | // Main Program
|
---|
32 | /////////////////////////////////////////////////////////////////////////////
|
---|
33 | int main(int argc, char *argv[]) {
|
---|
34 |
|
---|
35 | bool GUIenabled = true;
|
---|
36 | for (int ii = 1; ii < argc; ii++) {
|
---|
37 | if (QString(argv[ii]) == "-nw") {
|
---|
38 | GUIenabled = false;
|
---|
39 | break;
|
---|
40 | }
|
---|
41 | }
|
---|
42 |
|
---|
43 | QCoreApplication::setOrganizationName("BKG");
|
---|
44 | QCoreApplication::setOrganizationDomain("www.bkg.bund.de");
|
---|
45 | QCoreApplication::setApplicationName("BKG_NTRIP_Server");
|
---|
46 |
|
---|
47 | // Default Settings
|
---|
48 | // ----------------
|
---|
49 | QSettings settings;
|
---|
50 | if (settings.allKeys().size() == 0) {
|
---|
51 | }
|
---|
52 |
|
---|
53 | bnsApp app(argc, argv, GUIenabled);
|
---|
54 |
|
---|
55 | // Interactive Mode - open the main window
|
---|
56 | // ---------------------------------------
|
---|
57 | if (GUIenabled) {
|
---|
58 | bnsWindow* bnsWin = new bnsWindow();
|
---|
59 | bnsWin->show();
|
---|
60 | }
|
---|
61 |
|
---|
62 | // Non-Interactive (Batch) Mode
|
---|
63 | // ----------------------------
|
---|
64 | else {
|
---|
65 | cerr << "non-interactive mode not yet implemented" << endl;
|
---|
66 | exit(0);
|
---|
67 | }
|
---|
68 |
|
---|
69 | // Start the application
|
---|
70 | // ---------------------
|
---|
71 | return app.exec();
|
---|
72 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.