CARMA C++
sza::antenna::control::AntennaMaster Class Reference

Define a class to encapsulate the entire Antenna control system. More...

#include <carma/antenna/sza/antenna/control/AntennaMaster.h>

Inherits sza::antenna::control::SzaTask, and sza::util::GenericMasterTask< Msg >.

Public Member Functions

sza::antenna::control::AntennaControl * AntennaControl ()
 Return a pointer to the Control task resources. More...
 
sza::antenna::control::AntennaDriveAntennaDrive ()
 Return a pointer to the Drive control task resources. More...
 
 AntennaMaster (std::string host, std::string nameServer, const std::string &objectName, std::string eventServer, const std::string &eventChannelName, std::string notifyServer, bool simulateCanbus, const sza::util::AntNum &antNum, bool simPmac=false, unsigned ifNodeId=1, bool connect=true, bool newcaltert=true, unsigned nArg=0, char **argv=0, bool ignoreWrapLogic=true)
 Constructor. More...
 
sza::antenna::control::AntennaMonitorAntennaMonitor ()
 Return a pointer to the Monitor task resources. More...
 
sza::antenna::control::AntennaRxAntennaRx ()
 Return a pointer to the Receiver task resources. More...
 
std::string eventChannelName ()
 A copy of the event channel name on which we will send data back to the outside world. More...
 
std::string eventServer ()
 A copy of the Eventserver name to which we will attach. More...
 
sza::util::AntNumgetAnt ()
 Public method to get a reference to our antenna enumerator. More...
 
std::vector< std::string > getArgs ()
 
unsigned getIFNodeId ()
 
SzaSharegetShare ()
 Public method to get a reference to our shared resource object. More...
 
std::string host ()
 A copy of the Nameserver name to which we will attach. More...
 
bool ignoreWrapLogic ()
 
std::string nameServer ()
 A copy of the Nameserver name to which we will attach. More...
 
bool newCaltert ()
 
std::string notifyServer ()
 A copy of the Notifyserver name to which we will attach. More...
 
std::string objectName ()
 A copy of the CORBA object name that the nameserver will associate with us. More...
 
void restartServices ()
 Public interface to startThreads() More...
 
void sendAdoptBoardMsg (unsigned short, AntennaTask::Id taskId)
 Method by which other tasks can ask us for control of boards. More...
 
void setArgs (unsigned nArg, char **argv)
 
 SIGNALTASK_HANDLER_FN (doNothing)
 A no-op signal handler for signals we wish to explicitly disable. More...
 
sza::antenna::control::UmacControlUmacControl ()
 Return a pointer to the Receiver task resources. More...
 
 ~AntennaMaster ()
 Destructor. More...
 
- Public Member Functions inherited from sza::antenna::control::SzaTask
SzaSharegetShare ()
 Public method to get a pointer to our shared object. More...
 
 SzaTask ()
 Constructor. More...
 
virtual ~SzaTask ()
 Make this virtual so that inheritors destructors are properly called even if they are upcast. More...
 
- Public Member Functions inherited from sza::util::GenericMasterTask< Msg >
 GenericMasterTask ()
 Constructor. More...
 
virtual ~GenericMasterTask ()
 Destructor. More...
 
- Public Member Functions inherited from sza::util::GenericTask< Msg >
virtual void fwdTaskMsg (Msg *msg)
 Forward a message to this task via its message queue. More...
 
void sendHeartBeatMsg ()
 Method to send a heartbeat message to this task via its message queue. More...
 
void sendRestartMsg ()
 Method to send a stop message to this task via its message queue. More...
 
void sendStopMsg ()
 Method to send a stop message to this task via its message queue. More...
 

Static Public Member Functions

static void() forwardMasterMsg (AntennaMasterMsg *msg)
 Public method by which other tasks can forward message to us. More...
 
static SIGNALTASK_HANDLER_FN (sendSendHeartBeatMsg)
 Send a message to the AntennaMaster to tell it to send out a heartbeat request to all subordinate threads. More...
 
static SIGNALTASK_HANDLER_FN (sendShutDownMsg)
 Send a message to the AntennaMaster to tell it to shut down. More...
 
static SIGNALTASK_HANDLER_FN (sendPackDataFrameMsg)
 Send a message to the monitor task that it's time to pack a data frame for transmission back to the ACC. More...
 
static SIGNALTASK_HANDLER_FN (sendDriveTickMsg)
 Tell the Tracker task that the 1-second pulse has arrived. More...
 
static SIGNALTASK_HANDLER_FN (sendConnectControlMsg)
 Tell the Control task to attempt to connect to the host. More...
 
static SIGNALTASK_HANDLER_FN (sendConnectPmacMsg)
 Tell the Tracker to attempt to connect to the pmac. More...
 
static SIGNALTASK_HANDLER_FN (sendConnectScannerMsg)
 Tell the Control task to attempt to connect to the host. More...
 
static SIGNALTASK_HANDLER_FN (sendStrobePmacMsg)
 Tell the Tracker to readout the pmac DPRAM. More...
 
