- Timestamp:
- Jul 19, 2013, 12:42:35 PM (11 years ago)
- Location:
- branches/2.0-beta1
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0-beta1/cmake/PacpusUtilities.cmake
r120 r121 13 13 ## Qt macro compatibility Qt4 / Qt5 14 14 ## ======================================== 15 #function(qt_wrap_mocMOC_SRCS FILES_TO_MOC)16 17 #if(QT4_FOUNDED)18 # qt4_wrap_cpp(TEMP_VAR${FILES_TO_MOC})19 20 #elseif(Qt5Core_FOUND)21 # qt5_wrap_cpp(${MOC_SRCS} ${FILES_TO_MOC} PARENT_SCOPE)22 23 #else()24 # message(WARNING "QT uifound, can't wrap moc File")25 #endif()26 27 # #set(${MOC_SRCS} ${TEMP_VAR} PARENT_SCOPE)28 29 #endfunction(qt_wrap_moc)15 function(qt_wrap_cpp OUT_MOC_SRCS FILES_TO_MOC) 16 17 if(QT4_FOUNDED) 18 qt4_wrap_cpp(MOC_SRCS ${FILES_TO_MOC}) 19 20 elseif(Qt5Core_FOUND) 21 qt5_wrap_cpp(MOC_SRCS ${FILES_TO_MOC}) 22 23 else() 24 message(WARNING "QT not found, can't wrap moc File") 25 endif() 26 27 set(${OUT_MOC_SRCS} ${MOC_SRCS} PARENT_SCOPE) 28 29 endfunction(qt_wrap_cpp) 30 30 31 31 ## ======================================== 32 32 ## Qt macro compatibility Qt4 / Qt5 33 33 ## ======================================== 34 #function(qt_wrap_ui UI_SRCS UI_FILES) 35 # if(QT4_FOUND) 36 # qt4_wrap_ui( TEMP_VAR ${UI_FILES}) 37 38 # elseif(Qt5Core_FOUND) 39 # qt5_wrap_ui( TEMP_VAR ${UI_FILES}) 40 41 # else() 42 # message(WARNING "QT ui found, can't wrap ui File") 43 # endif() 44 45 # set(${UI_SRCS} ${TEMP_VAR} PARENT_SCOPE) 46 #endfunction() 34 function(qt_wrap_ui OUT_UI_SRCS UI_FILES) 35 if(QT4_FOUND) 36 qt4_wrap_ui( UI_SRCS ${UI_FILES}) 37 38 elseif(Qt5Core_FOUND) 39 qt5_wrap_ui( UI_SRCS ${UI_FILES}) 40 41 else() 42 message(WARNING "QT not found, can't wrap ui File") 43 endif() 44 45 set(${OUT_UI_SRCS} ${UI_SRCS} PARENT_SCOPE) 46 47 endfunction() 47 48 48 49 # ======================================== … … 53 54 if(QT4_FOUND) 54 55 pacpus_plugin_qt4(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) 56 #message("Create QT4 Plugin") 55 57 56 58 elseif(Qt5Core_FOUND) … … 61 63 endif() 62 64 65 set(${OUT_CPP} ${PLUGIN_CPP} PARENT_SCOPE) 66 set(${OUT_H} ${PLUGIN_H} PARENT_SCOPE) 63 67 64 68 endfunction(PACPUS_PLUGIN) … … 162 166 " Q_OBJECT\n" 163 167 " //Qt5 Plugins Macro\n" 164 " Q_PLUGIN_METADATA(IID \"papus. pacpuscityvip." ${PLUGIN_NAME} "\" FILE \"" ${PLUGIN_NAME} ".json\")\n"168 " Q_PLUGIN_METADATA(IID \"papus." ${PLUGIN_NAME} "\" FILE \"" ${PLUGIN_NAME} ".json\")\n" 165 169 " Q_INTERFACES(PacpusPluginInterface)\n" 166 170 "\n" … … 366 370 SET(${result} ${dirlist}) 367 371 ENDMACRO() 372 373 374 # ======================================== 375 # Create export header for plugins 376 # ======================================== 377 function(CREATE_EXPORT OUT_H PLUGIN_NAME) 378 379 set(${OUT_H} "export_${PLUGIN_NAME}.h" PARENT_SCOPE) 380 381 string(TOUPPER ${PLUGIN_NAME} PLUGIN_NAME_UPPER) 382 383 # create the header file 384 file(WRITE "export_${PLUGIN_NAME}.h" 385 "// Autogenerated file by PacpusUtilities.cmake\n" 386 "// DO NOT EDIT!!! ALL CHANGES WOULD BE REMOVED BY THE NEXT CALL OF CMAKE\n" 387 "\n" 388 389 "#ifndef __EXPORT_${PLUGIN_NAME_UPPER}__H__\n" 390 "#define __EXPORT_${PLUGIN_NAME_UPPER}_H__\n" 391 "\n" 392 "// Export macro for use DLL for Windows only\n" 393 "#ifdef WIN32\n" 394 "# ifdef ${PLUGIN_NAME_UPPER}_EXPORT\n" 395 "// make DLL\n" 396 "# define ${PLUGIN_NAME_UPPER}_API __declspec(dllexport)\n" 397 "# else\n" 398 "// use DLL\n" 399 "# define ${PLUGIN_NAME_UPPER}_API __declspec(dllimport)\n" 400 "# endif\n" 401 "#else\n" 402 "// On other platforms, simply ignore this\n" 403 "# define ${PLUGIN_NAME_UPPER}_API\n" 404 "//#endif\n" 405 406 "#endif // __EXPORT_${PLUGIN_NAME_UPPER}_H__\n" 407 ) 408 endfunction(CREATE_EXPORT) -
branches/2.0-beta1/include/Pacpus/PacpusTools/PacpusSerialPort.h
r120 r121 62 62 63 63 QString sepChar; 64 QString startChar; 65 QString stopChar; 64 66 65 67 -
branches/2.0-beta1/src/PacpusLib/CMakeLists.txt
r120 r121 65 65 ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/inputOutputInterface.h 66 66 ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/PacpusEvent.h 67 #${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpusStruct.h67 ${PACPUS_INCLUDE_DIR}/Pacpus/kernel/pacpusStruct.h 68 68 69 69 ./ComponentBase.cpp … … 75 75 ./XmlConfigFile.cpp 76 76 ./inputOutputBase.cpp 77 #./pacpusStruct.cpp77 ./pacpusStruct.cpp 78 78 ) 79 79 -
branches/2.0-beta1/src/PacpusTools/src/PacpusSerialPort.cpp
r120 r121 42 42 sepChar = "\n"; 43 43 44 startChar = "$"; 45 stopChar = "\n"; 46 44 47 // Or threaded 45 48 connect(serialPort,SIGNAL(readyRead()),this,SLOT(readData())); … … 101 104 sepChar = param.getProperty("sepChar"); 102 105 106 if(param.hasProperty("startChar")) 107 startChar = param.getProperty("startChar"); 108 109 if(param.hasProperty("stopChar")) 110 stopChar = param.getProperty("stopChar"); 111 103 112 serialPort->setPortName(portName); 104 113 105 114 if(!serialPort->setBaudRate(baudRate,direction)) 106 LOG_ERROR( "n° "<< serialPort->error());115 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 107 116 if(!serialPort->setDataBits(dataBits)) 108 LOG_ERROR( "n° "<< serialPort->error());117 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 109 118 if(!serialPort->setParity(parity)) 110 LOG_ERROR( "n° "<< serialPort->error());119 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 111 120 if(!serialPort->setStopBits(stopBits)) 112 LOG_ERROR( "n° "<< serialPort->error());121 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 113 122 if(!serialPort->setFlowControl(flowControl)) 114 LOG_ERROR( "n° "<< serialPort->error());123 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 115 124 if(!serialPort->setDataErrorPolicy(errorPolicy)) 116 LOG_ERROR( "n° "<< serialPort->error());125 LOG_ERROR(getName() << "\t error n° "<< serialPort->error()); 117 126 118 127 // For futher developpements … … 160 169 { 161 170 setState(MONITOR_OK); 162 LOG_DEBUG( "Serial write performed")171 LOG_DEBUG(getName() << " Serial write performed") 163 172 } 164 173 else 165 174 { 166 175 setState(MONITOR_NOK); 167 LOG_WARN( "Serial write error")176 LOG_WARN(getName() << " Serial write error") 168 177 } 169 178 }
Note:
See TracChangeset
for help on using the changeset viewer.