lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Xpm::PVPCtrls Class Reference

EPICS control PVs of one partition of an XPM; their callbacks program the L0 select, L1 trigger, analysis tag, message and inhibit registers of that partition in the Module. More...

#include <PVPCtrls.hh>

Public Types

enum  { FixedRate , ACRate , Sequence }
 L0 select modes stored by l0Select() and used by setL0Select(). More...
 

Public Member Functions

 PVPCtrls (Module &, Semaphore &, PVPStats &, unsigned shelf, unsigned partition)
 Store the module, semaphore, statistics object, shelf and partition; starts disabled and without PVs.
 
 ~PVPCtrls ()
 Does nothing; the PVs created by allocate() are not deleted.
 
void allocate (const std::string &title)
 Delete the PVs of an earlier call and create one PV per control, named title, a colon and the control name (XPM, Run, L0Select, MsgConfig and others).
 
void enable (unsigned shelf)
 Enable this object if shelf equals its shelf, else disable it.
 
void update ()
 Declared but not defined in PVPCtrls.cc.
 
bool enabled () const
 Return the result of the last enable() call (false before any call).
 
void setPartition ()
 Select this partition in the Module (Module::setPartition()); the callers in PVPCtrls.cc hold the semaphore.
 
Module & module ()
 Return the Module.
 
Semaphore & sem ()
 Return the semaphore taken around Module register access.
 
void l0Select (unsigned v)
 Store the L0 select mode (FixedRate, ACRate or Sequence) used by setL0Select().
 
void fixedRate (unsigned v)
 Store the rate that setL0Select() passes to Module::setL0Select_FixedRate().
 
void acRate (unsigned v)
 Store the rate that setL0Select() passes to Module::setL0Select_ACRate().
 
void acTimeslot (unsigned v)
 Store the timeslot mask that setL0Select() passes to Module::setL0Select_ACRate().
 
void seqIdx (unsigned v)
 Store the sequencer number that setL0Select() passes to Module::setL0Select_Sequence().
 
void seqBit (unsigned v)
 Store the sequence bit that setL0Select() passes to Module::setL0Select_Sequence().
 
void dstSelect (unsigned v)
 Store the destination mode that setL0Select() passes to Module::setL0Select_Destn().
 
void dstMask (unsigned v)
 Store the destination mask that setL0Select() passes to Module::setL0Select_Destn().
 
void configKey (unsigned v)
 Store the key that msg_config() writes as the message payload.
 
void setL0Select ()
 Under the semaphore, program the rate selection of this partition from the stored mode and values, then its destination selection.
 
void setDstSelect ()
 Declared but not defined in PVPCtrls.cc.
 
void msg_config ()
 Under the semaphore, write the configuration key as the message payload, set the message header to TransitionId::Configure and insert the message.
 
void msg_enable ()
 Under the semaphore, set the message header to TransitionId::Enable and insert the message; the payload is not changed.
 
void msg_disable ()
 Under the semaphore, set the message header to TransitionId::Disable and insert the message; the payload is not changed.
 
void msg_clear ()
 Under the semaphore, write payload 0, set the message header to 0 (the file-local MsgClear) and insert the message.
 
void dump () const
 Print the stored partition and L0 select values if PVPCtrls.cc is compiled with DBUG; otherwise does nothing.
 

Detailed Description

EPICS control PVs of one partition of an XPM; their callbacks program the L0 select, L1 trigger, analysis tag, message and inhibit registers of that partition in the Module.

Apart from the XPM PV, a PV callback acts only while enabled(), that is while the value of the XPM PV equals this shelf.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

L0 select modes stored by l0Select() and used by setL0Select().

Enumerator
FixedRate 

Use Module::setL0Select_FixedRate().

ACRate 

Use Module::setL0Select_ACRate().

Sequence 

Use Module::setL0Select_Sequence().

Constructor & Destructor Documentation

◆ PVPCtrls()

Pds::Xpm::PVPCtrls::PVPCtrls ( Module &  ,
Semaphore &  ,
PVPStats &  ,
unsigned  shelf,
unsigned  partition 
)

Store the module, semaphore, statistics object, shelf and partition; starts disabled and without PVs.

The statistics object is stored but not used in PVPCtrls.cc.

◆ ~PVPCtrls()

Pds::Xpm::PVPCtrls::~PVPCtrls ( )

Does nothing; the PVs created by allocate() are not deleted.

