Skip to content

Commit

Permalink
feat(fixtures): add debug ui showing fader values for fixture controls
Browse files Browse the repository at this point in the history
  • Loading branch information
maxjoehnk committed Aug 30, 2024
1 parent 669a19d commit 28fd40f
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion crates/components/fixtures/src/debug_ui_pane.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use mizer_module::*;
use mizer_node::Inject;

use crate::fixture::IFixture;
use crate::manager::FixtureManager;

pub struct FixturesDebugUiPane;
Expand Down Expand Up @@ -96,6 +96,38 @@ impl<TUi: DebugUi> DebugUiPane<TUi> for FixturesDebugUiPane {
}
});
});
ui.collapsing_header("Faders", |ui| {
ui.columns(3, |columns| {
for (control, _control_type) in fixture.current_mode.controls.controls().into_iter() {
for fader in control.faders() {
let channel = fixture.current_mode.controls.get_channel(&fader).unwrap();
let channel = format!("{:?}", channel);
columns[0].label(format!("{fader:?}"));
columns[1].label(fixture.read_control(fader).unwrap_or_default().to_string());
columns[2].label(channel);
}
}
});
});
ui.collapsing_header("Sub Fixtures", |ui| {
for sub_fixture in &fixture.current_mode.sub_fixtures {
ui.collapsing_header(&sub_fixture.name, |ui| {
ui.columns(3, |columns| {
if let Some(sub_fixture) = fixture.sub_fixture(sub_fixture.id) {
for (control, _control_type) in sub_fixture.definition.controls.controls().into_iter() {
for fader in control.faders() {
let channel = sub_fixture.definition.controls.get_channel(&fader).unwrap();
let channel = format!("{:?}", channel);
columns[0].label(format!("{fader:?}"));
columns[1].label(sub_fixture.read_control(fader).unwrap_or_default().to_string());
columns[2].label(channel);
}
}
}
});
})
}
});
});
}
}
Expand Down

0 comments on commit 28fd40f

Please sign in to comment.