Ejemplo n.º 1
0
void ra_mean::scan()
// Scan function is the class main function
{
  if(!isActive_) { // If it's the first program cycle, activate logging
    
    for(int i = 0; i < nResults_; i++)
      resultsList_[i].clearResult();
    
    time(&oldTime_);
    isActive_ = TRUE;
    nSeconds_ = 0;
    collectValues();
  }
  if(difftime(oldTime_, time(NULL)) != 0) { // Run every second
    time(&oldTime_);
    
    if(nSeconds_ == 60) { // Run every minute
      calculateResults();
      collectValues();
      nSeconds_ = 0;
    }
    else {
      collectValues();
      nSeconds_++;
    }
  }
}
Ejemplo n.º 2
0
TaskList TaskListMerger::mergedTaskList() const
{
    calculateResults();
    return m_results;
}
Ejemplo n.º 3
0
TaskList TaskListMerger::modifiedTasks() const
{
    calculateResults();
    return m_modifiedTasks;
}
Ejemplo n.º 4
0
TaskList TaskListMerger::addedTasks() const
{
    calculateResults();
    return m_addedTasks;
}
Ejemplo n.º 5
0
bool TestingWidgetFacade::connectToTestingWidget(QObject* testingwidget) {
    if(!QObject::connect(testingwidget, SIGNAL(menuJumpRequest()), this, SLOT(switchToStartWidget()), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(startTestRequest()), this, SLOT(startTest()), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(finishTestRequest()), this, SLOT(finishTest()), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(jumpToTaskRequest(QString)), this, SLOT(displayTaskById(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(jumpToTaskHelp(QString)), this, SLOT(displayHelpById(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(setTestRequest(ExamsTest)), this, SLOT(setTest(ExamsTest)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(answers(QList< QPair<QString, QString> >)), this, SLOT(calculateResults(QList<QPair<QString,QString> >)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(testingwidget, SIGNAL(loadTestRequest(QString)), this, SLOT(loadTest(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(timeLabelUpdate(QString)), testingwidget, SLOT(setTimeLabel(QString)), Qt::AutoConnection)) {
        return 0;
    }
    if(!QObject::connect(this, SIGNAL(setTaskCount(int, int, int)), testingwidget, SLOT(setTaskCount(int, int, int)), Qt::AutoConnection)) {
        return 0;
    }
    return 1;
}