Changeset 5066 in ntrip for trunk/BNC/src/bncapp.cpp
- Timestamp:
- Mar 30, 2013, 11:31:00 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncapp.cpp
r4904 r5066 27 27 * ------------------------------------------------------------------------- 28 28 * 29 * Class: bncApp29 * Class: t_pgmCore 30 30 * 31 31 * Purpose: This class implements the main application … … 58 58 // Constructor 59 59 //////////////////////////////////////////////////////////////////////////// 60 bncApp::bncApp(int& argc, char* argv[], bool GUIenabled) : 61 QApplication(argc, argv, GUIenabled) { 62 60 t_pgmCore::t_pgmCore(int& argc, char* argv[], bool GUIenabled) { 63 61 _GUIenabled = GUIenabled; 64 62 _logFileFlag = 0; … … 127 125 // Destructor 128 126 //////////////////////////////////////////////////////////////////////////// 129 bncApp::~bncApp() {127 t_pgmCore::~t_pgmCore() { 130 128 delete _logStream; 131 129 delete _logFile; … … 163 161 // Write a Program Message 164 162 //////////////////////////////////////////////////////////////////////////// 165 void bncApp::slotMessage(QByteArray msg, bool showOnScreen) {163 void t_pgmCore::slotMessage(QByteArray msg, bool showOnScreen) { 166 164 167 165 QMutexLocker locker(&_mutexMessage); … … 173 171 // Write a Program Message (private, no lock) 174 172 //////////////////////////////////////////////////////////////////////////// 175 void bncApp::messagePrivate(const QByteArray& msg) {173 void t_pgmCore::messagePrivate(const QByteArray& msg) { 176 174 177 175 // First time resolve the log file name … … 215 213 // New GPS Ephemeris 216 214 //////////////////////////////////////////////////////////////////////////// 217 void bncApp::slotNewGPSEph(gpsephemeris* gpseph) {215 void t_pgmCore::slotNewGPSEph(gpsephemeris* gpseph) { 218 216 219 217 QMutexLocker locker(&_mutex); … … 246 244 // New Glonass Ephemeris 247 245 //////////////////////////////////////////////////////////////////////////// 248 void bncApp::slotNewGlonassEph(glonassephemeris* glonasseph) {246 void t_pgmCore::slotNewGlonassEph(glonassephemeris* glonasseph) { 249 247 250 248 QMutexLocker locker(&_mutex); … … 292 290 // New Galileo Ephemeris 293 291 //////////////////////////////////////////////////////////////////////////// 294 void bncApp::slotNewGalileoEph(galileoephemeris* galileoeph) {292 void t_pgmCore::slotNewGalileoEph(galileoephemeris* galileoeph) { 295 293 296 294 QMutexLocker locker(&_mutex); … … 327 325 // Print Header of the output File(s) 328 326 //////////////////////////////////////////////////////////////////////////// 329 void bncApp::printEphHeader() {327 void t_pgmCore::printEphHeader() { 330 328 331 329 bncSettings settings; … … 499 497 // Print One GPS Ephemeris 500 498 //////////////////////////////////////////////////////////////////////////// 501 void bncApp::printGPSEph(gpsephemeris* ep, bool printFile) {499 void t_pgmCore::printGPSEph(gpsephemeris* ep, bool printFile) { 502 500 503 501 t_ephGPS eph; … … 512 510 // Print One Glonass Ephemeris 513 511 //////////////////////////////////////////////////////////////////////////// 514 void bncApp::printGlonassEph(glonassephemeris* ep, bool printFile) {512 void t_pgmCore::printGlonassEph(glonassephemeris* ep, bool printFile) { 515 513 516 514 t_ephGlo eph; … … 526 524 // Print One Galileo Ephemeris 527 525 //////////////////////////////////////////////////////////////////////////// 528 void bncApp::printGalileoEph(galileoephemeris* ep, bool printFile) {526 void t_pgmCore::printGalileoEph(galileoephemeris* ep, bool printFile) { 529 527 530 528 t_ephGal eph; … … 539 537 // Output 540 538 //////////////////////////////////////////////////////////////////////////// 541 void bncApp::printOutput(bool printFile, QTextStream* stream,539 void t_pgmCore::printOutput(bool printFile, QTextStream* stream, 542 540 const QString& strV2, const QString& strV3) { 543 541 … … 576 574 // Set Port Number 577 575 //////////////////////////////////////////////////////////////////////////// 578 void bncApp::setPort(int port) {576 void t_pgmCore::setPort(int port) { 579 577 _port = port; 580 578 if (_port != 0) { … … 582 580 _server = new QTcpServer; 583 581 if ( !_server->listen(QHostAddress::Any, _port) ) { 584 slotMessage(" bncApp: Cannot listen on ephemeris port", true);582 slotMessage("t_pgmCore: Cannot listen on ephemeris port", true); 585 583 } 586 584 connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); … … 592 590 // Set Port Number 593 591 //////////////////////////////////////////////////////////////////////////// 594 void bncApp::setPortCorr(int port) {592 void t_pgmCore::setPortCorr(int port) { 595 593 _portCorr = port; 596 594 if (_portCorr != 0) { … … 598 596 _serverCorr = new QTcpServer; 599 597 if ( !_serverCorr->listen(QHostAddress::Any, _portCorr) ) { 600 slotMessage(" bncApp: Cannot listen on correction port", true);598 slotMessage("t_pgmCore: Cannot listen on correction port", true); 601 599 } 602 600 connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr())); … … 608 606 // New Connection 609 607 //////////////////////////////////////////////////////////////////////////// 610 void bncApp::slotNewConnection() {608 void t_pgmCore::slotNewConnection() { 611 609 _sockets->push_back( _server->nextPendingConnection() ); 612 610 } … … 614 612 // New Connection 615 613 //////////////////////////////////////////////////////////////////////////// 616 void bncApp::slotNewConnectionCorr() {614 void t_pgmCore::slotNewConnectionCorr() { 617 615 _socketsCorr->push_back( _serverCorr->nextPendingConnection() ); 618 616 } … … 620 618 // 621 619 //////////////////////////////////////////////////////////////////////////// 622 void bncApp::slotQuit() {623 cout << " bncApp::slotQuit" << endl;620 void t_pgmCore::slotQuit() { 621 cout << "t_pgmCore::slotQuit" << endl; 624 622 delete _caster; 625 q uit();623 qApp->quit(); 626 624 } 627 625 628 626 // 629 627 //////////////////////////////////////////////////////////////////////////// 630 void bncApp::slotNewCorrLine(QString line, QString staID, long coTime) {628 void t_pgmCore::slotNewCorrLine(QString line, QString staID, long coTime) { 631 629 632 630 QMutexLocker locker(&_mutex); … … 680 678 // Dump Complete Correction Epochs 681 679 //////////////////////////////////////////////////////////////////////////// 682 void bncApp::dumpCorrs(long minTime, long maxTime) {680 void t_pgmCore::dumpCorrs(long minTime, long maxTime) { 683 681 for (long sec = minTime; sec <= maxTime; sec++) { 684 682 QList<QString> allCorrs = _corrs->values(sec); … … 690 688 // Dump all corrections 691 689 //////////////////////////////////////////////////////////////////////////// 692 void bncApp::dumpCorrs() {690 void t_pgmCore::dumpCorrs() { 693 691 QList<QString> allCorrs; 694 692 QMutableMapIterator<long, QString> it(*_corrs); … … 702 700 // Dump List of Corrections 703 701 //////////////////////////////////////////////////////////////////////////// 704 void bncApp::dumpCorrs(const QList<QString>& allCorrs) {702 void t_pgmCore::dumpCorrs(const QList<QString>& allCorrs) { 705 703 emit newCorrections(allCorrs); 706 704 if (_socketsCorr) { … … 729 727 // 730 728 //////////////////////////////////////////////////////////////////////////// 731 void bncApp::setConfFileName(const QString& confFileName) {729 void t_pgmCore::setConfFileName(const QString& confFileName) { 732 730 if (confFileName.isEmpty()) { 733 731 _confFileName = QDir::homePath() + QDir::separator() 734 732 + ".config" + QDir::separator() 735 + organizationName() + QDir::separator()736 + applicationName() + ".bnc";733 + qApp->organizationName() + QDir::separator() 734 + qApp->applicationName() + ".bnc"; 737 735 } 738 736 else { … … 743 741 // Raw Output 744 742 //////////////////////////////////////////////////////////////////////////// 745 void bncApp::writeRawData(const QByteArray& data, const QByteArray& staID,743 void t_pgmCore::writeRawData(const QByteArray& data, const QByteArray& staID, 746 744 const QByteArray& format) { 747 745 … … 763 761 // Get Glonass Slot Numbers from Global Array 764 762 //////////////////////////////////////////////////////////////////////////// 765 void bncApp::getGlonassSlotNums(int GLOFreq[]) {763 void t_pgmCore::getGlonassSlotNums(int GLOFreq[]) { 766 764 767 765 QMutexLocker locker(&_mutex); … … 776 774 // Store Glonass Slot Numbers to Global Array 777 775 //////////////////////////////////////////////////////////////////////////// 778 void bncApp::storeGlonassSlotNums(const int GLOFreq[]) {776 void t_pgmCore::storeGlonassSlotNums(const int GLOFreq[]) { 779 777 780 778 QMutexLocker locker(&_mutex); … … 789 787 // 790 788 //////////////////////////////////////////////////////////////////////////// 791 void bncApp::initCombination() {789 void t_pgmCore::initCombination() { 792 790 #ifdef USE_COMBINATION 793 791 _bncComb = new bncComb(); … … 801 799 // 802 800 //////////////////////////////////////////////////////////////////////////// 803 void bncApp::stopCombination() {801 void t_pgmCore::stopCombination() { 804 802 #ifdef USE_COMBINATION 805 803 delete _bncComb; … … 808 806 } 809 807 810 // Handling Events (virtual)811 ////////////////////////////////////////////////////////////////////////////812 bool bncApp::event(QEvent* ev) {813 814 if (ev->type() == QEvent::FileOpen) { // currently happens on Mac only815 QString fileName = static_cast<QFileOpenEvent*>(ev)->file();816 setConfFileName(fileName);817 return true;818 }819 820 return QApplication::event(ev);821 }822 823 808 // Check Ephemeris Consistency 824 809 //////////////////////////////////////////////////////////////////////////// 825 void bncApp::checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph) {810 void t_pgmCore::checkEphemeris(gpsephemeris* oldEph, gpsephemeris* newEph) { 826 811 if (oldEph->clock_bias != newEph->clock_bias || 827 812 oldEph->clock_drift != newEph->clock_drift ||
Note:
See TracChangeset
for help on using the changeset viewer.