17 #include "thermometer.h"
19 #include "flowcontroller.h"
20 #include "primarydriverwiththread.h"
21 #include "xnodeconnector.h"
24 class Ui_FrmTempControl;
37 XChannel(
const char *name,
bool runtime,
38 Transaction &tr_list,
const shared_ptr<XThermometerList> &list);
39 const shared_ptr<XItemNode<XThermometerList, XThermometer> > &thermometer()
const {
return m_thermometer;}
40 const shared_ptr<XThermometerList> &thermometers()
const {
return m_thermometers;}
41 const shared_ptr<XComboNode> &excitation()
const {
return m_excitation;}
43 const shared_ptr<XItemNode<XThermometerList, XThermometer> > m_thermometer;
44 const shared_ptr<XComboNode> m_excitation;
45 const shared_ptr<XThermometerList> m_thermometers;
50 const shared_ptr<XChannelList> &channels()
const {
return m_channels;}
53 const shared_ptr<XItemNode<XChannelList, XChannel> > ¤tChannel(
unsigned int lp)
const {
return loop(lp)->m_currentChannel;}
54 const shared_ptr<XDoubleNode> &targetTemp(
unsigned int lp)
const {
return loop(lp)->m_targetTemp;}
55 const shared_ptr<XDoubleNode> &manualPower(
unsigned int lp)
const {
return loop(lp)->m_manualPower;}
56 const shared_ptr<XDoubleNode> &prop(
unsigned int lp)
const {
return loop(lp)->m_prop;}
57 const shared_ptr<XDoubleNode> &interval(
unsigned int lp)
const {
return loop(lp)->m_int;}
58 const shared_ptr<XDoubleNode> &deriv(
unsigned int lp)
const {
return loop(lp)->m_deriv;}
59 const shared_ptr<XComboNode> &heaterMode(
unsigned int lp)
const {
return loop(lp)->m_heaterMode;}
60 const shared_ptr<XComboNode> &powerRange(
unsigned int lp)
const {
return loop(lp)->m_powerRange;}
61 const shared_ptr<XDoubleNode> &heaterPower(
unsigned int lp)
const {
return loop(lp)->m_heaterPower;}
62 const shared_ptr<XDoubleNode> &sourceTemp(
unsigned int lp)
const {
return loop(lp)->m_sourceTemp;}
63 const shared_ptr<XDoubleNode> &powerMax(
unsigned int lp)
const {
return loop(lp)->m_powerMax;}
64 const shared_ptr<XDoubleNode> &powerMin(
unsigned int lp)
const {
return loop(lp)->m_powerMin;}
66 const shared_ptr<XDoubleNode> &
stabilized(
unsigned int lp)
const {
return loop(lp)->m_stabilized;}
68 const shared_ptr<XItemNode<XDriverList, XDCSource, XFlowControllerDriver> > &
extDevice(
unsigned int lp)
const {
return loop(lp)->m_extDevice;}
69 const shared_ptr<XComboNode> &extDCSourceChannel(
unsigned int lp)
const {
return loop(lp)->m_extDCSourceChannel;}
70 const shared_ptr<XBoolNode> &extIsPositive(
unsigned int lp)
const {
return loop(lp)->m_extIsPositive;}
85 bool multiread, std::initializer_list<XString> channel_names,
86 std::initializer_list<XString> excitations,
87 std::initializer_list<XString> loop_names);
90 virtual double getRaw(shared_ptr<XChannel> &channel) = 0;
92 virtual double getTemp(shared_ptr<XChannel> &channel) = 0;
95 virtual double getHeater(
unsigned int loop) = 0;
99 bool hasExtDevice(
const Snapshot &shot,
unsigned int lp)
const {
return loop(lp)->hasExtDevice(shot);}
101 virtual void onPChanged(
unsigned int loop,
double p) = 0;
102 virtual void onIChanged(
unsigned int loop,
double i) = 0;
103 virtual void onDChanged(
unsigned int loop,
double d) = 0;
104 virtual void onTargetTempChanged(
unsigned int loop,
double temp) = 0;
105 virtual void onManualPowerChanged(
unsigned int loop,
double pow) = 0;
106 virtual void onHeaterModeChanged(
unsigned int loop,
int mode) = 0;
107 virtual void onPowerRangeChanged(
unsigned int loop,
int range) = 0;
108 virtual void onPowerMaxChanged(
unsigned int loop,
double v) = 0;
109 virtual void onPowerMinChanged(
unsigned int loop,
double v) = 0;
110 virtual void onCurrentChannelChanged(
unsigned int loop,
const shared_ptr<XChannel> &ch) = 0;
112 virtual void onExcitationChanged(
const shared_ptr<XChannel> &ch,
int exc) = 0;
114 shared_ptr<XChannelList> m_channels;
118 Loop(
const char *name,
bool runtime, shared_ptr<XTempControl>,
Transaction &tr,
119 unsigned int idx,
Transaction &tr_meas,
const shared_ptr<XMeasure> &meas);
121 weak_ptr<XTempControl> m_tempctrl;
122 const unsigned int m_idx;
123 shared_ptr<XItemNode<XChannelList, XChannel> > m_currentChannel;
124 const shared_ptr<XDoubleNode> m_targetTemp;
125 const shared_ptr<XDoubleNode> m_manualPower;
126 const shared_ptr<XDoubleNode> m_prop, m_int, m_deriv;
127 const shared_ptr<XComboNode> m_heaterMode;
128 const shared_ptr<XComboNode> m_powerRange;
129 const shared_ptr<XDoubleNode> m_powerMax, m_powerMin;
130 const shared_ptr<XDoubleNode> m_heaterPower, m_sourceTemp;
134 const shared_ptr<XItemNode<XDriverList, XDCSource, XFlowControllerDriver> > m_extDevice;
135 const shared_ptr<XComboNode> m_extDCSourceChannel;
136 const shared_ptr<XBoolNode> m_extIsPositive;
140 void update(
double temp);
143 bool hasExtDevice(
const Snapshot &shot)
const {
144 return shared_ptr<XDCSource>(shot[ *m_extDevice]) ||
145 shared_ptr<XFlowControllerDriver>(shot[ *m_extDevice]);
160 std::deque<xqcon_ptr> m_conUIs;
162 shared_ptr<XListener> m_lsnOnPChanged, m_lsnOnIChanged, m_lsnOnDChanged,
163 m_lsnOnTargetTempChanged, m_lsnOnManualPowerChanged, m_lsnOnHeaterModeChanged,
164 m_lsnOnPowerMaxChanged, m_lsnOnPowerMinChanged,
165 m_lsnOnPowerRangeChanged, m_lsnOnCurrentChannelChanged,
166 m_lsnOnSetupChannelChanged, m_lsnOnExtDeviceChanged;
169 double m_pidLastTemp;
176 std::deque<shared_ptr<Loop> > m_loops;
177 shared_ptr<Loop> loop(
unsigned int lp) {
return m_loops.at(lp);}
178 const shared_ptr<Loop> loop(
unsigned int lp)
const {
return m_loops.at(lp);}
180 shared_ptr<XItemNode<XChannelList, XChannel> > m_setupChannel;
182 shared_ptr<XListener> m_lsnOnSetupChannelChanged, m_lsnOnExcitationChanged;
187 std::deque<shared_ptr<XScalarEntry> > m_entry_temps;
188 std::deque<shared_ptr<XScalarEntry> > m_entry_raws;
194 m_conExcitation, m_conThermometer;