コード例 #1
0
ファイル: project.cpp プロジェクト: BrentChesny/EasyBlocks
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()));
    }
コード例 #2
0
ファイル: strangewindow.cpp プロジェクト: rpeng/QStrange
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()));

}
コード例 #3
0
ファイル: ScreenEncoder.cpp プロジェクト: AsherBond/DimSim
	void ScreenEncoder::createUpdate(OutputStream& out)
	{
		DDSS_VERBOSE("SEnc")<<"Create update called!!!!"<<std::endl;
		sendUpdate(out);
		
		
	}
コード例 #4
0
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();
    }
}
コード例 #5
0
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);
}
コード例 #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);
}
コード例 #7
0
void LLPanelClassifiedEdit::doSave()
{
	mCanClose = true;
	sendUpdate();
	resetDirty();

	mSaveButtonClickedSignal(this, LLSD());
}
コード例 #8
0
void DebuggerMagager::disableBreakPoint(int _iBreakPoint)
{
    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
    {
        breakpoints[_iBreakPoint]->setDisable();
        sendUpdate();
    }
}
コード例 #9
0
ファイル: qcontent_p.cpp プロジェクト: muromec/qtopia-ezx
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);
}
コード例 #10
0
void DebuggerMagager::enableAllBreakPoints()
{
    for (const auto& it : breakpoints)
    {
        it->setEnable();
    }

    sendUpdate();
}
コード例 #11
0
ファイル: inventory.cpp プロジェクト: madcad/mineserver
void Item::incHealth(int c)
{
  int healthMax = itemHealth(type);
  health += c;
  if (health > healthMax && healthMax > 0)
  {
    setType(-1);
  }
  sendUpdate();
}
コード例 #12
0
ファイル: llpanelpick.cpp プロジェクト: AlexRa/Kirstens-clone
void LLPanelPickEdit::onClickSave()
{
	sendUpdate();

	mLocationChanged = false;

	LLSD params;
	params["action"] = "save_new_pick";
	notifyParent(params);
}
コード例 #13
0
ファイル: inventory.cpp プロジェクト: madcad/mineserver
void Item::decCount(int c)
{
  count -= c;
  if (count < 1)
  {
    setType(-1);
    return;
  }
  sendUpdate();
}
コード例 #14
0
void DebuggerMagager::removeBreakPoint(int _iBreakPoint)
{
    if (_iBreakPoint >= 0 && _iBreakPoint <= breakpoints.size())
    {
        Breakpoints::iterator it = breakpoints.begin() + _iBreakPoint;
        delete *it;
        breakpoints.erase(it);
        sendUpdate();
    }
}
コード例 #15
0
ファイル: inventory.cpp プロジェクト: madcad/mineserver
void Item::setCount(int8_t count)
{
  this->count = count;
  if (count < 1)
  {
    setType(-1);
    return;
  }
  sendUpdate();
}
コード例 #16
0
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);
}
コード例 #17
0
ファイル: inventory.cpp プロジェクト: madcad/mineserver
void Item::setType(int16_t type)
{
  this->type = type;
  if (type == -1)
  {
    count = 0;
    health = 0;
  }

  sendUpdate();
}
コード例 #18
0
void DebuggerMagager::removeAllBreakPoints()
{
    Breakpoints::iterator it = breakpoints.begin();
    for (; it != breakpoints.end(); ++it)
    {
        delete *it;
    }

    breakpoints.clear();
    sendUpdate();
}
コード例 #19
0
ファイル: inventory.cpp プロジェクト: madcad/mineserver
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();
  }
}
コード例 #20
0
ファイル: WinDesktop.cpp プロジェクト: kaseya/tightvnc2
void WinDesktop::execute()
{
  Log::info(_T("WinDesktop thread started"));

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

  Log::info(_T("WinDesktop thread stopped"));
}
コード例 #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);
}
コード例 #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);
}
コード例 #23
0
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;

}
コード例 #24
0
ファイル: AmSession.cpp プロジェクト: Chocolatbuddha/sems
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;
  }
}
コード例 #25
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);
}
コード例 #26
0
ファイル: CDaemon.cpp プロジェクト: vojtad/uloz-to-daemon
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();
}
コード例 #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;
}
コード例 #28
0
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());
}
コード例 #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;
}
コード例 #30
0
void wsConnected(WebSocket& socket)
{
	totalActiveSockets++;
	sendUpdate();
}