From ad4ea837b9148c33a54ca5b77023e9134b0e4b32 Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Tue, 19 Jul 2022 06:04:30 +0200 Subject: [PATCH] more details about testing --- src/dsp/mod.rs | 27 +++++++++++++++++++++++++++ src/matrix.rs | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/dsp/mod.rs b/src/dsp/mod.rs index 42b9b8e..a84d7ed 100644 --- a/src/dsp/mod.rs +++ b/src/dsp/mod.rs @@ -376,9 +376,36 @@ When doing this, keep the following grid layout in mind: \_____/ ``` +Defining the outputs of a cell is done like this: + +```ignore + Cell::empty(ad).out(None, None, ad.out("sig")) +``` + +[crate::Cell::empty] takes a [NodeId] as first argument. The [crate::Cell] +structure then allows you to specify the output ports using the [crate::Cell::out] +function. The 3 arguments of that function are for the 3 edges of that hex tile: + +```ignore + // TopRight BottomRight Bottom + Cell::empty(ad).out(None, None, ad.out("sig")) +``` + +[crate::Cell::input] works the same way, but the 3 arguments refer to the 3 input +edges of a hex tile: + +```ignore + // Top TopLeft BottomLeft + Cell::empty(out).input(out.inp("ch1"), None, None) +``` + +The [NodeId] interface offers you functions to get the input parameter index from +a name like `out.inp("ch1")` or the output port index from a name: `ad.out("sig")`. + After you have setup everything for the test, you usually want to modify a paramter and look at the values the graph returns. + ```ignore #[test] fn check_node_ad_1() { diff --git a/src/matrix.rs b/src/matrix.rs index cea1c89..57c1291 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -388,7 +388,7 @@ pub trait MatrixObserver { /// Not called, when [MatrixObserver::update_all] tells you that /// everything has changed. fn update_prop(&self, key: &str); - /// Called when a new cell is monitored via [MatrixObserver::monitor_cell]. + /// Called when a new cell is monitored via [Matrix::monitor_cell]. /// Not called, when [MatrixObserver::update_all] tells you that /// everything has changed. fn update_monitor(&self, cell: &Cell);