fourres.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 fourresH
15 #define fourresH
16 //---------------------------------------------------------------------------
17 #include "dmm.h"
18 #include "dcsource.h"
19 #include "secondarydriver.h"
20 
21 class XScalarEntry;
22 class Ui_FrmFourRes;
24 
25 //! Measure Resistance By Switching Polarity of DC Source
26 class XFourRes : public XSecondaryDriver {
27 public:
28  XFourRes(const char *name, bool runtime,
29  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
30  ~XFourRes ();
31 
32  //! Shows all forms belonging to driver
33  virtual void showForms();
34 protected:
35  //! This function is called when a connected driver emit a signal
36  virtual void analyze(Transaction &tr, const Snapshot &shot_emitter, const Snapshot &shot_others,
37  XDriver *emitter) 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  //! Checks if the connected drivers have valid time stamps.
42  //! \return true if dependency is resolved.
43  //! This function must be reentrant unlike analyze().
44  virtual bool checkDependency(const Snapshot &shot_this,
45  const Snapshot &shot_emitter, const Snapshot &shot_others,
46  XDriver *emitter) const;
47 public:
49  private:
50  friend class XFourRes;
51  double value_inverted;
52  };
53 
54  const shared_ptr<XScalarEntry> &resistance() const {return m_resistance;}
55 
56  const shared_ptr<XItemNode < XDriverList, XDMM > > &dmm() const {return m_dmm;}
57  const shared_ptr<XItemNode < XDriverList, XDCSource > > &dcsource() const {return m_dcsource;}
58 
59  const shared_ptr<XBoolNode> &control() const {return m_control;}
60  //! Wait before reading value from DMM [s].
61 
62 private:
63  const shared_ptr<XScalarEntry> m_resistance;
64 
65  const shared_ptr<XItemNode < XDriverList, XDMM> > m_dmm;
66  const shared_ptr<XItemNode < XDriverList, XDCSource > > m_dcsource;
67  const shared_ptr<XBoolNode> m_control;
68 
69  xqcon_ptr m_conDMM, m_conDCSource, m_conControl, m_conRes;
70 
71  const qshared_ptr<FrmFourRes> m_form;
72 };
73 
74 #endif

Generated for KAME4 by  doxygen 1.8.3