Member Function Documentation

◆ acRate()

void Pds::Xpm::PVPCtrls::acRate ( unsigned  v)

Store the rate that setL0Select() passes to Module::setL0Select_ACRate().

◆ acTimeslot()

void Pds::Xpm::PVPCtrls::acTimeslot ( unsigned  v)

Store the timeslot mask that setL0Select() passes to Module::setL0Select_ACRate().

◆ allocate()

void Pds::Xpm::PVPCtrls::allocate ( const std::string &  title)

Delete the PVs of an earlier call and create one PV per control, named title, a colon and the control name (XPM, Run, L0Select, MsgConfig and others).

InhInterval, InhLimit and InhEnable get four PVs each, with suffixes 0 to 3.

◆ configKey()

void Pds::Xpm::PVPCtrls::configKey ( unsigned  v)

Store the key that msg_config() writes as the message payload.

◆ dstMask()

void Pds::Xpm::PVPCtrls::dstMask ( unsigned  v)

Store the destination mask that setL0Select() passes to Module::setL0Select_Destn().

◆ dstSelect()

void Pds::Xpm::PVPCtrls::dstSelect ( unsigned  v)

Store the destination mode that setL0Select() passes to Module::setL0Select_Destn().

◆ dump()

void Pds::Xpm::PVPCtrls::dump ( ) const

Print the stored partition and L0 select values if PVPCtrls.cc is compiled with DBUG; otherwise does nothing.

◆ enable()

void Pds::Xpm::PVPCtrls::enable ( unsigned  shelf)

Enable this object if shelf equals its shelf, else disable it.

Under the semaphore, reset L0, set the Module master bit to the result and, if disabled, clear the L0 enable; if enabled, then call updated() on every PV except the first eight (XPM, Run, the message PVs and others).

◆ enabled()

bool Pds::Xpm::PVPCtrls::enabled ( ) const

Return the result of the last enable() call (false before any call).

◆ fixedRate()

void Pds::Xpm::PVPCtrls::fixedRate ( unsigned  v)

Store the rate that setL0Select() passes to Module::setL0Select_FixedRate().

◆ l0Select()

void Pds::Xpm::PVPCtrls::l0Select ( unsigned  v)

Store the L0 select mode (FixedRate, ACRate or Sequence) used by setL0Select().

◆ module()

Module & Pds::Xpm::PVPCtrls::module ( )

Return the Module.

◆ msg_clear()

void Pds::Xpm::PVPCtrls::msg_clear ( )

Under the semaphore, write payload 0, set the message header to 0 (the file-local MsgClear) and insert the message.

◆ msg_config()

void Pds::Xpm::PVPCtrls::msg_config ( )

Under the semaphore, write the configuration key as the message payload, set the message header to TransitionId::Configure and insert the message.

◆ msg_disable()

void Pds::Xpm::PVPCtrls::msg_disable ( )

Under the semaphore, set the message header to TransitionId::Disable and insert the message; the payload is not changed.

◆ msg_enable()

void Pds::Xpm::PVPCtrls::msg_enable ( )

Under the semaphore, set the message header to TransitionId::Enable and insert the message; the payload is not changed.

◆ sem()

Semaphore & Pds::Xpm::PVPCtrls::sem ( )

Return the semaphore taken around Module register access.

◆ seqBit()

void Pds::Xpm::PVPCtrls::seqBit ( unsigned  v)

Store the sequence bit that setL0Select() passes to Module::setL0Select_Sequence().

◆ seqIdx()

void Pds::Xpm::PVPCtrls::seqIdx ( unsigned  v)

Store the sequencer number that setL0Select() passes to Module::setL0Select_Sequence().

◆ setDstSelect()

void Pds::Xpm::PVPCtrls::setDstSelect ( )

Declared but not defined in PVPCtrls.cc.

◆ setL0Select()

void Pds::Xpm::PVPCtrls::setL0Select ( )

Under the semaphore, program the rate selection of this partition from the stored mode and values, then its destination selection.

An unknown mode only prints a message; the destination is still written.

◆ setPartition()

void Pds::Xpm::PVPCtrls::setPartition ( )

Select this partition in the Module (Module::setPartition()); the callers in PVPCtrls.cc hold the semaphore.

◆ update()

void Pds::Xpm::PVPCtrls::update ( )

Declared but not defined in PVPCtrls.cc.


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