void SettingsDialog::accept()
{
    Settings::setScrollbackSize(ui->spn_scrollback->value());
    PortSettings port;
    port.BaudRate = (BaudRateType) currentData( ui->cmb_baud );
    port.DataBits = (DataBitsType) currentData( ui->cmb_dataBits );
    port.Parity = (ParityType) currentData( ui->cmb_parity );
    port.StopBits = (StopBitsType) currentData( ui->cmb_stop );
    port.FlowControl = (FlowType) currentData( ui->cmb_flow );
    Settings::setPortSettings(port);
    QDialog::accept();
}
예제 #2
0
void MemoryObjectStoreCursor::iterate(const IDBKeyData& key, uint32_t count, IDBGetResult& outData)
{
    LOG(IndexedDB, "MemoryObjectStoreCursor::iterate to key %s", key.loggingString().utf8().data());

    if (!m_objectStore.orderedKeys()) {
        m_currentPositionKey = { };
        outData = { };
        return;
    }

    if (key.isValid() && !m_info.range().containsKey(key)) {
        m_currentPositionKey = { };
        outData = { };
        return;
    }

    auto* set = m_objectStore.orderedKeys();
    if (set) {
        if (m_info.isDirectionForward())
            incrementForwardIterator(*set, key, count);
        else
            incrementReverseIterator(*set, key, count);
    }

    m_currentPositionKey = { };

    if (!hasValidPosition()) {
        outData = { };
        return;
    }

    currentData(outData);
}
예제 #3
0
void Scanner_Worker::runScan(int steps, int accuracy)
{
    ScanRunning = true;
    for(int i = 0; i <= steps; i++)
    {
        if(ScanRunning == false)
            break;
        Data->mutex.lock();
        if(Data->number >= accuracy)
        {
            qDebug() << "Current emitted data: Step: " << i << " and counts: " << Data->counts << " and current pos: " << ((qreal)i)/((qreal)steps)*100;
            emit currentData(qMakePair(i, Data->counts));
            emit moveStep();
            emit currentPosition(((qreal)i)/((qreal)steps)*100);
            Data->counts = 0;
            Data->number = 0;
            Data->mutex.unlock();
        }
        else
        {
            Data->WaitCond.wait(&(Data->mutex));
            Data->mutex.unlock();
            i--;
        }

    }
    emit ScanFinished();
}
    void paintEvent(QPaintEvent *event) override
    {
        QComboBox::paintEvent(event);

        QPainter painter(this);
        auto brushStyle = currentData().value<Qt::BrushStyle>();
        drawBrushStyle(painter, event->rect().adjusted(0, 0, -event->rect().height(), 0), QStyle::State_Active|QStyle::State_Enabled, brushStyle);
    }
예제 #5
0
    void IKSolverParallel::pushState(const SimTK::State& s) {

        GeneralisedCoordinatesData currentData(nCoordinates_);
        std::vector<double> q(nCoordinates_);
        SimTK::Vector stateQ(s.getQ());
        for (unsigned i(0); i < nCoordinates_; ++i)
            q[i] = stateQ[i];
        currentData.setQ(q);
        outputGeneralisedCoordinatesQueue_.push({ s.getTime(), currentData });
    }
