コード例 #1
0
/*! Will start tasks as long as there are tasks to be run. If the tasks are of the one-shot type,
  it just loops in here as long as it has tasks. If the task is event-based and needs us to 
  surrender control, it will surrender control but schedule the timer to come back here and 
  check on the task later.
*/
void TaskDispatcher::mainLoop()
{
    if (mSensor->isScheduled()) {
        mSensor->unschedule();
    }
    while(1){
        if(mCurrentTask) {
	    checkCurrentTask();
	}
	if (mStatus == READY) {
	    startNewTask();
	}
	switch(mStatus) {
	    case DONE:
		graspItGUI->exitMainLoop();		
	        return;
	    case FAILED:
		graspItGUI->exitMainLoop();		
	        return;
	    case NO_TASK:
		graspItGUI->exitMainLoop();		
	        return;
 	    case RUNNING:
	        mSensor->schedule();			
	        return;
	    case READY:
	        break;
	}
    }
}
コード例 #2
0
int UnixBusComm::startLinuxCameraTask (QString fullPath)
{
    return startNewTask(fullPath);
}
コード例 #3
0
int UnixBusComm::startImageServerTask (QString fullPath)
{
    return startNewTask(fullPath);
}