Skip to content

Commit

Permalink
Disallow spaces in signal names, unit names, and comments on signals
Browse files Browse the repository at this point in the history
  • Loading branch information
collin80 committed Jan 5, 2017
1 parent 5caef50 commit d950ff2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dbc/dbcsignaleditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
[=]()
{
if (currentSignal == NULL) return;
currentSignal->comment = ui->txtComment->text();
currentSignal->comment = ui->txtComment->text().simplified().replace(' ', '_');
});

connect(ui->txtUnitName, &QLineEdit::editingFinished,
[=]()
{
if (currentSignal == NULL) return;
currentSignal->unitName = ui->txtUnitName->text();
currentSignal->unitName = ui->txtUnitName->text().simplified().replace(' ', '_');
});
connect(ui->txtBitLength, &QLineEdit::editingFinished,
[=]()
Expand All @@ -155,7 +155,7 @@ DBCSignalEditor::DBCSignalEditor(DBCHandler *handler, QWidget *parent) :
[=]()
{
if (currentSignal == NULL) return;
currentSignal->name = ui->txtName->text();
currentSignal->name = ui->txtName->text().simplified().replace(' ', '_');
//need to update the list too.
ui->signalsList->currentItem()->setText(currentSignal->name);
});
Expand Down Expand Up @@ -291,7 +291,7 @@ void DBCSignalEditor::onValuesCellChanged(int row,int col)
}
else if (col == 1)
{
currentSignal->valList[row].descript = ui->valuesTable->item(row, col)->text();
currentSignal->valList[row].descript = ui->valuesTable->item(row, col)->text().simplified().replace(' ', '_');
}
}

Expand Down

0 comments on commit d950ff2

Please sign in to comment.