23 #ifndef __SPEEDCALCULATOR_H__ 24 #define __SPEEDCALCULATOR_H__ 42 qint64 expectedDataSize()
const {
return dataSizeExpected; }
69 return lastRegisterAttemptDataSize;
105 qint64 totalAmountOfArrivedData;
110 qint64 timeOfArrival;
114 this->totalAmountOfArrivedData = 0;
115 this->timeOfArrival = 0;
118 DataArrivalInfo(qint64 totalAmountOfArrivedData, qint64 timeOfArrival)
120 this->totalAmountOfArrivedData = totalAmountOfArrivedData;
121 this->timeOfArrival = timeOfArrival;
125 static const int NUM_ARRIVAL_DATA = 2;
127 QVector<DataArrivalInfo> arrivalData;
130 qint64 dataSizeExpected;
136 qint64 lastRegisterAttemptDataSize;
void start()
Clears all values. Prepares SpeedCalculator for new speed measure.
qint64 lastRegisteredDataAmount() const
Last amount of data registered through registerDataAmount() method.
void registerDataAmount(qint64 totalAmountOfArrivedData)
Register new total amount of data.
long double getSpeed() const
In bytes per second.
void setExpectedDataSize(qint64 size)
Maximum expected size of the data.
qint64 lastRegisterAttemptedDataAmount() const
Last amount of data that was passed to registerDataAmount()
long double estimatedTimeUntilArrival() const
In seconds.