Crate cmri_tools

Source
Expand description

§CMRI Tools

Crates Checks

A collection of tools I found useful for experimenting with CMRInet (as defined in NMRA Specification LCS-9.10.1).

§The Binaries

§hub

A CLI/GUI application which provids the means to interconnect devices/software which have differing connection requirements, anything received on a connection is written to all the others.

Use the --help command line flag for usage information.

§monitor

A GUI application which interprets the packets on a C/MRI network and provides:

  • The number of packets (in total and by type) seen.
  • A list of seen nodes.
  • For each node a detailed view including:
    • The number of packets (in total and by type) seen.
    • Type and configuration (if the initialization packet was seen).
    • Their input states (from the last receive data packet seen).
    • Their output states (from the last transmit data packet seen).

Use the --help command line flag for usage information.

If compiled with the experimenter feature then the packets over time plots also show unknown packets.

§controller

A GUI application for controlling the nodes of a CMRInet. The user can view the inputs and set the outputs of each node.

Use the --help command line flag for usage information.

§nodes

A GUI application for “simulating” the nodes of a CMRInet. The user can view the outputs set by the controller and set the inputs.

Use the --help command line flag for usage information.

§node

A GUI application for “simulating” a single node on a CMRInet. The user can view the outputs set by the controller and set the inputs.

Use the --help command line flag for usage information.

§Testing

Tested against all tier 1 targets (except Windows using GNU build) from https://doc.rust-lang.org/nightly/rustc/platform-support.html on nightly (at time of pushing to GitHub) rust.

Modules§

connection
Create and use a connection to a CMRInet network.
file
Common methods for saving/loading data.
gui
Shared behaviour for GUIs.
readings
A ring buffer allowing any number of items to be added, but only the last N retrieved.

Functions§

init_tracing
Initialze tracing with the provided tracing_subscriber::EnvFilter.
tokio_runtime
Get a tokio Runtime configured with time and io.
truncate_duration_to_micros
Truncate the precision of a Duration to microseconds for easier human readability.
truncate_duration_to_millis
Truncate the precision of a Duration to milliseconds for easier human readability.