CCrateController Class Reference

#include <CCrateController.h>

List of all members.

Public Member Functions

 CCrateController (unsigned int b, unsigned int c)
 CCrateController (const CCrateController &rhs)
 ~CCrateController ()
 Destructor.
CCrateControlleroperator= (const CCrateController &rhs)
 Assignment.
int operator== (const CCrateController &rhs) const
 Comparison for equality.
int operator!= (const CCrateController &rhs) const
CBD8210 getCBD8210 () const
CCamacModule getSlot28 () const
CCamacModule getSlot30 () const
CCamacModule getBroadcastSlot () const
CCamacModule getMulticastSlot () const
void Z ()
void C ()
long Lams ()
void WriteSnr (unsigned long nMask)
void UnInhibit ()
void DisableDemand ()
void Inhibit ()
void EnableDemand ()
bool isInhibited ()
bool isDemanding ()
bool isDemandEnabled ()
void BroadcastControl (unsigned int f, unsigned int a)
void BroadcastWrite (unsigned int f, unsigned int a, unsigned long d)
void MulticastControl (unsigned int f, unsigned int a, unsigned long nMask)
void MulticastWrite (unsigned int f, unsigned int a, unsigned long nMask, unsigned long nData)
void InitializeCrate ()

Private Attributes

CBD8210 m_myBranch
 Branch highway driver we live in.
CCamacModule m_Slot28
 C/Z happen via this slot.
CCamacModule m_Slot30
 Most other controller ops are here.
CCamacModule m_Broadcast
 Broadcast operations via this slot.
CCamacModule m_Multicast
 Multicast operations via SNR and this slot.


Detailed Description

Encapsulates a BiRa 1302 parallel branch highway crate controller. This controller answers in three slots: N28 - C/Z operations. N30 - Most of the other operations. N26 Broadcast FNAD N24 Multicast FNAD as pser the SNR.

Definition at line 302 of file CCrateController.h.


Constructor & Destructor Documentation

CCrateController::CCrateController ( unsigned int  b,
unsigned int  c 
)

Default constructor. This is called when declarations of the form e.g.:

Definition at line 296 of file CCrateController.cpp.

CCrateController::CCrateController ( const CCrateController rhs  ) 

Copy construction. This is invoked when e.g. an object is passed by value to a function. The copy constructor makes a clone of the rhs object.

Definition at line 310 of file CCrateController.cpp.

CCrateController::~CCrateController (  )  [inline]

Destructor.

Definition at line 317 of file CCrateController.h.


Member Function Documentation

CCrateController & CCrateController::operator= ( const CCrateController rhs  ) 

Assignment.

Assignment operation. This member function supports assignment of an object of this class to an object of the same class.

Definition at line 326 of file CCrateController.cpp.

References m_Broadcast, m_Multicast, m_myBranch, m_Slot28, and m_Slot30.

int CCrateController::operator== ( const CCrateController rhs  )  const

Comparison for equality.

Referenced by operator!=().

int CCrateController::operator!= ( const CCrateController rhs  )  const [inline]

Definition at line 321 of file CCrateController.h.

References operator==().

CBD8210 CCrateController::getCBD8210 (  )  const [inline]

Definition at line 328 of file CCrateController.h.

References m_myBranch.

CCamacModule CCrateController::getSlot28 (  )  const [inline]

Definition at line 331 of file CCrateController.h.

References m_Slot28.

CCamacModule CCrateController::getSlot30 (  )  const [inline]

Definition at line 335 of file CCrateController.h.

References m_Slot30.

CCamacModule CCrateController::getBroadcastSlot (  )  const [inline]

Definition at line 339 of file CCrateController.h.

References m_Broadcast.

CCamacModule CCrateController::getMulticastSlot (  )  const [inline]

Definition at line 343 of file CCrateController.h.

References m_Multicast.

void CCrateController::Z (  ) 

Performs a Crate Z operations. The Z line in the crate is strobed. This is an N28.F26.A8

Definition at line 348 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot28.

Referenced by InitializeCrate().

void CCrateController::C (  ) 

Performs a Create C operations. The C line in the crate is strobed. This is N28.F26.A9

Definition at line 362 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot28.

Referenced by InitializeCrate().

long CCrateController::Lams (  ) 

Returns the contents of the Create Graded LAM register. For NSCL configured controllers with the standard Graded LAM jumper header installed, the result is a bitmask which indicates which modules have LAMs set in them. N30.F0.A0

Definition at line 378 of file CCrateController.cpp.

References m_Slot30, and CCamacModule::Read().

void CCrateController::WriteSnr ( unsigned long  nMask  ) 

Writes the Station number mask register. The 1302 suports multicast operations. A multicast operation consists of selecting the modules to be affected by writing the SNR mask and then performing the desired F.A at N24. The member functions MulticastControl and MulticastWrite perform both of these operations and should be used.

Parameters:
unsigned long nMask

Definition at line 396 of file CCrateController.cpp.

References m_Slot30, and CCamacModule::Write().

Referenced by MulticastControl(), and MulticastWrite().

void CCrateController::UnInhibit (  ) 

Removes the inhibit signal from the dataway. The state of the inhibit can be tested, and the I led on the module reflects it as well.

Definition at line 409 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot30.

Referenced by InitializeCrate().

void CCrateController::DisableDemand (  ) 

Disables the production of branch demands. A branch demand is created whenever the GL register is non-zero when enabled.

Definition at line 422 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot30.

Referenced by InitializeCrate().

void CCrateController::Inhibit (  ) 

Sets the data way inhibit.

Definition at line 433 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot30.

void CCrateController::EnableDemand (  ) 

