Skip to main content

new_fixture

Function new_fixture 

Source
pub fn new_fixture(
    name: String,
    fixture_type_name: String,
    start_channel: ChannelIndex,
    start_universe: usize,
) -> Result<(), FixtureError>
Expand description

Creates and registers a new fixture instance, verifying and reserving its DMX channels.

§Arguments

  • name - Unique name for the fixture instance
  • fixture_type_name - Template name of the registered fixture type
  • start_channel - DMX channel offset within the universe
  • start_universe - Target DMX universe index (0-based)

§Errors

  • FixtureNameAlreadyInUse – if the name is already taken
  • InvalidFixtureType - if fixture_type_name is not registered
  • [ChannelAlreadyInUse] – if required channels overlap with existing
  • ChannelOutOfRange - if any required channel is out of bounds ([MAX_CHANNEL]).
  • [UniverseOutOfRange] - if the fixture is in a non-existent universe
  • [DmxStateDesync] - if the DMX-State and the fixture registry are out of sync