forked from M-Labs/kirdy
gui, ld: term_status -> term_50ohm
- term_status (Is50Ohm / Not50Ohm) -> term_50ohm (On/Off)
This commit is contained in:
parent
3737c2ed59
commit
ec5bf1d6b6
@ -223,7 +223,7 @@ class Device:
|
||||
'ld_i_set': 0.0, # Laser Diode Output Current (A)
|
||||
'pd_i': 2.0000002e-06, # Internal Photodiode Monitor current (A)
|
||||
'pd_pwr': None, # Power Readings from Internal Photodiode (W). Return None if pd_mon parameter(s) are not defined.
|
||||
'term_status': 'Is50Ohm' # Is the Low Frequency Modulation Input's Impedance 50 Ohm? (Is50Ohm/Not50Ohm)
|
||||
'term_50ohm': 'Is50Ohm' # Is the Low Frequency Modulation Input's Impedance 50 Ohm? (On/Off)
|
||||
},
|
||||
'thermostat': {
|
||||
'pwr_on': False, # Tec Power is On (True/False)
|
||||
|
@ -332,7 +332,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
{'name': 'LD Current Set', 'type': 'float', 'suffix': 'A', 'siPrefix': True, 'readonly': True},
|
||||
{'name': 'PD Current', 'type': 'float', 'suffix': 'A', 'siPrefix': True, 'readonly': True},
|
||||
{'name': 'PD Power', 'type': 'float', 'suffix': 'W', 'siPrefix': True, 'readonly': True},
|
||||
{'name': 'LF Mod Impedance', 'type': 'list', 'limits': ['Is50Ohm', 'Not50Ohm'], 'readonly': True}
|
||||
{'name': 'LF Mod Termination (50 Ohm)', 'type': 'list', 'limits': ['On', 'Off'], 'readonly': True}
|
||||
]},
|
||||
{'name': 'Output Config', 'expanded': True, 'type': 'group', 'children': [
|
||||
{'name': 'LD Current Set', 'type': 'float', 'value': 0, 'step': 1, 'decimals': 6, 'limits': (0, 1),
|
||||
@ -818,7 +818,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.params[1].child('Readings', 'PD Power').setValue(report["pd_pwr"])
|
||||
else:
|
||||
self.params[1].child('Readings', 'PD Power').setValue(0)
|
||||
self.params[1].child('Readings', 'LF Mod Impedance').setValue(report["term_status"])
|
||||
self.params[1].child('Readings', 'LF Mod Termination (50 Ohm)').setValue(report["term_50ohm"])
|
||||
except Exception as e:
|
||||
logging.error(f"Params tree cannot be updated. Data:{report}", exc_info=True)
|
||||
|
||||
|
@ -10,7 +10,7 @@ use uom::si::{electric_current::{ampere, milliampere},
|
||||
power::milliwatt};
|
||||
|
||||
use crate::{device::sys_timer::sleep,
|
||||
laser_diode::{ld_ctrl::{Impedance, LdCtrl},
|
||||
laser_diode::{ld_ctrl::{Impedance50Ohm, LdCtrl},
|
||||
ld_current_out_ctrl_timer::LdCurrentOutCtrlTimer,
|
||||
ld_pwr_exc_protector::{self, LdPwrExcProtector},
|
||||
pd_mon_params}};
|
||||
@ -66,7 +66,7 @@ pub struct StatusReport {
|
||||
ld_i_set: ElectricCurrent,
|
||||
pd_i: ElectricCurrent,
|
||||
pd_pwr: Power,
|
||||
term_status: Impedance,
|
||||
term_50ohm: Impedance50Ohm,
|
||||
}
|
||||
|
||||
pub struct LdDrive {
|
||||
@ -210,7 +210,7 @@ impl LdDrive {
|
||||
self.settings.default_pwr_on = pwr_on;
|
||||
}
|
||||
|
||||
pub fn get_term_status(&mut self) -> Impedance {
|
||||
pub fn get_term_status(&mut self) -> Impedance50Ohm {
|
||||
self.ctrl.get_lf_mod_in_impedance()
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ impl LdDrive {
|
||||
ld_i_set: ld_i_set,
|
||||
pd_i: self.get_pd_i(),
|
||||
pd_pwr: self.get_pd_pwr(),
|
||||
term_status: self.get_term_status(),
|
||||
term_50ohm: self.get_term_status(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,9 +11,9 @@ use uom::si::{electric_current::ampere,
|
||||
use crate::laser_diode::max5719::{self, Dac};
|
||||
|
||||
#[derive(Deserialize, Serialize, Debug, Clone, Copy)]
|
||||
pub enum Impedance {
|
||||
Is50Ohm,
|
||||
Not50Ohm,
|
||||
pub enum Impedance50Ohm {
|
||||
On,
|
||||
Off,
|
||||
}
|
||||
|
||||
pub trait ChannelPins {
|
||||
@ -66,11 +66,11 @@ impl LdCtrl {
|
||||
self.phy.current_source_short_pin.set_high();
|
||||
}
|
||||
|
||||
pub fn get_lf_mod_in_impedance(&mut self) -> Impedance {
|
||||
pub fn get_lf_mod_in_impedance(&mut self) -> Impedance50Ohm {
|
||||
if self.phy.termination_status_pin.is_high() {
|
||||
Impedance::Is50Ohm
|
||||
Impedance50Ohm::On
|
||||
} else {
|
||||
Impedance::Not50Ohm
|
||||
Impedance50Ohm::Off
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user