Changeset 2882 in ntrip


Ignore:
Timestamp:
Jan 26, 2011, 11:22:21 AM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncantex.cpp

    r2881 r2882  
    5353////////////////////////////////////////////////////////////////////////////
    5454bncAntex::~bncAntex() {
     55  QMapIterator<QString, t_antMap*> it(_maps);
     56  while (it.hasNext()) {
     57    it.next();
     58    delete it.value();
     59  }
    5560}
    5661
    5762//
    5863////////////////////////////////////////////////////////////////////////////
    59 void bncAntex::readFile(const QString& fileName) {
     64t_irc bncAntex::readFile(const QString& fileName) {
    6065
    6166  QFile inFile(fileName);
     
    6671  while ( !in.atEnd() ) {
    6772    QString line = in.readLine();
     73 
     74    t_antMap* newMap = 0;
     75    if      (line.indexOf("START OF ANTENNA") == 60) {
     76      if (newMap) {
     77        delete newMap;
     78        return failure;
     79      }
     80      else {
     81        newMap = new t_antMap();
     82      }
     83    }
    6884
     85    else if (line.indexOf("END OF ANTENNA") == 60) {
     86      if (newMap) {
     87        _maps[newMap->antName] = newMap;
     88        newMap = 0;
     89      }
     90      else {
     91        return failure;
     92      }
     93    }
    6994  }
     95
     96  return success;
    7097}
  • trunk/BNC/bncantex.h

    r2880 r2882  
    2828#include <QtCore>
    2929#include <newmat.h>
     30#include "bncconst.h"
    3031#include "bnctime.h"
    3132
     
    3435  bncAntex();
    3536  ~bncAntex();
    36   void readFile(const QString& fileName);
     37  t_irc readFile(const QString& fileName);
    3738
    3839 private:
     
    4849  class t_antMap {
    4950   public:
    50     QString  antName;
    51     double   phaseCenterL1[3];
    52     double   phaseCenterL2[3];
    53     t_frqMap frqMapL1;
    54     t_frqMap frqMapL2;
    55     bncTime  validFrom;
    56     bncTime  validTo;
     51    t_antMap() {
     52      frqMapL1 = 0;
     53      frqMapL2 = 0;
     54    }
     55    ~t_antMap() {
     56      delete frqMapL1;
     57      delete frqMapL2;
     58    }
     59    QString   antName;
     60    double    phaseCenterL1[3];
     61    double    phaseCenterL2[3];
     62    t_frqMap* frqMapL1;
     63    t_frqMap* frqMapL2;
     64    bncTime   validFrom;
     65    bncTime   validTo;
    5766  };
    5867
    59   QMap<QString, t_antMap> _maps;
     68  QMap<QString, t_antMap*> _maps;
    6069};
    6170
Note: See TracChangeset for help on using the changeset viewer.