Exemplo n.º 1
0
Process::Process(MessageQueue& debugIn, MessageQueue& debugOut)
  : debugIn(debugIn), debugOut(debugOut),
    blackboard(new Blackboard) // uses custom new operator
{
  setGlobals(); // In Simulator: in GUI thread
  initialized = false;
}
Exemplo n.º 2
0
int Process::processMain()
{
  if(!initialized)
  {
    setGlobals(); // In Simulator: in separate thread for process
    init();
    initialized = true;
  }

#ifndef RELEASE
  debugIn.handleAllMessages(*this);
  debugIn.clear();
#endif

  int toReturn = this->main();

#ifndef RELEASE
  if(Global::getDebugRequestTable().poll)
  {
    if(Global::getDebugRequestTable().pollCounter++ > 10)
    {
      Global::getDebugRequestTable().poll = false;
      OUTPUT(idDebugResponse, text, "pollingFinished");
    }
  }
#endif

  return toReturn;
}
Exemplo n.º 3
0
MenuScreen::MenuScreen(int x, int y, int w, int h, Globals * globals) : BaseScreen(x, y, w, h)
{

	cout << "MenuScreen constructor\n";

    //ctor
    setGlobals(globals);

	//ctor
	_menuRect.x = x;
	_menuRect.y = y;
	_menuRect.w = w;
	_menuRect.h = h;

	_menuSelect = 0;
	_selectedEntry = NULL;
	_lastClickedEntry = NULL;

//	name = "Main Menu";
	_state = ACTIVE;

	_nextMenuY = 0;

    cout << "MenuScreen constructor complete\n";
}
void luaInterpreterWrapper::doAfterExecution(
    bool fail,
    const string &code,
    bool putVariables,
    bool failOnException
)
{
    if(fail) {
        Info << "Lua Exception" << endl;

        printError();
    }

    if(
        interactiveAfterException_
        &&
        fail
    ) {
        Info << "Got an exception for "<< code
            << " now you can interact." << endl;
        interactiveLoop("Exception handling");
    }
    if(
        fail
        &&
        (
            !tolerateExceptions_
            ||
            failOnException
        )
    ) {
        FatalErrorIn("luaInterpreterWrapper::doAfterExecution")
            << "Lua exception raised by " << nl
	    << code << endl
	    << "To debug set 'interactiveAfterException true;' in " << dict().name()
                << endl << exit(FatalError);
    }

    if(interactiveAfterExecute_) {
        Info << "Executed "<< code
            << " now you can interact." << endl;
        interactiveLoop("After execution");
    }

    if(putVariables) {
        setGlobals();
    }
}