Exemplo n.º 1
0
int main(void)
{
//  wdt_disable();          	/* Stop watchdog timer */
  configurePorts();
  InitLCD(0x03);
/** Initialise the OS stuff, setup the control and receive tasks, and jump
to the OS. */
  initNartos();
//  controlTaskID = taskStart((uint16_t)*controlTask,FALSE);
  testLCDID = taskStart((uint16_t)*testLCD,FALSE);
  nartos();
//  for (;;)
//  {
//    LCDByte(0,0x00);
//    LCDByte(0,0x08);
//    LCDWriteString("Hello");
//    LCDWriteString("A");
//    LCDByte(1,0x41);
//    LCDByte(1,0x43);
//    LCDByte(1,0x50);
//    LCDByte(1,0x49);
//    LCDByte(1,0x41);
//  }
//  for (;;)
//  {
//    uint8_t x=0;
//  }
}
Exemplo n.º 2
0
void MainWindow::startTask(Task *task)
{
	connect(task, SIGNAL(started()), SLOT(taskStart()));
	connect(task, SIGNAL(succeeded()), SLOT(taskEnd()));
	connect(task, SIGNAL(failed(QString)), SLOT(taskEnd()));
	task->start();
}
void AfterEffectsBurner::startProcess()
{
	LOG_5( "AEB::startBurn() starting" );

	QString cmd = executable();
	QStringList args = buildCmdArgs();

	mCmd = new QProcess( this );
	connectProcess( mCmd );
	
	QString outputDir = Path( mJob.outputPath() ).dirPath();
	if( !QFile::exists( outputDir ) ) {
		logMessage( "creating output dir: "+ outputDir );
		QDir(outputDir).mkpath( outputDir );
		QFile::setPermissions( outputDir, QFile::ReadUser|QFile::WriteUser|QFile::ExeUser|QFile::ReadGroup|QFile::WriteGroup|QFile::ExeGroup|QFile::ReadOther|QFile::WriteOther|QFile::ExeOther );
	}

	logMessage( "AEB: Starting Cmd: " + cmd + " " + args.join(" ") );

#ifdef Q_OS_WIN
	mCmd->start( cmd, args );
	mJobAssignment.setCommand(cmd + " " + args.join(" "));
#else
	cmd = cmd + " " + args.join(" ") + "\"";
	mCmd->start( cmd );
	mJobAssignment.setCommand( cmd );
#endif

	mCheckupTimer->start( 15 * 1000 );
	taskStart( mFrame );
}
Exemplo n.º 4
0
/*-----------------------------------------------------------------------------
    Name        : pingStartup
    Description : Startup the ping module
    Inputs      :
    Outputs     :
    Return      :
----------------------------------------------------------------------------*/
void pingStartup(void)
{
    scriptSet(NULL, "ping.script", pingTweaks);
    pingAnomalyMinScreenSize = primScreenToGLScaleX(pingAnomalyMinScreenSize);
    pingNewShipMinScreenSize = primScreenToGLScaleX(pingNewShipMinScreenSize);
    pingBattleMinScreenSize = primScreenToGLScaleX(pingBattleMinScreenSize);
    pingTaskHandle = taskStart(pingUpdateTask, PNG_TaskPeriod, 0);
    listInit(&pingList);
    pingReset();
}
void AfterEffectsBurner::slotProcessOutputLine( const QString & line, QProcess::ProcessChannel channel )
{
	bool com = line.contains( mCompleteRE );
	bool framecom = line.contains( mFrameCompleteRE );
#ifdef Q_OS_MAC
	bool fatalMachError = line.contains(QRegExp("failed to name Mach port"));
	if( fatalMachError ) {
		logMessage(line);
		jobErrored("the Host has fatal Mach Errors until AB restarts.");
		mSlave->setStatus("restart");
	}
#endif

	if( framecom ) {
		if( taskStarted() ) {
			bool frameCheckFailure = false;
			if( !mJob.outputPath().endsWith( ".avi" ) && !mJob.outputPath().endsWith( ".mov" ) ) {
				QString framePath = makeFramePath( mJob.outputPath(), mFrame );
				QFileInfo fi( framePath );
				frameCheckFailure = !(fi.exists() && fi.isFile() && fi.size() > 0);
				if( !frameCheckFailure )
					emit fileGenerated(framePath);
				QString log = QString("Frame %1 %2").arg(framePath).arg(frameCheckFailure ? "missing" : "found");
				logMessage(log);
			}

			if( frameCheckFailure ) {
				jobErrored("AE: Got frame complete message, but frame doesn't exist or is zero bytes");
				return;
			}

			logMessage("AE: Completed frame: " + QString::number(mFrame));
			taskDone( mFrame );
			mFrame++;
			if( !com && mFrame <= mFrameEnd )
				taskStart( mFrame );
		}
	}

	if( com ) {
		if( mJob.outputPath().endsWith( ".avi" ) || mJob.outputPath().endsWith( ".mov" ) )
			emit fileGenerated(mJob.outputPath());
		LOG_3("AEB::slotReadOutput emit'ing jobFinished()");
		jobFinished();
		return;
	}

	JobBurner::slotProcessOutputLine( line, channel );
}
Exemplo n.º 6
0
/*-----------------------------------------------------------------------------
    Name        : taskStartup
    Description : Initialize the task module.
    Inputs      : frequency - frequency, in Hz of the timer to be used.
    Outputs     : All taskData structures cleared
    Return      : OKAY on success, ERROR if failure
----------------------------------------------------------------------------*/
sdword taskStartup(udword frequency)
{
    sdword index;

#if TASK_VERBOSE_LEVEL >= 1
    dbgMessagef("%s: Task module started using a frequency of %dHz", __FUNCTION__, frequency);
#endif

    dbgAssertOrIgnore(taskModuleInit == FALSE);

    for (index = 0; index < TSK_NumberTasks; index++)
    {
        taskData[index] = NULL;
    }

    taskMaxTask = 0;                                        //no tasks
    taskFrequency = (real32)frequency;                      //save the frequency
    taskModuleInit = TRUE;                                  //and say module init

    //call the task handler dispatcher once so that it will set return pointers OK
    taskExecuteAllPending(0);

#if TASK_TEST                                               //test this crazy module
    {
        taskhandle handle;
        handle = taskStart(taskTestFunction, 1, TF_OncePerFrame);
        taskRename(handle, "Task this you commie bastards!");
        taskExecuteAllPending(1);
        taskExecuteAllPending(1);
        taskExecuteAllPending(1);
        taskExecuteAllPending(1);
        taskExecuteAllPending(1);
        taskExecuteAllPending(1);
    }
#endif //TASK_TEST

    return(OKAY);
}
Exemplo n.º 7
0
void taskCallBackInit()
{
    listInit(&callbacks.babies);        //initialize linked list of babies
    babyTaskHandle = taskStart(taskCallBackProcess, BABY_CallBackPeriod, 0);
}