diff --git a/Makefile b/Makefile index 901df7d..492c148 100644 --- a/Makefile +++ b/Makefile @@ -12,9 +12,9 @@ HEADERS = $(wildcard $(SRC_DIR)/*.hpp) SRCS = $(wildcard $(SRC_DIR)/*.cpp) OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS)) -all: build_dirs h5_zmq_writer rest_api +all: build_dirs h5_zmq_writer -debug: CPPFLAGS += -DDEBUG -g +debug: CPPFLAGS += -DDEBUG_OUTPUT -g debug: all h5_zmq_writer: $(OBJS) diff --git a/src/H5ChunkedWriter.cpp b/src/H5ChunkedWriter.cpp index d529ca5..8e317e6 100644 --- a/src/H5ChunkedWriter.cpp +++ b/src/H5ChunkedWriter.cpp @@ -20,7 +20,7 @@ hsize_t expand_dataset(const H5::DataSet& dataset, hsize_t frame_index, hsize_t dataset.getSpace().getSimpleExtentDims(dataset_dimension); dataset_dimension[0] = frame_index + dataset_increase_step; - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[expand_dataset] Expanding dataspace to size ("; for (hsize_t i=0; ibuffer_used_slots = 0; this->ring_buffer_initialized = true; - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer::initialize] Total buffer_size " << buffer_size << endl; #endif } @@ -74,7 +74,7 @@ void RingBuffer::write(FrameMetadata &metadata, char* data) // Set the write index in the FrameMetadata object. metadata.buffer_slot_index = write_index; - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer::write] Ring buffer slot " << metadata.buffer_slot_index << " reserved for frame_index " << metadata.frame_index << endl; #endif @@ -97,7 +97,7 @@ void RingBuffer::write(FrameMetadata &metadata, char* data) char* slot_memory_address = get_buffer_slot_address(metadata.buffer_slot_index); memcpy(slot_memory_address, data, metadata.frame_bytes_size); - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer::write] Copied " << metadata.frame_bytes_size << " frame bytes to buffer_slot_index " << metadata.buffer_slot_index << endl; #endif @@ -108,7 +108,7 @@ void RingBuffer::write(FrameMetadata &metadata, char* data) frame_metadata_queue_mutex.unlock(); - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer] Metadata for frame_index " << metadata.frame_index << " added to metadata queue." << endl; #endif } @@ -124,7 +124,7 @@ char* RingBuffer::get_buffer_slot_address(size_t buffer_slot_index) { throw runtime_error(error_message.str()); } - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer::get_buffer_slot_address] For buffer_slot_index " << buffer_slot_index << " the calculated memory address is " << long(slot_memory_address) << endl; #endif @@ -150,7 +150,7 @@ pair RingBuffer::read() frame_metadata_queue_mutex.unlock(); - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[RingBuffer::read] Received metadata for frame_index " << frame_metadata.frame_index << endl; #endif } diff --git a/src/h5_zmq_writer.cpp b/src/h5_zmq_writer.cpp index bfe0603..5b27447 100644 --- a/src/h5_zmq_writer.cpp +++ b/src/h5_zmq_writer.cpp @@ -79,7 +79,7 @@ void run_writer(string connect_address, string output_file, uint64_t n_images){ WriterManager manager(n_images); RingBuffer ring_buffer(n_slots); - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[h5_zmq_writer::run_writer] Running writer"; cout << " with connect_address " << connect_address << " "; cout << " and output_file " << output_file << " "; @@ -96,7 +96,7 @@ void run_writer(string connect_address, string output_file, uint64_t n_images){ receiver_thread.join(); writer_thread.join(); - #ifdef DEBUG + #ifdef DEBUG_OUTPUT cout << "[h5_zmq_writer::run_writer] Writer properly stopped." << endl; #endif } diff --git a/src/rest_interface.cpp b/src/rest_interface.cpp index 33d3c77..d58619a 100644 --- a/src/rest_interface.cpp +++ b/src/rest_interface.cpp @@ -43,9 +43,9 @@ void start_rest_api(WriterManager& writer_manager, uint16_t port) CROW_ROUTE (app, "/statistics") ([&](){ crow::json::wvalue result; - for (const auto& item : writer_manager.get_statistics()) { - result[item.first] = item.second; - } + // for (const auto& item : writer_manager.get_statistics()) { + // result[item.first] = item.second; + // } return result; }); @@ -55,9 +55,9 @@ void start_rest_api(WriterManager& writer_manager, uint16_t port) if (req.method == "GET"_method) { - for (const auto& item : writer_manager.get_paramters()) { - result[item.first] = item.second; - } + // for (const auto& item : writer_manager.get_paramters()) { + // result[item.first] = item.second; + // } return result; } else {