- Timestamp:
- 07/02/13 13:11:02 (11 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STHistory.cpp
r2243 r2820 20 20 #include "STDefs.h" 21 21 #include "STHistory.h" 22 22 #include "MathUtils.h" 23 23 24 24 using namespace casa; … … 81 81 { 82 82 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 } 86 88 87 89 } 88 90 89 std::vector<std::string> asap::STHistory::getHistory( ) const 91 std::vector<std::string> asap::STHistory::getHistory( int nrow, 92 int start) const 90 93 { 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(); 94 96 } 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); 96 103 } 97 104 105 void asap::STHistory::drop() { 106 table_.removeRow(table_.rowNumbers()); 107 } 108 98 109 } -
trunk/src/STHistory.h
r1353 r2820 62 62 * @return a vector of strings 63 63 */ 64 std::vector<std::string> getHistory( ) const;64 std::vector<std::string> getHistory(int nrow=-1, int start=0 ) const; 65 65 66 66 const casa::String& name() const { return name_; } 67 68 int nrow() const { return table_.nrow(); } 69 70 71 void drop(); 67 72 68 73 private: -
trunk/src/Scantable.h
r2818 r2820 378 378 void makePersistent(const std::string& filename); 379 379 380 std::vector<std::string> getHistory() const 381 { return historyTable_.getHistory(); }; 380 std::vector<std::string> getHistory(int nrow=-1, int start=0) const 381 { return historyTable_.getHistory(nrow, start); } 382 383 uint historyLength() 384 { return historyTable_.nrow(); } 385 386 void dropHistory() { historyTable_.drop(); } 382 387 383 388 void addHistory(const std::string& hist) { historyTable_.addEntry(hist); } -
trunk/src/ScantableWrapper.h
r2818 r2820 242 242 } 243 243 244 std::vector<std::string> getHistory() const 245 { return table_->getHistory(); } 244 std::vector<std::string> getHistory(int nrow=-1, int start=0) const 245 { return table_->getHistory(nrow, start); } 246 247 uint historyLength() { 248 return table_->historyLength(); 249 } 250 251 void dropHistory() { table_->dropHistory(); } 246 252 247 253 void addHistory(const std::string& hist) -
trunk/src/python_Scantable.cpp
r2818 r2820 131 131 .def("_gethistory", &ScantableWrapper::getHistory) 132 132 .def("_addhistory", &ScantableWrapper::addHistory) 133 .def("drop_history", &ScantableWrapper::dropHistory) 134 .def("_historylength", &ScantableWrapper::historyLength) 133 135 .def("_getselection", &ScantableWrapper::getSelection) 134 136 .def("_setselection", &ScantableWrapper::setSelection)
Note:
See TracChangeset
for help on using the changeset viewer.