- Timestamp:
- Jan 26, 2011, 11:22:21 AM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncantex.cpp
r2881 r2882 53 53 //////////////////////////////////////////////////////////////////////////// 54 54 bncAntex::~bncAntex() { 55 QMapIterator<QString, t_antMap*> it(_maps); 56 while (it.hasNext()) { 57 it.next(); 58 delete it.value(); 59 } 55 60 } 56 61 57 62 // 58 63 //////////////////////////////////////////////////////////////////////////// 59 voidbncAntex::readFile(const QString& fileName) {64 t_irc bncAntex::readFile(const QString& fileName) { 60 65 61 66 QFile inFile(fileName); … … 66 71 while ( !in.atEnd() ) { 67 72 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 } 68 84 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 } 69 94 } 95 96 return success; 70 97 } -
trunk/BNC/bncantex.h
r2880 r2882 28 28 #include <QtCore> 29 29 #include <newmat.h> 30 #include "bncconst.h" 30 31 #include "bnctime.h" 31 32 … … 34 35 bncAntex(); 35 36 ~bncAntex(); 36 voidreadFile(const QString& fileName);37 t_irc readFile(const QString& fileName); 37 38 38 39 private: … … 48 49 class t_antMap { 49 50 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; 57 66 }; 58 67 59 QMap<QString, t_antMap> _maps; 68 QMap<QString, t_antMap*> _maps; 60 69 }; 61 70
Note:
See TracChangeset
for help on using the changeset viewer.