void SequenceDialog::fillDiagram()
{
    if (!sainfo_ || file_closed_) return;

    QCustomPlot *sp = ui->sequencePlot;

    if (sainfo_->type == SEQ_ANALYSIS_VOIP) {
        seq_diagram_->setData(sainfo_);
    } else {
        seq_diagram_->clearData();
        sequence_analysis_list_free(sainfo_);
        sequence_analysis_list_get(cap_file_.capFile(), sainfo_);
        num_items_ = sequence_analysis_get_nodes(sainfo_);
        seq_diagram_->setData(sainfo_);
    }

    QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont());
    char* addr_str;
    node_label_w_ = 0;
    for (guint i = 0; i < sainfo_->num_nodes; i++) {
        addr_str = (char*)address_to_display(NULL, &(sainfo_->nodes[i]));
        int label_w = vfm.width(addr_str);
        if (node_label_w_ < label_w) {
            node_label_w_ = label_w;
        }
        wmem_free(NULL, addr_str);
    }
    node_label_w_ = (node_label_w_ * 3 / 4) + one_em_;

    mouseMoved(NULL);
    resetAxes();

    // XXX QCustomPlot doesn't seem to draw any sort of focus indicator.
    sp->setFocus();
}
void SequenceDialog::fillDiagram()
{
    QCustomPlot *sp = ui->sequencePlot;
    seq_analysis_info_t new_sa;

    new_sa = seq_analysis_;
    new_sa.list = NULL;
    new_sa.ht = NULL;
    new_sa.num_nodes = 0;
    sequence_analysis_list_get(cap_file_, &new_sa);
    num_items_ = sequence_analysis_get_nodes(&new_sa);
    seq_diagram_->setData(&new_sa);
    sequence_analysis_list_free(&seq_analysis_);
    seq_analysis_ = new_sa;

    QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont());
    node_label_w_ = 0;
    for (guint i = 0; i < seq_analysis_.num_nodes; i++) {
        int label_w = vfm.width(ep_address_to_display(&(seq_analysis_.nodes[i])));
        if (node_label_w_ < label_w) {
            node_label_w_ = label_w;
        }
    }
    node_label_w_ = (node_label_w_ * 3 / 4) + one_em_;

    mouseMoved(NULL);
    resetAxes();

    // XXX QCustomPlot doesn't seem to draw any sort of focus indicator.
    sp->setFocus();
}
Esempio n. 3
0
void LBMUIMFlowDialog::fillDiagram(void)
{
    QCustomPlot * sp = m_ui->sequencePlot;
    seq_analysis_info_t new_sa;

    new_sa = m_sequence_analysis;
    new_sa.items = g_queue_new();
    new_sa.ht = NULL;
    new_sa.num_nodes = 0;
    lbm_uimflow_get_analysis(m_capture_file, &new_sa);
    m_num_items = sequence_analysis_get_nodes(&new_sa);
    m_sequence_diagram->setData(&new_sa);
    sequence_analysis_list_free(&m_sequence_analysis);
    m_sequence_analysis = new_sa;

    QFontMetrics vfm = QFontMetrics(sp->xAxis2->labelFont());
    m_node_label_width = 0;
    for (guint i = 0; i < m_sequence_analysis.num_nodes; i++)
    {
        QString addr_str = address_to_display_qstring(&(m_sequence_analysis.nodes[i]));
        int label_w = vfm.width(addr_str);
        if (m_node_label_width < label_w)
        {
            m_node_label_width = label_w;
        }
    }
    m_node_label_width = (m_node_label_width * 3 / 4) + m_one_em;

    mouseMoved(NULL);
    resetAxes();

    // XXX QCustomPlot doesn't seem to draw any sort of focus indicator.
    sp->setFocus();
}
Esempio n. 4
0
void sequence_analysis_info_free(seq_analysis_info_t *sainfo)
{
    if (!sainfo) return;

    sequence_analysis_list_free(sainfo);

    g_queue_free(sainfo->items);
    g_hash_table_destroy(sainfo->ht);

    g_free(sainfo);
}
Esempio n. 5
0
void sequence_analysis_info_free(seq_analysis_info_t *sainfo)
{
    if (!sainfo) return;

    /* SEQ_ANALYSIS_DEBUG("%d items", g_queue_get_length(sainfo->items)); */
    sequence_analysis_list_free(sainfo);

    g_queue_free(sainfo->items);
    g_hash_table_destroy(sainfo->ht);

    g_free(sainfo);
}
Esempio n. 6
0
void SequenceDialog::fillDiagram()
{
    if (!info_->sainfo() || file_closed_) return;

    QCustomPlot *sp = ui->sequencePlot;

    if (info_->sainfo()->type == SEQ_ANALYSIS_VOIP) {
        seq_diagram_->setData(info_->sainfo());
    } else {
        seq_diagram_->clearData();
        sequence_analysis_list_free(info_->sainfo());
        sequence_analysis_list_get(cap_file_.capFile(), info_->sainfo());
        num_items_ = sequence_analysis_get_nodes(info_->sainfo());
        seq_diagram_->setData(info_->sainfo());
    }

    sequence_w_ = one_em_ * 15 ; // Arbitrary

    mouseMoved(NULL);
    resetAxes();

    // XXX QCustomPlot doesn't seem to draw any sort of focus indicator.
    sp->setFocus();
}