14 #ifndef AUTOLCTUNER_H_
15 #define AUTOLCTUNER_H_
17 #include "secondarydriver.h"
19 #include "networkanalyzer.h"
21 class Ui_FrmAutoLCTuner;
30 Transaction &tr_meas,
const shared_ptr<XMeasure> &meas);
40 XDriver *emitter)
throw (XRecordError&);
51 const shared_ptr<XItemNode<XDriverList, XMotorDriver> > &stm1()
const {
return m_stm1;}
52 const shared_ptr<XItemNode<XDriverList, XMotorDriver> > &stm2()
const {
return m_stm2;}
53 const shared_ptr<XItemNode<XDriverList, XNetworkAnalyzer> > &netana()
const {
return m_netana;}
56 const shared_ptr<XBoolNode> &
tuning()
const {
return m_tuning;}
57 const shared_ptr<XBoolNode> &succeeded()
const {
return m_succeeded;}
58 const shared_ptr<XDoubleNode> &target()
const {
return m_target;}
59 const shared_ptr<XDoubleNode> &reflectionTargeted()
const {
return m_reflectionTargeted;}
60 const shared_ptr<XDoubleNode> &reflectionRequired()
const {
return m_reflectionRequired;}
61 const shared_ptr<XBoolNode> &useSTM1()
const {
return m_useSTM1;}
62 const shared_ptr<XBoolNode> &useSTM2()
const {
return m_useSTM2;}
63 const shared_ptr<XTouchableNode> &abortTuning()
const {
return m_abortTuning;}
67 enum STAGE {STAGE_FIRST, STAGE_DCA, STAGE_DCB};
70 std::complex<double> ref_first, ref_plus_dCa;
71 double fmin_first, fmin_plus_dCa;
74 std::complex<double> dref_dCa, dref_dCb;
75 double dfmin_dCa, dfmin_dCb;
77 std::vector<std::complex<double> > trace;
81 double stm1_best, stm2_best;
82 std::complex<double> ref_f0_best;
84 enum MODE {TUNE_APPROACHING, TUNE_FINETUNE};
88 bool isTargetAbondoned;
91 const shared_ptr<XItemNode<XDriverList, XMotorDriver> > m_stm1, m_stm2;
92 const shared_ptr<XItemNode<XDriverList, XNetworkAnalyzer> > m_netana;
94 const shared_ptr<XBoolNode> m_tuning;
95 const shared_ptr<XBoolNode> m_succeeded;
96 const shared_ptr<XDoubleNode> m_target;
97 const shared_ptr<XDoubleNode> m_reflectionTargeted;
98 const shared_ptr<XDoubleNode> m_reflectionRequired;
99 const shared_ptr<XBoolNode> m_useSTM1, m_useSTM2;
100 const shared_ptr<XTouchableNode> m_abortTuning;
102 std::deque<xqcon_ptr> m_conUIs;
104 shared_ptr<XListener> m_lsnOnTargetChanged, m_lsnOnAbortTouched;
111 void determineNextC(
double &deltaC1,
double &deltaC2,
112 double x,
double x_err,
113 double y,
double y_err,
114 double dxdC1,
double dxdC2,
115 double dydC1,
double dydC2);
116 void abortTuningFromAnalyze(
Transaction &tr, std::complex<double> reff0);