00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SEQLIST_H
00021 #define SEQLIST_H
00022
00023
00024 #include <tjutils/tjlist.h>
00025
00026 #include <odinseq/seqobj.h>
00027 #include <odinseq/seqdriver.h>
00028 #include <odinseq/seqrotmatrixvector.h>
00029
00030
00031 #define _MIN_PPG_CMDSIZE_ 25
00032 #define _MIN_GP_CMDSIZE_ 50
00033
00034
00035
00036
00046 class SeqListDriver : public SeqDriverBase {
00047
00048 public:
00049 SeqListDriver() {}
00050 virtual ~SeqListDriver() {}
00051
00052 virtual STD_string pre_program (programContext& context, const SeqRotMatrixVector* rotmats) const = 0;
00053 virtual STD_string post_program(programContext& context, const SeqRotMatrixVector* rotmats) const = 0;
00054
00055 virtual STD_string get_itemprogram(const SeqTreeObj* item, programContext& context) const = 0;
00056
00057 virtual void pre_event (eventContext& context, const RotMatrix* rotmatrix) const = 0;
00058 virtual void post_event(eventContext& context, const RotMatrix* rotmatrix) const = 0;
00059
00060 virtual void pre_itemevent (const SeqTreeObj* item, eventContext& context) const = 0;
00061 virtual void post_itemevent(const SeqTreeObj* item, eventContext& context) const = 0;
00062
00063 virtual bool prep_driver() = 0;
00064
00065 virtual SeqListDriver* clone_driver() const = 0;
00066 };
00067
00072
00073
00074 class SeqObjLoop;
00075 class SeqDecoupling;
00076 class SeqGradObjInterface;
00077 class SeqGradChan;
00078 class SeqGradChanList;
00079
00087 class SeqObjList : public SeqObjBase, public List<SeqObjBase, const SeqObjBase*, const SeqObjBase& > {
00088
00089 public:
00090
00094 SeqObjList(const STD_string& object_label="unnamedSeqObjList");
00095
00099 SeqObjList(const SeqObjList& so);
00100
00101 ~SeqObjList();
00102
00106 SeqObjList& operator = (const SeqObjList& so);
00107
00111 SeqObjList& operator = (const SeqObjLoop& sl);
00112
00113
00117 SeqObjList& operator = (const SeqDecoupling& sd);
00118
00119
00123 SeqObjList& operator = (const SeqObjBase& soa);
00124
00128 SeqObjList& operator = (SeqGradObjInterface& sgoa) {clear(); return (*this)+=sgoa;}
00129
00133 SeqObjList& operator = (SeqGradChan& sgc) {clear(); return (*this)+=sgc;}
00134
00138 SeqObjList& operator = (SeqGradChanList& sgcl) {clear(); return (*this)+=sgcl;}
00139
00143 SeqObjList& operator += (const SeqObjBase& soa);
00144
00148 SeqObjList& operator += (SeqGradObjInterface& sgoa);
00149
00150
00154 SeqObjList& operator += (SeqGradChan& sgc);
00155
00159 SeqObjList& operator += (SeqGradChanList& sgcl);
00160
00161
00162
00168 SeqObjList& set_gradrotmatrixvector(const SeqRotMatrixVector& matrixVec) {gradrotmatrixvec.set_handled(&matrixVec); return *this;}
00169
00170
00171
00172
00173 STD_string get_program(programContext& context) const;
00174 unsigned int event(eventContext& context) const;
00175 double get_duration() const;
00176 STD_string get_properties() const;
00177 void query(queryContext& context) const;
00178 RecoValList get_recovallist(unsigned int reptimes, JDXkSpaceCoords& coords) const;
00179 SeqValList get_freqvallist(freqlistAction action) const;
00180 SeqValList get_delayvallist() const;
00181 double get_rf_energy() const;
00182
00183 protected:
00184
00185
00186 void clear_container() {clear();}
00187 bool prep();
00188
00189 private:
00190 friend class SeqGradChan;
00191 friend class SeqOperator;
00192
00193
00194 bool contains_list() const {return true;}
00195
00196
00197 mutable SeqDriverInterface<SeqListDriver> listdriver;
00198
00199 Handler<const SeqRotMatrixVector* > gradrotmatrixvec;
00200 static Handler<const SeqRotMatrixVector* > current_gradrotmatrixvec;
00201
00202 };
00203
00204 #endif