- Static Public Member Functions inherited from sza::util::GenericMasterTask< Msg >
static void signalHandler (int sigNo)
 Signal handler. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sza::util::GenericMasterTask< Msg >
void addHandler (Msg *msg)
 Respond to a message to add/remove a handler. More...
 
void enableTimer (Msg *msg)
 Respond to a message to enable/disable a timer. More...
 
void installSignal (Msg *msg)
 Respond to a message to install a signal. More...
 
virtual void installSignals ()
 Install timers of interest to us. More...
 
void installTimer (Msg *msg)
 Respond to a message to install a timer. More...
 
virtual void installTimers ()
 Install timers of interest to us. More...
 
void processTaskMsg (bool *stop)
 Method to process a message received on the Task message * queue. More...
 
void sendAddHandlerMsg (std::string name, SIGNALTASK_HANDLER_FN(*handler), bool add)
 A message to add/remove a signal handler. More...
 
void sendEnableTimerMsg (std::string name, bool enable)
 A message to enable/disable a timer. More...
 
void sendInstallSignalMsg (int sigNo, SIGNALTASK_HANDLER_FN(*handler))
 A method to install a signal. More...
 
void sendInstallTimerMsg (std::string name, int sigNo, unsigned long intervalSec, unsigned long intervalNsec, SIGNALTASK_HANDLER_FN(*handler))
 Send a message to the master thread to install a timer. More...
 
void sendInstallTimerMsg (std::string name, int sigNo, unsigned long initSec, unsigned long initNsec, unsigned long intervalSec, unsigned long intervalNsec, SIGNALTASK_HANDLER_FN(*handler))
 Send the signal task a message to install a timer. More...
 
- Protected Member Functions inherited from sza::util::GenericTask< Msg >
virtual void addHandler (Msg *msg)
 Respond to a message to add/remove a handler. More...
 
void cancelThread (unsigned order)
 Cancel the next thread with the specified order. More...
 
void cancelThreads ()
 A method to cancel threads managed by this task. More...
 
virtual void enableTimer (Msg *msg)
 Respond to a message to enable/disable a timer. More...
 
 GenericTask ()
 Protected constructor ensures that the base class cannot be instantiated. More...
 
 GenericTask (Thread *thread)
 Constructor which initializes thread_, below. More...
 
unsigned getMinCancelOrder ()
 Method to return the minimum cancel order for threads which are not yet running. More...
 
unsigned getMinStartOrder ()
 Method to return the minimum start order for threads which are not yet running. More...
 
ThreadgetThread (std::string name)
 A method to start all threads managed by this task running. More...
 
virtual void installSignal (Msg *msg)
 Respond to a message to install a signal. More...
 
virtual void installTimer (Msg *msg)
 Respond to a message to install a timer. More...
 
void pingThreads (void *arg)
 A method to ping all pingable threads managed by this task. More...
 
virtual void processMsg (Msg *msg)
 This method should be defined by each inheriting task to process its own task-specific messages. More...
 
virtual void processTaskMsg (bool *stop)
 Process a message received on our message queue. More...
 
void raise (std::string name, int sigNo)
 Raise a signal to a named thread. More...
 
virtual void respondToHeartBeat ()
 Respond to a heartbeat message. More...
 
virtual void restart (void)
 Restart this thread. More...
 
virtual void run (void)
 Force inheritors to define a run method. More...
 
void sendTaskMsg (Msg *msg)
 Send a message to this task via its message queue. More...
 
virtual void serviceMsgQ (void)
 This routine will simply block, servicing messages on the message queue. More...
 
void shutdownConnection (int fd)
 Shutdown a connection. More...
 
void startThread (void *arg, unsigned order)
 Start the next thread with the specified order. More...
 
void startThreads (void *arg)
 A method to start all threads. More...
 
bool threadsAreRunning ()
 A method to test if the threads managed by this task are running. More...
 
bool threadsNeedCancelling ()
 Return true if there are still uncancelled threads. More...
 
bool threadsNeedStarting ()
 Return true if there are still unstarted threads. More...
 
virtual ~GenericTask ()
 Making the destructor virtual ensures that the right destructor will be called for classes which inherit from GenericTask. More...
 
- Protected Attributes inherited from sza::antenna::control::SzaTask
SzaShareshare_
 The shared-memory object. More...
 
- Protected Attributes inherited from sza::util::GenericMasterTask< Msg >
sza::util::SignalTasksignal_
 Handles all signals for this process. More...
 
- Protected Attributes inherited from sza::util::GenericTask< Msg >
sza::util::FdSet fdSet_
 A set of file descriptors associated with this task. More...
 
PipeQ< Msg > msgq_
 A message queue, implemented as a pipe, by which we can communicate with this task. More...
 
Threadthread_
 If this GenericTask object was instantiated by another thread, keep a pointer to it here. More...
 
std::vector< Thread * > threads_
 A vector of Thread objects managed by this task. More...
 
