This commit is contained in:
Mark Watkins 2014-08-20 03:29:39 +10:00
parent 2d4eb1de72
commit c39a28a536
4 changed files with 8 additions and 5 deletions

View File

@ -326,7 +326,7 @@ void CMS50F37Loader::processBytes(QByteArray bytes)
len = lengths[res & 0x1f];
if (len >= size)
if (len > size)
break;
if (len == 0) {
@ -427,8 +427,7 @@ void CMS50F37Loader::processBytes(QByteArray bytes)
m_importing = true;
m_itemCnt=0;
m_itemTotal=5000;
m_itemTotal=duration;
have_perfindex = (res == 0x9);
@ -439,9 +438,8 @@ void CMS50F37Loader::processBytes(QByteArray bytes)
cb_reset = 1;
}
killTimers();
resetTimer.singleShot(2000,this,SLOT(resetImportTimeout()));
}
break;
default:

View File

@ -59,6 +59,8 @@ Q_OBJECT
virtual int getSessionCount();
virtual int getOximeterInfo();
virtual void setDuration(int d) { duration=d; }
virtual bool commandDriven() { return true; }

View File

@ -86,6 +86,7 @@ public:
QDateTime startTime() { return m_startTime; }
void setStartTime(QDateTime datetime) { m_startTime = datetime; }
virtual bool isStartTimeValid() { return true; }
virtual void setDuration(int) { }
virtual qint64 importResolution() { return 1000; }
virtual qint64 liveResolution() { return 20; }

View File

@ -253,6 +253,7 @@ void OximeterImport::on_directImportButton_clicked()
ui->tableOxiSessions->setItem(i, 0, item);
item->setData(Qt::UserRole+1, datetime);
item->setData(Qt::UserRole, i);
item->setData(Qt::UserRole+2, duration);
item->setFlags(item->flags() & ~Qt::ItemIsEditable);
item = new QTableWidgetItem(QString(). sprintf("%ih, %im, %is", h,m,s));
@ -999,6 +1000,7 @@ void OximeterImport::on_chooseSessionButton_clicked()
if (!item) return;
QDateTime datetime = item->data(Qt::UserRole+1).toDateTime();
oximodule->setStartTime(datetime);
oximodule->setDuration(item->data(Qt::UserRole+2).toInt());
if (selecting_session) {
ui->stackedWidget->setCurrentWidget(ui->directImportPage);