Fix some bugs related to graphing and loading graph definitions

This commit is contained in:
Collin Kidder
2019-05-27 10:08:31 -04:00
parent 61653f4664
commit 377b42c8e7
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ GraphingWindow::GraphingWindow(const QVector<CANFrame> *frames, QWidget *parent)
selectedPen.setWidth(1); selectedPen.setWidth(1);
selectedPen.setColor(Qt::blue); selectedPen.setColor(Qt::blue);
ui->graphingView->setAttribute(Qt::WA_AcceptTouchEvents); //ui->graphingView->setAttribute(Qt::WA_AcceptTouchEvents);
if (useOpenGL) if (useOpenGL)
{ {
+13 -2
View File
@@ -93,8 +93,8 @@ void NewGraphDialog::checkSignalAgreement()
GraphParams testingParams; GraphParams testingParams;
bool bAgree = true; bool bAgree = true;
bool sigSigned = false; bool sigSigned = false;
DBC_SIGNAL *sig; DBC_SIGNAL *sig = nullptr;
DBC_MESSAGE *msg; DBC_MESSAGE *msg = nullptr;
if (dbcHandler == nullptr) return; if (dbcHandler == nullptr) return;
if (dbcHandler->getFileCount() == 0) return; if (dbcHandler->getFileCount() == 0) return;
@@ -104,6 +104,11 @@ void NewGraphDialog::checkSignalAgreement()
{ {
sig = msg->sigHandler->findSignalByName(ui->cbSignals->currentText()); sig = msg->sigHandler->findSignalByName(ui->cbSignals->currentText());
} }
else
{
ui->lblMsgStatus->setText("Msg ID doesn't exist in DBC");
return;
}
if (sig) if (sig)
{ {
@@ -125,6 +130,12 @@ void NewGraphDialog::checkSignalAgreement()
if (testingParams.startBit != sig->startBit) bAgree = false; if (testingParams.startBit != sig->startBit) bAgree = false;
if (testingParams.numBits != sig->signalSize) bAgree = false; if (testingParams.numBits != sig->signalSize) bAgree = false;
} }
else
{
ui->lblMsgStatus->setText("Signal name doesn't exist in DBC");
return;
}
if (bAgree) if (bAgree)
{ {
ui->lblMsgStatus->setText("Graph params match this signal"); ui->lblMsgStatus->setText("Graph params match this signal");