seqdec.h
1 /***************************************************************************
2  seqdec.h - description
3  -------------------
4  begin : Fri Sep 7 2001
5  copyright : (C) 2000-2015 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 #ifndef SEQDEC_H
19 #define SEQDEC_H
20 
21 #include <tjutils/tjembed.h>
22 
23 #include <odinseq/seqlist.h>
24 #include <odinseq/seqfreq.h>
25 #include <odinseq/seqsimvec.h>
26 #include <odinseq/seqdriver.h>
27 
28 
29 
30 
35 class SeqDecouplingDriver : public SeqDriverBase {
36 
37  public:
39  virtual ~SeqDecouplingDriver() {}
40 
41  virtual bool prep_driver(double decdur, int channel, float decpower, const STD_string& program, double pulsedur) = 0;
42  virtual void event(eventContext& context, double start) const = 0;
43 
44  virtual double get_preduration() const = 0;
45  virtual double get_postduration() const = 0;
46 
47  virtual STD_string get_preprogram(programContext& context, const STD_string& iteratorcommand) const = 0;
48  virtual STD_string get_postprogram(programContext& context) const = 0;
49 
50  virtual SeqDecouplingDriver* clone_driver() const = 0;
51 };
52 
53 
55 
56 
57 
58 
70 class SeqDecoupling : public SeqObjList, public Embed<SeqDecoupling,SeqObjBase>, public SeqFreqChan {
71 
72  public:
73 
86  SeqDecoupling(const STD_string& object_label,const STD_string& nucleus,float decpower,const dvector& freqlist=0,
87  const STD_string decprog="",float decpulsduration=0.0);
88 
92  SeqDecoupling(const SeqDecoupling& sd);
93 
97  SeqDecoupling(const STD_string& object_label="unnamedSeqDecoupling");
98 
99 
100 
105  SeqDecoupling& operator () (const SeqObjBase& so);
106 
107 
108 
112  float get_decpower() const {return power;}
113 
117  void set_decpower(float p) {power=p;}
118 
122  STD_string get_program() const;
123 
127  void set_program(const STD_string& p);
128 
132  double get_pulsduration() const;
133 
137  void set_pulsduration(float d);
138 
139 
143  SeqDecoupling& operator = (const SeqDecoupling& sd);
144 
145 
146  // implementing virtual functions of SeqTreeObj
147  double get_duration() const;
148  unsigned int event(eventContext& context) const;
149 
150 
151  // overwriting virtual function from SeqFreqChan
152  STD_string get_program(programContext& context) const;
153  double get_freqchan_duration() const {return get_duration();}
154  unsigned int get_freqlistindex() const {return 2;}
155  const SeqVector& get_freqlist_vector() const;
156 
157 
158  SeqValList get_freqvallist(freqlistAction action) const;
159 
160  void clear_container();
161 
162  private:
163  friend class Embed<SeqDecoupling,SeqObjBase>;
164 
165  int set_body(const SeqObjBase& so);
166 
167  // overwriting virtual functions from SeqClass
168  bool prep();
169 
170  float power;
171  STD_string decprogram;
172  double pulsduration;
173 
174 
175  mutable SeqDriverInterface<SeqDecouplingDriver> decdriver;
176 
177 
178  SeqSimultanVector instvec;
179 
180 };
181 
186 #endif
virtual bool prep()
Definition: seqclass.h:116
void set_decpower(float p)
Definition: seqdec.h:117
Container for sequence objects.
Definition: seqlist.h:86
virtual void clear_container()
Definition: seqclass.h:102
unsigned int get_freqlistindex() const
Definition: seqdec.h:154
freqlistAction
Definition: seqtree.h:102
Decoupling period.
Definition: seqdec.h:70
double get_freqchan_duration() const
Definition: seqdec.h:153
float get_decpower() const
Definition: seqdec.h:112