mrfioc2  2.3.0
Public Member Functions | List of all members
DelayModule Class Reference

#include <delayModule.h>

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

Public Member Functions

 DelayModule (const std::string &, EVRMRM *, unsigned int)
 
virtual ~DelayModule ()
 
virtual void setDelay0 (double val) OVERRIDE FINAL
 setDelay0 Sets the delay of the output 0 in the module More...
 
virtual double getDelay0 () const OVERRIDE FINAL
 getDelay0 Returns the last set delay for the output 0 in the module More...
 
virtual void setDelay1 (double val) OVERRIDE FINAL
 setDelay1 Sets the delay of the output 1 in the module More...
 
virtual double getDelay1 () const OVERRIDE FINAL
 getDelay1R eturns the last set delay for the output 1 in the module More...
 
virtual void setState (bool enabled) OVERRIDE FINAL
 setState Sets the enabled state of the delay module. If disabled, the module will output logic low on both ouputs. More...
 
virtual bool enabled () const OVERRIDE FINAL
 enabled Checks if the module is enabled or not. More...
 
- Public Member Functions inherited from DelayModuleEvr
 DelayModuleEvr (const std::string &n)
 
virtual ~DelayModuleEvr ()=0
 
- Public Member Functions inherited from mrf::ObjectInst< DelayModuleEvr >
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)
 

Additional Inherited Members

- 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)
 
- Static Public Member Functions inherited from mrf::ObjectInst< DelayModuleEvr >
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 *)
 
- Protected Member Functions inherited from mrf::ObjectInst< DelayModuleEvr >
 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
 

Detailed Description

Definition at line 16 of file delayModule.h.

Constructor & Destructor Documentation

◆ DelayModule()

DelayModule::DelayModule ( const std::string &  n,
EVRMRM o,
unsigned int  idx 
)

Definition at line 16 of file delayModule.cpp.

17  : DelayModuleEvr(n)
18  ,N_(idx)
19  ,gpio_(o->gpio())
20 {
21 }
DelayModuleEvr(const std::string &n)
Definition: delay.h:17
MRMGpio * gpio()
Definition: drvem.cpp:500

◆ ~DelayModule()

DelayModule::~DelayModule ( )
virtual

Definition at line 23 of file delayModule.cpp.

24 {
25 }

Member Function Documentation

◆ enabled()

bool DelayModule::enabled ( ) const
virtual

enabled Checks if the module is enabled or not.

Returns
True if the module is enabled, false othwerwise.

Implements DelayModuleEvr.

Definition at line 59 of file delayModule.cpp.

60 {
61  epicsUInt32 data;
62 
63  data = gpio_->getOutput();
64  return !(data & OUTPUT_DISABLE_BIT(N_));
65 }
#define OUTPUT_DISABLE_BIT(idx)
Definition: delayModule.cpp:13
epicsUInt32 getOutput()
Definition: mrmGpio.cpp:32

◆ getDelay0()

double DelayModule::getDelay0 ( ) const
virtual

getDelay0 Returns the last set delay for the output 0 in the module

Returns
The delay in [ns]

Implements DelayModuleEvr.

Definition at line 34 of file delayModule.cpp.

35 {
36  return (dly0_ * 8.686 / 1023.0);
37 }

◆ getDelay1()

double DelayModule::getDelay1 ( ) const
virtual

getDelay1R eturns the last set delay for the output 1 in the module

Returns
The delay in [ns]

Implements DelayModuleEvr.

Definition at line 46 of file delayModule.cpp.

47 {
48  return (dly1_ * 8.686 / 1023.0);
49 }

◆ setDelay0()

void DelayModule::setDelay0 ( double  val)
virtual

setDelay0 Sets the delay of the output 0 in the module

Parameters
valDelay in range of 0ns - 8.686ns. If the value is greater it will be set to maximum range value, if it is smaller it will be set to minimum range value.

Implements DelayModuleEvr.

Definition at line 27 of file delayModule.cpp.

28 {
29  if(val < 0) val = 0;
30  if(val > 8.686)val = 8.686;
31  setDelay(true, false, (epicsUInt16)(val * 1023.0 / 8.686), 0);
32 }

◆ setDelay1()

void DelayModule::setDelay1 ( double  val)
virtual

setDelay1 Sets the delay of the output 1 in the module

Parameters
valDelay in range of 0ns - 8.686ns. If the value is greater it will be set to maximum range value, if it is smaller it will be set to minimum range value.

Implements DelayModuleEvr.

Definition at line 39 of file delayModule.cpp.

40 {
41  if(val < 0) val = 0;
42  if(val > 8.686)val = 8.686;
43  setDelay(false, true, 0, (epicsUInt16)(val * 1023.0 / 8.686));
44 }

◆ setState()

void DelayModule::setState ( bool  enabled)
virtual

setState Sets the enabled state of the delay module. If disabled, the module will output logic low on both ouputs.

Parameters
enabledTrue for enabled and false for disabled

Implements DelayModuleEvr.

Definition at line 51 of file delayModule.cpp.

52 {
53  epicsGuard<epicsMutex> g(gpio_->lock_);
54  setGpioOutput();
55  if(enabled) enable();
56  else disable();
57 }
epicsMutex lock_
Definition: mrmGpio.h:29
virtual bool enabled() const OVERRIDE FINAL
enabled Checks if the module is enabled or not.
Definition: delayModule.cpp:59

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