Fixes to formatting of main frame display. Fixes issue #164
This commit is contained in:
+8
-2
@@ -255,6 +255,11 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
return QColor(Qt::white);
|
||||
}
|
||||
|
||||
if (role == Qt::TextAlignmentRole)
|
||||
{
|
||||
return Qt::AlignLeft;
|
||||
}
|
||||
|
||||
if (role == Qt::TextColorRole)
|
||||
{
|
||||
if (dbcHandler != NULL && interpretFrames)
|
||||
@@ -300,7 +305,8 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
for (int i = 0; i < dLen; i++)
|
||||
{
|
||||
quint8 byt = thisFrame.data[i];
|
||||
if (byt < 0x20) byt = 0x2E; //A dot
|
||||
//0x20 through 0x7E are printable characters. Outside of that range they aren't. So use dots instead
|
||||
if (byt < 0x20) byt = 0x2E; //dot character
|
||||
if (byt > 0x7E) byt = 0x2E;
|
||||
tempString.append(QString::fromUtf8((char *)&byt, 1));
|
||||
}
|
||||
@@ -326,7 +332,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
DBC_MESSAGE *msg = dbcHandler->findMessage(thisFrame);
|
||||
if (msg != NULL)
|
||||
{
|
||||
tempString.append("\n");
|
||||
tempString.append(" <Interpreted>\n");
|
||||
tempString.append(msg->name + "\n" + msg->comment + "\n");
|
||||
for (int j = 0; j < msg->sigHandler->getCount(); j++)
|
||||
{
|
||||
|
||||
@@ -272,6 +272,7 @@ void SerialBusConnection::testConnection() {
|
||||
stats.conStatus = getStatus();
|
||||
stats.numHardwareBuses = mNumBuses;
|
||||
emit status(stats);
|
||||
piStop();
|
||||
}
|
||||
break;
|
||||
case CANCon::NOT_CONNECTED:
|
||||
|
||||
+6
-2
@@ -55,6 +55,9 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
readSettings();
|
||||
|
||||
QHeaderView *verticalHeader = ui->canFramesView->verticalHeader();
|
||||
verticalHeader->setSectionResizeMode(QHeaderView::Fixed);
|
||||
verticalHeader->setDefaultSectionSize(10);
|
||||
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
|
||||
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
||||
connect(HorzHdr, SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int)));
|
||||
@@ -297,7 +300,7 @@ void MainWindow::readSettings()
|
||||
ui->canFramesView->setColumnWidth(5, settings.value("Main/BusColumn", 40).toUInt()); //bus
|
||||
ui->canFramesView->setColumnWidth(6, settings.value("Main/LengthColumn", 40).toUInt()); //length
|
||||
ui->canFramesView->setColumnWidth(7, settings.value("Main/AsciiColumn", 50).toUInt()); //ascii
|
||||
ui->canFramesView->setColumnWidth(8, settings.value("Main/DataColumn", 225).toUInt()); //data
|
||||
//ui->canFramesView->setColumnWidth(8, settings.value("Main/DataColumn", 225).toUInt()); //data
|
||||
}
|
||||
if (settings.value("Main/AutoScroll", false).toBool())
|
||||
{
|
||||
@@ -342,7 +345,7 @@ void MainWindow::writeSettings()
|
||||
settings.setValue("Main/BusColumn", ui->canFramesView->columnWidth(5));
|
||||
settings.setValue("Main/LengthColumn", ui->canFramesView->columnWidth(6));
|
||||
settings.setValue("Main/AsciiColumn", ui->canFramesView->columnWidth(7));
|
||||
settings.setValue("Main/DataColumn", ui->canFramesView->columnWidth(8));
|
||||
//settings.setValue("Main/DataColumn", ui->canFramesView->columnWidth(8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,6 +394,7 @@ void MainWindow::gridDoubleClicked(QModelIndex idx)
|
||||
void MainWindow::interpretToggled(bool state)
|
||||
{
|
||||
model->setInterpetMode(state);
|
||||
//ui->canFramesView->resizeRowsToContents(); //a VERY costly operation!
|
||||
}
|
||||
|
||||
void MainWindow::overwriteToggled(bool state)
|
||||
|
||||
Reference in New Issue
Block a user