Skip to content

RunOptions

struct (anonymous namespace){main.cpp}::RunOptions ยท Applications

The options of the run subcommand, as CLI11 parsed them.

Declared in src/cli/main.cpp (line 144)

Each field is bound to one flag in main. A field's initial value is what a flag that is not given leaves, and for most fields it means "keep what the profile says". run_simulation applies the fields on top of the loaded profile through apply_output_overrides, apply_sentence_overrides, apply_destination and apply_mode_overrides. CLI11 ensures that track_path and replay_path are not both set, that track_speed_kn and ignore_timestamps are only given with track_path, that replay_interval_ms is only given with replay_path and that tag_source is only given with tag_block.

Summary

Public data members

Name Description
profile_path Profile file, -p or --profile; CLI11 checks that it exists.
track_path GPX or KML track to follow, --track; CLI11 checks that it exists.
replay_path Log file to replay, --replay; CLI11 checks that it exists.
record_path Log file that records every sentence with a timestamp, --record; truncated when the run starts.
track_speed_kn Speed along untimed track legs, --speed; also the speed of a timed track with ignore_timestamps.
ignore_timestamps --ignore-timestamps: sails a timed track at the track speed instead of on its own timing.
loop --loop: starts the track or log again at its end instead of ending the run.
replay_interval_ms Spacing of the sentences of a log without any time information, --replay-interval; CLI11 accepts [1, 60000].
duration_s Wall-clock run time, -d or --duration; truncated to whole milliseconds.
period_ms Period of every registry sentence in milliseconds, -r or --rate; overrides the profile's per-sentence periods.
quiet -q or --quiet: suppresses the status lines on standard error.
use_stdout --stdout: adds an output that writes to standard output.
tcp_ports Ports of TCP server outputs, --tcp-server, repeatable; CLI11 accepts [1, 65535].
udp_targets Destinations of UDP outputs as host:port, --udp, repeatable; parsed by split_host_port.
websocket_ports Ports of WebSocket server outputs, --websocket, repeatable; CLI11 accepts [1, 65535].
serial_ports Serial outputs as device[@baud], --serial, repeatable; parsed by split_serial.
files Files that sentences are appended to, --file, repeatable.
enable Registry ids to switch on, --enable, repeatable; for example MWV-T.
disable Registry ids to switch off, --disable, repeatable.
encoding Encoding of the outputs, --encoding: nmea0183, signalk or viewsync.
tag_block --tag-block: prefixes every sentence of the outputs with an IEC 61162-450 TAG block.
tag_source TAG block source identifier, --tag-source; empty keeps the output's own source, SIM0001 unless a profile sets another.
destination Waypoint to steer for as LAT,LON[,NAME] in decimal degrees, --destination; parsed by apply_destination.

Public data members

profile_path

std::string profile_path

Profile file, -p or --profile; CLI11 checks that it exists.

Empty runs the built-in default profile.

Declared in src/cli/main.cpp:147

track_path

std::string track_path

GPX or KML track to follow, --track; CLI11 checks that it exists.

Empty keeps the profile's mode.

Declared in src/cli/main.cpp:150

replay_path

std::string replay_path

Log file to replay, --replay; CLI11 checks that it exists.

Empty keeps the profile's mode.

Declared in src/cli/main.cpp:153

record_path

std::string record_path

Log file that records every sentence with a timestamp, --record; truncated when the run starts.

Empty records nothing.

Declared in src/cli/main.cpp:156

track_speed_kn

double track_speed_kn{0.0}

Speed along untimed track legs, --speed; also the speed of a timed track with ignore_timestamps.

Zero or negative keeps the profile's simulation.track.speed_kn; check_finite_options refuses nan and inf.

Declared in src/cli/main.cpp:160

ignore_timestamps

bool ignore_timestamps{false}

--ignore-timestamps: sails a timed track at the track speed instead of on its own timing.

Not given keeps the profile's simulation.track.use_timestamps.

Declared in src/cli/main.cpp:163

loop

bool loop{false}

--loop: starts the track or log again at its end instead of ending the run.

Not given keeps the profile's loop flags.

Declared in src/cli/main.cpp:166

replay_interval_ms

int replay_interval_ms{0}

Spacing of the sentences of a log without any time information, --replay-interval; CLI11 accepts [1, 60000].

Zero keeps the profile's simulation.replay.fixed_interval_ms.

Declared in src/cli/main.cpp:170

duration_s

double duration_s{0.0}

Wall-clock run time, -d or --duration; truncated to whole milliseconds.

Zero or negative sets no limit; check_finite_options refuses nan and inf.

Declared in src/cli/main.cpp:173

period_ms

int period_ms{0}

Period of every registry sentence in milliseconds, -r or --rate; overrides the profile's per-sentence periods.

Zero or negative keeps them.

Declared in src/cli/main.cpp:176

quiet

bool quiet{false}

-q or --quiet: suppresses the status lines on standard error.

Errors and output warnings are still printed.

Declared in src/cli/main.cpp:179

use_stdout

bool use_stdout{false}

--stdout: adds an output that writes to standard output.

Declared in src/cli/main.cpp:181

tcp_ports

std::vector<int> tcp_ports

Ports of TCP server outputs, --tcp-server, repeatable; CLI11 accepts [1, 65535].

Declared in src/cli/main.cpp:183

udp_targets

std::vector<std::string> udp_targets

Destinations of UDP outputs as host:port, --udp, repeatable; parsed by split_host_port.

A broadcast address selects broadcast, see is_broadcast_address.

Declared in src/cli/main.cpp:187

websocket_ports

std::vector<int> websocket_ports

Ports of WebSocket server outputs, --websocket, repeatable; CLI11 accepts [1, 65535].

Declared in src/cli/main.cpp:190

serial_ports

std::vector<std::string> serial_ports

Serial outputs as device[@baud], --serial, repeatable; parsed by split_serial.

Declared in src/cli/main.cpp:192

files

std::vector<std::string> files

Files that sentences are appended to, --file, repeatable.

Declared in src/cli/main.cpp:194

enable

std::vector<std::string> enable

Registry ids to switch on, --enable, repeatable; for example MWV-T.

Declared in src/cli/main.cpp:196

disable

std::vector<std::string> disable

Registry ids to switch off, --disable, repeatable.

Applied after enable, so an id given to both ends up off.

Declared in src/cli/main.cpp:199

encoding

std::string encoding

Encoding of the outputs, --encoding: nmea0183, signalk or viewsync.

Empty, when the option is not given, leaves the command-line outputs at nmea0183 and the profile's outputs at their own encoding.

Declared in src/cli/main.cpp:203

tag_block

bool tag_block{false}

--tag-block: prefixes every sentence of the outputs with an IEC 61162-450 TAG block.

Not given leaves each profile output's own TAG block setting.

Declared in src/cli/main.cpp:206

tag_source

std::string tag_source

TAG block source identifier, --tag-source; empty keeps the output's own source, SIM0001 unless a profile sets another.

Declared in src/cli/main.cpp:209

destination

std::string destination

Waypoint to steer for as LAT,LON[,NAME] in decimal degrees, --destination; parsed by apply_destination.

Empty sets no destination.

Declared in src/cli/main.cpp:212