Skip to content

Library API

The public interface of the two libraries that other programs can link: nmeasim::core, the simulation engine and every encoder, with no Qt dependency, and nmeasim::io, the profiles, transports and runner built on Qt's non-GUI modules. Everything here is declared in the headers under src/core/include/ and src/io/include/. Good starting points:

Namespaces

Namespace Description
nmeasim Everything in NMEA Simulator X: the core and io libraries, the desktop application and the test helpers.
nmeasim::core The simulation engine, a static library with no Qt dependency (CMake target nmeasim::core).
nmeasim::core::ais AIS messages of the own vessel as a class A station, part of the nmeasim::core library.
nmeasim::core::geo Geographic positions and geodesics on the WGS 84 ellipsoid, part of the nmeasim::core library.
nmeasim::core::log Recorded sentence logs, part of the Qt-free nmeasim::core library: the format the simulator writes when recording and the third-party variants it reads back for replay.
nmeasim::core::model The simulated vessel and its environment at one instant, part of the nmeasim::core library.
nmeasim::core::nmea0183 NMEA 0183 sentences: framing and checksums, field formatting, the sentence catalogue, the encoders, the decoder and TAG blocks.
nmeasim::core::physics Physical models of the simulated environment, part of the nmeasim::core library.
nmeasim::core::signalk Signal K output, part of the nmeasim::core library.
nmeasim::core::simulation The simulation engine of the Qt-free core library: the sources that produce the vessel state over time, the schedule that turns it into sentences, and the Simulation that ties them together.
nmeasim::core::time Date and time text handling, part of the nmeasim::core library.
nmeasim::core::track Tracks and routes read from GPX and KML files for the track-following mode, part of the Qt-free nmeasim::core library.
nmeasim::core::units Unit conversions, part of the nmeasim::core library.
nmeasim::core::viewsync ViewSync output, part of the nmeasim::core library.
nmeasim::io Profiles, transports and the simulation runner: a static library on Qt Core, Network, Serial Port and WebSockets (CMake target nmeasim::io).

Types

