QString SICard::toString() const { QStringList sl; //sl << data().dump(); //sl << tr("cardType: %1 (raw type: %2)").arg(cardTypeToString(cardType())).arg(rawCardType()); sl << tr("stationNumber: %1").arg(stationNumber()); sl << tr("cardNumber: %1").arg(cardNumber()); //sl << tr("startNumber: %1").arg(startNumber()); //sl << tr("countryCode: %1").arg(countryCode()); //sl << tr("clubCode: %1").arg(clubCode()); sl << tr("check: %1").arg(time_str(checkTime())); sl << tr("start: %1").arg(time_str(startTime())); sl << tr("finish: %1").arg(time_str(finishTime())); for (int n = 0; n < punchCount(); ++n) { SIPunch p = punchAt(n); sl << (" " + QString::number(n+1)).right(4) + ".\t" + QString::number(p.code()) + "\t" + time_str(p.time()); } return sl.join("\n"); }
// Computes the next finish time for this queue and, if it has one, inserts it into the time index ByTimeIterator computeNextFinishTime(QueueInfo* qi, const Time& last_finish_time) { if ( qi->messageQueue->empty() ) { qi->nextFinishMessage = NULL; return mQueuesByTime.end(); } // If we don't restrict to strict queues, front() may return NULL even though the queue is not empty. // For example, if the input queue is a FairQueue itself, nothing may be able to send due to the // canSend predicate. Message* front_msg = qi->messageQueue->front(); if ( front_msg == NULL ) { qi->nextFinishMessage = NULL; return mQueuesByTime.end(); } qi->nextFinishMessage = front_msg; qi->nextFinishTime = finishTime( front_msg->size(), qi, last_finish_time); qi->nextFinishStartTime = last_finish_time; ByTimeIterator new_it = mQueuesByTime.insert( typename QueueInfoByFinishTime::value_type(qi->nextFinishTime, qi) ); return new_it; }