reda_sp/model/sources/
ac.rs

1use reda_unit::{Angle, Current, Voltage};
2
3
4#[derive(Debug, Clone)]
5pub struct AcCurrent {
6    pub magnitude: Current, 
7    pub phase_deg: Angle,
8}
9
10#[derive(Debug, Clone)]
11pub struct AcVoltage {
12    pub magnitude: Voltage, 
13    pub phase_deg: Angle,
14}
15
16impl AcVoltage {
17    pub fn to_spice(&self) -> String {
18        format!(
19            "AC {} {}",
20            self.magnitude,
21            self.phase_deg
22        )
23    }
24}
25
26impl AcCurrent {
27    pub fn to_spice(&self) -> String {
28        format!(
29            "AC {} {}",
30            self.magnitude,
31            self.phase_deg
32        )
33    }
34}