00001 /*************************************************************************** 00002 seqtrigg.h - description 00003 ------------------- 00004 begin : Tue Aug 13 2002 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef SEQTRIGG_H 00019 #define SEQTRIGG_H 00020 00021 #include <odinseq/seqobj.h> 00022 #include <odinseq/seqdriver.h> 00023 00024 00026 00031 class SeqTriggerDriver : public SeqDriverBase { 00032 00033 public: 00034 SeqTriggerDriver() {} 00035 virtual ~SeqTriggerDriver() {} 00036 00037 virtual double get_postduration() const = 0; 00038 00039 virtual bool prep_exttrigger(double duration) = 0; 00040 00041 virtual bool prep_halttrigger() = 0; 00042 00043 virtual bool prep_snaptrigger(const STD_string& snapshot_fname) = 0; 00044 00045 virtual bool prep_resettrigger() = 0; 00046 00047 virtual void event(eventContext& context, double start) const = 0; 00048 00049 virtual STD_string get_program(programContext& context) const = 0; 00050 00051 virtual SeqTriggerDriver* clone_driver() const = 0; 00052 }; 00053 00054 00055 00056 00058 00059 00071 class SeqTrigger : public SeqObjBase { 00072 00073 public: 00074 00079 SeqTrigger(const STD_string& object_label, double duration); 00080 00084 SeqTrigger(const STD_string& object_label = "unnamedSeqTrigger"); 00085 00089 SeqTrigger(const SeqTrigger& st) {SeqTrigger::operator = (st);} 00090 00094 SeqTrigger& operator = (const SeqTrigger& st); 00095 00096 // overloading virtual function from SeqTreeObj 00097 STD_string get_program(programContext& context) const; 00098 double get_duration() const; 00099 unsigned int event(eventContext& context) const; 00100 00101 00102 private: 00103 00104 // overwriting virtual functions from SeqClass 00105 bool prep(); 00106 00107 mutable SeqDriverInterface<SeqTriggerDriver> triggdriver; 00108 00109 double triggdur; 00110 00111 }; 00112 00114 00121 class SeqHalt : public SeqObjBase { 00122 00123 public: 00124 00128 SeqHalt(const STD_string& object_label = "unnamedSeqHalt"); 00129 00133 SeqHalt(const SeqHalt& sh) {SeqHalt::operator = (sh);} 00134 00138 SeqHalt& operator = (const SeqHalt& sh); 00139 00140 // overloading virtual function from SeqTreeObj 00141 STD_string get_program(programContext& context) const; 00142 double get_duration() const; 00143 unsigned int event(eventContext& context) const; 00144 00145 00146 private: 00147 00148 // overwriting virtual functions from SeqClass 00149 bool prep(); 00150 00151 mutable SeqDriverInterface<SeqTriggerDriver> triggdriver; 00152 }; 00153 00155 00156 00164 class SeqSnapshot : public SeqObjBase { 00165 00166 public: 00167 00172 SeqSnapshot(const STD_string& object_label, const STD_string& snapshot_fname); 00173 00177 SeqSnapshot(const STD_string& object_label = "unnamedSeqSnapshot"); 00178 00182 SeqSnapshot(const SeqSnapshot& ss) {SeqSnapshot::operator = (ss);} 00183 00187 SeqSnapshot& operator = (const SeqSnapshot& ss); 00188 00189 // overloading virtual function from SeqTreeObj 00190 double get_duration() const {return 0.0;} 00191 unsigned int event(eventContext& context) const; 00192 00193 00194 private: 00195 00196 // overwriting virtual functions from SeqClass 00197 bool prep(); 00198 00199 STD_string magn_fname; 00200 00201 mutable SeqDriverInterface<SeqTriggerDriver> triggdriver; 00202 00203 }; 00204 00206 00207 00215 class SeqMagnReset : public SeqObjBase { 00216 00217 public: 00218 00222 SeqMagnReset(const STD_string& object_label = "unnamedSeqMagnReset"); 00223 00227 SeqMagnReset(const SeqMagnReset& smr) {SeqMagnReset::operator = (smr);} 00228 00232 SeqMagnReset& operator = (const SeqMagnReset& smr); 00233 00234 // overloading virtual function from SeqTreeObj 00235 double get_duration() const {return 0.0;} 00236 unsigned int event(eventContext& context) const; 00237 00238 00239 private: 00240 00241 // overwriting virtual functions from SeqClass 00242 bool prep(); 00243 00244 mutable SeqDriverInterface<SeqTriggerDriver> triggdriver; 00245 00246 }; 00247 00252 #endif
1.5.6