Skip to main content

EulumdatEngine

Struct EulumdatEngine 

Source
pub struct EulumdatEngine { /* private fields */ }
Expand description

Plugin engine holding parsed photometric data

Implementations§

Source§

impl EulumdatEngine

Source

pub fn new() -> Self

Create a new engine instance

Source

pub fn has_data(&self) -> bool

Check if data is loaded

Source

pub fn parse_ldt(&mut self, content: &str) -> Result<String, JsValue>

Parse LDT (EULUMDAT) file content

Source

pub fn parse_ies(&mut self, content: &str) -> Result<String, JsValue>

Parse IES file content

Source

pub fn export_ldt(&self) -> Result<String, JsValue>

Export current data to LDT format

Source

pub fn export_ies(&self) -> Result<String, JsValue>

Export current data to IES format

Source

pub fn get_name(&self) -> Result<String, JsValue>

Get luminaire name

Source

pub fn get_data_json(&self) -> Result<String, JsValue>

Get current data as JSON

Source

pub fn clear(&mut self)

Clear loaded data

Source

pub fn beam_angle(&self) -> Result<f64, JsValue>

Calculate beam angle (angle at 50% max intensity)

Source

pub fn field_angle(&self) -> Result<f64, JsValue>

Calculate field angle (angle at 10% max intensity)

Source

pub fn half_beam_angle(&self) -> Result<f64, JsValue>

Calculate half beam angle

Source

pub fn half_field_angle(&self) -> Result<f64, JsValue>

Calculate half field angle

Source

pub fn total_flux(&self) -> Result<f64, JsValue>

Calculate total luminous flux

Source

pub fn downward_flux(&self, angle: f64) -> Result<f64, JsValue>

Calculate downward flux to a specific angle

Source

pub fn efficacy(&self) -> Result<f64, JsValue>

Calculate luminaire efficacy (lm/W)

Source

pub fn efficiency(&self) -> Result<f64, JsValue>

Calculate luminaire efficiency (downward flux fraction)

Source

pub fn cut_off_angle(&self) -> Result<f64, JsValue>

Calculate cut-off angle

Source

pub fn get_summary(&self) -> Result<String, JsValue>

Get photometric summary (all key metrics)

Source

pub fn beam_field_analysis(&self) -> Result<String, JsValue>

Get beam/field analysis

Source

pub fn zonal_lumens_30(&self) -> Result<String, JsValue>

Calculate zonal lumens (30-degree zones)

Source

pub fn cie_flux_codes(&self) -> Result<String, JsValue>

Calculate CIE flux codes

Source

pub fn spacing_criteria(&self) -> Result<String, JsValue>

Calculate spacing criteria

Source

pub fn cu_table(&self) -> Result<String, JsValue>

Calculate coefficient of utilization (CU) table

Source

pub fn ugr_table(&self) -> Result<String, JsValue>

Calculate UGR (Unified Glare Rating) table

Source

pub fn direct_ratios(&self, shr: &str) -> Result<String, JsValue>

Calculate direct ratios for standard room indices shr: Spacing to Height Ratio (“1.0”, “1.5”, “2.0”, etc.)

Source

pub fn bug_rating(&self) -> Result<String, JsValue>

Calculate BUG rating

Source

pub fn zone_lumens(&self) -> Result<String, JsValue>

Calculate zone lumens for BUG rating

Source

pub fn bug_diagram_data(&self) -> Result<String, JsValue>

Get BUG diagram data

Source

pub fn validate(&self) -> Result<String, JsValue>

Validate photometric data

Source

pub fn polar_svg( &self, width: f64, height: f64, theme: &str, ) -> Result<String, JsValue>

Generate polar diagram SVG

Source

pub fn cartesian_svg( &self, width: f64, height: f64, theme: &str, max_curves: usize, ) -> Result<String, JsValue>

Generate Cartesian diagram SVG

Source

pub fn butterfly_svg( &self, width: f64, height: f64, theme: &str, rotation: f64, ) -> Result<String, JsValue>

Generate butterfly diagram SVG

Source

pub fn heatmap_svg( &self, width: f64, height: f64, theme: &str, ) -> Result<String, JsValue>

Generate heatmap diagram SVG

Source

pub fn cone_svg( &self, width: f64, height: f64, theme: &str, mounting_height: f64, ) -> Result<String, JsValue>

Generate cone diagram SVG mounting_height: luminaire mounting height in meters (default 3.0)

Source

pub fn bug_svg( &self, width: f64, height: f64, theme: &str, ) -> Result<String, JsValue>

Generate BUG rating diagram SVG (TM-15-11)

Source

pub fn lcs_svg( &self, width: f64, height: f64, theme: &str, ) -> Result<String, JsValue>

Generate LCS classification diagram SVG (TM-15-07)

Trait Implementations§

Source§

impl Default for EulumdatEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<EulumdatEngine> for JsValue

Source§

fn from(value: EulumdatEngine) -> Self

Converts to this type from the input type.
Source§

impl FromWasmAbi for EulumdatEngine

Source§

type Abi = u32

The Wasm ABI type that this converts from when coming back out from the ABI boundary.
Source§

unsafe fn from_abi(js: u32) -> Self

Recover a Self from Self::Abi. Read more
Source§

impl IntoWasmAbi for EulumdatEngine

Source§

type Abi = u32

The Wasm ABI type that this converts into when crossing the ABI boundary.
Source§

fn into_abi(self) -> u32

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary.
Source§

impl LongRefFromWasmAbi for EulumdatEngine

Source§

type Abi = u32

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRef<EulumdatEngine>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl OptionFromWasmAbi for EulumdatEngine

Source§

fn is_none(abi: &Self::Abi) -> bool

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi.
Source§

impl OptionIntoWasmAbi for EulumdatEngine

Source§

fn none() -> Self::Abi

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more
Source§

impl RefFromWasmAbi for EulumdatEngine

Source§

type Abi = u32

The Wasm ABI type references to Self are recovered from.
Source§

type Anchor = RcRef<EulumdatEngine>

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous.
Source§

unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

Recover a Self::Anchor from Self::Abi. Read more
Source§

impl RefMutFromWasmAbi for EulumdatEngine

Source§

type Abi = u32

Same as RefFromWasmAbi::Abi
Source§

type Anchor = RcRefMut<EulumdatEngine>

Same as RefFromWasmAbi::Anchor
Source§

unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor

Same as RefFromWasmAbi::ref_from_abi
Source§

impl TryFromJsValue for EulumdatEngine

Source§

fn try_from_js_value(value: JsValue) -> Result<Self, JsValue>

Performs the conversion.
Source§

fn try_from_js_value_ref(value: &JsValue) -> Option<Self>

Performs the conversion.
Source§

impl VectorFromWasmAbi for EulumdatEngine

Source§

impl VectorIntoWasmAbi for EulumdatEngine

Source§

impl WasmDescribe for EulumdatEngine

Source§

impl WasmDescribeVector for EulumdatEngine

Source§

impl SupportsConstructor for EulumdatEngine

Source§

impl SupportsInstanceProperty for EulumdatEngine

Source§

impl SupportsStaticProperty for EulumdatEngine

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ReturnWasmAbi for T
where T: IntoWasmAbi,

Source§

type Abi = <T as IntoWasmAbi>::Abi

Same as IntoWasmAbi::Abi
Source§

fn return_abi(self) -> <T as ReturnWasmAbi>::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more