funcsynth.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 funcsynthH
15 #define funcsynthH
16 //---------------------------------------------------------------------------
17 #include "primarydriver.h"
18 #include "xnodeconnector.h"
19 
20 class QMainWindow;
21 class Ui_FrmFuncSynth;
23 
24 class XFuncSynth : public XPrimaryDriver {
25 public:
26  XFuncSynth(const char *name, bool runtime,
27  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
28  //! usually nothing to do
29  virtual ~XFuncSynth() {}
30  //! Shows all forms belonging to driver
31  virtual void showForms();
32 protected:
33  //! Starts up your threads, connects GUI, and activates signals.
34  virtual void start();
35  //! Shuts down your threads, unconnects GUI, and deactivates signals
36  //! This function may be called even if driver has already stopped.
37  virtual void stop();
38 
39  //! This function will be called when raw data are written.
40  //! Implement this function to convert the raw data to the record (Payload).
41  //! \sa analyze()
42  virtual void analyzeRaw(RawDataReader &reader, Transaction &tr) throw (XRecordError&);
43  //! This function is called after committing XPrimaryDriver::analyzeRaw() or XSecondaryDriver::analyze().
44  //! This might be called even if the record is invalid (time() == false).
45  virtual void visualize(const Snapshot &shot);
46 
47  //! driver specific part below
48  const shared_ptr<XBoolNode> &output() const {return m_output;}
49  const shared_ptr<XTouchableNode> &trig() const {return m_trig;} //!< trigger to burst
50  const shared_ptr<XComboNode> &mode() const {return m_mode;}
51  const shared_ptr<XComboNode> &function() const {return m_function;}
52  const shared_ptr<XDoubleNode> &freq() const {return m_freq;} //!< [Hz]
53  const shared_ptr<XDoubleNode> &amp() const {return m_amp;} //!< [Vp-p]
54  const shared_ptr<XDoubleNode> &phase() const {return m_phase;} //!< [deg.]
55  const shared_ptr<XDoubleNode> &offset() const {return m_offset;} //!< [V]
56 protected:
57  virtual void onOutputChanged(const Snapshot &shot, XValueNodeBase *) = 0;
58  virtual void onTrigTouched(const Snapshot &shot, XTouchableNode *) = 0;
59  virtual void onModeChanged(const Snapshot &shot, XValueNodeBase *) = 0;
60  virtual void onFunctionChanged(const Snapshot &shot, XValueNodeBase *) = 0;
61  virtual void onFreqChanged(const Snapshot &shot, XValueNodeBase *) = 0;
62  virtual void onAmpChanged(const Snapshot &shot, XValueNodeBase *) = 0;
63  virtual void onPhaseChanged(const Snapshot &shot, XValueNodeBase *) = 0;
64  virtual void onOffsetChanged(const Snapshot &shot, XValueNodeBase *) = 0;
65 private:
66  const shared_ptr<XBoolNode> m_output;
67  const shared_ptr<XTouchableNode> m_trig;
68  const shared_ptr<XComboNode> m_mode;
69  const shared_ptr<XComboNode> m_function;
70  const shared_ptr<XDoubleNode> m_freq;
71  const shared_ptr<XDoubleNode> m_amp;
72  const shared_ptr<XDoubleNode> m_phase;
73  const shared_ptr<XDoubleNode> m_offset;
74  shared_ptr<XListener> m_lsnOutput, m_lsnMode, m_lsnFunction,
75  m_lsnFreq, m_lsnAmp, m_lsnPhase, m_lsnOffset;
76  shared_ptr<XListener> m_lsnTrig;
77  xqcon_ptr m_conOutput, m_conTrig, m_conMode, m_conFunction,
78  m_conFreq, m_conAmp, m_conPhase, m_conOffset;
79 
80  const qshared_ptr<FrmFuncSynth> m_form;
81 };
82 
83 #endif

Generated for KAME4 by  doxygen 1.8.3