Skip to main content

EditOp

Enum EditOp 

Source
pub enum EditOp {
Show 32 variants InsertSurface { at: usize, surface: Map<String, Value>, }, DeleteSurface { surface: Ref, }, SetSurface { surface: Ref, fields: Map<String, Value>, }, SetSurfaceType { surface: Ref, typ: String, }, SetMaterial { surface: Ref, material: String, }, SetStop(StopOp<Ref>), AddPickup(PickupOp<Ref>), RemovePickup { dst: Ref, what: String, }, AddSolve(SolveOp<Ref>), AddMacroSolve(MacroSolveOp<Ref>), RemoveSolve { surface: Ref, what: SolveWhat, }, SetSurfaceData { surface: Ref, data: Map<String, Value>, }, SetParam { param: String, value: Num, }, SetSystemData { data: Map<String, Value>, }, DefineUnit { name: String, spans: Vec<[usize; 2]>, pivot: Option<[Num; 3]>, }, SetUnit { unit: Ref, name: Option<String>, spans: Option<Vec<[usize; 2]>>, pivot: Option<[Num; 3]>, }, RemoveUnit { unit: Ref, }, AddMech { part: MechPart, }, SetMech { mech: Ref, part: Map<String, Value>, }, RemoveMech { mech: Ref, }, SetConfigCount { n: usize, }, SetConfigRow { param: String, values: Vec<Num>, }, SetConfigMaterials { param: String, names: Vec<String>, }, SetConfigCoatings { param: String, names: Vec<String>, }, AddConfigRow { param: String, }, RemoveConfigRow { param: String, }, SetConfig { k: usize, }, InsertConfig { at: usize, from: Option<usize>, pickup: bool, }, RemoveConfig { k: usize, }, SetConfigPickup { param: String, k: usize, from: usize, row: Option<String>, scale: Option<Num>, offset: Option<Num>, }, RemoveConfigPickup { param: String, k: usize, }, MakeThermal { temps: Vec<Num>, pressures: Vec<Num>, },
}
Expand description

系の編集の操作(serve の edit の ops の要素)。op で選ぶ

Variants§

§

InsertSurface

面 at の前に面を入れる(surface は面の値の名前と値、lensbench_core::edit::SURF_FIELDS)

Fields

§surface: Map<String, Value>
§

DeleteSurface

面を消す

Fields

§surface: Ref
§

SetSurface

面の値を変える(名前と値、lensbench_core::edit::SURF_FIELDS。aperture は {“type”: “circular”, “max”: 3, …} か null)

Fields

§surface: Ref
§fields: Map<String, Value>
§

SetSurfaceType

面タイプを変える

Fields

§surface: Ref
§

SetMaterial

材料を変える

Fields

§surface: Ref
§material: String
§

SetStop(StopOp<Ref>)

面を絞りにする

§

AddPickup(PickupOp<Ref>)

ピックアップを置く

§

RemovePickup

ピックアップを外す

Fields

§dst: Ref
§what: String
§

AddSolve(SolveOp<Ref>)

ソルブを置く

§

AddMacroSolve(MacroSolveOp<Ref>)

円錐係数・半直径・機械半径・面タイプのパラメータのマクロのソルブを置く

§

RemoveSolve

ソルブを外す

Fields

§surface: Ref
§

SetSurfaceData

面のデータを全部の項目で変える(serve の surface_data の data と同じ形、書いた項目だけ)。屈折率 n・絞り stop・ 鏡 mirror は変えない(材料・set_stop で)。面タイプの形のデータ zern・grid・bin2・cylf・grin、前後の傾き偏心 before・after もここで

Fields

§surface: Ref
§

SetParam

パラメータの値を変える(名前は set と同じ)

Fields

§param: String
§value: Num
§

SetSystemData

系の設定の項目を変える(crate::edit_ops::SYSTEM_KEYS の書いた分だけ。形は serve の system_data と同じ)

Fields

§

DefineUnit

玉・群を作る(spans は面の範囲 [[最初, 最後], …]、pivot は既定 [0, 0, 0])

Fields

§name: String
§spans: Vec<[usize; 2]>
§pivot: Option<[Num; 3]>
§

SetUnit

玉・群を変える(書いた分だけ。範囲を変えるのは動き・移動が 0 のときだけ)

Fields

§unit: Ref
§spans: Option<Vec<[usize; 2]>>
§pivot: Option<[Num; 3]>
§

RemoveUnit

玉・群を外す(動き・移動が 0 のときだけ)

Fields

§unit: Ref
§

AddMech

機構部品を置く(系ファイルの mechanics の要素と同じ形)

Fields

§

SetMech

機構部品を変える(part は書いた項目だけ)

Fields

§mech: Ref
§

RemoveMech

機構部品を外す

Fields

§mech: Ref
§

SetConfigCount

多重構成の数

Fields

§

SetConfigRow

多重構成の表の行(パラメータの構成ごとの値)

Fields

§param: String
§values: Vec<Num>
§

SetConfigMaterials

多重構成の表の材料の行(param は N.material、構成ごとの材料の名前)

Fields

§param: String
§names: Vec<String>
§

SetConfigCoatings

多重構成の表の膜の行(param は N.coating、構成ごとの膜の名前。空は膜なし)

Fields

§param: String
§names: Vec<String>
§

AddConfigRow

多重構成の表に行を足す(どの構成も今の値)

Fields

§param: String
§

RemoveConfigRow

多重構成の表の行を外す

Fields

§param: String
§

SetConfig

構成 k(1 始まり)を系に入れる

Fields

§

InsertConfig

構成を at(1 始まり)に入れる。from の構成の値で(既定は今の構成、pickup なら 1)、pickup なら from を写す

Fields

§pickup: bool
§

RemoveConfig

構成 k を外す

Fields

§

SetConfigPickup

表の行 param の構成 k を構成 from から写す(× scale + offset)。row があれば表の別の行 row(同じ量の種類の行)の 構成 from から写す(OpticStudio の構成のピックアップの元の行。OpticStudio が拾わない下の行・後の構成からのものは .zmx に値だけ書く)

Fields

§param: String
§from: usize
§scale: Option<Num>
§offset: Option<Num>
§

RemoveConfigPickup

表の行 param の構成 k の写しをやめる

Fields

§param: String
§

MakeThermal

熱の構成を作る(OpticStudio の Make Thermal、lensbench_core::thermal)。今の構成を構成 1 にし、temps の温度 [°C] ごとに構成を足す。pressures は足す構成の気圧 [atm](省くと今の気圧)

Fields

§temps: Vec<Num>
§pressures: Vec<Num>

Implementations§

Source§

impl EditOp

Source

pub fn is_config(&self) -> bool

多重構成の表の操作か(そうでなければ、変えた値を表の今の構成の列にも写す)

Source

pub fn name(&self) -> String

操作の名前(op)

Trait Implementations§

Source§

impl Clone for EditOp

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 EditOp

Source§

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

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

impl<'de> Deserialize<'de> for EditOp

Source§

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

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

impl JsonSchema for EditOp

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 PartialEq for EditOp

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EditOp

Source§

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

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EditOp

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
§

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.