Exemplo n.º 1
0
void LBMStreamEntry::processPacket(const packet_info * pinfo, const lbm_uim_stream_tap_info_t * stream_info)
{
    LBMSubstreamEntry * substream = NULL;
    LBMSubstreamMapIterator it;

    if (m_first_frame > pinfo->num)
    {
        m_first_frame = pinfo->num;
    }
    if (m_flast_frame < pinfo->num)
    {
        m_flast_frame = pinfo->num;
    }
    m_bytes += stream_info->bytes;
    m_messages++;
    it = m_substreams.find(stream_info->substream_id);
    if (m_substreams.end() == it)
    {
        QTreeWidgetItem * item = NULL;

        substream = new LBMSubstreamEntry(m_channel, stream_info->substream_id, &(pinfo->src), pinfo->srcport, &(pinfo->dst), pinfo->destport);
        m_substreams.insert(stream_info->substream_id, substream);
        item = new QTreeWidgetItem();
        substream->setItem(item);
        m_item->addChild(item);
        m_item->sortChildren(Stream_Column, Qt::AscendingOrder);
    }
    else
    {
        substream = it.value();
    }
    fillItem();
    substream->processPacket(pinfo->num, stream_info->bytes);
}
Exemplo n.º 2
0
int main()
{
	int empty,loop, loop1, depth;
	double sum, tmp, coefficient, *constant;
	double item[6] = {0,0,0,0,0,0};

	constant = malloc(5 * sizeof(double));

	for (empty = 0; empty < 6; empty++)
	{
		coefficient = CoefficientCalculation(empty);
		fillItem(empty, constant); /* Withdraw a cell out of the array */

		/* Add coefficient of each order to the array */
		for (loop = 0; loop < 6; loop++)
		{
			sum = 0;

			if (loop == 0)
				depth = 0;
			else
				depth = 5 - loop;

			for (loop1 = 0; loop1 <= depth; loop1++)
			{
				sum += combinationCalculation(loop, loop1, constant);
			}
			item[loop] += sum*coefficient;
		//	printf("\n");
		}
	}

	printf("Polynomial is:\n%fX^5 + %fX^4 + %fX^3 + %fX^2 + %fX +%f", item[0], item[1], item[2], item[3], item[4], item[5]);
	return SUCCESS;
}
QTreeWidgetItem* K3bExternalEncoderSettingsWidget::createItem( const K3bExternalEncoderCommand& cmd )
{
    QTreeWidgetItem* item = new QTreeWidgetItem( m_viewEncoders );
    fillItem( item, cmd );
    m_commands.insert( item, cmd );
    return item;
}
Exemplo n.º 4
0
QTreeWidgetItem* ProgressTree2::findItem(Job* job, bool create)
{
    QList<Job*> path;
    Job* v = job;
    while (v) {
        path.insert(0, v);
        v = v->parentJob;
    }

    QTreeWidgetItem* c = 0;
    for (int i = 0; i < path.count(); i++) {
        Job* toFind = path.at(i);
        QTreeWidgetItem* found = 0;
        if (i == 0) {
            for (int j = 0; j < this->topLevelItemCount(); j++) {
                QTreeWidgetItem* item = this->topLevelItem(j);
                Job* v = getJob(*item);
                if (v == toFind) {
                    found = item;
                    break;
                }
            }
        } else {
            if (c) {
                for (int j = 0; j < c->childCount(); j++) {
                    QTreeWidgetItem* item = c->child(j);
                    Job* v = getJob(*item);
                    if (v == toFind) {
                        found = item;
                        break;
                    }
                }
            }
        }
        if (found)
            c = found;
        else {
            if (create) {
                if (!toFind->parentJob)
                    ; //c = addJob(toFind);
                else {
                    if (c) {
                        QTreeWidgetItem* subItem = new QTreeWidgetItem(c);
                        fillItem(subItem, toFind);
                        if (autoExpandNodes)
                            c->setExpanded(true);
                        c = subItem;
                    }
                }
            } else {
                c = 0;
                break;
            }
        }
    }

    return c;
}
void K3bExternalEncoderSettingsWidget::slotEditCommand()
{
    if( QTreeWidgetItem* item = m_viewEncoders->currentItem() ) {
        m_editDlg->setCommand( m_commands[item] );
        if( m_editDlg->exec() == QDialog::Accepted ) {
            m_commands[item] = m_editDlg->currentCommand();
            fillItem( item, m_editDlg->currentCommand() );
            emit changed( true );
        }
    }
}
Exemplo n.º 6
0
void LBMSubstreamEntry::processPacket(guint32 frame, guint32 bytes)
{
    if (m_first_frame > frame)
    {
        m_first_frame = frame;
    }
    if (m_flast_frame < frame)
    {
        m_flast_frame = frame;
    }
    m_bytes += bytes;
    m_messages++;
    fillItem();
}
Exemplo n.º 7
0
QTreeWidgetItem* ProgressTree2::addJob(Job* job)
{
    QTreeWidgetItem* item = new QTreeWidgetItem(this);
    fillItem(item, job);

    connect(job, SIGNAL(subJobCreated(Job*)), this,
            SLOT(subJobCreated(Job*)),
            Qt::QueuedConnection);

    connect(job, SIGNAL(changed(Job*)), this,
            SLOT(monitoredJobChanged(Job*)),
            Qt::QueuedConnection);

    addTopLevelItem(item);

    return item;
}
Exemplo n.º 8
0
void VNotebookSelector::editNotebookInfo()
{
    QList<QListWidgetItem *> items = m_listWidget->selectedItems();
    if (items.isEmpty()) {
        return;
    }

    Q_ASSERT(items.size() == 1);

    VNotebook *notebook = getNotebook(items[0]);
    VNotebookInfoDialog dialog(tr("Notebook Information"),
                               "",
                               notebook,
                               m_notebooks,
                               this);
    if (dialog.exec() == QDialog::Accepted) {
        bool updated = false;
        bool configUpdated = false;
        QString name = dialog.getName();
        if (name != notebook->getName()) {
            updated = true;
            notebook->rename(name);
            g_config->setNotebooks(m_notebooks);
        }

        QString imageFolder = dialog.getImageFolder();
        if (imageFolder != notebook->getImageFolderConfig()) {
            configUpdated = true;
            notebook->setImageFolder(imageFolder);
        }

        if (configUpdated) {
            updated = true;
            notebook->writeConfigNotebook();
        }

        if (updated) {
            fillItem(items[0], notebook);
            emit notebookUpdated(notebook);
        }
    }
}
Exemplo n.º 9
0
void VNotebookSelector::addNotebookItem(const VNotebook *p_notebook)
{
    QListWidgetItem *item = new QListWidgetItem(m_listWidget);
    fillItem(item, p_notebook);
}
Exemplo n.º 10
0
void LBMStreamEntry::setItem(QTreeWidgetItem * item)
{
    m_item = item;
    fillItem(FALSE);
}
Exemplo n.º 11
0
QListWidgetItem *ImHistoryBrowser::createItem(HistoryMsg& msg)
{
    QListWidgetItem *itemWidget = new QListWidgetItem;
    fillItem(itemWidget, msg);
    return itemWidget;
}