1
0
forked from ROMEO/nexosim

Introduce ProtoModel trait, remove Model::setup

The external_input example has been as well adapted and (at least
temporarily) simplifiedi/modified to remove the dependencies on
`atomic_wait` and `mio`.
This commit is contained in:
Serge Barral
2024-11-04 00:00:50 +01:00
parent 8f7057689c
commit 039fefad47
11 changed files with 462 additions and 314 deletions

View File

@ -4,14 +4,17 @@
//!
//! * self-scheduling methods,
//! * model initialization,
//! * simulation monitoring with event streams.
//! * simulation monitoring with buffered event sinks.
//!
//! ```text
//! ┌──────────┐ ┌──────────┐
//! PPS │ │ coil currents │ │ position
//! Pulse rate ●─────────►│ Driver ├───────────────►│ Motor ├──────────►
//! (±freq) │ │ (IA, IB) │ (0:199)
//! └──────────┘ ──────────
//! ┌──────────┐
//! PPS │ │ coil currents ┌─────────┐
//! Pulse rate ●─────────►│ Driver ├───────────────►│
//! (±freq) │ │ (IA, IB) │ │ position
//! └──────────┘ │ Motor ├──────────
//! torque │ │ (0:199)
//! Load ●─────────────────────────────────────►│ │
//! └─────────┘
//! ```
use std::future::Future;
@ -136,7 +139,7 @@ impl Driver {
}
}
/// Sets the pulse rate (sign = direction) [Hz] -- input port.
/// Pulse rate (sign = direction) [Hz] -- input port.
pub async fn pulse_rate(&mut self, pps: f64, context: &Context<Self>) {
println!(
"Model instance {} at time {}: setting pps: {:.2}",