Exemplo n.º 1
0
Project::Project() : _path(QString())
{
    _screen = new ScreenRepr;
    connect(_screen, SIGNAL(updated()), this, SLOT(sendUpdate()));
    _sprites.append(new SpriteRepr(new QPixmap(":/sprites/sprites/bee.png"), "Bee", _screen->getCenter()));
    foreach (SpriteRepr* s, _sprites) {
        connect(s, SIGNAL(graphicsUpdated()), this, SLOT(sendUpdate()));
        connect(s, SIGNAL(blocksUpdated()), this, SLOT(sendUpdate()));
    }
Exemplo n.º 2
0
strangeWindow::strangeWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::strangeWindow)
{
    ui->setupUi(this);
    this->connect(ui->paintButton,SIGNAL(clicked()),SLOT(paintPressed()));
    mainWidget = new strangewidget();
    ui->mainLayout->addWidget(mainWidget);

    // extra ui settings
    ui->slider_a->setValue(-97);
    ui->slider_b->setValue(288);
    ui->slider_c->setValue(76);
    ui->slider_d->setValue(74);

    // extra connects
    this->connect(ui->slider_a,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->slider_b,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->slider_c,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->slider_d,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->spin_a,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->spin_b,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->spin_c,SIGNAL(updateGenerator()),SLOT(sendUpdate()));
    this->connect(ui->spin_d,SIGNAL(updateGenerator()),SLOT(sendUpdate()));

}
Exemplo n.º 3
0
	void ScreenEncoder::createUpdate(OutputStream& out)
	{
		DDSS_VERBOSE("SEnc")<<"Create update called!!!!"<<std::endl;
		sendUpdate(out);
		
		
	}
