lockinamp.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 #ifndef lockinampH
15 #define lockinampH
16 //---------------------------------------------------------------------------
17 #include "primarydriverwiththread.h"
18 #include "xnodeconnector.h"
19 
20 class XScalarEntry;
21 class QMainWindow;
22 class Ui_FrmLIA;
24 
26 public:
27  XLIA(const char *name, bool runtime,
28  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
29  //! usually nothing to do
30  virtual ~XLIA() {}
31  //! Shows all forms belonging to driver
32  virtual void showForms();
33 protected:
34  //! This function will be called when raw data are written.
35  //! Implement this function to convert the raw data to the record (Payload).
36  //! \sa analyze()
37  virtual void analyzeRaw(RawDataReader &reader, Transaction &tr) throw (XRecordError&);
38  //! This function is called after committing XPrimaryDriver::analyzeRaw() or XSecondaryDriver::analyze().
39  //! This might be called even if the record is invalid (time() == false).
40  virtual void visualize(const Snapshot &shot);
41 
42  //! driver specific part below
43  const shared_ptr<XScalarEntry> &valueX() const {return m_valueX;}
44  const shared_ptr<XScalarEntry> &valueY() const {return m_valueY;}
45 
46  const shared_ptr<XDoubleNode> & output() const {return m_output;}
47  const shared_ptr<XDoubleNode> & frequency() const {return m_frequency;}
48  const shared_ptr<XComboNode> & sensitivity() const {return m_sensitivity;}
49  const shared_ptr<XComboNode> & timeConst() const {return m_timeConst;}
50  const shared_ptr<XBoolNode> & autoScaleX() const {return m_autoScaleX;}
51  const shared_ptr<XBoolNode> & autoScaleY() const {return m_autoScaleY;}
52  const shared_ptr<XDoubleNode> & fetchFreq() const {return m_fetchFreq;}
53 protected:
54  virtual void get(double *cos, double *sin) = 0;
55  virtual void changeOutput(double volt) = 0;
56  virtual void changeFreq(double freq) = 0;
57  virtual void changeSensitivity(int) = 0;
58  virtual void changeTimeConst(int) = 0;
59 private:
60  const shared_ptr<XScalarEntry> m_valueX, m_valueY;
61 
62  const shared_ptr<XDoubleNode> m_output;
63  const shared_ptr<XDoubleNode> m_frequency;
64  const shared_ptr<XComboNode> m_sensitivity;
65  const shared_ptr<XComboNode> m_timeConst;
66  const shared_ptr<XBoolNode> m_autoScaleX;
67  const shared_ptr<XBoolNode> m_autoScaleY;
68  const shared_ptr<XDoubleNode> m_fetchFreq; //Data Acquision Frequency to Time Constant
69  shared_ptr<XListener> m_lsnOutput, m_lsnSens, m_lsnTimeConst, m_lsnFreq;
70  xqcon_ptr m_conSens, m_conTimeConst, m_conOutput, m_conFreq;
71  xqcon_ptr m_conAutoScaleX, m_conAutoScaleY, m_conFetchFreq;
72 
73  const qshared_ptr<FrmLIA> m_form;
74 
75  void onOutputChanged(const Snapshot &shot, XValueNodeBase *);
76  void onFreqChanged(const Snapshot &shot, XValueNodeBase *);
77  void onSensitivityChanged(const Snapshot &shot, XValueNodeBase *);
78  void onTimeConstChanged(const Snapshot &shot, XValueNodeBase *);
79 
80  void *execute(const atomic<bool> &);
81 
82 };
83 
84 
85 #endif

Generated for KAME4 by  doxygen 1.8.3