ODIN
seqphase.h
1 /***************************************************************************
2  seqphase.h - description
3  -------------------
4  begin : Sun Apr 4 2004
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 
19 
20 #ifndef SEQPHASE_H
21 #define SEQPHASE_H
22 
23 
24 #include <odinseq/seqclass.h>
25 #include <odinseq/seqvec.h>
26 #include <odinseq/seqdriver.h>
27 
29 
34 class SeqPhaseDriver : public SeqDriverBase {
35 
36  public:
37  SeqPhaseDriver() {}
38  virtual ~SeqPhaseDriver() {}
39 
40  virtual void prep_driver(const dvector& phaselist) = 0;
41 
42  virtual unsigned int get_phaselistindex(const dvector& phaselist) const = 0;
43 
44  virtual STD_string get_loopcommand(const dvector& phaselist) const = 0;
45 
46  virtual svector get_phasevec_commands(const STD_string& iterator, const STD_string& instr) const = 0;
47 
48  virtual SeqPhaseDriver* clone_driver() const = 0;
49 };
50 
51 
53 
54 class SeqFreqChan; // forward declaration
55 
60 class SeqPhaseListVector : public SeqVector, public virtual SeqClass {
61 
62  private: //make everything private so that only SeqFreqChan can use it
63 
64  SeqPhaseListVector(const STD_string& object_label = "unnamedSeqPhaseListVector", const dvector& phase_list=0 );
65 
67 
68  SeqPhaseListVector& operator = (const SeqPhaseListVector& spl);
69 
73  SeqPhaseListVector& set_phaselist(const dvector& pl);
74 
78  dvector get_phaselist() const {return phaselist;}
79 
83  unsigned int get_phaselistindex() const;
84 
88  double get_phase() const;
89 
90 
91  // overloaded functions of SeqVector
92  unsigned int get_vectorsize() const {return phaselist.size();}
93  STD_string get_loopcommand() const;
94  svector get_vector_commands(const STD_string& iterator) const;
95  bool prep_iteration() const;
96  bool is_qualvector() const {return false;}
97 
98  private:
99  friend class SeqFreqChan;
100 
101 
102 
103  // overwriting virtual functions from SeqClass
104  bool prep();
105 
106  // the hardware driver
107  mutable SeqDriverInterface<SeqPhaseDriver> phasedriver;
108 
109  dvector phaselist; // in deg
110 
111  // the frequency object in which this object is embedded
112  SeqFreqChan* user;
113 
114 };
115 
116 
117 
118 #endif