ODIN
seqtrigg.h
1 /***************************************************************************
2  seqtrigg.h - description
3  -------------------
4  begin : Tue Aug 13 2002
5  copyright : (C) 2000-2021 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 
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 
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 
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 
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
Input trigger.
Definition: seqtrigg.h:121
SeqHalt(const SeqHalt &sh)
Definition: seqtrigg.h:133
unsigned int event(eventContext &context) const
SeqHalt(const STD_string &object_label="unnamedSeqHalt")
SeqHalt & operator=(const SeqHalt &sh)
STD_string get_program(programContext &context) const
double get_duration() const
Magnetization reset.
Definition: seqtrigg.h:215
SeqMagnReset & operator=(const SeqMagnReset &smr)
unsigned int event(eventContext &context) const
SeqMagnReset(const SeqMagnReset &smr)
Definition: seqtrigg.h:227
SeqMagnReset(const STD_string &object_label="unnamedSeqMagnReset")
double get_duration() const
Definition: seqtrigg.h:235
Magnetization snapshot.
Definition: seqtrigg.h:164
SeqSnapshot(const SeqSnapshot &ss)
Definition: seqtrigg.h:182
SeqSnapshot(const STD_string &object_label, const STD_string &snapshot_fname)
SeqSnapshot & operator=(const SeqSnapshot &ss)
double get_duration() const
Definition: seqtrigg.h:190
SeqSnapshot(const STD_string &object_label="unnamedSeqSnapshot")
unsigned int event(eventContext &context) const
Output trigger.
Definition: seqtrigg.h:71
STD_string get_program(programContext &context) const
SeqTrigger & operator=(const SeqTrigger &st)
SeqTrigger(const SeqTrigger &st)
Definition: seqtrigg.h:89
double get_duration() const
unsigned int event(eventContext &context) const
SeqTrigger(const STD_string &object_label, double duration)
SeqTrigger(const STD_string &object_label="unnamedSeqTrigger")