pub struct Patch {
pub topology: Topology,
pub layouts: Vec<Layout>,
}Expand description
All fixture data of a project: the topology and the layouts derived from it.
Fields§
§topology: Topology§layouts: Vec<Layout>Implementations§
Source§impl Patch
impl Patch
Sourcepub fn addressing(&self, collections: &Collections) -> Addressing
pub fn addressing(&self, collections: &Collections) -> Addressing
The addresses of every fixture and the universes they fill.
Source§impl Patch
impl Patch
Sourcepub fn color_orders(&self, collections: &Collections) -> ColorOrders
pub fn color_orders(&self, collections: &Collections) -> ColorOrders
The wire order of every addressed pixel that is not RGB. It belongs to the DMX slot, not to what the slot samples, so layouts and modes do not change it.
Source§impl Patch
impl Patch
pub fn layout(&self, layout: LayoutRef) -> Option<&Layout>
pub fn layout_mut(&mut self, layout: LayoutRef) -> Option<&mut Layout>
pub fn fixture(&self, id: FixtureId) -> Option<&Fixture>
Sourcepub fn fixture_name(&self, id: FixtureId) -> String
pub fn fixture_name(&self, id: FixtureId) -> String
The fixture’s name, or its id where the topology does not hold it.
Sourcepub fn layout_refs(&self) -> Vec<LayoutRef>
pub fn layout_refs(&self) -> Vec<LayoutRef>
Every layout, the topology first, in stack order.
pub fn add_layout(&mut self) -> usize
pub fn duplicate_layout(&mut self, index: usize) -> Option<usize>
pub fn remove_layout(&mut self, index: usize)
Sourcepub fn add_fixture(
&mut self,
fixture: Fixture,
position: LayoutPosition,
) -> FixtureId
pub fn add_fixture( &mut self, fixture: Fixture, position: LayoutPosition, ) -> FixtureId
Adds a fixture to the topology, and therefore to the default layout.
pub fn remove_fixture(&mut self, id: FixtureId)
Sourcepub fn add_member(&mut self, layout: LayoutRef, id: FixtureId)
pub fn add_member(&mut self, layout: LayoutRef, id: FixtureId)
Adds id to a user layout at its default-layout position, so a new
layout starts out as a copy of the physical arrangement.
Sourcepub fn set_member(&mut self, layout: LayoutRef, id: FixtureId, member: bool)
pub fn set_member(&mut self, layout: LayoutRef, id: FixtureId, member: bool)
Includes or excludes a fixture. Membership of the default layout cannot be changed — it holds every fixture by construction.
Sourcepub fn definition(
&self,
id: FixtureId,
collections: &Collections,
) -> Option<Arc<Asset<FixtureDefinition>>>
pub fn definition( &self, id: FixtureId, collections: &Collections, ) -> Option<Arc<Asset<FixtureDefinition>>>
The definition asset a fixture uses, if it has one and it is loaded. There is no built-in fallback — definitions live in the asset dir.
Sourcepub fn addresses(
&self,
collections: &Collections,
) -> BTreeMap<FixtureId, ArtnetDMXAddress>
pub fn addresses( &self, collections: &Collections, ) -> BTreeMap<FixtureId, ArtnetDMXAddress>
The address of every fixture, derived by walking each chain from its port. A fixture never straddles a universe boundary; it starts the next universe instead.
A fixture whose definition is missing has an unknown channel width, so
it and everything after it in its chain get no address at all rather
than a wrong one. The same goes for a fixture past MAX_UNIVERSE:
Art-Net cannot address its universe; and for a fixture wider than a
universe (a malformed definition), which fits nowhere without
straddling a boundary and leaves the channels after it unknown.
Sourcepub fn lowest_free_universe(
&self,
collections: &Collections,
placing: Option<FixtureId>,
) -> u16
pub fn lowest_free_universe( &self, collections: &Collections, placing: Option<FixtureId>, ) -> u16
A universe for a chain that is about to need one: the lowest no other chain reaches. Starting it inside a universe an existing chain has already spilled into would overlap them.
Sourcepub fn fixture_mode(
&self,
layout: LayoutRef,
mode: usize,
id: FixtureId,
collections: &Collections,
) -> Option<usize>
pub fn fixture_mode( &self, layout: LayoutRef, mode: usize, id: FixtureId, collections: &Collections, ) -> Option<usize>
Which mode of its own definition id uses in mode of layout.
Unassigned fixtures fall back to their definition’s default mode.
None when the fixture has no definition to take a mode from.
pub fn set_fixture_mode( &mut self, layout: LayoutRef, mode: usize, id: FixtureId, value: usize, )
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Patch
impl<'de> Deserialize<'de> for Patch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Patch
Auto Trait Implementations§
impl Freeze for Patch
impl RefUnwindSafe for Patch
impl Send for Patch
impl Sync for Patch
impl Unpin for Patch
impl UnsafeUnpin for Patch
impl UnwindSafe for Patch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DebugAny for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more