Changeset 82 in ntrip for trunk/BNC/bncmain.cpp
- Timestamp:
- Aug 30, 2006, 5:35:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncmain.cpp
r59 r82 16 16 * -----------------------------------------------------------------------*/ 17 17 18 #ifdef WIN3219 #include <windows.h>20 #endif21 22 18 #include <QApplication> 23 19 #include <QFile> 24 20 #include <iostream> 25 21 22 #include "bncapp.h" 26 23 #include "bncwindow.h" 27 24 28 25 using namespace std; 29 26 30 #ifdef WIN32 31 QFile logFile("BNC.LOG"); 32 QTextStream logStream; 33 #endif 34 35 void myMessageOutput(QtMsgType, const char *msg) { 36 #ifdef WIN32 37 logStream << msg << endl; 38 logStream.flush(); 39 #else 40 cerr << msg << endl; 41 #endif 42 } 43 27 // Main Program 28 ///////////////////////////////////////////////////////////////////////////// 44 29 int main(int argc, char *argv[]) { 45 30 … … 49 34 } 50 35 51 QApplication app(argc, argv, GUIenabled); 52 53 #ifdef WIN32 54 logFile.open(QIODevice::WriteOnly); 55 logStream.setDevice(&logFile); 56 #endif 57 qInstallMsgHandler(myMessageOutput); 36 bncApp app(argc, argv, GUIenabled); 58 37 59 38 QCoreApplication::setOrganizationName("AIUB"); … … 61 40 QCoreApplication::setApplicationName("Bernese NTRIP Client"); 62 41 63 bncWindow* bncWin = 0;64 65 42 if (GUIenabled) { 66 bncWin = new bncWindow();43 bncWindow* bncWin = new bncWindow(); 67 44 bncWin->show(); 68 45 } … … 78 55 79 56 app.connect(caster, SIGNAL(getThreadErrors()), &app, SLOT(quit())); 57 app.connect(caster, SIGNAL(newMessage(const QByteArray&)), 58 &app, SLOT(slotMessage(const QByteArray&))); 80 59 81 60 caster->start(); … … 84 63 while (it.hasNext()) { 85 64 QStringList hlp = it.next().split(" "); 65 if (hlp.size() <= 1) continue; 86 66 QUrl url(hlp[0]); 87 67 QByteArray mountPoint = url.path().mid(1).toAscii(); … … 92 72 mountPoint, user, password, 93 73 format); 74 app.connect(getThread, SIGNAL(newMessage(const QByteArray&)), 75 &app, SLOT(slotMessage(const QByteArray&))); 76 94 77 caster->addGetThread(getThread); 95 78 96 79 getThread->start(); 97 80 } 81 if (caster->nMountPoints() == 0) { 82 return 0; 83 } 98 84 } 99 85 return app.exec();
Note:
See TracChangeset
for help on using the changeset viewer.