Ignore:
Timestamp:
07/02/13 13:11:02 (11 years ago)
Author:
Malte Marquarding
Message:

Issue #293: added scantbale.drop_history and added extra parameters to scantable.history to allow selection of rows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STHistory.cpp

    r2243 r2820  
    2020#include "STDefs.h"
    2121#include "STHistory.h"
    22 
     22#include "MathUtils.h"
    2323
    2424using namespace casa;
     
    8181{
    8282  const Table& t = other.table();
    83   addEntry(asap::SEPERATOR);
    84   TableCopy::copyRows(table_, t, table_.nrow(), 0, t.nrow());
    85   addEntry(asap::SEPERATOR);
     83  if (other.nrow() > 0) {
     84    addEntry(asap::SEPERATOR);
     85    TableCopy::copyRows(table_, t, table_.nrow(), 0, t.nrow());
     86    addEntry(asap::SEPERATOR);
     87  }
    8688
    8789}
    8890
    89 std::vector<std::string> asap::STHistory::getHistory( ) const
     91std::vector<std::string> asap::STHistory::getHistory( int nrow,
     92                                                      int start) const
    9093{
    91   std::vector<std::string> stlout;
    92   for (uInt i=0; i<table_.nrow(); ++i) {
    93     stlout.push_back(itemCol_(i));
     94  if (nrow < 0) {
     95    nrow = this->nrow();
    9496  }
    95   return stlout;
     97  AlwaysAssert(nrow <= this->nrow(), AipsError);
     98  Vector<String> rows;
     99  Slicer slice(IPosition(1, start), IPosition(1, nrow));
     100 
     101  rows = itemCol_.getColumnRange(slice);
     102  return mathutil::tovectorstring(rows);
    96103}
    97104
     105  void asap::STHistory::drop() {
     106    table_.removeRow(table_.rowNumbers());
     107  }
     108
    98109}
Note: See TracChangeset for help on using the changeset viewer.