diff --git a/pps_ws/src/d_fall_pps/CMakeLists.txt b/pps_ws/src/d_fall_pps/CMakeLists.txt index 812daab1c972412a7373c21d56dd2dbf76ac63e8..144ae1d525d0d363b775e698982440f7c46ede8c 100755 --- a/pps_ws/src/d_fall_pps/CMakeLists.txt +++ b/pps_ws/src/d_fall_pps/CMakeLists.txt @@ -35,8 +35,12 @@ find_package(Qt5Gui REQUIRED) find_package(Qt5Svg REQUIRED) # GUI -- Add src and includes -set(MY_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/src) -set(MY_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include) +set(MY_GUI_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/src) +set(MY_GUI_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include) + +# StudentGUI -- Add src and includes +set(STUDENT_GUI_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/studentGUI/src) +set(STUDENT_GUI_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/studentGUI/include) # GUI -- Resource file set(MY_RESOURCE_FILE_QRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/CrazyFlyGUI.qrc) @@ -51,21 +55,35 @@ add_definitions(-std=c++11) # GUI -- Special Qt sources that need to be wrapped before being compiled # they have the Qt macro QOBJECT inside, the MOC cpp file needs to be done manually -set(SRC_HDRS_QOBJECT - ${MY_LIB_PATH_INC}/crazyFlyZoneTab.h - ${MY_LIB_PATH_INC}/myGraphicsScene.h - ${MY_LIB_PATH_INC}/myGraphicsView.h - ${MY_LIB_PATH_INC}/mainguiwindow.h - ${MY_LIB_PATH_INC}/rosNodeThread.h - ${MY_LIB_PATH_INC}/CFLinker.h +set(SRC_HDRS_QOBJECT_GUI + ${MY_GUI_LIB_PATH_INC}/crazyFlyZoneTab.h + ${MY_GUI_LIB_PATH_INC}/myGraphicsScene.h + ${MY_GUI_LIB_PATH_INC}/myGraphicsView.h + ${MY_GUI_LIB_PATH_INC}/mainguiwindow.h + ${MY_GUI_LIB_PATH_INC}/rosNodeThread.h + ${MY_GUI_LIB_PATH_INC}/CFLinker.h ) + # GUI -- wrap UI file and QOBJECT files -qt5_wrap_ui(UIS_HDRS GUI_Qt/CrazyFlyGUI/src/mainguiwindow.ui) -qt5_wrap_cpp(SRC_MOC_HDRS ${SRC_HDRS_QOBJECT}) +qt5_wrap_ui(UIS_HDRS_GUI ${MY_GUI_LIB_PATH_SRC}/mainguiwindow.ui) +qt5_wrap_cpp(SRC_MOC_HDRS_GUI ${SRC_HDRS_QOBJECT_GUI}) # GUI -- wrap resource file qrc->rcc qt5_add_resources(MY_RESOURCE_FILE_RCC ${MY_RESOURCE_FILE_QRC}) + + +# StudentGUI -- Special Qt sources that need to be wrapped before being compiled + +set(SRC_HDRS_QOBJECT_STUDENT_GUI + ${STUDENT_GUI_LIB_PATH_INC}/MainWindow.h + ) + +# StudentGUI -- wrap UI file and QOBJECT files +qt5_wrap_ui(UIS_HDRS_STUDENT_GUI ${STUDENT_GUI_LIB_PATH_SRC}/MainWindow.ui) +qt5_wrap_cpp(SRC_MOC_HDRS_STUDENT_GUI ${SRC_HDRS_QOBJECT_STUDENT_GUI}) + + ## Uncomment this if the package has a setup.py. This macro ensures ## modules and global scripts declared therein get installed ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html @@ -179,7 +197,8 @@ generate_messages( ## CATKIN_DEPENDS: catkin_packages dependent projects also need ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( - INCLUDE_DIRS include ${MY_LIB_PATH_INC} # GUI -- include headers from GUI in package + INCLUDE_DIRS include ${MY_GUI_LIB_PATH_INC} # GUI -- include headers from GUI in package + INCLUDE_DIRS include ${STUDENT_GUI_LIB_PATH_INC} # StudentGUI -- include headers from GUI in package LIBRARIES CATKIN_DEPENDS roscpp rospy std_msgs rosbag roslib DEPENDS @@ -193,7 +212,8 @@ catkin_package( ## Your package locations should be listed before other locations # include_directories(include) include_directories( - ${MY_LIB_PATH_INC} # GUI -- include directory inside GUI folder + ${MY_GUI_LIB_PATH_INC} # GUI -- include directory inside GUI folder + ${STUDENT_GUI_LIB_PATH_INC} # StudentGUI -- include directory inside GUI folder ${catkin_INCLUDE_DIRS} include ) @@ -223,28 +243,37 @@ add_executable(FollowCrazyflieService src/FollowCrazyflieService.cpp) # GUI -- Add sources here -set(MY_CPP_SOURCES # compilation of sources - ${MY_LIB_PATH_SRC}/mainguiwindow.cpp - ${MY_LIB_PATH_SRC}/main.cpp - ${MY_LIB_PATH_SRC}/cornergrabber.cpp - ${MY_LIB_PATH_SRC}/crazyFlyZone.cpp - ${MY_LIB_PATH_SRC}/crazyFlyZoneTab.cpp - ${MY_LIB_PATH_SRC}/myGraphicsRectItem.cpp - ${MY_LIB_PATH_SRC}/myGraphicsScene.cpp - ${MY_LIB_PATH_SRC}/myGraphicsView.cpp - ${MY_LIB_PATH_SRC}/tablePiece.cpp - ${MY_LIB_PATH_SRC}/marker.cpp - ${MY_LIB_PATH_SRC}/rosNodeThread.cpp - ${MY_LIB_PATH_SRC}/crazyFly.cpp - ${MY_LIB_PATH_SRC}/CFLinker.cpp - ${MY_LIB_PATH_SRC}/channelLUT.cpp +set(MY_CPP_SOURCES_GUI # compilation of sources + ${MY_GUI_LIB_PATH_SRC}/mainguiwindow.cpp + ${MY_GUI_LIB_PATH_SRC}/main.cpp + ${MY_GUI_LIB_PATH_SRC}/cornergrabber.cpp + ${MY_GUI_LIB_PATH_SRC}/crazyFlyZone.cpp + ${MY_GUI_LIB_PATH_SRC}/crazyFlyZoneTab.cpp + ${MY_GUI_LIB_PATH_SRC}/myGraphicsRectItem.cpp + ${MY_GUI_LIB_PATH_SRC}/myGraphicsScene.cpp + ${MY_GUI_LIB_PATH_SRC}/myGraphicsView.cpp + ${MY_GUI_LIB_PATH_SRC}/tablePiece.cpp + ${MY_GUI_LIB_PATH_SRC}/marker.cpp + ${MY_GUI_LIB_PATH_SRC}/rosNodeThread.cpp + ${MY_GUI_LIB_PATH_SRC}/crazyFly.cpp + ${MY_GUI_LIB_PATH_SRC}/CFLinker.cpp + ${MY_GUI_LIB_PATH_SRC}/channelLUT.cpp + ) + +# StudentGUI -- Add sources here +set(MY_CPP_SOURCES_STUDENT_GUI # compilation of sources + ${STUDENT_GUI_LIB_PATH_SRC}/MainWindow.cpp + ${STUDENT_GUI_LIB_PATH_SRC}/main.cpp ) # GUI -- Add executables here -add_executable(my_GUI ${MY_CPP_SOURCES} ${UIS_HDRS} ${SRC_MOC_HDRS} ${MY_RESOURCE_FILE_RCC}) +add_executable(my_GUI ${MY_CPP_SOURCES_GUI} ${UIS_HDRS_GUI} ${SRC_MOC_HDRS_GUI} ${MY_RESOURCE_FILE_RCC}) qt5_use_modules(my_GUI Widgets) +# StudentGUI -- Add executables here +add_executable(student_GUI ${MY_CPP_SOURCES_STUDENT_GUI} ${UIS_HDRS_STUDENT_GUI} ${SRC_MOC_HDRS_STUDENT_GUI}) +qt5_use_modules(student_GUI Widgets) @@ -259,6 +288,9 @@ add_dependencies(FollowCrazyflieService d_fall_pps_generate_messages_cpp ${catki # GUI-- dependencies add_dependencies(my_GUI d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS}) +# StudentGUI-- dependencies +add_dependencies(student_GUI d_fall_pps_generate_messages_cpp ${catkin_EXPORTED_TARGETS}) + ## Rename C++ executable without prefix ## The above recommended prefix causes long target names, the following renames the ## target back to the shorter version for ease of user use @@ -299,6 +331,11 @@ target_link_libraries(my_GUI Qt5::Svg) # target_link_libraries(my_GUI my_library) target_link_libraries(my_GUI ${catkin_LIBRARIES}) +# StudentGUI -- link libraries +target_link_libraries(student_GUI Qt5::Widgets) # GUI -- let my_GUI have acesss to Qt stuff + +target_link_libraries(student_GUI ${catkin_LIBRARIES}) + ############# ## Install ## diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.h b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h similarity index 100% rename from pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.h rename to pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp similarity index 100% rename from pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.cpp rename to pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.ui b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui similarity index 100% rename from pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/MainWindow.ui rename to pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/main.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/main.cpp similarity index 100% rename from pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/main.cpp rename to pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/main.cpp diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro index 15f249d604baa955b6082afc111448a58cc928d6..4f43aedbed97bb2800fd5eac5501c59fad890f7b 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro @@ -11,10 +11,15 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = studentGUI TEMPLATE = app +INCLUDEPATH += $$PWD/include +CONFIG += c++11 -SOURCES += main.cpp\ - MainWindow.cpp +SOURCES += \ + src/main.cpp \ + src/MainWindow.cpp -HEADERS += MainWindow.h +HEADERS += \ + include/MainWindow.h \ -FORMS += MainWindow.ui +FORMS += \ + src/MainWindow.ui diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user index c12e645ab840d0541e3e3641c4f08f70ee348e6f..a6d9768ef20874d3be6e5b48ddd88b71dfc3d2a9 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.0.2, 2017-08-21T11:02:29. --> +<!-- Written by QtCreator 4.0.2, 2017-08-21T11:11:11. --> <qtcreator> <data> <variable>EnvironmentId</variable>