Changeset 121 in pacpusframework for branches/2.0-beta1/src


Ignore:
Timestamp:
Jul 19, 2013, 12:42:35 PM (11 years ago)
Author:
morasjul
Message:

add cmake macro
and improve serial component

Location:
branches/2.0-beta1/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0-beta1/src/PacpusLib/CMakeLists.txt

    r120 r121  
    6565    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/inputOutputInterface.h
    6666    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/PacpusEvent.h
    67     #${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpusStruct.h
     67    ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpusStruct.h
    6868
    6969    ./ComponentBase.cpp
     
    7575    ./XmlConfigFile.cpp
    7676    ./inputOutputBase.cpp
    77     #./pacpusStruct.cpp
     77    ./pacpusStruct.cpp
    7878)
    7979
  • branches/2.0-beta1/src/PacpusTools/src/PacpusSerialPort.cpp

    r120 r121  
    4242    sepChar = "\n";
    4343
     44    startChar = "$";
     45    stopChar = "\n";
     46
    4447    // Or threaded
    4548    connect(serialPort,SIGNAL(readyRead()),this,SLOT(readData()));
     
    101104    sepChar =  param.getProperty("sepChar");
    102105
     106    if(param.hasProperty("startChar"))
     107    startChar =  param.getProperty("startChar");
     108
     109    if(param.hasProperty("stopChar"))
     110    stopChar =  param.getProperty("stopChar");
     111
    103112    serialPort->setPortName(portName);
    104113
    105114    if(!serialPort->setBaudRate(baudRate,direction))
    106         LOG_ERROR("n° "<< serialPort->error());
     115        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    107116    if(!serialPort->setDataBits(dataBits))
    108         LOG_ERROR("n° "<< serialPort->error());
     117        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    109118    if(!serialPort->setParity(parity))
    110         LOG_ERROR("n° "<< serialPort->error());
     119        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    111120    if(!serialPort->setStopBits(stopBits))
    112         LOG_ERROR("n° "<< serialPort->error());
     121        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    113122    if(!serialPort->setFlowControl(flowControl))
    114         LOG_ERROR("n° "<< serialPort->error());
     123        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    115124    if(!serialPort->setDataErrorPolicy(errorPolicy))
    116         LOG_ERROR("n° "<< serialPort->error());
     125        LOG_ERROR(getName() << "\t error n° "<< serialPort->error());
    117126
    118127    // For futher developpements
     
    160169    {
    161170        setState(MONITOR_OK);
    162         LOG_DEBUG("Serial write performed")
     171        LOG_DEBUG(getName() << " Serial write performed")
    163172    }
    164173    else
    165174     {
    166175        setState(MONITOR_NOK);
    167         LOG_WARN("Serial write error")
     176        LOG_WARN(getName() << " Serial write error")
    168177    }
    169178}
Note: See TracChangeset for help on using the changeset viewer.