35#ifndef PowerSupplyDialog_h
36#define PowerSupplyDialog_h
52 bool m_overcurrentShutdownEnabled;
53 bool m_softStartEnabled;
55 std::string m_setVoltage;
56 std::string m_setCurrent;
57 std::string m_setSSRamp;
59 float m_committedSetVoltage;
60 float m_committedSetCurrent;
61 float m_committedSSRamp;
64 : m_outputEnabled(
false)
65 , m_overcurrentShutdownEnabled(
false)
68 , m_committedSetVoltage(0)
69 , m_committedSetCurrent(0)
70 , m_committedSSRamp(0)
74 : m_outputEnabled(psu->GetPowerChannelActive(chan))
75 , m_overcurrentShutdownEnabled(psu->GetPowerOvercurrentShutdownEnabled(chan))
76 , m_softStartEnabled(psu->IsSoftStartEnabled(chan))
77 , m_committedSetVoltage(psu->GetPowerVoltageNominal(chan))
78 , m_committedSetCurrent(psu->GetPowerCurrentNominal(chan))
79 , m_committedSSRamp(psu->GetSoftStartRampTime(chan))
81 Unit volts(Unit::UNIT_VOLTS);
82 Unit amps(Unit::UNIT_AMPS);
83 Unit fs(Unit::UNIT_FS);
84 m_setVoltage = volts.
PrettyPrint(m_committedSetVoltage);
85 m_setCurrent = amps.
PrettyPrint(m_committedSetCurrent);
96 virtual bool DoRender();
98 void RefreshFromHardware();
100 std::shared_ptr<SCPIPowerSupply> GetPSU()
105 void AsyncLoadState();
117 std::shared_ptr<SCPIPowerSupply>
m_psu;
123 std::vector<std::future<PowerSupplyChannelUIState> > m_futureUIState;
Generic dialog box or other popup window.
Definition: Dialog.h:44
UI state for a single power supply channel.
Definition: PowerSupplyDialog.h:49
Definition: PowerSupplyDialog.h:91
double m_tstart
Timestamp of when we opened the dialog.
Definition: PowerSupplyDialog.h:114
std::vector< PowerSupplyChannelUIState > m_channelUIState
Channel state for the UI.
Definition: PowerSupplyDialog.h:126
std::shared_ptr< SCPIPowerSupply > m_psu
The PSU we're controlling.
Definition: PowerSupplyDialog.h:117
Session * m_session
Session handle so we can remove the PSU when closed.
Definition: PowerSupplyDialog.h:108
std::shared_ptr< PowerSupplyState > m_state
Current channel stats, live updated.
Definition: PowerSupplyDialog.h:120
void ChannelSettings(int i, float v, float a, float etime)
A single channel's settings.
Definition: PowerSupplyDialog.cpp:185
A Session stores all of the instrument configuration and other state the user has open.
Definition: Session.h:95
A unit of measurement, plus conversion to pretty-printed output.
Definition: Unit.h:57
std::string PrettyPrint(double value, int sigfigs=-1, bool useDisplayLocale=true) const
Prints a value with SI scaling factors.
Definition: Unit.cpp:587