void TCPStreamDialog::axisClicked(QCPAxis *axis, QCPAxis::SelectablePart, QMouseEvent *)
{
    QCustomPlot *sp = ui->streamPlot;

    if (axis == sp->xAxis) {
        switch (graph_.type) {
        case GRAPH_THROUGHPUT:
        case GRAPH_TSEQ_STEVENS:
        case GRAPH_TSEQ_TCPTRACE:
        case GRAPH_WSCALE:
            ts_origin_conn_ = ts_origin_conn_ ? false : true;
            fillGraph();
            break;
        case GRAPH_RTT:
            seq_origin_zero_ = seq_origin_zero_ ? false : true;
            fillGraph();
            break;
        default:
            break;
        }
    } else if (axis == sp->yAxis) {
        switch (graph_.type) {
        case GRAPH_TSEQ_STEVENS:
        case GRAPH_TSEQ_TCPTRACE:
            seq_origin_zero_ = seq_origin_zero_ ? false : true;
            fillGraph();
            break;
        default:
            break;
        }
    }
}
Beispiel #2
0
TEST_F(CTestInference, inference_exact_weiss)
{
	CGraphWeiss graph(m_nStates);
	buildGraph(graph, m_nNodes);
	fillGraph(graph);
	
	CInferExact inferer(graph);
	testInferer(inferer);
}
Beispiel #3
0
TEST_F(CTestInference, inference_LBP)
{
	CGraphPairwise graph(m_nStates);
	buildGraph(graph, m_nNodes);
	fillGraph(graph);
	
	CInferLBP inferer(graph);
	testInferer(inferer);
}
void TCPStreamDialog::on_streamNumberSpinBox_valueChanged(int new_stream)
{
    if (new_stream >= 0 && new_stream < int(get_tcp_stream_count())) {
        graph_.stream = new_stream;
        clear_address(&graph_.src_address);
        clear_address(&graph_.dst_address);
        findStream();
        fillGraph();
    }
}
Beispiel #5
0
// Constructor
CTestInference::CTestInference(void)
{
	CGraphPairwise graph(m_nStates);
	buildGraph(graph, m_nNodes);
	fillGraph(graph);

	CInferExact exactInferer(graph);
	exactInferer.infer();
	m_vPotExact = exactInferer.getPotentials(0);
}
// Once channel details are known, complete the graph with details that depend upon the channel.
void LteRlcGraphDialog::completeGraph(bool may_be_empty)
{
    QCustomPlot *rp = ui->rlcPlot;

    // If no channel chosen already, try to use currently selected frame.
    findChannel(may_be_empty);

    // Set window title here.
    if (graph_.channelSet) {
        QString dlg_title = tr("LTE RLC Graph (UE=%1 chan=%2%3 %4 - %5)")
                                 .arg(graph_.ueid)
                                 .arg((graph_.channelType == CHANNEL_TYPE_SRB) ? "SRB" : "DRB")
                                 .arg(graph_.channelId)
                                 .arg((graph_.direction == DIRECTION_UPLINK) ? "UL" : "DL")
                                 .arg((graph_.rlcMode == RLC_UM_MODE) ? "UM" : "AM");
        setWindowTitle(dlg_title);
    }
    else {
        setWindowTitle(tr("LTE RLC Graph - no channel selected"));
    }

    // Set colours/styles for each of the traces on the graph.
    QCustomPlot *sp = ui->rlcPlot;
    base_graph_ = sp->addGraph(); // All: Selectable segments
    base_graph_->setPen(QPen(QBrush(Qt::black), 0.25));

    reseg_graph_ = sp->addGraph();
    reseg_graph_->setPen(QPen(QBrush(Qt::lightGray), 0.25));

    acks_graph_ = sp->addGraph();
    acks_graph_->setPen(QPen(QBrush(graph_color_ack), 1.0));

    nacks_graph_ = sp->addGraph();
    nacks_graph_->setPen(QPen(QBrush(graph_color_nack), 0.25));

    // Create tracer
    tracer_ = new QCPItemTracer(sp);
    sp->addItem(tracer_);
    tracer_->setVisible(false);
    toggleTracerStyle(true);

    // Change label on save/export button.
    QPushButton *save_bt = ui->buttonBox->button(QDialogButtonBox::Save);
    save_bt->setText(tr("Save As" UTF8_HORIZONTAL_ELLIPSIS));

    connect(rp, SIGNAL(mousePress(QMouseEvent*)), this, SLOT(graphClicked(QMouseEvent*)));
    connect(rp, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(mouseMoved(QMouseEvent*)));
    connect(rp, SIGNAL(mouseRelease(QMouseEvent*)), this, SLOT(mouseReleased(QMouseEvent*)));
    disconnect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    this->setResult(QDialog::Accepted);

    // Extract the data that the graph can use.
    fillGraph();
}
void TCPStreamDialog::on_actionSwitchDirection_triggered()
{
    address tmp_addr;
    guint16 tmp_port;

    copy_address(&tmp_addr, &graph_.src_address);
    tmp_port = graph_.src_port;
    copy_address(&graph_.src_address, &graph_.dst_address);
    graph_.src_port = graph_.dst_port;
    copy_address(&graph_.dst_address, &tmp_addr);
    graph_.dst_port = tmp_port;

    fillGraph();
}
Beispiel #8
0
int main (void)
{
	int i;

	tGraph * graph ;

	int size = 11;
	char * list_of_vertexes = "ABCDEFGHIJ";
	char ** list_of_adj;

	//char * visited;

	list_of_adj = (char **) malloc (size * sizeof(char*));

	list_of_adj[0] = "CB";
	list_of_adj[1] = "ACD";
	list_of_adj[2] = "ABDE";
	list_of_adj[3] = "CB";
	list_of_adj[4] = "CHF";
	list_of_adj[5] = "EH";
	list_of_adj[6] = "HI";
	list_of_adj[7] = "EFGI";
	list_of_adj[8] = "GHJ";
	list_of_adj[10] = "I";



	createGraph (&graph, list_of_vertexes);

	for (i=0; i<size ; i++)
	{
		fillGraph (&graph, i, list_of_adj[i]);
	}

	verifyGraph (&graph);





	return 0;
}
void TCPStreamDialog::on_actionToggleTimeOrigin_triggered()
{
    ts_origin_conn_ = ts_origin_conn_ ? false : true;
    fillGraph();
}
void TCPStreamDialog::on_actionToggleSequenceNumbers_triggered()
{
    seq_origin_zero_ = seq_origin_zero_ ? false : true;
    fillGraph();
}
void TCPStreamDialog::on_graphTypeComboBox_currentIndexChanged(int index)
{
    if (index < 0) return;
    graph_.type = static_cast<tcp_graph_type>(ui->graphTypeComboBox->itemData(index).toInt());
    fillGraph();
}