void JobHistoryView::setHistory( JobHistoryList history )
{
    setupModel();
	mJobs = JobList();
	mModel->setRootList(history);
}
Beispiel #2
0
JobList
PythonJobModule::jobs() const
{
    return JobList() << m_job;
}
Beispiel #3
0
/*! @brief The vision control loop
    @relates NUbot
 
     The thread is set up to run when signalled by signalVision(). It will grab the
     new image, compute a response, and then send the commands to motion and lcs.
 
    @param arg a pointer to the nubot
 */
void* runThreadVision(void* arg)
{
    debug << "NUbot::runThreadVision: Starting." << endl;
    
    NUbot* nubot = (NUbot*) arg;                // the nubot
    NUSensorsData* data = NULL;
    NUActionatorsData* actions = NULL;
    JobList joblist = JobList();
    
#ifdef THREAD_VISION_MONITOR_TIME
    double entrytime;
    double realstarttime, processstarttime, threadstarttime; 
    double realendtime, processendtime, threadendtime;
#endif
    
    double lastupdatetime = nusystem->getTime();
    
    int err;
    do 
    {
#if defined THREAD_VISION_MONITOR_TIME && !defined TARGET_IS_NAOWEBOTS
        entrytime = NUSystem::getRealTimeFast();
#endif
        err = nubot->waitForNewVisionData();
        nubot->signalVisionStart();
        
#ifdef THREAD_VISION_MONITOR_TIME
        realstarttime = NUSystem::getRealTimeFast();
    #ifndef TARGET_IS_NAOWEBOTS         // there is not point monitoring wait times in webots
        if (realstarttime - entrytime > 1000/15.0 + 5)
            debug << "NUbot::runThreadVision. Waittime " << realstarttime - entrytime << " ms."<< endl;
    #endif
        processstarttime = NUSystem::getProcessTime();
        threadstarttime = NUSystem::getThreadTime();
#endif
        try
        {
            // -----------------------------------------------------------------------------------------------------------------------------------------------------------------
            //          image = nubot->platform->camera->getData()
            data = nubot->platform->sensors->getData();
            //                 odometry = nubot->motion->getData()                // There is no deep copy here either
            //      gamectrl, teaminfo = nubot->network->getData()
            //          fieldobj = nubot->vision->process(image, data, gamectrl)
            //          wm = nubot->localisation->process(fieldobj, teaminfo, odometry, gamectrl, actions)
            #ifdef USE_BEHAVIOUR
                nubot->behaviour->process(joblist);      //TODO: nubot->behaviour->process(wm, gamectrl, p_jobs)
            #endif
            #ifdef USE_MOTION
                #ifdef USE_WALKOPTIMISER
                    nubot->walkoptimiser->process(joblist);
                #endif
                nubot->motion->process(joblist);
            #endif
            //          cmds = nubot->lcs->process(lcsactions)
            //nubot->platform->actionators->process(m_actions);
            //joblist.clear();                           // assume that all of the jobs have been completed
            // -----------------------------------------------------------------------------------------------------------------------------------------------------------------
        }
        catch (exception& e) 
        {
            unhandledExceptionHandler(e);
        }
#ifdef THREAD_VISION_MONITOR_TIME
        realendtime = NUSystem::getRealTimeFast();
        processendtime = NUSystem::getProcessTime();
        threadendtime = NUSystem::getThreadTime();
        if (threadendtime - threadstarttime > 10)
            debug << "NUbot::runThreadVision. Thread took a long time to complete. Time spent in this thread: " << (threadendtime - threadstarttime) << "ms, in this process: " << (processendtime - processstarttime) << "ms, in realtime: " << realendtime - realstarttime << "ms." << endl;
#endif
        nubot->signalVisionCompletion();
    } 
    while (err == 0 && errno != EINTR);
    pthread_exit(NULL);
}
Beispiel #4
0
/************************************************
 *
 * ***********************************************/
void Project::addJob(Job job)
{
    addJobs(JobList() << job);
}