diff options
Diffstat (limited to 'ui/qt/tcp_stream_dialog.cpp')
-rw-r--r-- | ui/qt/tcp_stream_dialog.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/ui/qt/tcp_stream_dialog.cpp b/ui/qt/tcp_stream_dialog.cpp index 8d668f62..b8e15429 100644 --- a/ui/qt/tcp_stream_dialog.cpp +++ b/ui/qt/tcp_stream_dialog.cpp @@ -295,7 +295,7 @@ TCPStreamDialog::TCPStreamDialog(QWidget *parent, capture_file *cf, tcp_graph_ty sack2_eb_->setDataPlottable(sack2_graph_); // RWin graph - displays upper extent of RWIN advertised on reverse packets - rwin_graph_ = sp->addGraph(sp->xAxis, sp->yAxis2); + rwin_graph_ = sp->addGraph(); rwin_graph_->setPen(QPen(QBrush(graph_color_3), pen_width)); rwin_graph_->setLineStyle(QCPGraph::lsStepLeft); @@ -554,6 +554,9 @@ void TCPStreamDialog::fillGraph(bool reset_axes, bool set_focus) sp->yAxis2->setVisible(false); sp->yAxis2->setLabel(QString()); + /* For graphs other than receive window, the axes are not in sync. */ + disconnect(sp->yAxis, QOverload<const QCPRange&>::of(&QCPAxis::rangeChanged), sp->yAxis2, QOverload<const QCPRange&>::of(&QCPAxis::setRange)); + if (!cap_file_) { QString dlg_title = QString(tr("No Capture Data")); setWindowTitle(dlg_title); @@ -905,6 +908,7 @@ void TCPStreamDialog::fillTcptrace() sack_eb_->setData(sack_span); sack2_graph_->setData(sack2_time, sack2_center, true); sack2_eb_->setData(sack2_span); + rwin_graph_->setValueAxis(sp->yAxis); rwin_graph_->setData(ackrwin_time, rwin, true); dup_ack_graph_->setData(dup_ack_time, dup_ack, true); zero_win_graph_->setData(zero_win_time, zero_win, true); @@ -1585,15 +1589,24 @@ void TCPStreamDialog::fillWindowScale() /* base_graph_ is the one that the tracer is on and allows selecting * segments. XXX - Is the congestion window more interesting to see * the exact value and select? + * + * We'll put the graphs on the same axis so they'll use the same scale. */ base_graph_->setData(cwnd_time, cwnd_size); + rwin_graph_->setValueAxis(sp->yAxis); rwin_graph_->setData(rel_time, win_size); - sp->yAxis->setLabel(cwnd_label_); + /* The left axis has the color and label for the unacked bytes, + * and the right axis will have the color and label for the window size. + */ + sp->yAxis->setLabel(cwnd_label_); sp->yAxis2->setLabel(window_size_label_); sp->yAxis2->setLabelColor(QColor(graph_color_3)); sp->yAxis2->setTickLabelColor(QColor(graph_color_3)); sp->yAxis2->setVisible(true); + + /* Keep the ticks on the two axes in sync. */ + connect(sp->yAxis, QOverload<const QCPRange&>::of(&QCPAxis::rangeChanged), sp->yAxis2, QOverload<const QCPRange&>::of(&QCPAxis::setRange)); } QString TCPStreamDialog::streamDescription() |