mrfioc2  2.3.0
mrmSeq.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2016 Michael Davidsaver
3 * mrfioc2 is distributed subject to a Software License Agreement found
4 * in file LICENSE that is included with this distribution.
5 \*************************************************************************/
6 #ifndef MRMSEQ_H
7 #define MRMSEQ_H
8 
9 #include <vector>
10 #include <map>
11 #include <string>
12 
13 #include <dbScan.h>
14 #include <shareLib.h>
15 
16 #include <mrf/object.h>
17 
18 // special trigger sources w/ HW dependent representation
19 #define SEQ_TRIG_NONE (-1)
20 #define SEQ_TRIG_SW (-2)
21 #define SEQ_TRIG_INP(n) (-100-(n))
22 
23 struct SeqHW;
24 struct SoftSequence;
25 
26 class epicsShareClass SeqManager : public mrf::ObjectInst<SeqManager>
27 {
29 public:
30  // Which model card?
31  // used handle external and software trigger source mapping
32  enum Type {
33  TypeEVG, // "classic" 230/300 series EVG as well as EVM
34  TypeEVR, // 300DC EVR
35  };
36  const Type type;
37 
38  SeqManager(const std::string& name, Type t);
39  virtual ~SeqManager();
40 
41  // no locking needed. our members are effectivly "const" after addHW() during sub-class ctor
42  virtual void lock() const OVERRIDE FINAL {}
43  virtual void unlock() const OVERRIDE FINAL {}
44 
45  static mrf::Object* buildSW(const std::string& name, const std::string& klass, const mrf::Object::create_args_t& args);
46 
48  void doStartOfSequence(unsigned i);
50  void doEndOfSequence(unsigned i);
51 
55  virtual double getClkFreq() const =0;
56 
60  virtual void mapTriggerSrc(unsigned i, unsigned src) =0;
61 
62  virtual epicsUInt32 testStartOfSeq() =0;
63 
64 protected:
65  void addHW(unsigned i,
66  volatile void *ctrl,
67  volatile void *ram);
68 private:
69  typedef std::vector<SeqHW*> hw_t;
70  hw_t hw;
71  friend struct SoftSequence;
72 };
73 
74 epicsShareExtern int SeqManagerDebug;
75 
76 #endif // MRMSEQ_H
const Type type
Definition: mrmSeq.h:36
std::map< std::string, std::string > create_args_t
Definition: object.h:422
epicsShareExtern int SeqManagerDebug
Definition: mrmSeq.h:74
Definition: evrdump.c:37
virtual void lock() const OVERRIDE FINAL
Definition: mrmSeq.h:42
Base object inspection.
Definition: object.h:378
User implementation hook.
Definition: object.h:459
Definition: mrmSeq.cpp:56
virtual void unlock() const OVERRIDE FINAL
Definition: mrmSeq.h:43