- Static Protected Attributes inherited from sza::util::GenericMasterTask< Msg >
static GenericMasterTask< Msg > * masterTask_ = 0
 

Detailed Description

Define a class to encapsulate the entire Antenna control system.

Instantiating this object will spawn all subsystem threads of the Antenna control system, which currently include a receiver task, a drive system task and a monitoring task.

Definition at line 110 of file AntennaMaster.h.

Constructor & Destructor Documentation

sza::antenna::control::AntennaMaster::AntennaMaster ( std::string  host,
std::string  nameServer,
const std::string &  objectName,
std::string  eventServer,
const std::string &  eventChannelName,
std::string  notifyServer,
bool  simulateCanbus,
const sza::util::AntNum antNum,
bool  simPmac = false,
unsigned  ifNodeId = 1,
bool  connect = true,
bool  newcaltert = true,
unsigned  nArg = 0,
char **  argv = 0,
bool  ignoreWrapLogic = true 
)

Constructor.

Exceptions
Exception;
sza::antenna::control::AntennaMaster::~AntennaMaster ( )

Destructor.

Exceptions
Exception

Member Function Documentation

sza::antenna::control::AntennaControl* sza::antenna::control::AntennaMaster::AntennaControl ( )

Return a pointer to the Control task resources.

sza::antenna::control::AntennaDrive* sza::antenna::control::AntennaMaster::AntennaDrive ( )

Return a pointer to the Drive control task resources.

sza::antenna::control::AntennaMonitor* sza::antenna::control::AntennaMaster::AntennaMonitor ( )

Return a pointer to the Monitor task resources.

sza::antenna::control::AntennaRx* sza::antenna::control::AntennaMaster::AntennaRx ( )

Return a pointer to the Receiver task resources.

std::string sza::antenna::control::AntennaMaster::eventChannelName ( )

A copy of the event channel name on which we will send data back to the outside world.

Definition at line 304 of file AntennaMaster.h.

std::string sza::antenna::control::AntennaMaster::eventServer ( )

A copy of the Eventserver name to which we will attach.

Definition at line 293 of file AntennaMaster.h.

static void() sza::antenna::control::AntennaMaster::forwardMasterMsg ( AntennaMasterMsg msg)
static

Public method by which other tasks can forward message to us.

sza::util::AntNum* sza::antenna::control::AntennaMaster::getAnt ( )

Public method to get a reference to our antenna enumerator.

SzaShare* sza::antenna::control::AntennaMaster::getShare ( )

Public method to get a reference to our shared resource object.

std::string sza::antenna::control::AntennaMaster::host ( )

A copy of the Nameserver name to which we will attach.

Definition at line 277 of file AntennaMaster.h.

std::string sza::antenna::control::AntennaMaster::nameServer ( )

A copy of the Nameserver name to which we will attach.

Definition at line 282 of file AntennaMaster.h.

std::string sza::antenna::control::AntennaMaster::notifyServer ( )

A copy of the Notifyserver name to which we will attach.

Definition at line 298 of file AntennaMaster.h.

std::string sza::antenna::control::AntennaMaster::objectName ( )

A copy of the CORBA object name that the nameserver will associate with us.

Definition at line 288 of file AntennaMaster.h.

void sza::antenna::control::AntennaMaster::restartServices ( )

Public interface to startThreads()

Exceptions
Exception
void sza::antenna::control::AntennaMaster::sendAdoptBoardMsg ( unsigned  short,
AntennaTask::Id  taskId 
)

Method by which other tasks can ask us for control of boards.

Exceptions
Exception(via MsgQ::sendMsg)
sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( doNothing  )

A no-op signal handler for signals we wish to explicitly disable.

static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendSendHeartBeatMsg  )
static

Send a message to the AntennaMaster to tell it to send out a heartbeat request to all subordinate threads.

Exceptions
Exception(via MsgQ::sendMsg)
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendShutDownMsg  )
static

Send a message to the AntennaMaster to tell it to shut down.

Exceptions
Exception(via MsgQ::sendMsg)
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendPackDataFrameMsg  )
static

Send a message to the monitor task that it's time to pack a data frame for transmission back to the ACC.

static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendDriveTickMsg  )
static

Tell the Tracker task that the 1-second pulse has arrived.

Exceptions
Exception
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendConnectControlMsg  )
static

Tell the Control task to attempt to connect to the host.

Exceptions
Exception
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendConnectPmacMsg  )
static

Tell the Tracker to attempt to connect to the pmac.

Exceptions
Exception
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendConnectScannerMsg  )
static

Tell the Control task to attempt to connect to the host.

Exceptions
Exception
static sza::antenna::control::AntennaMaster::SIGNALTASK_HANDLER_FN ( sendStrobePmacMsg  )
static

Tell the Tracker to readout the pmac DPRAM.

Exceptions
Exception
sza::antenna::control::UmacControl* sza::antenna::control::AntennaMaster::UmacControl ( )

Return a pointer to the Receiver task resources.


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