Type Description
nmeasim::core::ais::BitPacker Accumulates the bit fields of one AIS message, most significant bit first.
nmeasim::core::ais::Payload A packed payload ready for a sentence: the armoured characters and the fill bits.
nmeasim::core::geo::InverseSolution Result of the inverse geodesic problem between two positions.
nmeasim::core::geo::LegSolution Bearings and distances of a leg and of the vessel relative to it.
nmeasim::core::geo::Position A geographic position on the WGS 84 ellipsoid, without height.
nmeasim::core::log::Log A parsed log: its sentences in file order with their offsets, and the header metadata.
nmeasim::core::log::LogEntry One sentence of a log, with the time at which a replay sends it.
nmeasim::core::log::LogParseOptions Options for parse_log and load_log.
nmeasim::core::model::AisStatic Static data of the own vessel for the AIS messages, plus the message options.
nmeasim::core::model::Destination The waypoint the vessel steers for.
nmeasim::core::model::Engine One propulsion engine.
nmeasim::core::model::GnssFix State of the GNSS receiver: fix, satellites and dilution of precision.
nmeasim::core::model::Navigation Position, motion and heading of the vessel.
nmeasim::core::model::Steering Steering gear state.
nmeasim::core::model::VesselState Complete snapshot of the vessel that every encoder reads.
nmeasim::core::model::Water Depth sounder and water temperature readings.
nmeasim::core::model::Wind True and apparent wind measured on board.
nmeasim::core::nmea0183::CoordinateField A latitude or longitude formatted for two consecutive NMEA 0183 fields: the value and the hemisphere letter.
nmeasim::core::nmea0183::DateParts The UTC calendar date split into its components, as sent in ZDA.
nmeasim::core::nmea0183::EncoderContext Everything an encoder needs to produce its sentences for one emission.
nmeasim::core::nmea0183::EncoderOptions Options that change how an encoder formats its fields.
nmeasim::core::nmea0183::ParsedSentence A sentence split into its start delimiter, address and data fields.
nmeasim::core::nmea0183::SentenceBuilder Builder for one sentence: the address, then fields appended in order and separated by commas.
nmeasim::core::nmea0183::SentenceDescriptor Static description of one sentence: its identity, its defaults and the encoder that produces it.
nmeasim::core::nmea0183::SentenceRegistry Immutable list of sentence descriptors; the only instance is standard.
nmeasim::core::nmea0183::SentenceTime A UTC time carried by a sentence, with the date when the sentence carries one.
nmeasim::core::nmea0183::TagBlockOptions What the TAG block in front of each sentence of an output contains.
nmeasim::core::physics::ApparentWind Apparent wind as experienced on board a moving vessel.
nmeasim::core::signalk::PathValue One path of a delta with its value already rendered as JSON.
nmeasim::core::signalk::SignalKOptions Settings shared by the delta and hello encoders, one set per output.
nmeasim::core::simulation::CustomSentence One operator-defined sentence and its schedule.
nmeasim::core::simulation::DeltaConfig Configuration of a DeltaSource: the seed state and the drift of each value.
nmeasim::core::simulation::DeltaSource Endless source whose values drift at random around their seeds.
nmeasim::core::simulation::EmittedSentence One sentence produced by a simulation step, together with the id that produced it.
nmeasim::core::simulation::ReplayConfig Configuration of a ReplaySource.
nmeasim::core::simulation::ReplaySource Replays the entries of a log as the replay clock passes their offsets.
nmeasim::core::simulation::SentenceScheduler The per-sentence enable flags, talkers and periods, plus the operator's custom sentences, with the time each one is next due.
nmeasim::core::simulation::SentenceScheduler::CustomEntry Schedule of one accepted custom sentence.
nmeasim::core::simulation::SentenceScheduler::Entry Schedule of one registry sentence.
nmeasim::core::simulation::SentenceSetting The settings of one registry sentence that an operator can change.
nmeasim::core::simulation::Simulation A source and a sentence schedule, advanced together by the host on a simulated clock.
nmeasim::core::simulation::Source Base class of the simulation modes: delta drift, track following and log replay.
nmeasim::core::simulation::TrackConfig Configuration of a TrackSource.
nmeasim::core::simulation::TrackSource Follows a track leg by leg, one leg per pair of consecutive points.
nmeasim::core::simulation::TrackSource::Leg One leg of the track, between two consecutive points.
nmeasim::core::simulation::Variation How far a value may wander from its seed and how fast.
nmeasim::core::track::Track A sequence of points to follow, read from one GPX or KML file.
nmeasim::core::track::TrackPoint One point of a track, with the optional values the file recorded for it.
nmeasim::core::viewsync::ViewSyncOptions Camera settings for the packets of one output.
nmeasim::io::FileTransport Writes lines to a file, flushing after every write so that the file can be tailed while the simulator runs.
nmeasim::io::LogTransport Records sentences to a log file: a # header when the file is empty, then one line per sentence prefixed with the wall-clock UTC time.
nmeasim::io::NetworkInterfaceInfo One IPv4 address of a network interface, with the broadcast address of its subnet.
nmeasim::io::OutputChannel One enabled output of a running profile: its transport, its filter and its counters.
nmeasim::io::OutputConfig One configured output channel, an entry of the outputs array of a profile.
nmeasim::io::OutputConfig::TagBlock IEC 61162-450 TAG block in front of every sentence of an NMEA 0183 output.
nmeasim::io::Profile A complete simulator setup, stored as a JSON profile file.
nmeasim::io::ReplaySettings Settings of the log replay mode, the simulation.replay object of a profile.
nmeasim::io::SerialConfig Settings of a serial port output, applied when the port is opened.
nmeasim::io::SerialPortDescriptor Describes one serial port found on the host machine.
nmeasim::io::SerialTransport Writes lines to a serial port.
nmeasim::io::SimulationRunner Runs the simulation of a profile on a timer and writes its output to the profile's transports and to an optional recording.
nmeasim::io::StdoutTransport Writes lines to standard output, flushing after each one so that a pipe sees it immediately.
nmeasim::io::TcpClientTransport Connects to a TCP server, sends it every line, and reconnects automatically after a failed attempt or a dropped connection.
nmeasim::io::TcpServerTransport Listens for TCP clients and sends every line to all of them.
nmeasim::io::TrackSettings Settings of the track-following mode, the simulation.track object of a profile.
nmeasim::io::Transport Abstract output channel: TCP server or client, UDP, WebSocket server, serial port, file, log or standard output.
nmeasim::io::UdpConfig Settings of a UDP output, applied when the transport is opened.
nmeasim::io::UdpTransport Sends every line as one UDP datagram to the destination of a UdpConfig.
nmeasim::io::WebSocketServerTransport Accepts WebSocket clients and sends every line to all of them as a text frame.

Files

