Ejemplo n.º 1
0
SimpleUDPChat::SimpleUDPChat(QWidget *parent)
    : QDialog(parent) {
    setWindowTitle("Simple UDP Chat");

    constructObjects();
    connectObjects();
}
Ejemplo n.º 2
0
void CassandraObjectFactory::generate(const String& timestamp) {
    CassandraDBPtr db = Cassandra::getSingleton().open(mDBHost, mDBPort);

    std::vector<Column> Columns;
    try{
        SliceRange range;
        range.count=1000000; // set large enough to get all the objects of the object host
        Columns = db->db()->getColumns(mOHostID, CF_NAME, timestamp, range);
    }
    catch(...){
        std::cout <<"Exception Caught when get object lists"<<std::endl;
        return;
    }

    for (std::vector<Column>::iterator it= Columns.begin(); it != Columns.end(); ++it) {
        String object_str((*it).name);

        //current value format is <"#type#"+script_type+"#args#"+script_args+"#contents#"+script_contents>
        String script_value((*it).value);
        String script_type=script_value.substr(6,script_value.find("#args#")-6);
        String script_args=script_value.substr(script_value.find("#args#")+6,script_value.find("#contents#")-script_value.find("#args#")-6);
        String script_contents=script_value.substr(script_value.find("#contents#")+10);

        if (!script_type.empty()) {
            ObjectInfo info;
            info.id = UUID(object_str, UUID::HexString());
            info.scriptType = script_type;
            info.scriptArgs = script_args;
            info.scriptContents = script_contents;
            mIncompleteObjects.push(info);
        }
    }

    connectObjects();
}
Ejemplo n.º 3
0
void GadWorkspace::outputSelected(GadObject * obj, int no)
{
  qDebug("GadWorkspace::outputSelected\n");
  output_.obj = obj;
  output_.no = no;
  if (input_.obj)
    connectObjects();
}
Ejemplo n.º 4
0
MainForm::MainForm(QWidget *parent):QWidget(parent) {
	// Icon für die Anwendung festlegen
	QIcon Icon(":/img/gnuboy.png");
	qApp->setWindowIcon(Icon);
	this->setWindowTitle(trUtf8("KBoy"));
	
	// Objektmember initialisieren
	Spieleliste=new CGBSpielListModel();
	Spieleliste->fromXml(QDir::homePath()+"/.kboy/gamelist.xml"); // Wenn Datei nicht geladen werden kann, bleibt die Liste leer
	Gnuboy=new QProcess(this);
	
	// Grafische Oberfläche aufbauen
	initWidgets();
	buildGUI();
	configureWidgets();
	
	// Signal-/Slot-Objekte verknüpfen
	connectObjects();
}
Ejemplo n.º 5
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)//,
    //ui(new Ui::MainWindow)
{
    //ui->setupUi(this);

    tilesetImage = new QImage(QString("data/tileset.png"));
    enemyImage   = new QImage(QString("data/chars.png"));
    itemImage    = new QImage(QString("data/itens.png"));

    if(tilesetImage)
        qDebug() << "Imagem carregada";
    else
        qDebug() << "Imagem não encontrada";


    //Tileset editor setup
    tilesetEditor = new TilesetEditor(tilesetImage,this);

    tilesetDock = new QDockWidget(tr("Tileset"), this);
    tilesetDock->setWidget(tilesetEditor);
    tilesetDock->setMinimumWidth(200);

    addDockWidget(Qt::LeftDockWidgetArea, tilesetDock);

    mapView = new MapView(tilesetImage, enemyImage, itemImage,this);
    setCentralWidget(mapView);

    createActions();
    createToolBars();
    createMenus();
    createStatusBar();

    readSettings();

    setCurrentFile("");
    setUnifiedTitleAndToolBarOnMac(true);

    entitySelector = new QTreeWidget(this);
    QStringList columnNames;
        columnNames << "Entidade" << "Tipo";
    entitySelector->setHeaderLabels(columnNames);
    entitySelector->setRootIsDecorated(false);
    entitySelector->setColumnCount(2);
    entitySelector->setMouseTracking(true);

    entitySelector->setSelectionMode(QAbstractItemView::SingleSelection);

    entitySelector->setVisible(false);

    populateTreeList();

    //tilesetDock->setWidget(entitySelector);


    connectObjects();

//    QMap<QString,QString> mMap;
//    mMap.insert("key", "gust");
//    mMap.insert("my","name");

//    QString str = mMap.find("my").value();
//    qDebug() << str;
//    str = mMap.find("key").value();
//    qDebug() << str;
//    if (mMap.find("a") == mMap.end())
//        qDebug() << "END";


    scriptWindow = new ScriptMainWindow(this);
    LuaManager::LuaControl.startLua(mapView);

}
Ejemplo 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();
	}
}