Exemplo n.º 1
0
void SceneTreeManager::initInputs( int index, osg::Node * modified )
{
	if (supportedNodes[index]=="Group")
		initInputs(dynamic_cast<osg::Group *>(modified));
	if (supportedNodes[index]=="MatrixTransform")
		initInputs(dynamic_cast<osg::MatrixTransform *>(modified));
	if (supportedNodes[index]=="PositionAttitudeTransform")
		initInputs(dynamic_cast<osg::PositionAttitudeTransform *>(modified));
}
Exemplo n.º 2
0
//---------------------------------------------init
void ModuleWidget::init()
{
  m_pUi = new Ui::ModuleWidgetUI();
  m_pUi->setupUi(this);
  m_pUi->m_pModuleName->setText(QString(m_pModule->getRuntimeModuleID().c_str()));

  setAcceptDrops(true);

  m_aTimer.start(TIMER_UNIT); //interval the timer is invoked

  connectModuleSignals(); //call virtual method

  //QObject::connect(m_pUi->m_pRunButton, SIGNAL(pressed()), this, SLOT(onRunButton()));
  //QObject::connect(m_pUi->m_pResetButton, SIGNAL(pressed()), this, SLOT(onResetButton()));
  QObject::connect(&m_aTimer, SIGNAL(timeout()), this, SLOT(onTimer()));

  initInputs();
  initOutputs();

  setContextMenuPolicy(Qt::CustomContextMenu);

  static QBitmap aMask;
  if(aMask.width() == 0) //create the mask only once
  {
    aMask = QBitmap(size());
    aMask.clear();
    QPainter aPainter(&aMask);
    aPainter.setBrush(QBrush(Qt::SolidPattern));
    aPainter.drawEllipse(QPoint(width()/2, height()/2), width()/2, width()/2);
  }
  setMask(aMask);
}
Exemplo n.º 3
0
void Neuron::init( int num )
{
    isOrNeuron = false;
    threshold = 1.0;
    this->num_inputs = (short)num;
    setValue( 0. );

    inputs = NULL;
   	initInputs();
	initWeights();
}
Exemplo n.º 4
0
void SceneTreeManager::createNewNode()
{
	modWidgetStatus = NEW;
	state = CANCEL;
	ui.label_nodeType->setEnabled(true);
	nodeWidget->setWindowModality(Qt::WindowModality::ApplicationModal);
	initInputs(-1);
	nodeTypeChanged(ui.nodeType->currentIndex());
	nodeWidget->show();
/*
	if (state == CANCEL)
		return NULL;
	return actualNode;*/
}
Exemplo n.º 5
0
int main(int argc, char **argv) {
  initWindow();
  initInputs();
  initG();

  #ifdef __APPLE__
    glfwInit();
  #else
    glewInit();
  #endif

  initShaders();

  world.loadSpheres();
  world.load("obj/island.obj", 0, 0, 0, 1.0);
  world.load("obj/box.obj", 0, 0, 0, 0.6);
  world.skybox.load("skyboxes/bluesky1");
  world.sea.load(WINDOW_RESOLUTION_X, WINDOW_RESOLUTION_Y);

  world.loadMusic();
  mainLoop();
  exit(EXIT_FAILURE);
}
Exemplo n.º 6
0
/****************************************************************************
 *
 * NAME: AppColdStart
 *
 * DESCRIPTION:
 * Entry point for application from boot loader. Initialises system and runs
 * main loop.
 *
 * RETURNS:
 * Never returns.
 *
 ****************************************************************************/
