Esempio n. 1
0
String Controller::getStatus()
{
  time_t t = now(); // save current time
  char buffer[200];
  sprintf(buffer, "{\"status\":%d,\"start\":\"%02d:%02d\",\"stop\":\"%02d:%02d\",\"rewind\":\"%02d:%02d\",\"date\":\"%02d.%02d.%u\",\"time\":\"%02d:%02d:%02d\",\"interval\":%u,\"step\":",
    calculateProgress(),_times[0],_times[1],_times[2],_times[3],_times[4],_times[5],
    day(t), month(t), year(t), hour(t), minute(t), second(t), interval); // max 16 arguments :(
  String s = buffer;
  s += stepTime;
  s += "}";
  return s;
}
void SGMFastDacqScanController::onDacqState(const QString &state){
	if(state == "Runup")
		dacqRunUpStarted_ = true;
	if(state == "Run" && dacqRunUpStarted_){
		dacqRunUpCompleted_ = true;
		fastScanTimer_->start(500);
	}
	if(state == "Off"){
		dacqRunCompleted_ = true;
		if(fastScanTimer_ && fastScanTimer_->isActive())
			fastScanTimer_->stop();
	}
	calculateProgress(-1, -1);
}
void RenderThread::executeRenderCommand(QString program, QStringList arguments)
{
    // Create a new process for the render job
    if(!renderprocess)
        renderprocess = new QProcess(this);

    // Get regular progress updates from the process, and have it emit a signal when finished
    connect(renderprocess, SIGNAL(readyReadStandardOutput()), this, SLOT(calculateProgress()));
    connect(renderprocess, SIGNAL(finished(int)), this, SLOT(renderFinished()));

    // Now start the process, and emit a signal saying we've done so
    renderprocess->start(program, arguments);
    emit renderProgress(tr("Currently rendering ")+project.second, 0);
}
void SGMFastDacqScanController::onInitializationActionsStageSucceeded(int stageIndex){
	initializationStagesComplete_ = stageIndex+1;
	calculateProgress(-1, -1);
}