Expand description
Lightweight Rust client for controlling a JSBSim instance over TCP.
This module provides a small, focused API to spawn or connect to a JSBSim process and interact with its console via the TCP interface. It is intended for integration tests and tooling that need programmatic control of JSBSim (get/set properties, step the simulation, hold/resume, etc.). The implementation is intentionally minimal and synchronous.
§Examples
Spawn JSBSim and set a property:
use jsbsimrs::JSBSimProcessProperties;
use jsbsimrs::JSBSim;
let props = JSBSimProcessProperties::default();
let mut sim = JSBSim::new_with_process(props).expect("start jsbsim");
sim.set("fcs/throttle-cmd-norm", 1.0).unwrap();Connect to an already-running JSBSim server:
use jsbsimrs::JSBSim;
let mut sim = JSBSim::new("127.0.0.1:5556").expect("connect");
let t: f64 = sim.get("simulation/sim-time-sec").unwrap();Structs§
- JSBSim
- A connected JSBSim client.
- JSBSim
Process Properties - Configuration used when spawning a JSBSim process via
JSBSim::new_with_process.
Enums§
- GetError
- Error returned by
JSBSim::getwhen retrieving a property value.