correct PIBinaryLog play_speed

git-svn-id: svn://db.shs.com.ru/pip@121 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-04-27 09:52:12 +00:00
parent 4a6bc6a4ab
commit 57e0e56c71
3 changed files with 8 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
project(pip)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include(CheckFunctionExists)

View File

@@ -146,10 +146,12 @@ bool PIBinaryLog::threadedRead(uchar *readed, int size) {
int dtc;
if (is_started) {
if (delay > 0) {
cdelay = delay / play_speed;
cdelay = delay * play_speed;
dtc = int(cdelay) /100;
if (play_speed <= 0.) dtc = 1;
for (int j=0; j<dtc; j++) {
cdelay = delay / play_speed;
if (play_speed <= 0.) j--;
cdelay = delay * play_speed;
dtc = int(cdelay) /100;
PISystemTime::fromMilliseconds(100).sleep();
}
@@ -541,7 +543,8 @@ void PIBinaryLog::propertyChanged(const PIString &) {
default_id = property("defaultID").toInt();
rapid_start = property("rapidStart").toBool();
play_mode = (PlayMode)property("playMode").toInt();
play_speed = property("playSpeed").toDouble();
double ps = property("playSpeed").toDouble();
play_speed = ps > 0 ? 1. / ps : 0;
play_delay = property("playDelay").toSystemTime();
split_mode = (SplitMode)property("splitMode").toInt();
split_time = property("splitTime").toSystemTime();

View File

@@ -103,7 +103,7 @@ public:
int defaultID() const {return default_id;}
//! Returns current play speed
double playSpeed() const {return play_speed;}
double playSpeed() const {return play_speed > 0 ? 1. / play_speed : 0;}
//! Returns current play delay
PISystemTime playDelay() const {return play_delay;}