seqtrigg.h
1 /***************************************************************************
2  seqtrigg.h - description
3  -------------------
4  begin : Tue Aug 13 2002
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 SEQTRIGG_H
19 #define SEQTRIGG_H
20 
21 #include <odinseq/seqobj.h>
22 #include <odinseq/seqdriver.h>
23 
24 
26 
31 class SeqTriggerDriver : public SeqDriverBase {
32 
33  public:
34  SeqTriggerDriver() {}
35  virtual ~SeqTriggerDriver() {}
36 
37  virtual double get_postduration() const = 0;
38 
39  virtual bool prep_exttrigger(double duration) = 0;
40 
41  virtual bool prep_halttrigger() = 0;
42 
43  virtual bool prep_snaptrigger(const STD_string& snapshot_fname) = 0;
44 
45  virtual bool prep_resettrigger() = 0;
46 
47  virtual void event(eventContext& context, double start) const = 0;
48 
49  virtual STD_string get_program(programContext& context) const = 0;
50 
51  virtual SeqTriggerDriver* clone_driver() const = 0;
52 };
53 
54 
55 
56 
58 
59 
71 class SeqTrigger : public SeqObjBase {
72 
73  public:
74 
79  SeqTrigger(const STD_string& object_label, double duration);
80 
84  SeqTrigger(const STD_string& object_label = "unnamedSeqTrigger");
85 
90 
94  SeqTrigger& operator = (const SeqTrigger& st);
95 
96  // overloading virtual function from SeqTreeObj
97  STD_string get_program(programContext& context) const;
98  double get_duration() const;
99  unsigned int event(eventContext& context) const;
100 
101 
102  private:
103 
104  // overwriting virtual functions from SeqClass
105  bool prep();
106 
107  mutable SeqDriverInterface<SeqTriggerDriver> triggdriver;
108 
109  double triggdur;
110 
111 };
112 
114 
121 class SeqHalt : public SeqObjBase {
122 
123  public:
124 
128  SeqHalt(const STD_string& object_label = "unnamedSeqHalt");
129 
134 
138  SeqHalt& operator = (const SeqHalt& sh);
139 
140  // overloading virtual function from SeqTreeObj
141  STD_string get_program(programContext& context) const;
142  double get_duration() const;
143  unsigned int event(eventContext& context) const;
144 
145 
146  private:
147 
148  // overwriting virtual functions from SeqClass
149  bool prep();
150 
151  mutable SeqDriverInterface<SeqTriggerDriver> triggdriver;
152 };
153 
155 
156 
164 class SeqSnapshot : public SeqObjBase {
165 
166  public:
167 
172  SeqSnapshot(const STD_string& object_label, const STD_string& snapshot_fname);
173 
177  SeqSnapshot(const STD_string& object_label = "unnamedSeqSnapshot");
178 
183 
187  SeqSnapshot& operator = (const SeqSnapshot& ss);
188 
189  // overloading virtual function from SeqTreeObj
190  double get_duration() const {return 0.0;}
191  unsigned int event(eventContext& context) const;
192 
193 
194  private:
195 
196  // overwriting virtual functions from SeqClass
197  bool prep();
198 
199  STD_string magn_fname;
200 
201  mutable SeqDriverInterface<SeqTriggerDriver> triggdriver;
202 
203 };
204 
206 
207 
215 class SeqMagnReset : public SeqObjBase {
216 
217  public:
218 
222  SeqMagnReset(const STD_string& object_label = "unnamedSeqMagnReset");
223 
228 
232  SeqMagnReset& operator = (const SeqMagnReset& smr);
233 
234  // overloading virtual function from SeqTreeObj
235  double get_duration() const {return 0.0;}
236  unsigned int event(eventContext& context) const;
237 
238 
239  private:
240 
241  // overwriting virtual functions from SeqClass
242  bool prep();
243 
244  mutable SeqDriverInterface<SeqTriggerDriver> triggdriver;
245 
246 };
247 
252 #endif
SeqMagnReset & operator=(const SeqMagnReset &smr)
virtual bool prep()
Definition: seqclass.h:116
Magnetization snapshot.
Definition: seqtrigg.h:164
SeqHalt & operator=(const SeqHalt &sh)
double get_duration() const
Definition: seqtrigg.h:235
double get_duration() const
Definition: seqtrigg.h:190
Output trigger.
Definition: seqtrigg.h:71
SeqMagnReset(const SeqMagnReset &smr)
Definition: seqtrigg.h:227
SeqHalt(const SeqHalt &sh)
Definition: seqtrigg.h:133
SeqTrigger(const SeqTrigger &st)
Definition: seqtrigg.h:89
Input trigger.
Definition: seqtrigg.h:121
Magnetization reset.
Definition: seqtrigg.h:215
SeqTrigger & operator=(const SeqTrigger &st)
SeqSnapshot & operator=(const SeqSnapshot &ss)
SeqSnapshot(const SeqSnapshot &ss)
Definition: seqtrigg.h:182