Changeset 99 in pacpussensors for trunk/SpanCPTComponent
- Timestamp:
- Oct 15, 2015, 2:47:01 PM (9 years ago)
- Location:
- trunk/SpanCPTComponent
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SpanCPTComponent/CMakeLists.txt
r59 r99 1 #########################quick start############################################ 2 #cmake ../ -G "CodeBlocks - Unix Makefiles" 3 #make 4 #make install 5 #make clean 6 ################################################################################ 1 7 project(SpanCPTComponent) 2 8 … … 4 10 add_definitions( -DCPTCOMPONENT_EXPORTS ) 5 11 add_definitions( -DPLUGINLIB_EXPORTS ) 12 ################################################################################ 13 create_export(EXPORT_HDR ${PROJECT_NAME}) 14 pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME}) 15 add_definitions (${QT_DEFINITIONS}) 6 16 7 8 # ======================================== 9 # Configure qt4 10 # ======================================== 11 if(QT4_FOUND) 12 set(QT_USE_QTXML true) 13 set(QT_USE_QTNETWORK true) 14 include(${QT_USE_FILE}) 15 else() 16 message(ERROR "Qt4 needed") 17 endif() 18 19 # ======================================== 20 # Compiler definitions 21 # ======================================== 22 add_definitions( 23 ${QT_DEFINITIONS} 24 ) 25 26 # ======================================== 27 # Include directories 28 # ======================================== 29 include_directories( 30 ${PROJECT_BINARY_DIR} 31 ${QT_INCLUDE_DIR} 17 find_package(Qt5Network REQUIRED) 18 ################################################################################ 19 # DIRECTORIES 20 include_directories( 21 ${PROJECT_BINARY_DIR} 22 ${QT_INCLUDE_DIR} 23 ${PACPUS_INCLUDE_DIR} 24 ${PACPUS_INCLUDE_DIR}/Pacpus/ 32 25 ) 33 26 … … 40 33 41 34 42 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) 43 44 # ======================================== 45 # List of sources 46 # ======================================== 47 set( 48 PROJECT_SRCS 49 CPTComponent.h 50 CPTComponent.cpp 35 ################################################################################ 36 # FILES 37 set(PROJECT_HDRS 38 ${EXPORT_HDR} 39 CPTComponent.h 51 40 ../driver/AbstractSerialPort.h 52 ../driver/AbstractSerialPort.cpp 41 xml/spancpt.xml 42 ) 43 set(PROJECT_SRCS 53 44 ${PLUGIN_CPP} 45 CPTComponent.cpp 46 ../driver/AbstractSerialPort.cpp 54 47 ) 55 48 … … 70 63 endif(UNIX) 71 64 72 73 # ========================================74 # Files to MOC75 # ========================================76 77 65 if(UNIX) 78 66 set(FILES_TO_MOC … … 80 68 CPTComponent.h 81 69 ../driver/PosixSerialPort.h 82 ${PLUGIN_H }70 ${PLUGIN_HDR} 83 71 ) 84 72 endif(UNIX) … … 89 77 CPTComponent.h 90 78 ../driver/Win32SerialPort.h 91 ${PLUGIN_H }79 ${PLUGIN_HDR} 92 80 ) 93 81 endif(WIN32) 94 82 95 set( 96 UI_FILES 83 set(UI_FILES 97 84 ) 98 85 99 # ======================================== 100 # Call MOC 101 # ======================================== 102 qt4_wrap_cpp( 103 PROJECT_MOC_SRCS 86 ################################################################################ 87 # Qt: call moc, uic 88 qt_wrap_cpp(PROJECT_MOC_SRCS 104 89 ${FILES_TO_MOC} 105 90 ) 106 91 107 qt4_wrap_ui( 108 PROJECT_UI_SRCS 92 qt_wrap_ui(PROJECT_UI_SRCS 109 93 ${UI_FILES} 110 94 ) 111 95 112 # ======================================== 113 # Build a library 114 # ======================================== 115 pacpus_add_library( 116 ${PROJECT_NAME} SHARED 96 ################################################################################ 97 # BUILD and LINK 98 pacpus_add_library(${PROJECT_NAME} SHARED 99 ${PROJECT_HDRS} 117 100 ${PROJECT_SRCS} 118 101 ${PROJECT_MOC_SRCS} … … 120 103 ) 121 104 105 122 106 # ======================================== 123 107 # Libraries 124 108 # ======================================== 125 if(WIN32) 126 set(LIBS 127 # add your specific libraries to link here 128 optimized NMEA0183LIB debug NMEA0183LIB_d 129 optimized PacpusTools debug PacpusTools_d 109 set(LIBS 110 optimized FileLib debug FileLib_d 111 optimized PacpusLib debug PacpusLib_d 112 optimized PacpusTools debug PacpusTools_d 113 optimized NMEA0183LIB debug NMEA0183LIB_d 114 ) 115 if (WIN32) 116 list(APPEND LIBS 117 optimized ROAD_TIME debug ROAD_TIME_d 130 118 ) 131 endif(WIN32) 132 133 if(UNIX) 134 set(LIBS 135 # add your specific libraries to link here 136 137 ) 138 endif(UNIX) 139 140 # All the platform 141 target_link_libraries( 142 ${PROJECT_NAME} 143 ${PACPUS_LIBRARIES} 144 ${QT_LIBRARIES} 145 ${PACPUS_DEPENDENCIES_LIB} 146 ${LIBS} 147 # optimized PacpusTools debug PacpusTools_d 148 ) 119 endif() 120 # LINK 121 target_link_libraries(${PROJECT_NAME} 122 ${PACPUS_LIBRARIES} 123 ${PACPUS_DEPENDENCIES_LIB} 124 ${LIBS} 125 ${QT_LIBRARIES} 126 ) 127 qt5_use_modules(${PROJECT_NAME} Network) 128 ################################################################################ 129 # FOLDERS 149 130 pacpus_folder(${PROJECT_NAME} "components") 150 151 # ======================================== 152 # Install 153 # ======================================== 154 pacpus_install(${PROJECT_NAME}) 155 131 ################################################################################ 132 # INSTALL 133 pacpus_install(${PROJECT_NAME}) -
trunk/SpanCPTComponent/CPTComponent.cpp
r88 r99 183 183 memcpy(buffer, currentDataFrame, currentDataFrameLength_); 184 184 buffer[currentDataFrameLength_] = '\0'; // add a \0 to convert for the conversion in QString 185 currentDataFrame_ = QString::fromAscii(buffer); 185 currentDataFrame_ = ""; 186 currentDataFrame_.append(buffer); 186 187 187 188 delete[] buffer; -
trunk/SpanCPTComponent/CPTComponent.h
r88 r99 17 17 #include <fstream> 18 18 #include <qobject.h> 19 #include <QPointF> 19 20 #include <string> 20 21 … … 162 163 TimestampedInscovFrame*); 163 164 164 165 166 165 // component ouputs 166 void addOutputs(); 167 OutputInterface<QPointF, CPTComponent>* position2DENUOutput_; 167 168 }; 168 169
Note:
See TracChangeset
for help on using the changeset viewer.