Add a way to render the state

Note that this has exposed some scaling error that needs to be fixed.
This commit is contained in:
2020-07-12 21:16:42 -07:00
parent ccd7b45fc8
commit 0ea06af0b0
3 changed files with 48 additions and 4 deletions

17
src/render.rs Normal file
View File

@@ -0,0 +1,17 @@
use crate::SimState;
pub struct NumericTermRenderer;
impl NumericTermRenderer {
pub fn render(&self, state: &SimState) {
print!("E: ");
for cell in state.cells() {
print!("{:>8.1e} ", cell.ez());
}
print!("\nB: ");
for cell in state.cells() {
print!("{:>8.1e} ", cell.by());
}
print!("\n");
}
}