Changeset 342 in pacpusframework


Ignore:
Timestamp:
Mar 12, 2015, 5:12:51 PM (10 years ago)
Author:
phudelai
Message:

mise à jour du decriptor

Location:
branches/0.1.x/src/dbcDecriptor/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.1.x/src/dbcDecriptor/src/mainwindow.cpp

    r331 r342  
    1111#include "mainwindow.h"
    1212#include "ui_mainwindow.h"
    13 #include <iostream>
    14 #include <math.h>
    1513
    1614#include <QString>
     
    6664
    6765    if (!file.open(QIODevice::ReadOnly))
    68     {
    6966        ui->label_file_error->setText("<font color=\"#C80000\">Can not open the file</font>");
    70     }
    7167    else
    7268    {
     
    8581            if (frameFound)
    8682            {
    87                 // " SG_" is the beginning if a line containing a signal information
    88                 if (dbcFiles_.content[i].startsWith(" SG_"))
     83                // signalMnemo is the beginning if a line containing a signal information
     84                if (dbcFiles_.content[i].startsWith(signalMnemo))
    8985                {
    9086                    tmpFrame.numberOfSignals++;
     
    9692
    9793            // "BO_" is the beginning of a line containing a frame information and all signals are following
    98             if (dbcFiles_.content[i].startsWith("BO_"))
     94            if (dbcFiles_.content[i].startsWith(signalInfoMnemo))
    9995            {
    10096                int numberOfSpace = 0, j = 0;
     
    126122                tmpFrame.frameName = tmp;
    127123            }
    128             else if (dbcFiles_.content[i].startsWith("CM_"))
    129             {
    130                 // Get the comment at the end of the DBC file
    131                 findComment(i);
    132             }
    133             else if (dbcFiles_.content[i].startsWith("VAL_"))
    134             {
    135                 // Get the value descritpion at the end of the DBC file
    136                 findValueDescription(i);
    137             }
     124            else if (dbcFiles_.content[i].startsWith(commentMnemo))
     125                findComment(i); // Get the comment at the end of the DBC file
     126            else if (dbcFiles_.content[i].startsWith(valueInfoMnemo))               
     127                findValueDescription(i); // Get the value descritpion at the end of the DBC file
    138128
    139129            // If a hole frame has been treated it's registered in the vector
     
    194184    {
    195185        for (int j = 0; j < dbcFiles_.canFrames[i].signalsVector.size(); j++)
    196         {
    197186            printFrame(i, j);
    198         }
    199187    }
    200188}
  • branches/0.1.x/src/dbcDecriptor/src/structure.h

    r331 r342  
    1111#ifndef STRUCTURE_H
    1212#define STRUCTURE_H
    13 
    14 #include <QMap>
    15 #include <QFile>
    1613
    1714
     
    4845    QStringList          content;   /// Content of the dbc file
    4946} StructDBCFile;
     47
     48
     49/// define the mnemonique of each message to find
     50#define signalMnemo " SG_"
     51#define signalInfoMnemo "BO_"
     52#define commentMnemo "CM_"
     53#define valueInfoMnemo "VAL_"
    5054
    5155
Note: See TracChangeset for help on using the changeset viewer.