Changeset 5097 in ntrip


Ignore:
Timestamp:
Apr 12, 2013, 4:01:55 PM (12 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/inpedit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/inpedit/keyword.cpp

    r5096 r5097  
    2626// Constructor
    2727////////////////////////////////////////////////////////////////////////////
    28 t_keyword::t_keyword(QString line, QTextStream& inStream) {
     28t_keyword::t_keyword(QString line, QTextStream& inStream, QStringList& staticLines) {
    2929
    3030  _ok     = false;
     
    3434  QTextStream in(line.toAscii(), QIODevice::ReadOnly);
    3535  in >> _name >> numVal;
     36
     37  staticLines << _name;
    3638
    3739  if (!_name.isEmpty()) {
     
    4951    while (inStream.status() == QTextStream::Ok && !inStream.atEnd()) {
    5052      line = inStream.readLine().trimmed();
     53      staticLines << line;
    5154      if      (line.isEmpty()) {
    5255        break;
  • trunk/GnssCenter/inpedit/keyword.h

    r5092 r5097  
    88class t_keyword {
    99 public:
    10   t_keyword(QString line, QTextStream& inStream);
     10  t_keyword(QString line, QTextStream& inStream, QStringList& staticLines);
    1111  ~t_keyword();
    1212
  • trunk/GnssCenter/inpedit/panel.cpp

    r5000 r5097  
    2626////////////////////////////////////////////////////////////////////////////
    2727t_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) {
    2930
    3031  _keywords = keywords;
     
    4445  this->setWidget(_page);
    4546
    46   read(line, inStream);
     47  read(line, inStream, staticLines);
    4748
    4849  setWidgetResizable(true);
     
    5657// Read Panel
    5758////////////////////////////////////////////////////////////////////////////
    58 void t_panel::read(QString line, QTextStream& inStream) {
     59void t_panel::read(QString line, QTextStream& inStream, QStringList& staticLines) {
     60  staticLines << line;
    5961  int iRow = -1;
    6062  while (inStream.status() == QTextStream::Ok && !inStream.atEnd()) {
    6163    line = inStream.readLine().trimmed();
     64    staticLines << line;
    6265    if  (line.isEmpty() || line.indexOf("END_PANEL") != -1) {
    6366      break;
  • trunk/GnssCenter/inpedit/panel.h

    r5000 r5097  
    1111 public:
    1212  t_panel(const QString& line, QTextStream& inStream,
    13           QMap<QString, t_keyword*>* keywords);
     13          QMap<QString, t_keyword*>* keywords,
     14          QStringList& staticLines);
    1415  ~t_panel();
    1516  bool ok() const {return _ok;}
    1617
    1718 private:
    18   void read(QString line, QTextStream& inStream);
     19  void read(QString line, QTextStream& inStream,
     20            QStringList& staticLines);
    1921  void addWidget(QWidget* widget, int row, int col,
    2022                 int rSpan, int cSpan, const QString& toolTip = "");
  • trunk/GnssCenter/inpedit/tabwidget.cpp

    r5090 r5097  
    1616 * -----------------------------------------------------------------------*/
    1717
     18#include <iostream>
    1819#include "tabwidget.h"
    1920#include "keyword.h"
     
    4950void t_tabWidget::readFile() {
    5051
     52  _staticLines.clear();
     53
    5154  QFile file(_fileName);
    5255  file.open(QIODevice::ReadOnly | QIODevice::Text);
     
    6164    // -----------------------------
    6265    if      (line.isEmpty() || line[0] == '!') {
     66      _staticLines << line;
    6367      continue;
    6468    }
     
    6771    // -----------
    6872    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);
    7074      if (panel->ok()) {
    7175        ++iPanel;
     
    8084    // -------------
    8185    else {
    82       t_keyword* keyword = new t_keyword(line, inStream);
     86      t_keyword* keyword = new t_keyword(line, inStream, _staticLines);
    8387      if (keyword->ok()) {
    8488        _keywords[keyword->name()] = keyword;
     
    8993    }
    9094  }
     95
     96  //// beg test
     97  for (int ii = 0; ii < _staticLines.size(); ii++) {
     98    cout << _staticLines[ii].toAscii().data() << endl;
     99  }
     100  //// end test
    91101}
  • trunk/GnssCenter/inpedit/tabwidget.h

    r5090 r5097  
    1818  QString                   _fileName;
    1919  QMap<QString, t_keyword*> _keywords;
     20  QStringList               _staticLines;
    2021};
    2122
Note: See TracChangeset for help on using the changeset viewer.