00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SEQDEC_H
00019 #define SEQDEC_H
00020
00021 #include <tjutils/tjembed.h>
00022
00023 #include <odinseq/seqlist.h>
00024 #include <odinseq/seqfreq.h>
00025 #include <odinseq/seqsimvec.h>
00026 #include <odinseq/seqdriver.h>
00027
00028
00029
00030
00035 class SeqDecouplingDriver : public SeqDriverBase {
00036
00037 public:
00038 SeqDecouplingDriver() {}
00039 virtual ~SeqDecouplingDriver() {}
00040
00041 virtual bool prep_driver(double decdur, int channel, float decpower, const STD_string& program, double pulsedur) = 0;
00042 virtual void event(eventContext& context, double start) const = 0;
00043
00044 virtual double get_preduration() const = 0;
00045 virtual double get_postduration() const = 0;
00046
00047 virtual STD_string get_preprogram(programContext& context, const STD_string& iteratorcommand) const = 0;
00048 virtual STD_string get_postprogram(programContext& context) const = 0;
00049
00050 virtual SeqDecouplingDriver* clone_driver() const = 0;
00051 };
00052
00053
00055
00056
00057
00058
00070 class SeqDecoupling : public SeqObjList, public Embed<SeqDecoupling,SeqObjBase>, public SeqFreqChan {
00071
00072 public:
00073
00086 SeqDecoupling(const STD_string& object_label,const STD_string& nucleus,float decpower,const dvector& freqlist=0,
00087 const STD_string decprog="",float decpulsduration=0.0);
00088
00092 SeqDecoupling(const SeqDecoupling& sd);
00093
00097 SeqDecoupling(const STD_string& object_label="unnamedSeqDecoupling");
00098
00099
00100
00105 SeqDecoupling& operator () (const SeqObjBase& so);
00106
00107
00108
00112 float get_decpower() const {return power;}
00113
00117 void set_decpower(float p) {power=p;}
00118
00122 STD_string get_program() const;
00123
00127 void set_program(const STD_string& p);
00128
00132 double get_pulsduration() const;
00133
00137 void set_pulsduration(float d);
00138
00139
00143 SeqDecoupling& operator = (const SeqDecoupling& sd);
00144
00145
00146
00147 double get_duration() const;
00148 unsigned int event(eventContext& context) const;
00149
00150
00151
00152 STD_string get_program(programContext& context) const;
00153 double get_freqchan_duration() const {return get_duration();}
00154 unsigned int get_freqlistindex() const {return 2;}
00155 const SeqVector& get_freqlist_vector() const;
00156
00157
00158 SeqValList get_freqvallist(freqlistAction action) const;
00159
00160 void clear_container();
00161
00162 private:
00163 friend class Embed<SeqDecoupling,SeqObjBase>;
00164
00165 int set_body(const SeqObjBase& so);
00166
00167
00168 bool prep();
00169
00170 float power;
00171 STD_string decprogram;
00172 double pulsduration;
00173
00174
00175 mutable SeqDriverInterface<SeqDecouplingDriver> decdriver;
00176
00177
00178 SeqSimultanVector instvec;
00179
00180 };
00181
00186 #endif