pub struct Coatings {
pub file: CoatingFile,
pub measured: HashMap<String, Measured>,
pub models: HashMap<String, CoatModel>,
pub user: HashMap<String, Arc<dyn CoatingModel>>,
pub phase: PhaseConvention,
pub table_normal: TableNormal,
pub auto: Vec<(String, PathBuf)>,
pub auto_measured: Vec<String>,
pub registered: Vec<(String, String)>,
pub auto_stacks: Vec<String>,
pub notes: Vec<String>,
}Expand description
系の膜: 膜ファイルと実測表
Fields§
§file: CoatingFile§measured: HashMap<String, Measured>境界の鍵 → 実測表
models: HashMap<String, CoatModel>膜の名前 → 特性行列モデル
user: HashMap<String, Arc<dyn CoatingModel>>膜の名前 → 係数を計算で返す利用者の膜(登録した一覧・膜のファイル形式から)
phase: PhaseConvention透過の位相の約束
table_normal: TableNormalTABLE 膜の垂直入射の扱い
auto: Vec<(String, PathBuf)>膜ファイルのフォルダから膜の名前で自動で読んだモデル・実測表(系の膜の名前 → ファイル)。
Coatings::for_system が埋める
auto_measured: Vec<String>自動で読んだ実測表(.lbct)の境界の鍵(明示したモデルのある膜から外すため)
registered: Vec<(String, String)>登録した膜の一覧から入れた膜(系の膜の名前, 一覧の名前)。Coatings::for_system が埋める
auto_stacks: Vec<String>自動で膜ファイルに入れた層の並び・表の膜の名前(近似の膜 .lbcs・登録した一覧・登録した形式。明示して読んだ
モデル・実測表のある膜から外すため)
notes: Vec<String>注意(同じ名前の膜が 2 か所にあり、先のものを使ったときなど)
Implementations§
Source§impl Coatings
impl Coatings
Sourcepub fn prepare(
&self,
sys: &System,
key: &str,
wl: f64,
n1: f64,
n2: f64,
) -> Result<Iface>
pub fn prepare( &self, sys: &System, key: &str, wl: f64, n1: f64, n2: f64, ) -> Result<Iface>
境界 key の波長 wl [µm] での係数を用意する(n1・n2 は前後の屈折率、鏡では n2 は使わない)
屈折面での反射(鍵 膜|入射側|反対側|R、ゴーストの経路)は鏡と同じ約束(p = s × k を反射の後で反転)の r を返す。
n2 は反対側の媒質の屈折率。膜の向き(基板の側)は透過と同じく、反対側が空気でなければ反対側が基板、空気なら
入射側が基板。位相は基板の面を面の頂点に置いた値(膜の側から入るときは鏡と同じく exp(2 i k n1 cosθ1 Σ d_j)
を掛け、基板の側から入るときは掛けない)。暗号化された膜は特性行列モデルの M から r を求める(透過の実測表
だけでは求められない)
Source§impl Coatings
impl Coatings
Sourcepub fn for_system(sys: &System) -> Result<Coatings>
pub fn for_system(sys: &System) -> Result<Coatings>
系の膜ファイル(zmx の COFN)。なければ空(膜なし・理想膜・実測表だけ)
Sourcepub fn apply_registered(&mut self, sys: &System) -> usize
pub fn apply_registered(&mut self, sys: &System) -> usize
系 sys が使う膜を、今の拡張の表(crate::ext::current)の登録した膜の一覧から入れる(優先の順は
crate::usercoating)。入れたものは Coatings::registered に記録し、数を返す。膜ファイルに同じ名前の膜が
あれば膜ファイルから外して一覧の方を使い、系に書いた表と同じ名前なら表の方を使う(どちらも注意を足す)
Sourcepub fn load_dir_for(&mut self, sys: &System, dir: &Path) -> Result<usize>
pub fn load_dir_for(&mut self, sys: &System, dir: &Path) -> Result<usize>
フォルダ dir から、系 sys が使う膜のうち膜ファイルで決まらないもの(暗号化された膜など)の
モデル・実測表を膜の名前で探して読む。ファイル名は <膜の名前>.lbcb・.lbcm・.lbct、
層のわかる近似の膜なら .lbcs(膜ファイルの形式で COAT とその材料の MATE)
(大文字小文字は区別しない。同じ膜で複数あれば lbcb・lbcm・lbct・lbcs の順に 1 つ)。
使う膜だけ読む。読んだものは Coatings::auto に記録し、読んだ数を返す。
後から Coatings::load_file で読んだもの(明示の指定)が勝つ
pub fn add_measured(&mut self, key: &str, m: Measured) -> Result<()>
Sourcepub fn kind(&self, key: &str) -> CoatKind
pub fn kind(&self, key: &str) -> CoatKind
境界 key の膜の扱い(Coatings::prepare もこの判定で係数の作り方を選ぶ)
Sourcepub fn load_models(&mut self, path: &Path) -> Result<usize>
pub fn load_models(&mut self, path: &Path) -> Result<usize>
膜のモデルのファイル(parse_models の形式)を読み、モデルの数を返す
Sourcepub fn load_file(&mut self, path: &Path) -> Result<usize>
pub fn load_file(&mut self, path: &Path) -> Result<usize>
実測表(LBCT)か膜のモデル(LBCM)のファイルを、1 行目で見分けて読む。拡張子を足した膜のファイル形式
(crate::ext::Ext::add_coating_source)が読むなら、それで読んだ膜をすべて入れる(読んだ膜の数を返す)
Sourcepub fn load_measured(&mut self, path: &Path) -> Result<usize>
pub fn load_measured(&mut self, path: &Path) -> Result<usize>
実測表のファイル(parse_measured の形式)を読み、表の数を返す
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Coatings
impl !UnwindSafe for Coatings
impl Freeze for Coatings
impl Send for Coatings
impl Sync for Coatings
impl Unpin for Coatings
impl UnsafeUnpin for Coatings
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,
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