Enables the Branch demand from this crate. When the BD is enabled, anytime there's a non zero value in the Gl register, a branch demand is created.

Definition at line 445 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Slot30.

bool CCrateController::isInhibited (  ) 

true if the crate is inhibited. Note that this operation invovles N30.f27.a9 followed by a Q test on the branch. If the multiple processes are accessing the same crate concurrently, this function is not reliable.

Definition at line 461 of file CCrateController.cpp.

References CCamacModule::Control(), m_myBranch, m_Slot30, and CBD8210::Qtest().

bool CCrateController::isDemanding (  ) 

Returns true if the crate is currently issuing a demand. This funciton requires a n30.f24.a10 followed by a Qtest. If other processes or threads are concurrently accessing the crate this may return incorrect results.

Definition at line 476 of file CCrateController.cpp.

References CCamacModule::Control(), m_myBranch, m_Slot30, and CBD8210::Qtest().

bool CCrateController::isDemandEnabled (  ) 

Returns true if the Branch Demand is enabled. When the branch demand is enabled, this module can initiate branch demands whenever the GL register is nonzero. This function requires a n30.f27.a11 followed by a Q test in the branch controller. This operation is not gaurenteed to work if other threads or processes are concurrently accessing the branch.

Definition at line 493 of file CCrateController.cpp.

References CCamacModule::Control(), m_myBranch, m_Slot30, and CBD8210::Qtest().

void CCrateController::BroadcastControl ( unsigned int  f,
unsigned int  a 
)

Broadcasts the same control F.A to all modules in the crate. Note that F must be in the range of valid control functions.

Parameters:
f - Function code to broadcast.
a - Subaddress to broadcast at.
Exceptions:
CRangeError - If F is not a control function [8-15,24-31], or A is not a valid subaddress [0,16).
Parameters:
unsigned int f, unsigned int a

Definition at line 514 of file CCrateController.cpp.

References CCamacModule::Control(), and m_Broadcast.

void CCrateController::BroadcastWrite ( unsigned int  f,
unsigned int  a,
unsigned long  d 
)

Broadcasts the same write F and A to all modules in the crate.

Parameters:
f - Function code to broadcast.
a - Subaddress of broadcast.
d - longword data to write.
Exceptions:
CRangeException - if either f is not a write operation [16-24) or a is not a valid subaddress [0,16).
Parameters:
unsigned int f, unsigned int a

Definition at line 537 of file CCrateController.cpp.

References m_Broadcast, and CCamacModule::Write().

void CCrateController::MulticastControl ( unsigned int  f,
unsigned int  a,
unsigned long  nMask 
)

Multicasts the same control F.A to a set of modules. The modules are selected by a bitmask. Low order bit represents slot1. e.g. a mask value of: 0x15 multicasts to slots 1,3,5

Parameters:
f - Function to broadcast. Must be a valid control function.
a - Subaddress associated with the function.
nMask - Mask of slots to which the operation is multicast.
Exceptions:
CRangeError - if f not in {[8-16), [24,32)} or a is not in [0,16).
Note:
This operation is not atomic. It requires writing the Slot mask register and then performing the multicast. If more than one thread or process is concurrently accessing the crate, this operation is not reliable. this is especially true if the other threads/processes are also doing multicasts.

Definition at line 568 of file CCrateController.cpp.

References CCamacModule::Control(), m_Multicast, and WriteSnr().

void CCrateController::MulticastWrite ( unsigned int  f,
unsigned int  a,
unsigned long  nMask,
unsigned long  nData 
)

Performs a multicast write. The specified data is written to the set of modules selected by a mask. See MulticastControl for information about the format of this mask.

Parameters:
f - Function code to execute.
a - Subaddress at which the function is done.
nMask - Mask of slots describing the multicast.
nData - 24 bit data to write.
Note:
This function is not atomic with respect to the crate. This means that if other threads or processes are concurrently attempting to multicast operations, this operation can fail.

Definition at line 594 of file CCrateController.cpp.

References m_Multicast, CCamacModule::Write(), and WriteSnr().

void CCrateController::InitializeCrate (  ) 

The crate is returned to a known configuration. This means that C/Z are done, the crate I is removed and branch demands are disabled.

Definition at line 609 of file CCrateController.cpp.

References C(), DisableDemand(), UnInhibit(), and Z().


Member Data Documentation

CBD8210 CCrateController::m_myBranch [private]

Branch highway driver we live in.

Definition at line 306 of file CCrateController.h.

Referenced by getCBD8210(), isDemandEnabled(), isDemanding(), isInhibited(), and operator=().

CCamacModule CCrateController::m_Slot28 [private]

C/Z happen via this slot.

Definition at line 307 of file CCrateController.h.

Referenced by C(), getSlot28(), operator=(), and Z().

CCamacModule CCrateController::m_Slot30 [private]

Most other controller ops are here.

Definition at line 308 of file CCrateController.h.

Referenced by DisableDemand(), EnableDemand(), getSlot30(), Inhibit(), isDemandEnabled(), isDemanding(), isInhibited(), Lams(), operator=(), UnInhibit(), and WriteSnr().

CCamacModule CCrateController::m_Broadcast [private]

Broadcast operations via this slot.

Definition at line 309 of file CCrateController.h.

Referenced by BroadcastControl(), BroadcastWrite(), getBroadcastSlot(), and operator=().

CCamacModule CCrateController::m_Multicast [private]

Multicast operations via SNR and this slot.

Definition at line 310 of file CCrateController.h.

Referenced by getMulticastSlot(), MulticastControl(), MulticastWrite(), and operator=().


The documentation for this class was generated from the following files:
Generated on Wed Sep 17 08:38:11 2008 for NSCL Device support. by  doxygen 1.5.1