Fix issue where graph windows would be corrupted if a new file was
loaded while graphs were visible.
This commit is contained in:
@@ -1333,7 +1333,8 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam)
|
|||||||
for (int i = 0; i < modelFrames->count(); i++)
|
for (int i = 0; i < modelFrames->count(); i++)
|
||||||
{
|
{
|
||||||
CANFrame thisFrame = modelFrames->at(i);
|
CANFrame thisFrame = modelFrames->at(i);
|
||||||
if (thisFrame.frameId() == params.ID && thisFrame.frameType() == QCanBusFrame::DataFrame && ( ( params.bus == -1) || (params.bus == thisFrame.bus) ) ) frameCache.append(thisFrame);
|
if ( (thisFrame.frameId() == params.ID) && (thisFrame.frameType() == QCanBusFrame::DataFrame)
|
||||||
|
&& ( ( params.bus == -1) || (params.bus == thisFrame.bus) ) ) frameCache.append(thisFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
//to fix weirdness where a graph that has no data won't be able to be edited, selected, or deleted properly
|
//to fix weirdness where a graph that has no data won't be able to be edited, selected, or deleted properly
|
||||||
@@ -1352,6 +1353,8 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam)
|
|||||||
int numEntries = frameCache.count() / params.stride;
|
int numEntries = frameCache.count() / params.stride;
|
||||||
if (numEntries < 1) numEntries = 1; //could happen if stride is larger than frame count
|
if (numEntries < 1) numEntries = 1; //could happen if stride is larger than frame count
|
||||||
|
|
||||||
|
params.x.clear();
|
||||||
|
params.y.clear();
|
||||||
params.x.reserve(numEntries);
|
params.x.reserve(numEntries);
|
||||||
params.y.reserve(numEntries);
|
params.y.reserve(numEntries);
|
||||||
//params.x.fill(0, numEntries);
|
//params.x.fill(0, numEntries);
|
||||||
|
|||||||
Reference in New Issue
Block a user