MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
PulseGen Class Reference

#include <PulseGen.h>

+ Collaboration diagram for PulseGen:

Public Member Functions

double getBaseLevel () const
 
unsigned int getCount () const
 
double getDelay (unsigned int index) const
 
double getFirstDelay () const
 
double getFirstLevel () const
 
double getFirstWidth () const
 
double getLevel (unsigned int index) const
 
double getOutput () const
 
int getPreviousInput () const
 
double getSecondDelay () const
 
double getSecondLevel () const
 
double getSecondWidth () const
 
unsigned int getTrigMode () const
 
double getTrigTime () const
 
double getWidth (unsigned int index) const
 
void input (double input)
 
void process (const Eref &e, ProcPtr p)
 
 PulseGen ()
 
void reinit (const Eref &e, ProcPtr p)
 
void setBaseLevel (double value)
 
void setCount (unsigned int count)
 
void setDelay (unsigned int pulseNo, double delay)
 
void setFirstDelay (double value)
 
void setFirstLevel (double value)
 
void setFirstWidth (double value)
 
void setLevel (unsigned int pulseNo, double level)
 
void setSecondDelay (double value)
 
void setSecondLevel (double value)
 
void setSecondWidth (double value)
 
void setTrigMode (unsigned int value)
 
void setWidth (unsigned int pulseNo, double width)
 
 ~PulseGen ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 

Protected Attributes

double baseLevel_
 
vector< double > delay_
 
int input_
 
vector< double > level_
 
double output_
 
int prevInput_
 
bool secondPulse_
 
unsigned int trigMode_
 
double trigTime_
 
vector< double > width_
 

Static Private Attributes

static const int EXT_GATE = 2
 
static const int EXT_TRIG = 1
 
static const int FREE_RUN = 0
 

Detailed Description

PulseGen acts as a pulse generator. It generates square pulses of specified duration and amplitude. Two consecutive pulses are separated by specified delay.

Definition at line 40 of file PulseGen.h.

Constructor & Destructor Documentation

PulseGen::PulseGen ( )

Definition at line 188 of file PulseGen.cpp.

References baseLevel_, delay_, level_, output_, prevInput_, trigMode_, trigTime_, and width_.

189 {
190  level_.reserve(2);
191  width_.reserve(2);
192  delay_.reserve(2);
193  level_.resize(2);
194  width_.resize(2);
195  delay_.resize(2);
196  level_.assign(2, 0.0);
197  delay_.assign(2, 0.0);
198  width_.assign(2, 0.0);
199  output_ = 0.0;
200  baseLevel_ = 0.0;
201  trigTime_ = -1;
202  trigMode_ = 0;
203  prevInput_ = 0;
204 }
vector< double > delay_
Definition: PulseGen.h:123
double trigTime_
Definition: PulseGen.h:129
int prevInput_
Definition: PulseGen.h:133
double output_
Definition: PulseGen.h:127
double baseLevel_
Definition: PulseGen.h:128
unsigned int trigMode_
Definition: PulseGen.h:130
vector< double > level_
Definition: PulseGen.h:124
vector< double > width_
Definition: PulseGen.h:125
PulseGen::~PulseGen ( )

Definition at line 206 of file PulseGen.cpp.

208 {
209  ;
210 }

Member Function Documentation

double PulseGen::getBaseLevel ( ) const

Definition at line 289 of file PulseGen.cpp.

References baseLevel_.

Referenced by initCinfo().

290 {
291  return baseLevel_;
292 }
double baseLevel_
Definition: PulseGen.h:128

+ Here is the caller graph for this function:

unsigned int PulseGen::getCount ( ) const

Definition at line 327 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

