#tudelft #xray #sim

tudelft-xray-sim

simulation library for the modeling assignment in the course 'Software Systems' at the TU Delft

1 stable release

1.0.0 Jan 11, 2023

#208 in Simulation

Download history 1/week @ 2023-10-14 3/week @ 2023-10-28 1/week @ 2023-11-04 2/week @ 2023-11-11 1/week @ 2023-11-18 6/week @ 2023-11-25 1/week @ 2023-12-16 2/week @ 2023-12-23 2/week @ 2024-01-06 1/week @ 2024-01-13 21/week @ 2024-01-20 45/week @ 2024-01-27

69 downloads per month

MIT license

29KB
393 lines

tudelft-xray-sim

Simulation library for the modeling assignment in the course 'Software Systems' at the TU Delft.

See the course website and documentation for more information.


lib.rs:

Simulation library for the modeling assignment in the course 'Software Systems' at the TU Delft.

The expected way to interact with this library is to implement the PedalMapper and ActionLogic traits and then use either run_single_plane_sim or run_double_plane_sim from your main function. A GUI will appear with a checkbox for each pedal, and a display for each of the available planes.

Depending on the implementation of the two traits mentioned above, pressing each pedal will modify the state of the planes. All interaction is logged, as well as any potential warnings or errors caused by improper commands.

Here is the absolute minimum you have to do to get the simulation to run:

use tudelft_xray_sim::*;

fn main() {
    run_single_plane_sim(Logic);
}

struct Logic;

impl PedalMapper for Logic {
    type Pedals = ThreePedals;
    fn on_press(&self, pedal: Self::Pedals) -> Option<Request> { None }
    fn on_release(&self, pedal: Self::Pedals) -> Option<Request> { None }
}

impl ActionLogic<false> for Logic {
    fn handle_request(&mut self, request: Request, controller: &mut Controller<false>) {}
}

Logging is done with [log], so any logger which supports it will work. For example you can use simple_logger to print everything to the standard output (default configuration).

fn main() {
    simple_logger::init().unwrap();
    // ...
}

Dependencies

~7–20MB
~271K SLoC