PUBLIC void AppColdStart(void)
{
#if (defined JN5148 || defined JN5168 )
	// TODO - use watch dog and probably disable brownout reset
	vAHI_WatchdogStop();
#endif
#ifdef JN5139
	vAppApiSetBoostMode(TRUE);
#endif

	// Initialise the hopping mode status
	// TODO - move to settings?
	setHopMode(hoppingRxStartup);

	connectObjects();
	RX.ro.version=2;

	// Initialise the system
	vInitSystem();

	// set up the exception handlers
	setExceptionHandlers();


	if(!radioDebug)debugRoute=&pcViaComPort;
	else debugRoute=&pcViaTx;

	if (debugRoute->routeNodes[0] == CONPC)
	{
		// Don't use uart pins for servo op
		initPcComs(&pccoms, CONPC, 0, rxHandleRoutedMessage);
		rxHardware.uart0InUse=TRUE;
	}


	// Initialise the clock
	// TODO - fix this
	/* the jn5148 defaults to 16MHz for the processor,
	   it can be switched to 32Mhz however the servo driving
	   code would need tweaking
	   */
	//bAHI_SetClockRate(3);


	resetType rt=getResetReason();
	if(rt!=NOEXCEPTION)
	{
		dbgPrintf("EXCEPTION %d \r\n",rt);
	}


	// Set handler for incoming data
	setRadioDataCallback(rxHandleRoutedMessage, CONTX);

	// Retrieve the MAC address and log it to the PC
	module_MAC_ExtAddr_s* macptr = (module_MAC_ExtAddr_s*)pvAppApiGetMacAddrLocation();


	// Send init string to PC log rx mac and bound tx mac to pc
	dbgPrintf("rx24 2.10 rx %x %x tx %x %x",macptr->u32H, macptr->u32L,txMACh ,txMACl );


	// Use dio 16 for test sync pulse
	vAHI_DioSetDirection(0, 1 << 16);


	// Set demands to impossible values
	// TODO - fix magic numbers grrr
	int i;
	for (i = 0; i < 20; i++)
	{
		RX.rxDemands[i] = 4096;
		RX.rxMixedDemands[i] = 4096;
	}
	rxHardware.i2cInUse=imu.enabled;
	startIMU(&imu);


	// Set up digital inputs and outputs
	initInputs(&rxHardware);
	initOutputs(&rxHardware);



	if(rxHardware.oneWireEnabled==TRUE)
	{
		// enable onewire sensor bus
		initOneWireBus(&sensorBus1,CONONEWIRE,rxHardware.oneWirePort,rxHandleRoutedMessage);

	}
	if(rxHardware.gpsEnabled==TRUE)
	{
		initNmeaGps(rxHardware.gpsPort, E_AHI_UART_RATE_38400);
	}

	// Setup DIO  for the LED
	vAHI_DioSetDirection(0, rxHardware.ledBit);

	// Initialise Analogue peripherals
	vAHI_ApConfigure(E_AHI_AP_REGULATOR_ENABLE, E_AHI_AP_INT_DISABLE,
			E_AHI_AP_SAMPLE_8, E_AHI_AP_CLOCKDIV_500KHZ, E_AHI_AP_INTREF);

	while (bAHI_APRegulatorEnabled() == 0)
		;


	// Start the servo pwm generator
	setFrameCallback(frameStartEvent);
	setMixCallback(mixEvent);



	startServoPwm(RX.servoUpdateRate);


	// Enter the never ending main handler
	while (1)
	{
		// Process any events
		vProcessEventQueues();
	}
}
Exemplo n.º 7
0
int __entry_menu(int argc, char** argv) {
	InitOSFunctionPointers();
	InitVPadFunctionPointers();
	InitFSFunctionPointers();
	mount_sd_fat("sd");
	
	//Setup BATs for later
	InjectSyscall36((unsigned int)injectBAT);
	RunSyscall36();
	
	InstallExceptionHandler();
	
	initInputs();
	
	initVideo();
	videoDebugMessage(0, "All running!");
	
	//*((int*)0x04) = 4243;
	
	unsigned char* MEM2core = 0;
	unsigned int coreSize = 0;
	LoadFileToMem("sd://stella.elf", &MEM2core, &coreSize);

	void* core = (void*)CORES_BASE_ADDRESS;
	
	memcpy(core, MEM2core, coreSize); //Move core to MEM1
	free(MEM2core);
	
	int error = loadCore(core); //Load core symbols (UDynLoad)
	
	char buf[255];
	__os_snprintf(buf, 255, "Core loaded, error %d. Core at 0x%X", error, core);
	videoDebugMessage(1, buf);
	
	unsigned char* game = 0;
	unsigned int gameSize = 0;
	LoadFileToMem("sd://game.bin", &game, &gameSize);
	
	error = setupCore((void*)game, gameSize); //Initialise core
	
	__os_snprintf(buf, 255, "Setup core, error %d, game at %X size %X", error, game, gameSize);
	videoDebugMessage(2, buf);
	
	testVideoOutput();
	
	while (1) {
		pollInputs();
		if (UIInputCheckButton()) {
			break;
		}
	}
	
	
	
	//cleanup
	shutdownVideo();
	memset(core, 0, coreSize); //Delete core from memory or HBL will cry every time
	memset(game, 0, gameSize);
	InjectSyscall36((unsigned int)clearBAT);
	RunSyscall36();
	return 0;
}
Exemplo n.º 8
0
//---------------------------------------------onModuleInputUnregistered
void ModuleWidget::onModuleInputUnregistered(ModuleInputBase* pInput)
{
  deInitInputs();
  initInputs();
}