예제 #6
0
void OpenOtherDialog::on_treeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem*)
{
    if (current->data(0, Qt::UserRole).isValid()) {
        QString currentData(current->data(0, Qt::UserRole).toString());
        for (int i = 0; i < ui->methodTabWidget->count(); i++) {
            QString tabName(ui->methodTabWidget->widget(i)->objectName());
            if (currentData == tabName) {
                ui->methodTabWidget->setCurrentIndex(i);
                QWidget* w = ui->methodTabWidget->currentWidget();
                if (w == ui->networkTab)
                    m_current = ui->networkWidget;
                else if (w == ui->decklinkTab)
                    m_current = ui->decklinkWidget;
                else if (w == ui->v4lTab)
                    m_current = ui->v4lWidget;
                else if (w == ui->colorTab)
                    m_current = ui->colorWidget;
                else if (w == ui->noiseTab)
                    m_current = ui->noiseWidget;
                else if (w == ui->isingTab)
                    m_current = ui->isingWidget;
                else if (w == ui->lissajousTab)
                    m_current = ui->lissajousWidget;
                else if (w == ui->plasmaTab)
                    m_current = ui->plasmaWidget;
                else if (w == ui->colorbarsTab)
                    m_current = ui->colorbarsWidget;
                else if (w == ui->pulseTab)
                    m_current = ui->pulseWidget;
                else if (w == ui->jackTab)
                    m_current = ui->jackWidget;
                else if (w == ui->alsaTab)
                    m_current = ui->alsaWidget;
                else if (w == ui->x11grabTab)
                    m_current = ui->x11grabWidget;
                else if (w == ui->dshowVideoTab)
                    m_current = ui->dshowVideoWidget;
                else if (w == ui->toneTab)
                    m_current = ui->toneWidget;
                break;
            }
        }
    }
}
예제 #7
0
void drawButton(const Button* button){
	if(button == NULL) return;
	GLuint textureId = 0;
	
	switch(button->action){
	case PUT_GUN : textureId = GAME_TEXTURES_ID.GUN_BUTTON_ID;
	break;
	case PUT_HYBRID : textureId = GAME_TEXTURES_ID.HYBRID_BUTTON_ID;
	break;
	case PUT_LASER : textureId = GAME_TEXTURES_ID.LASER_BUTTON_ID;
	break;
	case PUT_ROCKET : textureId = GAME_TEXTURES_ID.ROCKET_BUTTON_ID;
	break;
	case QUIT_GAME : textureId = GAME_TEXTURES_ID.QUIT_GAME_ID;
	break;
	case AIDE_MENU : textureId = MENU_TEXTURES_ID.AIDE_BUTTON;
	break;
	case CHOIX_MENU : textureId = MENU_TEXTURES_ID.MAP_CHOICE_BUTTON;
	break;
	case PLAY_MENU : textureId = MENU_TEXTURES_ID.PLAY_BUTTON;
	break;
	case MAP_MENU :
		goToPosition(BUTTON_OF_MENU.lstMapTextureIndex, BUTTON_OF_MENU.lstMapButton->position);
		textureId = *((GLuint*)currentData(BUTTON_OF_MENU.lstMapTextureIndex));
	break;
	case CLOSE_RULES_MENU : textureId = MENU_TEXTURES_ID.RULES_CLOSE;
	break;

	
	default : return;
	break;
	}

	glPushMatrix();
	glTranslatef(button->position.x , button->position.y , button->position.z);
	glScalef(button->width, button->height,1.);
	drawTexturedQuad(textureId);
	glPopMatrix();
}
예제 #8
0
void ServiceDataBufferTest::test_getWritable()
{
    {
        // Use case:
        // Call getWritable twice without releasing the new object.
        // expect second call to return an invalid object.
        ServiceDataBuffer buffer("test");
        WritableData data1 = buffer.getWritable(1);
        WritableData data2 = buffer.getWritable(1);
        CPPUNIT_ASSERT(data1.isValid());
        CPPUNIT_ASSERT(!data2.isValid());
    }
    
    {
        // Use case:
        // On deleting the WritableData expect it to become current.
        // This should also release the lock allowing a second call
        // to getWritable() to return a valid object
        ServiceDataBuffer buffer("test");
        {
            LockableServiceData* data = 0;
            data = static_cast<LockableServiceData*>(buffer.getWritable(1).data());
            CPPUNIT_ASSERT( data != 0 );
            CPPUNIT_ASSERT( data->isValid() );
        }

        _app->processEvents(); // needed to connect signals and slots

        LockedData currentData("test");
        buffer.getCurrent(currentData);
        CPPUNIT_ASSERT(currentData.isValid());

        // Check that the lock is now released allowing a second getWritable()
        // to return valid data
        WritableData wd = buffer.getWritable(1);
        CPPUNIT_ASSERT( wd.isValid() );
    }
}
BookmarksItem* BookmarksComboBoxWidget::getCurrentFolder()
{
	BookmarksItem *item = qobject_cast<BookmarksModel*>(model())->getBookmark(currentData(BookmarksModel::IdentifierRole).toLongLong());

	return (item ? item :qobject_cast<BookmarksModel*>(model())->getRootItem());
}
예제 #10
0
Qt::PenJoinStyle QgsPenJoinStyleComboBox::penJoinStyle() const
{
  return ( Qt::PenJoinStyle ) currentData().toInt();
}
예제 #11
0
void Spectrometer_Control::scanData(QPair<int, int> data)
{
    emit currentData(data);
}
int ActionComboBoxWidget::getActionIdentifier() const
{
	return ((currentIndex() >= 0) ? currentData(IdentifierRole).toInt() : -1);
}
예제 #13
0
BookmarksItem* BookmarksComboBoxWidget::getCurrentFolder() const
{
	BookmarksItem *item(m_model->getBookmark(currentData(BookmarksModel::IdentifierRole).toULongLong()));

	return (item ? item : m_model->getRootItem());
}
예제 #14
0
void methodComboBox::box_Index_Changed(int index)
{
    emit(newMethodSelected(id_, qvariant_cast<QString>(currentData())));
}