reda_sp/model/components/
bjt.rs

1use derive_builder::Builder;
2
3use crate::ToSpice;
4
5#[derive(Debug, Clone, Builder)]
6#[builder(setter(strip_option, into))]
7pub struct BJT {
8    pub name: String,         // Qname
9    pub collector: String,    // C
10    pub base: String,         // B
11    pub emitter: String,      // E
12    pub model_name: String,   // BJT_modelName
13}
14
15impl ToSpice for BJT {
16    fn to_spice(&self) -> String {
17        format!(
18            "Q{} {} {} {} {}",
19            self.name,
20            self.collector,
21            self.base,
22            self.emitter,
23            self.model_name
24        )
25    }
26}