add diag to basetransfer

fix pibinarylog delay

git-svn-id: svn://db.shs.com.ru/pip@63 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-07 06:52:41 +00:00
parent 8b7752face
commit e16bd8f652
7 changed files with 151 additions and 14 deletions

View File

@@ -142,11 +142,20 @@ bool PIBinaryLog::threadedRead(uchar *readed, int size) {
break;
case PlayVariableSpeed:
delay = lastrecord.timestamp.toMilliseconds() - play_time;
delay /= play_speed;
double cdelay;
int dtc;
if (is_started) {
if (delay > 0)
/// TODO: Sleep by steps (about 100ms)
PISystemTime::fromMilliseconds(delay).sleep();
if (delay > 0) {
cdelay = delay / play_speed;
dtc = int(cdelay) /100;
for (int j=0; j<dtc; j++) {
cdelay = delay / play_speed;
dtc = int(cdelay) /100;
PISystemTime::fromMilliseconds(100).sleep();
}
cdelay = cdelay - dtc*100;
PISystemTime::fromMilliseconds(cdelay).sleep();
}
} else is_started = true;
play_time = lastrecord.timestamp.toMilliseconds();
break;