<commit_before>#include "StdAfx.h"

/*
  Command line and options file option handling for ultracomm.
*/

UltracommOptions::UltracommOptions(const int& argc, char* argv[])
    : int_imaging_params("Ultracomm integer parameters")
{
    //string appName = boost::filesystem::basename(argv[0]);

    // Command-line-only options.
    po::options_description cmdlineonly("Ultracomm command-line-only options");
    cmdlineonly.add_options()
        ("help,h", "print help message and stop")
        ("version", "print ultracomm version and stop")
        ("sdkversion", "print Ultrasonix SDK version used to compile ultracomm and stop")
        ("params,p", po::value<string>(), "parameter options file (see below)")
    ;

    // Options allowed in options file or on command line.
    po::options_description global_opts("Ultracomm global options for command line or options file");
    global_opts.add_options()
        ("address,a", po::value<string>()->required(), "ultrasonix ip address")
        ("output,o", po::value<string>()->required(), "output filename")
        ("datatype", po::value<int>()->required(), "datatype")
        ("probe-id", po::value<int>(), "probe-id")
        ("verbose,v", po::value<int>()->default_value(0), "display informational messages")
        ("ms_delay_after_freeze", po::value<int>()->default_value(0), "force ultrasonix to wait to acquire cine data after freezing (ms)")
        ("compression_status", po::value<int>()->default_value(0), "compression status")
    ;

    // Options allowed in options file or on command line.
/*
    NOTE: this one is now in the initialization list
    po::options_description int_imaging_params("Ultracomm integer imaging parameters");
*/
    int_imaging_params.add_options()
        ("b-depth", po::value<int>(), "b-depth")
        ("trigger_out", po::value<int>(), "trigger out")
        ("trigger_out_2", po::value<int>(), "trigger out 2")
        ("sector", po::value<int>(), "sector")
        ("b-ldensity", po::value<int>(), "b-ldensity")
        ("b-focus_count", po::value<int>(), "b-focus_count")
        ("b-freq", po::value<int>(), "b-freq")
        ("b-sampl_freq", po::value<int>(), "b-sampl_freq")
        ("b-persistence", po::value<int>(), "b-persistence")
        ("soundvelocity", po::value<int>(), "soundvelocity")
        ("focus_depth", po::value<int>(), "focus_depth")
        ("image_flip", po::value<int>(), "image_flip")
        // FIXME: is frame_rate a settable parameter?
        ("frame_rate", po::value<int>(), "frame_rate")
        // FIXME: is max_frame a settable parameter?
        ("max_frame", po::value<int>(), "max_frame")
    ;

    // Now combine into full set of command line options.
    po::options_description cmdline_options;
    cmdline_options.add(cmdlineonly).add(global_opts).add(int_imaging_params);

    // And a full set of options file options.
    po::options_description cmd_or_file;
    cmd_or_file.add(global_opts).add(int_imaging_params);

    // Read command line options into opt.
    po::store(po::parse_command_line(argc, argv, cmdline_options), opt);<commit_msg>Add max_fr (Fr Limit) parameter.<commit_after>#include "StdAfx.h"

/*
  Command line and options file option handling for ultracomm.
*/

UltracommOptions::UltracommOptions(const int& argc, char* argv[])
    : int_imaging_params("Ultracomm integer parameters")
{
    //string appName = boost::filesystem::basename(argv[0]);

    // Command-line-only options.
    po::options_description cmdlineonly("Ultracomm command-line-only options");
    cmdlineonly.add_options()
        ("help,h", "print help message and stop")
        ("version", "print ultracomm version and stop")
        ("sdkversion", "print Ultrasonix SDK version used to compile ultracomm and stop")
        ("params,p", po::value<string>(), "parameter options file (see below)")
    ;

    // Options allowed in options file or on command line.
    po::options_description global_opts("Ultracomm global options for command line or options file");
    global_opts.add_options()
        ("address,a", po::value<string>()->required(), "ultrasonix ip address")
        ("output,o", po::value<string>()->required(), "output filename")
        ("datatype", po::value<int>()->required(), "datatype")
        ("probe-id", po::value<int>(), "probe-id")
        ("verbose,v", po::value<int>()->default_value(0), "display informational messages")
        ("ms_delay_after_freeze", po::value<int>()->default_value(0), "force ultrasonix to wait to acquire cine data after freezing (ms)")
        ("compression_status", po::value<int>()->default_value(0), "compression status")
    ;

    // Options allowed in options file or on command line.
/*
    NOTE: this one is now in the initialization list
    po::options_description int_imaging_params("Ultracomm integer imaging parameters");
*/
    int_imaging_params.add_options()
        ("b-depth", po::value<int>(), "b-depth")
        ("trigger_out", po::value<int>(), "trigger out")
        ("trigger_out_2", po::value<int>(), "trigger out 2")
        ("sector", po::value<int>(), "sector")
        ("b-ldensity", po::value<int>(), "b-ldensity")
        ("b-focus_count", po::value<int>(), "b-focus_count")
        ("b-freq", po::value<int>(), "b-freq")
        ("b-sampl_freq", po::value<int>(), "b-sampl_freq")
        ("b-persistence", po::value<int>(), "b-persistence")
        ("soundvelocity", po::value<int>(), "soundvelocity")
        ("focus_depth", po::value<int>(), "focus_depth")
        ("image_flip", po::value<int>(), "image_flip")
        ("max_fr", po::value<int>(), "max_fr; Fr Limit")
        // FIXME: is frame_rate a settable parameter?
        ("frame_rate", po::value<int>(), "frame_rate")
        // FIXME: is max_frame a settable parameter?
        ("max_frame", po::value<int>(), "max_frame")
    ;

    // Now combine into full set of command line options.
    po::options_description cmdline_options;
    cmdline_options.add(cmdlineonly).add(global_opts).add(int_imaging_params);

    // And a full set of options file options.
    po::options_description cmd_or_file;
    cmd_or_file.add(global_opts).add(int_imaging_params);

    // Read command line options into opt.
    po::store(po::parse_command_line(argc, argv, cmdline_options), opt);
{'fraction_non_alphanumeric': 0.16810207336523125, 'fraction_numerical': 0.0019138755980861245, 'mean_word_length': 3.9261586802827964, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4069672', 'n_tokens_mistral': 1979, 'n_tokens_neox': 1936, 'n_words': 468}