328 {
329  return level_.size();
330 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

double PulseGen::getDelay ( unsigned int  index) const

Definition at line 368 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

369 {
370  if ( index < delay_.size()){
371  return delay_[index];
372  } else {
373  cout << "WARNING: PulseGen::getDelay - invalid index." << endl;
374  return 0.0;
375  }
376 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

double PulseGen::getFirstDelay ( ) const

Definition at line 235 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

236 {
237  return delay_[0];
238 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

double PulseGen::getFirstLevel ( ) const

Definition at line 217 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

218 {
219  return level_[0];
220 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

double PulseGen::getFirstWidth ( ) const

Definition at line 227 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

228 {
229  return width_[0];
230 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

double PulseGen::getLevel ( unsigned int  index) const

Definition at line 332 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

333 {
334  if (index < level_.size()){
335  return level_[index];
336  } else {
337  cout << "WARNING: PulseGen::getLevel - invalid index." << endl;
338  return 0.0;
339  }
340 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

double PulseGen::getOutput ( ) const

Definition at line 301 of file PulseGen.cpp.

References output_.

Referenced by initCinfo().

302 {
303  return output_;
304 }
double output_
Definition: PulseGen.h:127

+ Here is the caller graph for this function:

int PulseGen::getPreviousInput ( ) const

Definition at line 306 of file PulseGen.cpp.

References prevInput_.

307 {
308  return prevInput_;
309 }
int prevInput_
Definition: PulseGen.h:133
double PulseGen::getSecondDelay ( ) const

Definition at line 277 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

278 {
279  if (delay_.size() >= 2){
280  return delay_[1];
281  }
282  return 0.0;
283 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

double PulseGen::getSecondLevel ( ) const

Definition at line 247 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

248 {
249  if (level_.size() >= 2){
250  return level_[1];
251  } else {
252  return 0.0;
253  }
254 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

double PulseGen::getSecondWidth ( ) const

Definition at line 263 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

264 {
265  if (width_.size() >= 2){
266  return width_[1];
267  } else {
268  return 0.0;
269  }
270 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

unsigned int PulseGen::getTrigMode ( ) const

Definition at line 297 of file PulseGen.cpp.

References trigMode_.

Referenced by initCinfo().

298 {
299  return trigMode_;
300 }
unsigned int trigMode_
Definition: PulseGen.h:130

+ Here is the caller graph for this function:

double PulseGen::getTrigTime ( ) const
double PulseGen::getWidth ( unsigned int  index) const

Definition at line 351 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

352 {
353  if (index < width_.size()){
354  return width_[index];
355  } else {
356  cout << "WARNING: PulseGen::getWidth - invalid index." << endl;
357  return 0.0;
358  }
359 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

const Cinfo * PulseGen::initCinfo ( )
static

Definition at line 42 of file PulseGen.cpp.

References getBaseLevel(), getCount(), getDelay(), getFirstDelay(), getFirstLevel(), getFirstWidth(), getLevel(), getOutput(), getSecondDelay(), getSecondLevel(), getSecondWidth(), getTrigMode(), getWidth(), Neutral::initCinfo(), input(), output(), outputOut(), process(), pulseGenCinfo, reinit(), setBaseLevel(), setCount(), setDelay(), setFirstDelay(), setFirstLevel(), setFirstWidth(), setLevel(), setSecondDelay(), setSecondLevel(), setSecondWidth(), setTrigMode(), and setWidth().

43 {
45  // Field definitions
48  "Output amplitude",
50  static ValueFinfo< PulseGen, double > baseLevel("baseLevel",
51  "Basal level of the stimulus",
54  static ValueFinfo< PulseGen, double > firstLevel("firstLevel",
55  "Amplitude of the first pulse in a sequence",
58  static ValueFinfo< PulseGen, double > firstWidth("firstWidth",
59  "Width of the first pulse in a sequence",
62  static ValueFinfo< PulseGen, double > firstDelay("firstDelay",
63  "Delay to start of the first pulse in a sequence",
66  static ValueFinfo< PulseGen, double > secondLevel("secondLevel",
67  "Amplitude of the second pulse in a sequence",
70  static ValueFinfo< PulseGen, double > secondWidth("secondWidth",
71  "Width of the second pulse in a sequence",
74  static ValueFinfo< PulseGen, double > secondDelay("secondDelay",
75  "Delay to start of of the second pulse in a sequence",
78  static ValueFinfo< PulseGen, unsigned int > count("count",
79  "Number of pulses in a sequence",
82  static ValueFinfo< PulseGen, unsigned int > trigMode("trigMode",
83  "Trigger mode for pulses in the sequence.\n"
84  " 0 : free-running mode where it keeps looping its output\n"
85  " 1 : external trigger, where it is triggered by an external input (and"
86  " stops after creating the first train of pulses)\n"
87  " 2 : external gate mode, where it keeps generating the pulses in a"
88  " loop as long as the input is high.",
92  "Level of the pulse at specified index",
96  "Width of the pulse at specified index",
100  "Delay of the pulse at specified index",
104  // Dest messages
106  static DestFinfo levelIn("levelIn",
107  "Handle level value coming from other objects",
109  static DestFinfo widthIn("widthIn",
110  "Handle width value coming from other objects",
112  static DestFinfo delayIn("delayIn",
113  "Handle delay value coming from other objects",
115 
116  static DestFinfo input("input",
117  "Handle incoming input that determines gating/triggering onset. "
118  "Note that although this is a double field, the underlying field is"
119  " integer. So fractional part of input will be truncated",
122  // Shared messages
124  static DestFinfo process( "process",
125  "Handles process call, updates internal time stamp.",
127  static DestFinfo reinit( "reinit",
128  "Handles reinit call.",
130  static Finfo* processShared[] =
131  {
132  &process, &reinit
133  };
134 
135  static SharedFinfo proc( "proc",
136  "This is a shared message to receive Process messages "
137  "from the scheduler objects."
138  "The first entry in the shared msg is a MsgDest "
139  "for the Process operation. It has a single argument, "
140  "ProcInfo, which holds lots of information about current "
141  "time, thread, dt and so on. The second entry is a MsgDest "
142  "for the Reinit operation. It also uses ProcInfo. ",
143  processShared, sizeof( processShared ) / sizeof( Finfo* )
144  );
145 
146  static Finfo* pulseGenFinfos[] = {
147  &output,
148  &baseLevel,
149  &firstLevel,
150  &firstWidth,
151  &firstDelay,
152  &secondLevel,
153  &secondWidth,
154  &secondDelay,
155  &count,
156  &trigMode,
157  &level,
158  &width,
159  &delay,
160  &input,
161  outputOut(),
162  &levelIn,
163  &widthIn,
164  &delayIn,
165  &proc,
166  };
167  static string doc[] =
168  {
169  "Name", "PulseGen",
170  "Author", "Subhasis Ray",
171  "Description", "PulseGen: general purpose pulse generator. This can generate any "
172  "number of pulses with specified level and duration.",
173  };
174  static Dinfo<PulseGen> dinfo;
175  static Cinfo pulseGenCinfo("PulseGen",
177  pulseGenFinfos,
178  sizeof(pulseGenFinfos)/sizeof(Finfo*),
179  &dinfo,
180  doc,
181  sizeof(doc)/sizeof(string));
182  return & pulseGenCinfo;
183 
184 }
double getWidth(unsigned int index) const
Definition: PulseGen.cpp:351
Definition: Dinfo.h:60
void setWidth(unsigned int pulseNo, double width)
Definition: PulseGen.cpp:360
void setLevel(unsigned int pulseNo, double level)
Definition: PulseGen.cpp:342
double getSecondWidth() const
Definition: PulseGen.cpp:263
void reinit(const Eref &e, ProcPtr p)
Definition: PulseGen.cpp:466
void setCount(unsigned int count)
Definition: PulseGen.cpp:311
double getFirstWidth() const
Definition: PulseGen.cpp:227
void setDelay(unsigned int pulseNo, double delay)
Definition: PulseGen.cpp:378
void setSecondWidth(double value)
Definition: PulseGen.cpp:256
Definition: OpFunc.h:40
double getBaseLevel() const
Definition: PulseGen.cpp:289
static SrcFinfo1< double > * output()
Definition: Arith.cpp:14
double getSecondDelay() const
Definition: PulseGen.cpp:277
void setSecondDelay(double value)
Definition: PulseGen.cpp:271
unsigned int getCount() const
Definition: PulseGen.cpp:327
double getFirstLevel() const
Definition: PulseGen.cpp:217
void setTrigMode(unsigned int value)
Definition: PulseGen.cpp:293
void setFirstWidth(double value)
Definition: PulseGen.cpp:222
Definition: OpFunc.h:27
void setFirstLevel(double value)
Definition: PulseGen.cpp:212
unsigned int getTrigMode() const
Definition: PulseGen.cpp:297
double getLevel(unsigned int index) const
Definition: PulseGen.cpp:332
void input(double input)
Definition: PulseGen.cpp:392
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void process(const Eref &e, ProcPtr p)
Definition: PulseGen.cpp:398
double getFirstDelay() const
Definition: PulseGen.cpp:235
void setBaseLevel(double value)
Definition: PulseGen.cpp:285
double getOutput() const
Definition: PulseGen.cpp:301
Definition: Cinfo.h:18
double getSecondLevel() const
Definition: PulseGen.cpp:247
double getDelay(unsigned int index) const
Definition: PulseGen.cpp:368
void setFirstDelay(double value)
Definition: PulseGen.cpp:231
void setSecondLevel(double value)
Definition: PulseGen.cpp:240
static const Cinfo * pulseGenCinfo
Definition: PulseGen.cpp:186
Definition: Finfo.h:12
static SrcFinfo1< double > * outputOut()
Definition: PulseGen.cpp:35

+ Here is the call graph for this function:

void PulseGen::input ( double  input)

Definition at line 392 of file PulseGen.cpp.

References input_, and value.

Referenced by initCinfo().

393 {
394  input_ = value;
395 }
uint32_t value
Definition: moosemodule.h:42
int input_
Definition: PulseGen.h:134

+ Here is the caller graph for this function:

void PulseGen::process ( const Eref e,
ProcPtr  p 
)

Definition at line 398 of file PulseGen.cpp.

References baseLevel_, ProcInfo::currTime, delay_, EXT_GATE, EXT_TRIG, FREE_RUN, input_, level_, output_, outputOut(), prevInput_, trigMode_, trigTime_, and width_.

Referenced by initCinfo().

399 {
400  double currentTime = p->currTime;
401  double period = width_[0] + delay_[0];
402  double phase = 0.0;
403  for (unsigned int ii = 1; ii < width_.size() && (width_[ii] > 0.0 || delay_[ii] > 0.0); ++ii){
404  double incr = delay_[ii] + width_[ii] - width_[ii-1];
405  if (incr > 0){
406  period += incr;
407  }
408  }
409  switch (trigMode_){
410  case PulseGen::FREE_RUN:
411  phase = fmod(currentTime, period);
412  break;
413  case PulseGen::EXT_TRIG:
414  if (input_ == 0){
415  if (trigTime_ < 0){
416  phase = period;
417  }else{
418  phase = currentTime - trigTime_;
419  }
420  } else {
421  if (prevInput_ == 0){
422  trigTime_ = currentTime;
423  }
424  phase = currentTime - trigTime_;
425  }
426  prevInput_ = input_;
427  break;
428  case PulseGen::EXT_GATE:
429  if(input_ == 0)
430  {
431  phase = period; /* output = baselevel */
432  }
433  else
434  { /* gate high */
435  if(prevInput_ == 0)
436  { /* low -> high */
437  trigTime_ = currentTime;
438  }
439  phase = fmod(currentTime - trigTime_, period);
440  }
441  prevInput_ = input_;
442  break;
443  default:
444  cerr << "ERROR: PulseGen::newProcessFunc( const Conn* , ProcInfo ) - invalid triggerMode - " << trigMode_ << endl;
445  }
446  if (phase >= period){ // we have crossed all pulses
448  return;
449  }
450  // go through all pulse positions to check which pulse/interpulse
451  // are we are in and set the output level accordingly
452  for (unsigned int ii = 0; ii < width_.size(); ++ii){
453  if (phase < delay_[ii]){ // we are in the baseline area - before ii-th pulse
455  break;
456  } else if (phase < delay_[ii] + width_[ii]){ // we are inside th ii-th pulse
457  output_ = level_[ii];
458  break;
459  }
460  phase -= delay_[ii];
461  }
462  outputOut()->send(e, output_);
463 }
vector< double > delay_
Definition: PulseGen.h:123
double trigTime_
Definition: PulseGen.h:129
int prevInput_
Definition: PulseGen.h:133
double currTime
Definition: ProcInfo.h:19
double output_
Definition: PulseGen.h:127
static const int EXT_GATE
Definition: PulseGen.h:68
double baseLevel_
Definition: PulseGen.h:128
unsigned int trigMode_
Definition: PulseGen.h:130
static const int FREE_RUN
Definition: PulseGen.h:47
int input_
Definition: PulseGen.h:134
vector< double > level_
Definition: PulseGen.h:124
static const int EXT_TRIG
Definition: PulseGen.h:63
static SrcFinfo1< double > * outputOut()
Definition: PulseGen.cpp:35
vector< double > width_
Definition: PulseGen.h:125

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PulseGen::reinit ( const Eref e,
ProcPtr  p 
)

Definition at line 466 of file PulseGen.cpp.

References baseLevel_, input_, output_, outputOut(), prevInput_, and trigTime_.

Referenced by initCinfo().

467 {
468  trigTime_ = -1;
469  prevInput_ = 0;
471  input_ = 0;
472  outputOut()->send(e, output_);
473 }
double trigTime_
Definition: PulseGen.h:129
int prevInput_
Definition: PulseGen.h:133
double output_
Definition: PulseGen.h:127
double baseLevel_
Definition: PulseGen.h:128
int input_
Definition: PulseGen.h:134
static SrcFinfo1< double > * outputOut()
Definition: PulseGen.cpp:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void PulseGen::setBaseLevel ( double  value)

Definition at line 285 of file PulseGen.cpp.

References baseLevel_.

Referenced by initCinfo().

286 {
287  baseLevel_ = level;
288 }
double baseLevel_
Definition: PulseGen.h:128

+ Here is the caller graph for this function:

void PulseGen::setCount ( unsigned int  count)

Definition at line 311 of file PulseGen.cpp.

References delay_, level_, and width_.

Referenced by initCinfo().

312 {
313  if (count <= 0){
314  cout << "WARNING: invalid pulse count specified." << endl;
315  return;
316  }
317  // we want to keep it compact - reserve will ensure we do not
318  // overallocate in resize call
319  level_.reserve(count);
320  delay_.reserve(count);
321  width_.reserve(count);
322  level_.resize(count, 0.0);
323  delay_.resize(count, 0.0);
324  width_.resize(count, 0.0);
325 }
vector< double > delay_
Definition: PulseGen.h:123
vector< double > level_
Definition: PulseGen.h:124
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

void PulseGen::setDelay ( unsigned int  pulseNo,
double  delay 
)

Definition at line 378 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

379 {
380  if ( index < delay_.size() ){
381  delay_[index] = delay;
382  } else {
383  cout << "WARNING: PulseGen::setDelay - invalid index. First set the number of pulses by setting 'count' field." << endl;
384  }
385 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

void PulseGen::setFirstDelay ( double  value)

Definition at line 231 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

232 {
233  delay_[0] = delay;
234 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

void PulseGen::setFirstLevel ( double  value)

Definition at line 212 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

213 {
214  level_[0] = level;
215 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

void PulseGen::setFirstWidth ( double  value)

Definition at line 222 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

223 {
224  width_[0] = width;
225 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

void PulseGen::setLevel ( unsigned int  pulseNo,
double  level 
)

Definition at line 342 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

343 {
344  if (index < level_.size()){
345  level_[index] = level;
346  } else {
347  cout << "WARNING: PulseGen::setLevel - invalid index. First set the number of pulses by setting 'count' field." << endl;
348  }
349 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

void PulseGen::setSecondDelay ( double  value)

Definition at line 271 of file PulseGen.cpp.

References delay_.

Referenced by initCinfo().

272 {
273  if (delay_.size() >= 2){
274  delay_[1] = delay;
275  }
276 }
vector< double > delay_
Definition: PulseGen.h:123

+ Here is the caller graph for this function:

void PulseGen::setSecondLevel ( double  value)

Definition at line 240 of file PulseGen.cpp.

References level_.

Referenced by initCinfo().

241 {
242  if (level_.size() >= 2){
243  level_[1] = level;
244  }
245 }
vector< double > level_
Definition: PulseGen.h:124

+ Here is the caller graph for this function:

void PulseGen::setSecondWidth ( double  value)

Definition at line 256 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

257 {
258  if (width_.size() >= 2){
259  width_[1] = width;
260  }
261 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

void PulseGen::setTrigMode ( unsigned int  value)

Definition at line 293 of file PulseGen.cpp.

References trigMode_.

Referenced by initCinfo().

294 {
295  trigMode_ = mode;
296 }
unsigned int trigMode_
Definition: PulseGen.h:130

+ Here is the caller graph for this function:

void PulseGen::setWidth ( unsigned int  pulseNo,
double  width 
)

Definition at line 360 of file PulseGen.cpp.

References width_.

Referenced by initCinfo().

361 {
362  if ( index < width_.size()){
363  width_[index] = width;
364  } else {
365  cout << "WARNING: PulseGen::setWidth - invalid index. First set the number of pulses by setting 'count' field." << endl;
366  }
367 }
vector< double > width_
Definition: PulseGen.h:125

+ Here is the caller graph for this function:

Member Data Documentation

double PulseGen::baseLevel_
protected

Definition at line 128 of file PulseGen.h.

Referenced by getBaseLevel(), process(), PulseGen(), reinit(), and setBaseLevel().

vector<double> PulseGen::delay_
protected
const int PulseGen::EXT_GATE = 2
staticprivate

With trigMode = EXT_GATE, the pulse occurs firstDelay later from the leading edge of the input.

Definition at line 68 of file PulseGen.h.

Referenced by process().

const int PulseGen::EXT_TRIG = 1
staticprivate

With trigMode = EXT_TRIG the pulse generator may be triggered or may generate a single pulse and then stop. The logic depends on trigTime field. If trigTime is negative ( which it is by default and remains so unless there is a non zero input trigger to the PulseGen object ), the output remains at baselevel. For trigTime >= 0, if there is no input trigger, the PulseGen object will produce pair of pulses, the first one starting at firstDelay and staying at firstLevel for firstWidth time. And then the second one starting at secondDelay time after the start of the first pulse, staying at secondLevel for secondWidth time. If secondDelay is less than firstWidth, there will be no second pulse.

Definition at line 63 of file PulseGen.h.

Referenced by process().

const int PulseGen::FREE_RUN = 0
staticprivate

With trigMode = FREE_RUN the pulse generator will create a train of pulses determined by the firstDealy, firstWidth, firstLevel, secondDelay, secondWidth and secondLevel.

Definition at line 47 of file PulseGen.h.

Referenced by process().

int PulseGen::input_
protected

Definition at line 134 of file PulseGen.h.

Referenced by input(), process(), and reinit().

vector<double> PulseGen::level_
protected
double PulseGen::output_
protected

Definition at line 127 of file PulseGen.h.

Referenced by getOutput(), process(), PulseGen(), and reinit().

int PulseGen::prevInput_
protected

Definition at line 133 of file PulseGen.h.

Referenced by getPreviousInput(), process(), PulseGen(), and reinit().

bool PulseGen::secondPulse_
protected

Definition at line 131 of file PulseGen.h.

unsigned int PulseGen::trigMode_
protected

Definition at line 130 of file PulseGen.h.

Referenced by getTrigMode(), process(), PulseGen(), and setTrigMode().

double PulseGen::trigTime_
protected

Definition at line 129 of file PulseGen.h.

Referenced by process(), PulseGen(), and reinit().

vector<double> PulseGen::width_
protected

The documentation for this class was generated from the following files: