mrfioc2  2.3.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
SeqManager Class Referenceabstract

#include <mrmSeq.h>

Inheritance diagram for SeqManager:
Inheritance graph
[legend]
Collaboration diagram for SeqManager:
Collaboration graph
[legend]

Public Types

enum  Type { TypeEVG, TypeEVR }
 
- Public Types inherited from mrf::Object
typedef m_obj_children_t::const_iterator child_iterator
 
typedef std::map< std::string, std::string > create_args_t
 
typedef Object *(* create_factory_t) (const std::string &name, const std::string &klass, const create_args_t &args)
 

Public Member Functions

 SeqManager (const std::string &name, Type t)
 
virtual ~SeqManager ()
 
virtual void lock () const OVERRIDE FINAL
 
virtual void unlock () const OVERRIDE FINAL
 
void doStartOfSequence (unsigned i)
 Call from ISR. More...
 
void doEndOfSequence (unsigned i)
 Call from ISR. More...
 
virtual double getClkFreq () const =0
 
virtual void mapTriggerSrc (unsigned i, unsigned src)=0
 
virtual epicsUInt32 testStartOfSeq ()=0
 
- Public Member Functions inherited from mrf::ObjectInst< SeqManager >
virtual propertyBasegetPropertyBase (const char *pname, const std::type_info &ptype)
 
virtual void visitProperties (bool(*cb)(propertyBase *, void *), void *arg)
 
- Public Member Functions inherited from mrf::Object
const std::string & name () const
 
const Objectparent () const
 
child_iterator beginChild () const
 
child_iterator endChild () const
 
template<typename P >
mrf::auto_ptr< property< P > > getProperty (const char *pname)
 

Static Public Member Functions

static mrf::ObjectbuildSW (const std::string &name, const std::string &klass, const mrf::Object::create_args_t &args)
 
- Static Public Member Functions inherited from mrf::ObjectInst< SeqManager >
static int initObject ()
 
- Static Public Member Functions inherited from mrf::Object
static ObjectgetObject (const std::string &name)
 
static ObjectgetCreateObject (const std::string &name, const std::string &klass, const create_args_t &args=create_args_t())
 
static void addFactory (const std::string &klass, create_factory_t fn)
 
static void visitObjects (bool(*)(Object *, void *), void *)
 

Public Attributes

const Type type
 

Protected Member Functions

void addHW (unsigned i, volatile void *ctrl, volatile void *ram)
 
- Protected Member Functions inherited from mrf::ObjectInst< SeqManager >
 ObjectInst (const std::string &n)
 
 ObjectInst (const std::string &n, A &a)
 
virtual ~ObjectInst ()
 
- Protected Member Functions inherited from mrf::Object
 Object (const std::string &n, const Object *par=0)
 
virtual ~Object ()=0
 

Friends

struct SoftSequence
 

Detailed Description

Definition at line 26 of file mrmSeq.h.

Member Enumeration Documentation

◆ Type

Enumerator
TypeEVG 
TypeEVR 

Definition at line 32 of file mrmSeq.h.

32  {
33  TypeEVG, // "classic" 230/300 series EVG as well as EVM
34  TypeEVR, // 300DC EVR
35  };

Constructor & Destructor Documentation

◆ SeqManager()

SeqManager::SeqManager ( const std::string &  name,
Type  t 
)

Definition at line 687 of file mrmSeq.cpp.

688  :base_t(name)
689  ,type(t)
690 {
691  switch(type) {
692  case TypeEVG:
693  case TypeEVR:
694  break;
695  default:
696  throw std::invalid_argument("Bad SeqManager type");
697  }
698 }
const Type type
Definition: mrmSeq.h:36
const std::string & name() const
Definition: object.h:393

◆ ~SeqManager()

SeqManager::~SeqManager ( )
virtual

Definition at line 700 of file mrmSeq.cpp.

700 {}

Member Function Documentation

◆ addHW()

void SeqManager::addHW ( unsigned  i,
volatile void *  ctrl,
volatile void *  ram 
)
protected

Definition at line 765 of file mrmSeq.cpp.

768 {
769  hw.resize(std::max(hw.size(), size_t(i+1)), 0);
770  assert(!hw[i]);
771  hw[i] = new SeqHW(this, i, ctrl, ram);
772 }
Definition: mrmSeq.cpp:56

◆ buildSW()

