Changeset 5097 in ntrip
- Timestamp:
- Apr 12, 2013, 4:01:55 PM (12 years ago)
- Location:
- trunk/GnssCenter/inpedit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/inpedit/keyword.cpp
r5096 r5097 26 26 // Constructor 27 27 //////////////////////////////////////////////////////////////////////////// 28 t_keyword::t_keyword(QString line, QTextStream& inStream ) {28 t_keyword::t_keyword(QString line, QTextStream& inStream, QStringList& staticLines) { 29 29 30 30 _ok = false; … … 34 34 QTextStream in(line.toAscii(), QIODevice::ReadOnly); 35 35 in >> _name >> numVal; 36 37 staticLines << _name; 36 38 37 39 if (!_name.isEmpty()) { … … 49 51 while (inStream.status() == QTextStream::Ok && !inStream.atEnd()) { 50 52 line = inStream.readLine().trimmed(); 53 staticLines << line; 51 54 if (line.isEmpty()) { 52 55 break; -
trunk/GnssCenter/inpedit/keyword.h
r5092 r5097 8 8 class t_keyword { 9 9 public: 10 t_keyword(QString line, QTextStream& inStream );10 t_keyword(QString line, QTextStream& inStream, QStringList& staticLines); 11 11 ~t_keyword(); 12 12 -
trunk/GnssCenter/inpedit/panel.cpp
r5000 r5097 26 26 //////////////////////////////////////////////////////////////////////////// 27 27 t_panel::t_panel(const QString& line, QTextStream& inStream, 28 QMap<QString, t_keyword*>* keywords) : QScrollArea(0) { 28 QMap<QString, t_keyword*>* keywords, 29 QStringList& staticLines) : QScrollArea(0) { 29 30 30 31 _keywords = keywords; … … 44 45 this->setWidget(_page); 45 46 46 read(line, inStream );47 read(line, inStream, staticLines); 47 48 48 49 setWidgetResizable(true); … … 56 57 // Read Panel 57 58 //////////////////////////////////////////////////////////////////////////// 58 void t_panel::read(QString line, QTextStream& inStream) { 59 void t_panel::read(QString line, QTextStream& inStream, QStringList& staticLines) { 60 staticLines << line; 59 61 int iRow = -1; 60 62 while (inStream.status() == QTextStream::Ok && !inStream.atEnd()) { 61 63 line = inStream.readLine().trimmed(); 64 staticLines << line; 62 65 if (line.isEmpty() || line.indexOf("END_PANEL") != -1) { 63 66 break; -
trunk/GnssCenter/inpedit/panel.h
r5000 r5097 11 11 public: 12 12 t_panel(const QString& line, QTextStream& inStream, 13 QMap<QString, t_keyword*>* keywords); 13 QMap<QString, t_keyword*>* keywords, 14 QStringList& staticLines); 14 15 ~t_panel(); 15 16 bool ok() const {return _ok;} 16 17 17 18 private: 18 void read(QString line, QTextStream& inStream); 19 void read(QString line, QTextStream& inStream, 20 QStringList& staticLines); 19 21 void addWidget(QWidget* widget, int row, int col, 20 22 int rSpan, int cSpan, const QString& toolTip = ""); -
trunk/GnssCenter/inpedit/tabwidget.cpp
r5090 r5097 16 16 * -----------------------------------------------------------------------*/ 17 17 18 #include <iostream> 18 19 #include "tabwidget.h" 19 20 #include "keyword.h" … … 49 50 void t_tabWidget::readFile() { 50 51 52 _staticLines.clear(); 53 51 54 QFile file(_fileName); 52 55 file.open(QIODevice::ReadOnly | QIODevice::Text); … … 61 64 // ----------------------------- 62 65 if (line.isEmpty() || line[0] == '!') { 66 _staticLines << line; 63 67 continue; 64 68 } … … 67 71 // ----------- 68 72 else if (line[0] == '#' && line.indexOf("BEGIN_PANEL") != -1) { 69 t_panel* panel = new t_panel(line, inStream, &_keywords );73 t_panel* panel = new t_panel(line, inStream, &_keywords, _staticLines); 70 74 if (panel->ok()) { 71 75 ++iPanel; … … 80 84 // ------------- 81 85 else { 82 t_keyword* keyword = new t_keyword(line, inStream );86 t_keyword* keyword = new t_keyword(line, inStream, _staticLines); 83 87 if (keyword->ok()) { 84 88 _keywords[keyword->name()] = keyword; … … 89 93 } 90 94 } 95 96 //// beg test 97 for (int ii = 0; ii < _staticLines.size(); ii++) { 98 cout << _staticLines[ii].toAscii().data() << endl; 99 } 100 //// end test 91 101 } -
trunk/GnssCenter/inpedit/tabwidget.h
r5090 r5097 18 18 QString _fileName; 19 19 QMap<QString, t_keyword*> _keywords; 20 QStringList _staticLines; 20 21 }; 21 22
Note:
See TracChangeset
for help on using the changeset viewer.