Esempio n. 1
0
MmsEditAccount::MmsEditAccount(QWidget *parent)
    : QDialog(parent)
{
    setObjectName("mms-account");
    setupUi(this);
    connect(networkBtn, SIGNAL(clicked()), this, SLOT(configureNetworks()));
    QtopiaIpcAdaptor* netChannel = new QtopiaIpcAdaptor("QPE/NetworkState", this);
    QtopiaIpcAdaptor::connect(netChannel, MESSAGE(wapChanged()),
            this, SLOT(updateNetwork()));
}
Esempio n. 2
0
void Application::run(){
	DeltaTime = irrTimer->getTime() - TimeStamp;
	TimeStamp = irrTimer->getTime();

	printf("%f\n", (float)DeltaTime); 
	if(!paused){
		UpdatePhysics(6);
		activeQuad->update(DeltaTime);
	}
	
	updateNetwork(); 

	irrDriver->beginScene(true, true, SColor(255, 20, 0, 0));
	
	irrScene->drawAll();
	
	// debug
	activeQuad->render(irrDriver); 
	
	irrGUI->drawAll();
	irrDriver->endScene();
	irrDevice->run();
}
Esempio n. 3
0
Player::Player(QGraphicsItem *parent): QGraphicsPixmapItem(parent)
{

            bulletsound = new QMediaPlayer(); // create a media player
            bulletsound->setMedia(QUrl("qrc:/sounds/SHOOTIN3.wav")); // set sound from resource file


    setPixmap(QPixmap(":/img/Ship.png")); // set player image

    QTimer * timer = new QTimer();

        QTimer * netTimer =  new QTimer();
        writeUdpSocket = new QUdpSocket(this);
        readUdpSocket = new QUdpSocket(this);
        readUdpSocket->bind(45454, QUdpSocket::ShareAddress);
        connect(timer,SIGNAL(timeout()), this, SLOT(updateNetwork()));
        connect(readUdpSocket, SIGNAL(readyRead()), this, SLOT(parsePackets()));
        netTimer->start(50.00);

        connect(timer,SIGNAL(timeout()),this, SLOT (move()));
        timer->start(33.33);

}
Esempio n. 4
0
void GameWorld::update(float eTime){
    //게임 시작 초 계산
    m_fStartFrame += eTime;
    
    //카메라 업데이트
    CameraMgr->Update(eTime);
    m_pCameraLayer->setPosition(-CameraMgr->GetPos() + (Vec2(3200,-1600)));
    
    //업데이트 네트워크
    int CntUpdateNetwork = (int)(m_fStartFrame * NETWORK_FPS) - NetMgr->GetCntCarryOutMessages();
    while(CntUpdateNetwork-- > 0){
        updateNetwork(eTime);
    }
    
    //유닛 업데이트
    for(auto pUnit : m_Units){
        pUnit.second->update(eTime);
    }
    
//    auto pUnit = getChildByTag(5);
//    DrawNode* pU = (DrawNode*)pUnit;
//    pU->drawDot(m_pCameraLayer->convertToWorldSpace(m_pMap->GetNavGraph().GetNode(m_Units[0]->GetTileIndex()).getPosition()), 1, Color4F(1,1,1,1));

}
Esempio n. 5
0
void COneWire::doWork(boost::shared_ptr<yApi::IYPluginApi> api)
{
   api->setPluginState(yApi::historization::EPluginState::kCustom, "connecting");

   std::cout << "OneWire is starting..." << std::endl;

   m_configuration->initializeWith(api->getConfiguration());
   m_engine = CFactory::createEngine(api, m_configuration);

   // 1-wire Network devices
   std::map<std::string, boost::shared_ptr<device::IDevice> > devices;

   // Periodic network refresh
   api->getEventHandler().createTimer(kEvtTimerNetworkRefresh,
                                      shared::event::CEventTimer::kPeriodic,
                                      boost::posix_time::seconds(5));

   api->setPluginState(yApi::historization::EPluginState::kRunning);

   // the main loop
   std::cout << "OneWire plugin is running..." << std::endl;

   while (1)
   {
      try
      {
         // Wait for an event
         switch (api->getEventHandler().waitForEvents())
         {
         case yApi::IYPluginApi::kEventStopRequested:
         {
            std::cout << "Stop requested" << std::endl;
            api->setPluginState(yApi::historization::EPluginState::kStopped);
            return;
         }
         case kEvtTimerNetworkRefresh:
         {
            // Scan 1-wire network for new devices and update our network image
            updateNetwork(api, devices, m_engine->scanNetwork());

            // Now read all devices state and historize data
            for (auto device = devices.begin(); device != devices.end(); ++device)
            {
               // Set here an interruption point because it can take some time in case of big networks
               boost::this_thread::interruption_point();

               boost::shared_ptr<device::IDevice> newDevice = device->second;
               newDevice->read();
               if (!newDevice->keywords().empty())
                  api->historizeData(newDevice->ident()->deviceName(),
                                     newDevice->keywords());
            }

            break;
         }
         case yApi::IYPluginApi::kEventDeviceCommand:
         {
            // A command was received from Yadoms
            auto command = api->getEventHandler().getEventData<boost::shared_ptr<const yApi::IDeviceCommand> >();
            onCommand(devices, command);

            break;
         }
         case yApi::IYPluginApi::kEventUpdateConfiguration:
         {
            onUpdateConfiguration(api, api->getEventHandler().getEventData<shared::CDataContainer>());
            break;
         }
         default:
         {
            std::cerr << "Unknown message id" << std::endl;
            break;
         }
         }
      }
      catch (COneWireException& e)
      {
         std::cerr << e.what() << std::endl;
      }
   }
}