Skip to main content

Block

Enum Block 

Source
pub enum Block {
    Lens {
        id: String,
        source: LensSource,
        reversed: bool,
        stop: bool,
        place: Place,
        faces: FaceMods,
    },
    Air {
        id: String,
        t: f64,
        medium: Option<String>,
    },
    Stop {
        id: String,
        semi: f64,
        faces: FaceMods,
    },
    Mirror {
        id: String,
        radius: Option<f64>,
        conic: f64,
        tilt: [f64; 2],
        semi: f64,
        aperture: Option<SurfAperture>,
        coat: String,
        on: bool,
        back: bool,
        row: Option<Box<Row>>,
        faces: FaceMods,
    },
    Surfaces {
        id: String,
        surfaces: Vec<SurfSpec>,
        place: Place,
        faces: FaceMods,
    },
    Zmx {
        id: String,
        path: String,
        from: Option<usize>,
        to: Option<usize>,
        config: usize,
        stop: bool,
        state: Option<String>,
        beam_path: Option<String>,
        groups: Vec<ZmxGroup>,
        place: Place,
        faces: FaceMods,
    },
    User {
        id: String,
        catalog: String,
        item: String,
        place: Place,
        faces: FaceMods,
    },
    Splitter {
        id: String,
        spec: SplitterSpec,
        place: Place,
    },
    Group {
        id: String,
        name: String,
        role: Option<Role>,
        shift: f64,
        blocks: Vec<Block>,
        place: Place,
        faces: FaceMods,
    },
    Detector(DetectorBlock),
}

Variants§

§

Lens

Fields

§source: LensSource
§reversed: bool
§stop: bool

玉の前面を絞りにする

§place: Place
§faces: FaceMods
§

Air

Fields

§medium: Option<String>

間隔を満たす媒質(液浸の油・水など、硝材の名前か屈折率の数)。省略は空気。最後の間隔なら像空間の媒質

§

Stop

絞り(空気中のダミー面)

Fields

§semi: f64
§faces: FaceMods
§

Mirror

Fields

§radius: Option<f64>

曲率半径(省略・0 なら平面)

§conic: f64
§tilt: [f64; 2]

傾き x・y [deg]。折り曲げでは鏡の前後で同じ角だけ傾ける(光軸が折れる。後ろは回す順を逆にして、2 軸でも後の軸が反射した光軸に乗る)。 back(往路を戻る)では鏡だけを傾け、座標は元の軸に戻す(復路の光線が傾きの 2 倍の角で戻る)

§semi: f64
§aperture: Option<SurfAperture>

鏡の開口(省略なら半径 semi の円。四角い鏡は rect)

§coat: String
§on: bool
§back: bool

往路を戻る: 同じ並び(群)で鏡より前のブロックを、逆の順・逆の向きにたどる

§row: Option<Box<Row>>

radius・conic で書けない鏡(Zernike・Grid Sag など)を、システムファイル(版 2)の面の行で書く。 働きは鏡(reflect、または mirror の付く働き)。書くときは radius・conic・semi・aperture・coat を書かない (行に書く)。厚さ・媒質・絞りの印は書かない(間隔は後の空気、絞りはブロックの set_stop で)

§faces: FaceMods
§

Surfaces

空気中の面の並び(玉に分けない)

Fields

§surfaces: Vec<SurfSpec>
§place: Place
§faces: FaceMods
§

Zmx

.zmx から取り込んだ系(面 from〜to、既定は面 1 から像面の手前まで。空気間隔も含む)。path は lensbench の系 (系ファイル・プロジェクトの .json、構成は 1 だけ)でもよい

Fields

§path: String
§config: usize

.zmx のマルチコンフィグの番号(1 始まり)

§stop: bool

.zmx の絞りを系の絞りにする(false なら取り込んだ面の絞りを外す。系の絞りはほかのブロックで)

§state: Option<String>

取り込むプロジェクト(.json)の状態(省略なら状態の変更なし)

§beam_path: Option<String>

取り込むプロジェクト(.json)の BS の経路(T・R の文字列。省略なら状態・プロジェクトの path)

§groups: Vec<ZmxGroup>

玉モードの群(.zmx の面の範囲)

§place: Place
§faces: FaceMods
§

User

ユーザーカタログの項目(群と同じに入れる)

Fields

§catalog: String

ユーザーカタログのファイル(プロジェクトのフォルダから)

§item: String
§place: Place
§faces: FaceMods
§

Splitter

ビームスプリッター(SplitterSpec)。id が要る

Fields

§place: Place
§

Group

Fields

§name: String
§role: Option<Role>
§shift: f64

群の移動 [mm](光の進む向きが正)。前の間隔に足し、後の間隔から引く

§blocks: Vec<Block>
§place: Place
§faces: FaceMods
§

Detector(DetectorBlock)

検出器(登録した種類、DetectorBlock)。"type" は種類の名前(このクレートの組み込みの名前でないもの)。 読み書きは下の Deserialize・Serialize の実装で、スキーマは crate::schema が足す

Implementations§

Source§

impl Block

Source

pub fn serialize<__S>( __self: &Block, __serializer: __S, ) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Source§

impl<'de> Block

Source

pub fn deserialize<__D>(__deserializer: __D) -> Result<Block, __D::Error>
where __D: Deserializer<'de>,

Source§

impl Block

Source

pub fn faces(&self) -> Option<&FaceMods>

ブロックの面の上書き・操作(持てる種類だけ)

Source

pub fn faces_mut(&mut self) -> Option<&mut FaceMods>

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Block

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Block

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Block

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl Serialize for Block

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnsafeUnpin for Block

§

impl UnwindSafe for Block

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.