23.06.2014 - PICodeParser, PICodeInfo, PIConnection, new binary "pip_cmg"
This commit is contained in:
12
pitimer.cpp
12
pitimer.cpp
@@ -309,7 +309,7 @@ void PITimer::start(double msecs) {
|
||||
if (msecs < 0 || running_) return;
|
||||
interval_ = msecs;
|
||||
inc_time = PISystemTime::fromMilliseconds(msecs);
|
||||
st_time = currentSystemTime() + inc_time;
|
||||
st_time = PISystemTime::current() + inc_time;
|
||||
deferred_ = false;
|
||||
running_ = true;
|
||||
PIThread::start();
|
||||
@@ -320,9 +320,9 @@ void PITimer::deferredStart(double interval_msecs, double delay_msecs) {
|
||||
//piCoutObj << "defStart exec with" << delay_msecs << interval_msecs;
|
||||
if (interval_msecs < 0 || running_) return;
|
||||
interval_ = interval_msecs;
|
||||
PISystemTime cst = currentSystemTime();
|
||||
PISystemTime cst = PISystemTime::current();
|
||||
inc_time = PISystemTime::fromMilliseconds(interval_msecs);
|
||||
st_time = currentSystemTime() + PISystemTime::fromMilliseconds(delay_msecs);
|
||||
st_time = PISystemTime::current() + PISystemTime::fromMilliseconds(delay_msecs);
|
||||
if (st_time < cst) st_time = cst;
|
||||
running_ = deferred_ = true;
|
||||
PIThread::start();
|
||||
@@ -334,7 +334,7 @@ void PITimer::deferredStart(double interval_msecs, const PIDateTime & start_date
|
||||
//piCoutObj << "defStart exec to" << start_datetime.toString() << interval_msecs;
|
||||
if (interval_msecs < 0 || running_) return;
|
||||
interval_ = interval_msecs;
|
||||
PISystemTime cst = currentSystemTime();
|
||||
PISystemTime cst = PISystemTime::current();
|
||||
inc_time = PISystemTime::fromMilliseconds(interval_msecs);
|
||||
st_time = start_datetime.toSystemTime();
|
||||
if (st_time < cst) st_time = cst;
|
||||
@@ -347,7 +347,7 @@ void PITimer::deferredStart(double interval_msecs, const PIDateTime & start_date
|
||||
void PITimer::run() {
|
||||
if (!running_) return;
|
||||
while (deferred_) {
|
||||
PISystemTime tst = st_time - currentSystemTime();
|
||||
PISystemTime tst = st_time - PISystemTime::current();
|
||||
if (tst.seconds > 0) {
|
||||
piMSleep(100);
|
||||
if (!running_) return;
|
||||
@@ -365,7 +365,7 @@ void PITimer::run() {
|
||||
#ifdef WINDOWS
|
||||
tt_st = __PIQueryPerformanceCounter();
|
||||
#else
|
||||
(st_time - currentSystemTime()).sleep();
|
||||
(st_time - PISystemTime::current()).sleep();
|
||||
st_time += inc_time;
|
||||
#endif
|
||||
//if (lockRun) lock();
|
||||
|
||||
Reference in New Issue
Block a user