Skip to content

Commit

Permalink
Merge pull request #317 from odin-detector/tidy-cli
Browse files Browse the repository at this point in the history
Tidy Application CLI interfaces
  • Loading branch information
GDYendell authored Aug 7, 2023
2 parents 3d48d91 + 84c0525 commit 551ca96
Show file tree
Hide file tree
Showing 24 changed files with 250 additions and 871 deletions.
31 changes: 31 additions & 0 deletions cpp/common/include/OdinDataDefaults.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* OdinDataDefaults.h
*
* Created on: 07/07/2023
* Author: Gary Yendell
*/

#ifndef ODINDATADEFAULTS_H_
#define ODINDATADEFAULTS_H_

#include <cstddef>
#include <stdint.h>
#include <string>

namespace OdinData
{

namespace Defaults
{

const unsigned int default_io_threads = 1;
const std::string default_frame_ready_endpoint = "tcp://127.0.0.1:5001";
const std::string default_frame_release_endpoint = "tcp://127.0.0.1:5002";
const std::string default_json_config_file = "";
const std::string default_shared_buffer_name = "OdinDataBuffer";

} // namespace Defaults

} // namespace OdinData

#endif // ODINDATADEFAULTS_H_
10 changes: 0 additions & 10 deletions cpp/config/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
set(TEST_CONFIGS
fp_log4cxx.xml
fr_log4cxx.xml
fr_test.config
fp_test.config
fr_test_osx.config
fp_py_test.config
fp_py_test_osx.config
fp_py_test_excalibur.config
fr_excalibur1.config
fr_excalibur2.config
fp_excalibur1.config
fp_excalibur2.config
)

foreach(test_config ${TEST_CONFIGS})
Expand Down
20 changes: 0 additions & 20 deletions cpp/config/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions cpp/config/fp_excalibur1.config

This file was deleted.

5 changes: 0 additions & 5 deletions cpp/config/fp_excalibur2.config

This file was deleted.

9 changes: 0 additions & 9 deletions cpp/config/fp_py_test.config

This file was deleted.

8 changes: 0 additions & 8 deletions cpp/config/fp_py_test_excalibur.config

This file was deleted.

6 changes: 0 additions & 6 deletions cpp/config/fp_py_test_osx.config

This file was deleted.

9 changes: 0 additions & 9 deletions cpp/config/fp_test.config

This file was deleted.

11 changes: 0 additions & 11 deletions cpp/config/fr_excalibur1.config

This file was deleted.

11 changes: 0 additions & 11 deletions cpp/config/fr_excalibur2.config

This file was deleted.

8 changes: 0 additions & 8 deletions cpp/config/fr_test.config

This file was deleted.

8 changes: 0 additions & 8 deletions cpp/config/fr_test_excalibur.config

This file was deleted.

9 changes: 0 additions & 9 deletions cpp/config/fr_test_osx.config

This file was deleted.

23 changes: 7 additions & 16 deletions cpp/frameProcessor/include/FrameProcessorApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,19 @@ class FrameProcessorApp
~FrameProcessorApp();

int parse_arguments(int argc, char** argv);

bool isBloscRequired();

void configureController();
void configureDetector();
void configureDetectorDecoder();
void configureBlosc();
void configureHDF5();
void configureDataset(string name, bool master=false);
void configurePlugins();
void configureFileWriter();

void checkNoClientArgs();

void configure_controller(OdinData::IpcMessage& config_msg);
void run();

private:

LoggerPtr logger_; //!< Log4CXX logger instance pointer
std::string json_config_file_; //!< Full path to JSON configuration file
static boost::shared_ptr<FrameProcessorController> controller_; //!< FrameProcessor controller object
boost::program_options::variables_map vm_; //!< Boost program options variable map

// Command line options
unsigned int io_threads_; //!< Number of IO threads for IPC channels
std::string ctrl_channel_endpoint_; //!< IPC channel endpoint for control communication with other processes
std::string config_file_; //!< Full path to JSON configuration file

};

} // namespace FrameProcessor
Expand Down
7 changes: 4 additions & 3 deletions cpp/frameProcessor/include/FrameProcessorController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "SharedBufferManager.h"
#include "ClassLoader.h"
#include "FrameProcessorPlugin.h"
#include "OdinDataDefaults.h"

namespace FrameProcessor
{
Expand All @@ -36,7 +37,7 @@ class FrameProcessorController : public IFrameCallback,
public boost::enable_shared_from_this<FrameProcessorController>
{
public:
FrameProcessorController(unsigned int num_io_threads=1);
FrameProcessorController(unsigned int num_io_threads=OdinData::Defaults::default_io_threads);
virtual ~FrameProcessorController();
void handleCtrlChannel();
void handleMetaRxChannel();
Expand Down Expand Up @@ -134,8 +135,8 @@ class FrameProcessorController : public IFrameCallback,
std::map<std::string, std::string> stored_configs_;
/** Condition for exiting this file writing process */
boost::condition_variable exitCondition_;
/** Frames per dataset */
int datasetSize;
/** Frames to write before shutting down - 0 to disable shutdown */
int shutdownFrameCount;
/** Total frames processed */
int totalFrames;
/** Master frame specifier - Frame to include in count of total frames processed */
Expand Down
Loading

0 comments on commit 551ca96

Please sign in to comment.