void DebuggerMagager::addBreakPoint(Breakpoint* bp)
{
    //check if breakpoint does not exist

    bool add = true;
    for (const auto b : breakpoints)
    {
        if (b->getFunctioName() != bp->getFunctioName())
        {
            continue;
        }

        if (b->getMacroLine() != bp->getMacroLine())
        {
            continue;
        }

        if (b->getCondition() != bp->getCondition())
        {
            continue;
        }

        //same breakpoint, cancel add
        add = false;
    }

    if (add)
    {
        breakpoints.push_back(bp);
        sendUpdate();
    }
}
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent)
{
    m_browser     = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);
    m_model = new UAVObjectTreeModel();
    m_browser->treeView->setModel(m_model);
    m_browser->treeView->setColumnWidth(0, 300);
    // m_browser->treeView->expandAll();
    BrowserItemDelegate *m_delegate = new BrowserItemDelegate();
    m_browser->treeView->setItemDelegate(m_delegate);
    m_browser->treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
    m_browser->treeView->setSelectionBehavior(QAbstractItemView::SelectItems);
    showMetaData(m_viewoptions->cbMetaData->isChecked());
    connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(currentChanged(QModelIndex, QModelIndex)), Qt::UniqueConnection);
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool)));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(categorize(bool)));
    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->tbView, SIGNAL(clicked()), this, SLOT(viewSlot()));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(useScientificNotation(bool)));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    enableSendRequest(false);
}
Exemplo n.º 6
0
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent),
    updatePeriod(MAXIMUM_UPDATE_PERIOD)
{
    // Create browser and configuration GUIs
    m_browser = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);

    // Create data model
    m_model = new UAVObjectTreeModel(this);

    // Create tree view and add to layout
    treeView = new UAVOBrowserTreeView(MAXIMUM_UPDATE_PERIOD);
    treeView->setObjectName(QString::fromUtf8("treeView"));
    m_browser->verticalLayout->addWidget(treeView);

    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->viewSettingsButton,SIGNAL(clicked()),this,SLOT(viewSlot()));


    connect((QTreeView*) treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(onTreeItemCollapsed(QModelIndex) ));
    connect((QTreeView*) treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(onTreeItemExpanded(QModelIndex) ));

    connect(m_browser->le_searchField, SIGNAL(textChanged(QString)), this, SLOT(searchTextChanged(QString)));
    connect(m_browser->bn_clearSearchField, SIGNAL(clicked()), this, SLOT(searchTextCleared()));

    // Set browser buttons to disabled
    enableUAVOBrowserButtons(false);
}
Exemplo n.º 7
0
void LLPanelClassifiedEdit::doSave()
{
	mCanClose = true;
	sendUpdate();
	resetDirty();

	mSaveButtonClickedSignal(this, LLSD());
}
void DebuggerMagager::disableBreakPoint(int _iBreakPoint)
{
    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
    {
        breakpoints[_iBreakPoint]->setDisable();
        sendUpdate();
    }
}
Exemplo n.º 9
0
QContentUpdateManager::QContentUpdateManager(QObject *parent)
    : QObject(parent), mutex(QMutex::Recursive)
{
    updateTimer.setSingleShot(true);
    connect(&updateTimer, SIGNAL(timeout()), this, SLOT(sendUpdate()));
    updateTimer.setSingleShot(true);
    updateTimer.setInterval(50);
    vsoDocuments = new QValueSpaceProxyObject("/Documents", this);
}
void DebuggerMagager::enableAllBreakPoints()
{
    for (const auto& it : breakpoints)
    {
        it->setEnable();
    }

    sendUpdate();
}
Exemplo n.º 11
0
void Item::incHealth(int c)
{
  int healthMax = itemHealth(type);
  health += c;
  if (health > healthMax && healthMax > 0)
  {
    setType(-1);
  }
  sendUpdate();
}
Exemplo n.º 12
0
void LLPanelPickEdit::onClickSave()
{
	sendUpdate();

	mLocationChanged = false;

	LLSD params;
	params["action"] = "save_new_pick";
	notifyParent(params);
}
Exemplo n.º 13
0
void Item::decCount(int c)
{
  count -= c;
  if (count < 1)
  {
    setType(-1);
    return;
  }
  sendUpdate();
}
void DebuggerMagager::removeBreakPoint(int _iBreakPoint)
{
    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
    {
        Breakpoints::iterator it = breakpoints.begin() + _iBreakPoint;
        delete *it;
        breakpoints.erase(it);
        sendUpdate();
    }
}
Exemplo n.º 15
0
void Item::setCount(int8_t count)
{
  this->count = count;
  if (count < 1)
  {
    setType(-1);
    return;
  }
  sendUpdate();
}
void UAVObjectBrowserWidget::saveObject()
{
    // Send update so that the latest value is saved
    sendUpdate();
    // Save object
    ObjectTreeItem *objItem = findCurrentObjectTreeItem();
    Q_ASSERT(objItem);
    UAVObject *obj = objItem->object();
    Q_ASSERT(obj);
    updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj);
}
Exemplo n.º 17
0
void Item::setType(int16_t type)
{
  this->type = type;
  if (type == -1)
  {
    count = 0;
    health = 0;
  }

  sendUpdate();
}
void DebuggerMagager::removeAllBreakPoints()
{
    Breakpoints::iterator it = breakpoints.begin();
    for (; it != breakpoints.end(); ++it)
    {
        delete *it;
    }

    breakpoints.clear();
    sendUpdate();
}
Exemplo n.º 19
0
void Item::setHealth(int16_t health)
{
  bool rightUse;
  if (health <= 0)
  {
    this->health = health;
    return;
  }
  int healthMax = itemHealth(type);
  if (health > healthMax && healthMax > 0)
  {
    type = -1;
    count = 0;
    this->health = 0;
    sendUpdate();
  }
  else
  {
    this->health = health;
    sendUpdate();
  }
}
Exemplo n.º 20
0
void WinDesktop::execute()
{
  Log::info(_T("WinDesktop thread started"));

  while (!isTerminating()) {
    m_newUpdateEvent.waitForEvent();
    if (!isTerminating()) {
      sendUpdate();
    }
  }

  Log::info(_T("WinDesktop thread stopped"));
}
Exemplo n.º 21
0
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent),
    updatePeriod(MAXIMUM_UPDATE_PERIOD)
{
    // Create browser and configuration GUIs
    m_browser = new Ui_UAVObjectBrowser();
    m_viewoptions = new Ui_viewoptions();
    m_viewoptionsDialog = new QDialog(this);
    m_viewoptions->setupUi(m_viewoptionsDialog);
    m_browser->setupUi(this);

    // Create data model
    m_model = new UAVObjectTreeModel();

    // Create tree view and add to layout
    treeView = new UAVOBrowserTreeView(m_model, MAXIMUM_UPDATE_PERIOD);
    treeView->setObjectName(QString::fromUtf8("treeView"));
    m_browser->verticalLayout->addWidget(treeView);

    treeView->setModel(m_model);
    treeView->setColumnWidth(0, 300);
    treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
    treeView->setSelectionBehavior(QAbstractItemView::SelectItems);
    treeView->setUniformRowHeights(true);

    BrowserItemDelegate *m_delegate = new BrowserItemDelegate();
    treeView->setItemDelegate(m_delegate);

    showMetaData(m_viewoptions->cbMetaData->isChecked());

    // Connect signals
    connect(treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(toggleUAVOButtons(QModelIndex,QModelIndex)));
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool)));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(categorize(bool)));
    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    connect(m_browser->viewSettingsButton,SIGNAL(clicked()),this,SLOT(viewSlot()));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(useScientificNotation(bool)));
    connect(m_viewoptions->cbScientific, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbMetaData, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));
    connect(m_viewoptions->cbCategorized, SIGNAL(toggled(bool)), this, SLOT(viewOptionsChangedSlot()));

    connect((QTreeView*) treeView, SIGNAL(collapsed(QModelIndex)), this, SLOT(on_TreeItemCollapsed(QModelIndex) ));
    connect((QTreeView*) treeView, SIGNAL(expanded(QModelIndex)), this, SLOT(on_TreeItemExpanded(QModelIndex) ));

    // Set browser buttons to disabled
    enableUAVOBrowserButtons(false);
}
Exemplo n.º 22
0
void wsMessageReceived(WebSocket& socket, const String& message)
{
	WebSocketsList &clients = server.getActiveWebSockets();

    StaticJsonBuffer<200> jsonBuffer;
    JsonObject& root = jsonBuffer.parseObject(message);
    String actionName  = root["name"].asString();
 
    if(actionName=="enhance"){
    	setEnhance(!enhance);
    }else if(actionName=="power"){
    	setPower(!power);
    }else if(actionName=="mute"){
    	setMmute(!mute);
    }else if(actionName=="mixing"){
    	setMixing(!mixing);
    }else if(actionName=="frequency"){
		setFrequency(root["val"]);
    }else if(actionName=="source"){
		setSource(root["val"]);
    }else if (actionName == "volumeFR") {
        setVolume(CHAN_FR, root["val"]);
    } else if (actionName == "volumeFL") {
        setVolume(CHAN_FL, root["val"]);
    } else if (actionName == "volumeRR") {
        setVolume(CHAN_RR, root["val"]);
    } else if (actionName == "volumeRL") {
        setVolume(CHAN_RL, root["val"]);
    } else if (actionName == "volumeCEN") {
        setVolume(CHAN_CEN, root["val"]);
    } else if (actionName == "volumeSW") {
        setVolume(CHAN_SW, root["val"]);
    } else if (actionName == "volumeALLCH") {
        setVolume(CHAN_ALL, root["val"]);
    } else if (actionName == "volumeSW") {
        setVolume(CHAN_SW, root["val"]);
    } else if (actionName == "lcdText") {
        setLcd(root["line"], root["val"]);
    }





	sendUpdate();
	Serial.printf("WebSocket message received:\r\n%s\r\n", actionName);
}
int sendRights(int fd, long const count, size_t count_len, vmguest_t * Live_vms,
                                                            long msi_vectors)
{
    /* updates about new guests are sent one at a time */

    long i, j;

    for (i = 0; i <= count; i++) {
        if (Live_vms[i].alive) {
            for (j = 0; j < msi_vectors; j++) {
                sendUpdate(Live_vms[count].sockfd, i, sizeof(long),
                                                        Live_vms[i].efd[j]);
            }
        }
    }

    return 0;

}
Exemplo n.º 24
0
bool AmSession::refresh(int flags) {
  // no session refresh if not connected
  if (dlg->getStatus() != AmSipDialog::Connected)
    return false;

  if (refresh_method == REFRESH_UPDATE) {
    DBG("Refreshing session with UPDATE\n");
    return sendUpdate( NULL, "") == 0;
  } else {

    if (dlg->getUACInvTransPending()) {
      DBG("INVITE transaction pending - not refreshing now\n");
      return false;
    }

    DBG("Refreshing session with re-INVITE\n");
    return sendReinvite(true, "", flags) == 0;
  }
}
UAVObjectBrowserWidget::UAVObjectBrowserWidget(QWidget *parent) : QWidget(parent)
{
    m_browser = new Ui_UAVObjectBrowser();
    m_browser->setupUi(this);
    m_model = new UAVObjectTreeModel();
    m_browser->treeView->setModel(m_model);
    m_browser->treeView->setColumnWidth(0, 300);
    //m_browser->treeView->expandAll();
    BrowserItemDelegate *m_delegate = new BrowserItemDelegate();
    m_browser->treeView->setItemDelegate(m_delegate);
    m_browser->treeView->setEditTriggers(QAbstractItemView::AllEditTriggers);
    m_browser->treeView->setSelectionBehavior(QAbstractItemView::SelectItems);
    showMetaData(m_browser->metaCheckBox->isChecked());
    connect(m_browser->treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(currentChanged(QModelIndex,QModelIndex)));
    connect(m_browser->metaCheckBox, SIGNAL(toggled(bool)), this, SLOT(showMetaData(bool)));
    connect(m_browser->saveSDButton, SIGNAL(clicked()), this, SLOT(saveObject()));
    connect(m_browser->readSDButton, SIGNAL(clicked()), this, SLOT(loadObject()));
    connect(m_browser->eraseSDButton, SIGNAL(clicked()), this, SLOT(eraseObject()));
    connect(m_browser->sendButton, SIGNAL(clicked()), this, SLOT(sendUpdate()));
    connect(m_browser->requestButton, SIGNAL(clicked()), this, SLOT(requestUpdate()));
    enableSendRequest(false);
}
Exemplo n.º 26
0
CDaemon::CDaemon(QObject *parent) :
	QObject(parent),
	m_server(0)
{
	if(::socketpair(AF_UNIX, SOCK_STREAM, 0, m_sigIntFd))
		qFatal("Couldn't create INT socket pair.");

	if(::socketpair(AF_UNIX, SOCK_STREAM, 0, m_sigTermFd))
		qFatal("Couldn't create TERM socket pair.");

	m_sigInt = new QSocketNotifier(m_sigIntFd[1], QSocketNotifier::Read, this);
	m_sigTerm = new QSocketNotifier(m_sigTermFd[1], QSocketNotifier::Read, this);
	m_server = new QTcpServer(this);

	connect(m_sigInt, SIGNAL(activated(int)), this, SLOT(handleSigInt()));
	connect(m_sigTerm, SIGNAL(activated(int)), this, SLOT(handleSigTerm()));
	connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(terminate()));
	connect(m_server, SIGNAL(newConnection()), this, SLOT(newConnection()));
	connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(sendUpdate()));

	loadSettings();
}
Exemplo n.º 27
0
vrpn_Shared_float64 & vrpn_Shared_float64::set (vrpn_float64 newValue,
                                                timeval when,
                                                vrpn_bool isLocalSet) {
  vrpn_bool acceptedUpdate;

  acceptedUpdate = shouldAcceptUpdate(newValue, when, isLocalSet);
  if (acceptedUpdate) {
    d_value = newValue;
    d_lastUpdate = when;
    //yankCallbacks(isLocalSet);
  }

  if (shouldSendUpdate(isLocalSet, acceptedUpdate)) {
    sendUpdate(newValue, when);
  }

  //yankCallbacks is placed after sendUpdate so that the update goes on the
  //network before the updates due to local callbacks.
  if (acceptedUpdate)
    yankCallbacks(isLocalSet);

  return *this;
}
void MitecomCommunicator::execute(void* arg)
{
	char networkBuffer[MITECOM_LENGTH_MAX];
	struct timeval timeout;     // timeout for socket access

	timeout.tv_sec = 0;
	timeout.tv_usec = 100000;

	uint64_t currentTime;
	uint64_t lastSendTime = getCurrentTime();

	do {
		if (mNetwork == NULL) {
			break;
		}
		currentTime = getCurrentTime();
		size_t len = mNetwork->receiveData(networkBuffer, MITECOM_LENGTH_MAX, &timeout, NULL, NULL);
		if( len > 0) {
			handlePacket(networkBuffer, len, currentTime);
		}
		if( currentTime - lastSendTime >= MITECOM_SEND_INTERVAL) {
			sendUpdate();
			lastSendTime = currentTime;
			pthread_mutex_lock(&mTeamMutex);
			for (MixedTeamMates::iterator it = mTeamMates.begin(); it != mTeamMates.end(); ) {
				if( currentTime - (it->second).lastUpdate >= MITECOM_UPDATE_TIME_LIMIT) {
					Debugger::INFO("Mitecom", "Robot %d has exceeded time limit. Good bye.",
							it->first);
					mTeamMates.erase(it++);
				} else {
					++it;
				}
			}
			pthread_mutex_unlock(&mTeamMutex);
		}
	} while (IsRunning());
}
Exemplo n.º 29
0
vrpn_Shared_String & vrpn_Shared_String::set (const char * newValue,
                                              timeval when,
                                              vrpn_bool isLocalSet) {
  vrpn_bool acceptedUpdate;

  acceptedUpdate = shouldAcceptUpdate(newValue, when, isLocalSet);
  if (acceptedUpdate) {

    if ((d_value == NULL) || (strcmp(d_value,newValue) != 0)) {
      if (d_value) {
        delete [] d_value;
      }
      d_value = new char [1 + strlen(newValue)];
      if (!d_value) {
        fprintf(stderr, "vrpn_Shared_String::set:  Out of memory.\n");
        return *this;
      }
      strcpy(d_value, newValue);
    }

//fprintf(stderr, "vrpn_Shared_String::set:  %s to \"%s\".\n", name(), value());

    d_lastUpdate = when;
  }

  if (shouldSendUpdate(isLocalSet, acceptedUpdate)) {
    sendUpdate(newValue, when);
  }

  //yankCallbacks is placed after sendUpdate so that the update goes on the
  //network before the updates due to local callbacks.
  if (acceptedUpdate) 
    yankCallbacks(isLocalSet);

  return *this;
}
Exemplo n.º 30
0
void wsConnected(WebSocket& socket)
{
	totalActiveSockets++;
	sendUpdate();
}