pulserdriverh8.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 #include "pulserdriver.h"
15 #include "chardevicedriver.h"
16 #include <vector>
17 
18 //! My pulser driver
19 class XH8Pulser : public XCharDeviceDriver<XPulser> {
20 public:
21  XH8Pulser(const char *name, bool runtime,
22  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
23  virtual ~XH8Pulser() {}
24 
25  struct Payload : public XPulser::Payload {
26  private:
27  friend class XH8Pulser;
28  struct h8ushort {unsigned char msb; unsigned char lsb;};
29  std::vector<h8ushort> m_zippedPatterns;
30  };
31 
32  //! time resolution [ms]
33  virtual double resolution() const;
34 protected:
35  //! Be called just after opening interface. Call start() inside this routine appropriately.
36  virtual void open() throw (XKameError &);
37  //! Sends patterns to pulser or turns off.
38  virtual void changeOutput(const Snapshot &shot, bool output, unsigned int blankpattern);
39  //! Converts RelPatList to native patterns
40  virtual void createNativePatterns(Transaction &tr);
41  virtual double resolutionQAM() const {return 0.0;}
42  //! minimum period of pulses [ms]
43  virtual double minPulseWidth() const;
44  //! existense of AO ports.
45  virtual bool hasQAMPorts() const {return false;}
46 private:
47  //! Add 1 pulse pattern
48  //! \param term a period to next pattern
49  //! \param pattern a pattern for digital, to appear
50  int pulseAdd(Transaction &tr, uint64_t term, uint16_t pattern);
51 };

Generated for KAME4 by  doxygen 1.8.3