thamwayprot.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 thamwayprotH
15 #define thamwayprotH
16 
17 #include "networkanalyzer.h"
18 #include "signalgenerator.h"
19 #include "chardevicedriver.h"
20 #include "xnodeconnector.h"
21 
22 //! Thamway Impedance Analyzer T300-1049A
23 class XThamwayT300ImpedanceAnalyzer : public XCharDeviceDriver<XNetworkAnalyzer> {
24 public:
25  XThamwayT300ImpedanceAnalyzer(const char *name, bool runtime,
26  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
27  virtual ~XThamwayT300ImpedanceAnalyzer() {}
28 protected:
29  virtual void onStartFreqChanged(const Snapshot &shot, XValueNodeBase *);
30  virtual void onStopFreqChanged(const Snapshot &shot, XValueNodeBase *);
31  virtual void onAverageChanged(const Snapshot &shot, XValueNodeBase *) {}
32  virtual void onPointsChanged(const Snapshot &shot, XValueNodeBase *);
33 
34  virtual void onCalOpenTouched(const Snapshot &shot, XTouchableNode *);
35  virtual void onCalShortTouched(const Snapshot &shot, XTouchableNode *);
36  virtual void onCalTermTouched(const Snapshot &shot, XTouchableNode *);
37  virtual void onCalThruTouched(const Snapshot &shot, XTouchableNode *) {}
38 
39  virtual void getMarkerPos(unsigned int num, double &x, double &y);
40  virtual void oneSweep();
41  virtual void startContSweep();
42  virtual void acquireTrace(shared_ptr<RawData> &, unsigned int ch);
43  //! Converts raw to dispaly-able
44  virtual void convertRaw(RawDataReader &reader, Transaction &tr) throw (XRecordError&);
45 
46  //! Be called just after opening interface. Call start() inside this routine appropriately.
47  virtual void open() throw (XKameError &);
48 };
49 
50 class Ui_FrmThamwayPROT;
52 
53 //! Thamway NMR PROT series
54 template <class tInterface>
55 class XThamwayPROT : public XCharDeviceDriver<XSG, tInterface> {
56 public:
57  XThamwayPROT(const char *name, bool runtime,
58  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
59  virtual ~XThamwayPROT() {}
60 
61  //! show all forms belonging to driver
62  virtual void showForms(); //!< overrides XSG::showForms()
63 
64  const shared_ptr<XDoubleNode> &rxGain() const {return m_rxGain;} //!< Receiver Gain [dB] (0 -- 95)
65  const shared_ptr<XDoubleNode> &rxPhase() const {return m_rxPhase;} //!< Receiver phase [deg.]
66  const shared_ptr<XDoubleNode> &rxLPFBW() const {return m_rxLPFBW;} //!< Receiver BW of LPF [kHz] (0 -- 200)
67 protected:
68  //! Starts up your threads, connects GUI, and activates signals.
69  virtual void start();
70  //! Shuts down your threads, unconnects GUI, and deactivates signals
71  //! This function may be called even if driver has already stopped.
72  virtual void stop();
73 
74  virtual void changeFreq(double mhz);
75  virtual void onFreqChanged(const Snapshot &shot, XValueNodeBase *node) {XSG::onFreqChanged(shot, node);}
76  virtual void onRFONChanged(const Snapshot &shot, XValueNodeBase *);
77  virtual void onOLevelChanged(const Snapshot &shot, XValueNodeBase *);
78  virtual void onFMONChanged(const Snapshot &shot, XValueNodeBase *) {}
79  virtual void onAMONChanged(const Snapshot &shot, XValueNodeBase *) {}
80  //! PROT features below
81  virtual void onRXGainChanged(const Snapshot &shot, XValueNodeBase *);
82  virtual void onRXPhaseChanged(const Snapshot &shot, XValueNodeBase *);
83  virtual void onRXLPFBWChanged(const Snapshot &shot, XValueNodeBase *);
84 private:
85  const shared_ptr<XDoubleNode> m_rxGain, m_rxPhase, m_rxLPFBW;
86 
87  shared_ptr<XListener> m_lsnRFON, m_lsnFreq, m_lsnOLevel;
88  shared_ptr<XListener> m_lsnRXGain, m_lsnRXPhase, m_lsnRXLPFBW;
89 
90  std::deque<xqcon_ptr> m_conUIs;
91 
92  const qshared_ptr<FrmThamwayPROT> m_form;
93 };
94 
95 //! Thamway NMR PROT series for GPIB, etc..
96 class XThamwayCharPROT : public XThamwayPROT<XCharInterface> {
97 public:
98  XThamwayCharPROT(const char *name, bool runtime,
99  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
100  virtual ~XThamwayCharPROT() {}
101 };
102 
103 #ifdef USE_EZUSB
104  #include "ezusbthamway.h"
106  public:
107  XThamwayMODCUSBInterface(const char *name, bool runtime, const shared_ptr<XDriver> &driver)
108  : XWinCUSBInterface(name, runtime, driver, 0u, "") {} //DIP-SW address should be 6 (=DEV_ADDR_PROT)
109  virtual ~XThamwayMODCUSBInterface() {}
110  };
111 
112  //! Thamway NMR PROT series for USB
113  class XThamwayUSBPROT : public XThamwayPROT<XThamwayMODCUSBInterface> {
114  public:
115  XThamwayUSBPROT(const char *name, bool runtime,
116  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
117  virtual ~XThamwayUSBPROT() {}
118  protected:
119  //! Starts up your threads, connects GUI, and activates signals.
120  virtual void start();
121  };
122 
123 #endif
124 
125 #endif

Generated for KAME4 by  doxygen 1.8.3