do not rescale y axis of graphing window when changing graph parameters
This commit is contained in:
@@ -1225,7 +1225,7 @@ void GraphingWindow::showParamsDialog(int idx = -1)
|
|||||||
//create a new graph with the returned parameters.
|
//create a new graph with the returned parameters.
|
||||||
GraphParams params;
|
GraphParams params;
|
||||||
thisDialog->getParams(params);
|
thisDialog->getParams(params);
|
||||||
createGraph(params);
|
createGraph(params, true, false);
|
||||||
}
|
}
|
||||||
delete thisDialog;
|
delete thisDialog;
|
||||||
}
|
}
|
||||||
@@ -1322,7 +1322,7 @@ void GraphingWindow::appendToGraph(GraphParams ¶ms, CANFrame &frame, QVector
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam)
|
void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam, bool recalcY)
|
||||||
{
|
{
|
||||||
int64_t tempVal; //64 bit temp value.
|
int64_t tempVal; //64 bit temp value.
|
||||||
double yminval=10000000.0, ymaxval = -1000000.0;
|
double yminval=10000000.0, ymaxval = -1000000.0;
|
||||||
@@ -1561,8 +1561,10 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam)
|
|||||||
ui->graphingView->xAxis->setRange(xminval, xmaxval);
|
ui->graphingView->xAxis->setRange(xminval, xmaxval);
|
||||||
ui->graphingView->axisRect()->setupFullAxesBox();
|
ui->graphingView->axisRect()->setupFullAxesBox();
|
||||||
}
|
}
|
||||||
//always recalculate Y range so that new graphs actually show up in view
|
//almost always recalculate Y range so that new graphs actually show up in view
|
||||||
|
if (recalcY) {
|
||||||
ui->graphingView->yAxis->setRange(yminval, ymaxval);
|
ui->graphingView->yAxis->setRange(yminval, ymaxval);
|
||||||
|
}
|
||||||
|
|
||||||
ui->graphingView->replot();
|
ui->graphingView->replot();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ public:
|
|||||||
void showEvent(QShowEvent*);
|
void showEvent(QShowEvent*);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void createGraph(GraphParams ¶ms, bool createGraphParam = true);
|
void createGraph(GraphParams ¶ms, bool createGraphParam = true, bool recalcY = true);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void titleDoubleClick(QMouseEvent *event, QCPTextElement *title);
|
void titleDoubleClick(QMouseEvent *event, QCPTextElement *title);
|
||||||
|
|||||||
Reference in New Issue
Block a user