From 970f4dd8f186a8e6a60b1e678e5dc1130f1c9598 Mon Sep 17 00:00:00 2001 From: Your Name <you@example.com> Date: Tue, 25 May 2021 19:19:18 +0200 Subject: [PATCH] still trouble in moernising --- CMakeLists.txt | 4 ++-- o_gnuplot/CMakeLists.txt | 8 +++----- o_gnuplot/src/history_graph.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a66a4b0..50d120c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ # Set the minimum version of cmake required to build this project -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.13) project(gnuplot) subdirs(o_gnuplot) -subdirs(o_gnuplot_poi) +#subdirs(o_gnuplot_poi) // Need to be checked and documented diff --git a/o_gnuplot/CMakeLists.txt b/o_gnuplot/CMakeLists.txt index f313afc..ec6d86f 100644 --- a/o_gnuplot/CMakeLists.txt +++ b/o_gnuplot/CMakeLists.txt @@ -3,11 +3,9 @@ cmake_minimum_required(VERSION 2.6) project(o_gnuplot) -find_package(blc_channel REQUIRED) -find_package(blc_program REQUIRED) +find_package(blc REQUIRED) -add_definitions(${BL_DEFINITIONS} -std=c++14) -include_directories(${BL_INCLUDE_DIRS}) add_executable(o_gnuplot src/o_gnuplot.cpp src/history_graph.cpp src/graph.cpp ) -target_link_libraries(o_gnuplot ${BL_LIBRARIES}) +target_compile_features(o_gnuplot PRIVATE cxx_std_14) +target_link_libraries(o_gnuplot PRIVATE blc rt}) diff --git a/o_gnuplot/src/history_graph.cpp b/o_gnuplot/src/history_graph.cpp index aa884b6..feb7464 100644 --- a/o_gnuplot/src/history_graph.cpp +++ b/o_gnuplot/src/history_graph.cpp @@ -1,9 +1,11 @@ #include "blc_program.h" +#include "blc_text.h" #include "graph.h" #include <pthread.h> #include <sys/time.h> #include <unistd.h> #include <string> +#include <unique> using namespace std; @@ -20,7 +22,7 @@ typedef struct history:blc_array{ unsigned long initial_us; }type_history; -type_history history; +unique_ptr<type_history> history; pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER; int k; @@ -197,7 +199,7 @@ void create_history_graph(deque <blc_channel> &inputs, char const *title, int hi command.append(buffer); } - history.init(input->type, input->format, 2, columns_nb, history_length); + history(input->type, input->format, {columns_nb, history_length}); history.sampling_period=sampling_period; history.input=input; -- GitLab