Make CAN id's either be 3 hex digits or 8 hex digits when displayed - depending on whether a frame uses standard or extended id mode.

This commit is contained in:
Collin Kidder
2017-11-26 16:30:48 -05:00
parent 1635e0ae44
commit 3b9c793e99
13 changed files with 55 additions and 27 deletions
+6 -4
View File
@@ -124,11 +124,12 @@ void FrameInfoWindow::updatedFrames(int numFrames)
bool thisID = false;
for (int x = modelFrames->count() - numFrames; x < modelFrames->count(); x++)
{
unsigned int id = modelFrames->at(x).ID;
CANFrame thisFrame = modelFrames->at(x);
unsigned int id = thisFrame.ID;
if (!foundID.contains(id))
{
foundID.append(id);
ui->listFrameID->addItem(Utility::formatNumber(id));
ui->listFrameID->addItem(Utility::formatCANID(id, thisFrame.extended));
}
if (currID == modelFrames->at(x).ID)
@@ -394,11 +395,12 @@ void FrameInfoWindow::refreshIDList()
int id;
for (int i = 0; i < modelFrames->count(); i++)
{
id = (int)modelFrames->at(i).ID;
CANFrame thisFrame = modelFrames->at(i);
id = (int)thisFrame.ID;
if (!foundID.contains(id))
{
foundID.append(id);
ui->listFrameID->addItem(Utility::formatNumber(id));
ui->listFrameID->addItem(Utility::formatCANID(id, thisFrame.extended));
}
}
//default is to sort in ascending order