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: LensSourceAir
Stop
絞り(空気中のダミー面)
Mirror
Fields
§
tilt: [f64; 2]傾き x・y [deg]。折り曲げでは鏡の前後で同じ角だけ傾ける(光軸が折れる。後ろは回す順を逆にして、2 軸でも後の軸が反射した光軸に乗る)。
back(往路を戻る)では鏡だけを傾け、座標は元の軸に戻す(復路の光線が傾きの 2 倍の角で戻る)
§
aperture: Option<SurfAperture>鏡の開口(省略なら半径 semi の円。四角い鏡は rect)
Surfaces
空気中の面の並び(玉に分けない)
Zmx
.zmx から取り込んだ系(面 from〜to、既定は面 1 から像面の手前まで。空気間隔も含む)。path は lensbench の系
(系ファイル・プロジェクトの .json、構成は 1 だけ)でもよい
Fields
User
ユーザーカタログの項目(群と同じに入れる)
Fields
Splitter
ビームスプリッター(SplitterSpec)。id が要る
Group
Fields
Detector(DetectorBlock)
検出器(登録した種類、DetectorBlock)。"type" は種類の名前(このクレートの組み込みの名前でないもの)。
読み書きは下の Deserialize・Serialize の実装で、スキーマは crate::schema が足す
Implementations§
Source§impl<'de> Block
impl<'de> Block
pub fn deserialize<__D>(__deserializer: __D) -> Result<Block, __D::Error>where
__D: Deserializer<'de>,
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Block
impl<'de> Deserialize<'de> for Block
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
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
impl JsonSchema for Block
Source§fn schema_id() -> Cow<'static, str>
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
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
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 moreAuto 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> 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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 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> ⓘ
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