58 OpenRTM_aist.Task.__init__(self)
90 def __del__(self, Task=OpenRTM_aist.Task):
125 if self._alive.value:
128 self._alive.value =
True 129 OpenRTM_aist.Task.activate(self)
149 self._alive.value =
False 151 self._suspend.cond.acquire()
152 self._suspend.suspend =
False 153 self._suspend.cond.notify()
154 self._suspend.cond.release()
173 self._suspend.cond.acquire()
174 self._suspend.suspend =
True 175 self._suspend.cond.release()
194 self._periodTime.reset()
195 self._execTime.reset()
196 self._suspend.cond.acquire()
197 self._suspend.suspend =
False 198 self._suspend.cond.notify()
199 self._suspend.cond.release()
218 self._suspend.cond.acquire()
219 self._suspend.cond.notify()
220 self._suspend.cond.release()
238 def setTask(self, func, delete_in_dtor = True):
263 if type(period) == float:
268 if self._period.sec() == 0
and self._period.usec() == 0:
337 return self._execStat.stat
350 return self._periodStat.stat
356 while self._alive.value:
358 self._periodTime.tack()
361 self._suspend.cond.acquire()
362 if self._suspend.suspend:
363 self._suspend.cond.wait()
365 if not self._alive.value:
366 self._suspend.cond.release()
368 self._suspend.cond.release()
371 self._periodTime.tick()
375 self._execTime.tick()
379 self._execTime.tack()
395 sleep_sec = self.
_period - self._execTime.interval()
397 if sleep_sec.toDouble() < 0:
400 time.sleep(sleep_sec.toDouble())
408 self._execStat.stat = self._execTime.getStatistics()
419 self._periodStat.stat = self._periodTime.getStatistics()
445 self.
stat = OpenRTM_aist.TimeMeasure.Statistics()
def suspend(self)
Suspending the task.
def updatePeriodStat(self)
virtual void updatePeriodStat();
def __del__(self, Task=OpenRTM_aist.Task)
dtor
def signal(self)
Executing the suspended task one tick.
def getExecStat(self)
virtual TimeMeasure::Statistics getExecStat();
def getPeriodStat(self)
virtual TimeMeasure::Statistics getPeriodStat();
def updateExecStat(self)
virtual void updateExecStat();
def setPeriod(self, period)
Setting task execution period.
def setTask(self, func, delete_in_dtor=True)
Setting task execution function.
def activate(self)
Starting the task.
def resume(self)
Resuming the suspended task.
def periodicMeasure(self, value)
virtual void periodicMeasure(bool value);
def executionMeasure(self, value)
virtual void executionMeasure(bool value);
def sleep(self)
virtual void sleep();
def svc(self)
virtual int svc();
def finalize(self)
Finalizing the task.
def executionMeasureCount(self, n)
virtual void executionMeasureCount(int n);
def periodicMeasureCount(self, n)
virtual void periodicMeasureCount(int n);