mrf::Object * SeqManager::buildSW ( const std::string &  name,
const std::string &  klass,
const mrf::Object::create_args_t args 
)
static

Definition at line 703 of file mrmSeq.cpp.

704 {
705  (void)klass;
706 
707  mrf::Object::create_args_t::const_iterator it=args.find("PARENT");
708  if(it==args.end())
709  throw std::runtime_error("No PARENT= (EVG) specified");
710 
711  mrf::Object *mgrobj = mrf::Object::getObject(it->second);
712  if(!mgrobj)
713  throw std::runtime_error("No such PARENT object");
714 
715  SeqManager *mgr = dynamic_cast<SeqManager*>(mgrobj);
716  if(!mgr)
717  throw std::runtime_error("PARENT is not a SeqManager");
718 
719  return new SoftSequence(mgr, name);
720 }
Definition: evrdump.c:37
Base object inspection.
Definition: object.h:378
static Object * getObject(const std::string &name)
Definition: object.cpp:107
friend struct SoftSequence
Definition: mrmSeq.h:71
const std::string & name() const
Definition: object.h:393

◆ doEndOfSequence()

void SeqManager::doEndOfSequence ( unsigned  i)

Call from ISR.

Definition at line 739 of file mrmSeq.cpp.

740 {
741  assert(i<hw.size());
742  SeqHW* HW = hw[i];
743 
744  HW->running = false;
745 
746  SoftSequence *seq = HW->loaded;
747 
748  if(!seq) return;
749 
750  if(seq->committed.mode==Single) {
751  seq->is_enabled = false;
752  }
753 
754  seq->numEnd++;
755 
756  scanIoRequest(seq->onEnd);
757 
758  if(!seq->is_insync)
759  seq->sync();
760 
761  if(seq->committed.mode==Single)
762  scanIoRequest(seq->changed);
763 }
bool is_enabled
Whether user has requested enable.
Definition: mrmSeq.cpp:344
bool is_insync
Definition: mrmSeq.cpp:349
void sync()
Definition: mrmSeq.cpp:574
epicsUInt32 numEnd
Definition: mrmSeq.cpp:352
IOSCANPVT changed
Definition: mrmSeq.cpp:356
struct SoftSequence::Config committed
Definition: mrmSeq.cpp:56
IOSCANPVT onEnd
Definition: mrmSeq.cpp:356

◆ doStartOfSequence()

void SeqManager::doStartOfSequence ( unsigned  i)

Call from ISR.

Definition at line 723 of file mrmSeq.cpp.

724 {
725  assert(i<hw.size());
726  SeqHW* HW = hw[i];
727  HW->running = true;
728 
729  SoftSequence *seq = HW->loaded;
730 
731  if(!seq) return;
732 
733  seq->numStart++;
734 
735  scanIoRequest(seq->onStart);
736 }
Definition: mrmSeq.cpp:56
IOSCANPVT onStart
Definition: mrmSeq.cpp:356
epicsUInt32 numStart
Guarded by interruptLock only.
Definition: mrmSeq.cpp:352

◆ getClkFreq()

virtual double SeqManager::getClkFreq ( ) const
pure virtual

sub-class implement to provide scaling between time and frequency. Units of Hz called with a SoftSeq mutex held.

Implemented in EvgSeqManager, and EvrSeqManager.

◆ lock()

virtual void SeqManager::lock ( ) const
inlinevirtual

Implements mrf::Object.

Definition at line 42 of file mrmSeq.h.

42 {}

◆ mapTriggerSrc()

virtual void SeqManager::mapTriggerSrc ( unsigned  i,
unsigned  src 
)
pure virtual

sub-class implement Setup (or clear w/ zero) the external trigger source Called from interrupt context

Implemented in EvgSeqManager, and EvrSeqManager.

◆ testStartOfSeq()

virtual epicsUInt32 SeqManager::testStartOfSeq ( )
pure virtual

Implemented in EvgSeqManager, and EvrSeqManager.

◆ unlock()

virtual void SeqManager::unlock ( ) const
inlinevirtual

Implements mrf::Object.

Definition at line 43 of file mrmSeq.h.

43 {}

Friends And Related Function Documentation

◆ SoftSequence

friend struct SoftSequence
friend

Definition at line 71 of file mrmSeq.h.

Member Data Documentation

◆ type

const Type SeqManager::type

Definition at line 36 of file mrmSeq.h.


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