File Description
src/core/include/nmeasim/core/ais/messages.hpp AIS messages of the own vessel and their framing into VDO and VDM sentences.
src/core/include/nmeasim/core/ais/sixbit.hpp Bit-level packing of AIS messages and the six-bit ASCII armouring of their payload.
src/core/include/nmeasim/core/geo/geodesic.hpp Geodesic distance, bearing and destination on the WGS 84 ellipsoid.
src/core/include/nmeasim/core/geo/route.hpp Geometry of a leg between two waypoints as seen from the vessel.
src/core/include/nmeasim/core/log/log_file.hpp Reading and writing sentence logs: parse_log, load_log, format_log_line and format_header_line.
src/core/include/nmeasim/core/model/vessel_state.hpp The vessel state: the snapshot of the simulated vessel that every encoder reads.
src/core/include/nmeasim/core/nmea0183/checksum.hpp NMEA 0183 sentence framing: delimiters, the length limit and the XOR checksum.
src/core/include/nmeasim/core/nmea0183/decoder.hpp Decoder that reads NMEA 0183 sentences back into a vessel state.
src/core/include/nmeasim/core/nmea0183/encoders.hpp Encoders that turn a vessel state into NMEA 0183 sentences.
src/core/include/nmeasim/core/nmea0183/fields.hpp Formatting of individual NMEA 0183 field values: numbers, coordinates, times and dates.
src/core/include/nmeasim/core/nmea0183/registry.hpp The catalogue of every NMEA 0183 sentence the simulator can emit.
src/core/include/nmeasim/core/nmea0183/sentence_builder.hpp Assembly of one NMEA 0183 sentence field by field, framed with its checksum.
src/core/include/nmeasim/core/nmea0183/tag_block.hpp IEC 61162-450 TAG blocks that name the source and the time of a sentence.
src/core/include/nmeasim/core/physics/wind.hpp Apparent wind on board a moving vessel.
src/core/include/nmeasim/core/signalk/delta.hpp Signal K delta and hello messages built from the vessel state.
src/core/include/nmeasim/core/simulation/custom_sentence.hpp Operator-defined sentences: their settings and the validation and framing of their bodies.
src/core/include/nmeasim/core/simulation/delta_source.hpp The delta simulation mode: seed values that drift within configured bounds, with operator overrides, nudges and rudder steering.
src/core/include/nmeasim/core/simulation/emitted_sentence.hpp The unit of output of a simulation step: one sentence together with the id that produced it.
src/core/include/nmeasim/core/simulation/replay_source.hpp The replay mode: the sentences of a recorded log are sent again with their original timing.
src/core/include/nmeasim/core/simulation/sentence_scheduler.hpp The sentence schedule: which NMEA 0183 sentences are sent, with which talker and how often, and which are due at a given simulated time.
src/core/include/nmeasim/core/simulation/simulation.hpp The Simulation, which advances a source and a sentence schedule together on a simulated clock.
src/core/include/nmeasim/core/simulation/source.hpp The Source interface that every simulation mode implements.
src/core/include/nmeasim/core/simulation/track_source.hpp The track-following mode: the vessel sails a GPX or KML track leg by leg.
src/core/include/nmeasim/core/time/iso8601.hpp ISO 8601 date-time parsing and formatting without any locale or time zone database.
src/core/include/nmeasim/core/track/gpx.hpp Reader for GPX 1.0 and 1.1 track and route files: parse_gpx.
src/core/include/nmeasim/core/track/kml.hpp Reader for tracks in OGC KML 2.2 files: parse_kml.
src/core/include/nmeasim/core/track/track.hpp The in-memory track: Track, its points and the kind of file element it came from.
src/core/include/nmeasim/core/track/track_file.hpp Loading a track from a file, with the reader chosen from the file name: parse_track and load_track.
src/core/include/nmeasim/core/units.hpp Unit conversion constants and functions used throughout the simulator.
src/core/include/nmeasim/core/version.hpp.in Project name and version, filled in by CMake from the project() call.
src/core/include/nmeasim/core/viewsync/viewsync.hpp ViewSync camera packets that make Google Earth follow the simulated vessel.
src/io/include/nmeasim/io/network_interfaces.hpp Enumeration of the host's IPv4 network interfaces, with their subnet broadcast addresses.
src/io/include/nmeasim/io/profile/profile.hpp The simulator profile: the persistent JSON description of a complete simulation setup.
src/io/include/nmeasim/io/serial_ports.hpp Enumeration of the serial ports present on the host machine.
src/io/include/nmeasim/io/simulation_runner.hpp The SimulationRunner, which drives a simulation from a real timer and fans its output out to transports, and the OutputChannel it keeps per output.
src/io/include/nmeasim/io/transport.hpp The Transport base class of every output channel, with its life-cycle State.
src/io/include/nmeasim/io/transports/file_transport.hpp FileTransport, the output that writes lines to a plain text file.
src/io/include/nmeasim/io/transports/log_transport.hpp LogTransport, the recorder that writes timestamped sentences in the log format of ADR 0012.
src/io/include/nmeasim/io/transports/serial_transport.hpp SerialTransport, the output that writes lines to a serial port, and its SerialConfig.
src/io/include/nmeasim/io/transports/stdout_transport.hpp StdoutTransport, the output that writes lines to the standard output of the process.
src/io/include/nmeasim/io/transports/tcp_client_transport.hpp TcpClientTransport, the output that connects to a TCP server and reconnects by itself.
src/io/include/nmeasim/io/transports/tcp_server_transport.hpp TcpServerTransport, the output that listens for TCP clients and sends every line to all of them.
src/io/include/nmeasim/io/transports/udp_transport.hpp UdpTransport, the output that sends every line as one UDP datagram, and its UdpConfig.
src/io/include/nmeasim/io/transports/websocket_server_transport.hpp WebSocketServerTransport, the output that accepts WebSocket clients and sends every line as a text frame.