Ignore:
Timestamp:
03/01/06 14:00:04 (18 years ago)
Author:
mar637
Message:

reworked history table
added STHistory class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r859 r860  
    7474  moleculeTable_ = STMolecules(*this);
    7575  table_.rwKeywordSet().defineTable("MOLECULES", moleculeTable_.table());
    76   setupHistoryTable();
     76  historyTable_ = STHistory(*this);
     77  table_.rwKeywordSet().defineTable("HISTORY", historyTable_.table());
    7778  setupFitTable();
    78   historyTable_ = table_.keywordSet().asTable("HISTORY");
    7979  fitTable_ = table_.keywordSet().asTable("FITS");
    8080  originalTable_ = table_;
     
    9999  attach();
    100100}
    101 
    102101
    103102Scantable::Scantable( const Scantable& other, bool clear )
     
    141140  tcalTable_ = STTcal(table_);
    142141  moleculeTable_ = STMolecules(table_);
     142  historyTable_ = STHistory(table_);
    143143}
    144144
     
    213213  originalTable_ = table_;
    214214
    215 }
    216 
    217 void Scantable::setupHistoryTable( )
    218 {
    219   TableDesc tdh("", "1", TableDesc::Scratch);
    220   tdh.addColumn(ScalarColumnDesc<String>("ITEM"));
    221   SetupNewTable histtab("history", tdh, Table::Scratch);
    222   Table histTable(histtab, Table::Memory);
    223   table_.rwKeywordSet().defineTable("HISTORY", histTable);
    224215}
    225216
     
    522513{
    523514  return polCol_(whichrow);
    524 }
    525 
    526 Table Scantable::getHistoryTable() const
    527 {
    528   return table_.keywordSet().asTable("HISTORY");
    529 }
    530 
    531 void Scantable::appendToHistoryTable(const Table& otherHist)
    532 {
    533   Table t = table_.rwKeywordSet().asTable("HISTORY");
    534 
    535   addHistory(asap::SEPERATOR);
    536   TableCopy::copyRows(t, otherHist, t.nrow(), 0, otherHist.nrow());
    537   addHistory(asap::SEPERATOR);
    538 }
    539 
    540 void Scantable::addHistory(const std::string& hist)
    541 {
    542   Table t = table_.rwKeywordSet().asTable("HISTORY");
    543   uInt nrow = t.nrow();
    544   t.addRow();
    545   ScalarColumn<String> itemCol(t, "ITEM");
    546   itemCol.put(nrow, hist);
    547 }
    548 
    549 std::vector<std::string> Scantable::getHistory() const
    550 {
    551   Vector<String> history;
    552   const Table& t = table_.keywordSet().asTable("HISTORY");
    553   uInt nrow = t.nrow();
    554   ROScalarColumn<String> itemCol(t, "ITEM");
    555   std::vector<std::string> stlout;
    556   String hist;
    557   for (uInt i=0; i<nrow; ++i) {
    558     itemCol.get(i, hist);
    559     stlout.push_back(hist);
    560   }
    561   return stlout;
    562515}
    563516
     
    678631  oss << endl;
    679632  String tmp;
    680   //table_.keywordSet().get("Observer", tmp);
    681   oss << setw(15) << "Observer:" << table_.keywordSet().asString("Observer") << endl;
     633  oss << setw(15) << "Observer:"
     634      << table_.keywordSet().asString("Observer") << endl;
    682635  oss << setw(15) << "Obs Date:" << getTime(-1,true) << endl;
    683636  table_.keywordSet().get("Project", tmp);
Note: See TracChangeset for help on using the changeset viewer.