LCOV - code coverage report
Current view: top level - src/config - config_to_flx.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 15 26 57.7 %
Date: 2025-09-09 12:09:29 Functions: 3 7 42.9 %

          Line data    Source code
       1             : #include "config.hpp"
       2             : 
       3             : 
       4           5 : ConfigToFlx::ConfigToFlx() : Config()
       5             : {
       6           5 :     resource.toflx = true;
       7           5 : }
       8             : 
       9             : 
      10             : //ConfigToFlx::~ConfigToFlx() {}
      11             : 
      12             : 
      13           0 : std::ostream& ConfigToFlx::format(std::ostream& os) const
      14             : {
      15           0 :     os << "ConfigToFlx" << std::endl;
      16           0 :     os << "cmem_buffersize: " << resource.cmem_buffersize << std::endl;
      17           0 :     os << "unbuffered: " << unbuffered << std::endl;
      18           0 :     os << std::endl;
      19           0 :     return Config::format(os);
      20             : }
      21             : 
      22             : 
      23           0 : std::ostream& operator<<(std::ostream& os, const ConfigToFlx& c) {
      24           0 :     return c.format(os);
      25             : }
      26             : 
      27             : 
      28           0 : std::string ConfigToFlx::usage()
      29             : {
      30           0 :     return
      31           0 : R"(felix-toflx - FELIX central data acquisition application
      32             : 
      33             :     Usage:
      34             :       felix-toflx [options --device=<device>... --cid=<cid>...]
      35             : )";
      36             : }
      37             : 
      38             : 
      39           5 : std::string ConfigToFlx::options()
      40             : {
      41           5 :     return Config::options() +
      42           5 : R"(
      43             :     ToFlx Options:
      44             :     -c, --cmem=SIZE                 CMEM buffer size in MB. [default: 20]
      45             :     -p, --port=PORT                 Send data to port PORT. [calculated: 53200 + 10*device + dma]
      46             :     -u, --unbuffered                Use unbuffered mode
      47             :     -t, --trickle                   Use trickle mode
      48             : )";
      49             : }
      50             : 
      51             : 
      52           5 : void ConfigToFlx::handle_cmd_line(std::map<std::string, docopt::value> args)
      53             : {
      54           5 :     Config::handle_cmd_line(args);
      55           5 :     resource.cmem_buffersize = args["--cmem"].asLong() * 1024 * 1024;
      56             : 
      57          10 :     int base_port = args["--port"] ? args["--port"].asLong() : PORT_TOFLX_OFFSET;
      58          10 :     for(auto dev : resource.device){
      59           5 :         network.ports.emplace(dev, PORT(base_port, dev, 0));
      60             :     }    
      61             : 
      62           5 :     unbuffered = args["--unbuffered"].asBool();
      63           5 :     trickle = args["--trickle"].asBool();
      64           5 : }

Generated by: LCOV version 1.0