comparison data/model/EditableDenseThreeDimensionalModel.cpp @ 1679:0d89abd631ac single-point

Re-add the toDelimitedDataString stuff
author Chris Cannam
date Thu, 28 Mar 2019 16:03:36 +0000
parents f97d64b8674f
children 81f50b70bdef
comparison
equal deleted inserted replaced
1678:1078f0ef3012 1679:0d89abd631ac
485 } 485 }
486 } 486 }
487 } 487 }
488 488
489 QString 489 QString
490 EditableDenseThreeDimensionalModel::toDelimitedDataString(QString delimiter) const 490 EditableDenseThreeDimensionalModel::toDelimitedDataString(QString delimiter,
491 { 491 DataExportOptions,
492 QReadLocker locker(&m_lock); 492 sv_frame_t startFrame,
493 QString s; 493 sv_frame_t duration) const
494 for (int i = 0; in_range_for(m_data, i); ++i) {
495 QStringList list;
496 for (int j = 0; in_range_for(m_data.at(i), j); ++j) {
497 list << QString("%1").arg(m_data.at(i).at(j));
498 }
499 s += list.join(delimiter) + "\n";
500 }
501 return s;
502 }
503
504 QString
505 EditableDenseThreeDimensionalModel::toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const
506 { 494 {
507 QReadLocker locker(&m_lock); 495 QReadLocker locker(&m_lock);
508 QString s; 496 QString s;
509 for (int i = 0; in_range_for(m_data, i); ++i) { 497 for (int i = 0; in_range_for(m_data, i); ++i) {
510 sv_frame_t fr = m_startFrame + i * m_resolution; 498 sv_frame_t fr = m_startFrame + i * m_resolution;
511 if (fr >= f0 && fr < f1) { 499 if (fr >= startFrame && fr < startFrame + duration) {
512 QStringList list; 500 QStringList list;
513 for (int j = 0; in_range_for(m_data.at(i), j); ++j) { 501 for (int j = 0; in_range_for(m_data.at(i), j); ++j) {
514 list << QString("%1").arg(m_data.at(i).at(j)); 502 list << QString("%1").arg(m_data.at(i).at(j));
515 } 503 }
516 s += list.join(delimiter) + "\n"; 504 s += list.join(delimiter) + "\n";