1 #ifndef ANTENNAMASTER_H
2 #define ANTENNAMASTER_H
23 #include "carma/szautil/Directives.h"
34 #define ANTENNA_HEARTBEAT_SIGNAL SIGRTMIN+1
35 #define ANTENNA_DRIVE_SIGNAL SIGRTMIN+2
36 #define ANTENNA_MONITOR_SIGNAL SIGRTMIN+3
37 #define STROBE_PMAC_SIGNAL SIGRTMIN+4
38 #define CONNECT_SIGNAL SIGRTMIN+5
43 #define ANTENNA_HEARTBEAT_SEC 5
47 #define ANTENNA_DRIVE_SEC 1
53 #define ANTENNA_DRIVE_DELAY_NSEC 500000000 // Delay after the integral
64 #define ANTENNA_MONITOR_NSEC 500000000 // 2Hz data pulse
72 #define STROBE_PMAC_NSEC 500000000
78 #define STROBE_PMAC_DELAY_NSEC 250000000 // Delay after the integral
85 #define CONNECT_SEC 2 // Connect timer
87 #define ANTENNAMASTER_TASK_FWD_FN(fn) void (fn)(AntennaMasterMsg* msg)
112 public sza::util::GenericMasterTask<AntennaMasterMsg> {
132 bool newcaltert=
true,
135 bool ignoreWrapLogic=
true);
277 inline std::string
host() {
return host_;}
306 inline unsigned getIFNodeId() {
310 void setArgs(
unsigned nArg,
char** argv);
311 std::vector<std::string> getArgs();
317 bool ignoreWrapLogic() {
318 return ignoreWrapLogic_;
329 std::vector<std::string> args_;
344 bool ignoreWrapLogic_;
364 std::string nameServer_;
370 std::string objectName_;
375 std::string eventServer_;
380 std::string notifyServer_;
386 std::string eventChannelName_;
396 static THREAD_START(startAntennaCanBus);
402 static THREAD_START(startAntennaDrive);
407 static THREAD_START(startAntennaMonitor);
412 static THREAD_START(startAntennaControl);
417 static THREAD_START(startAntennaRx);
422 static THREAD_START(startAntennaSignal);
427 static THREAD_START(startUmacControl);
435 static THREAD_CLEAN(cleanAntennaDrive);
440 static THREAD_CLEAN(cleanAntennaMonitor);
445 static THREAD_CLEAN(cleanAntennaCanbus);
450 static THREAD_CLEAN(cleanAntennaControl);
455 static THREAD_CLEAN(cleanAntennaRx);
460 static THREAD_CLEAN(cleanAntennaSignal);
465 static THREAD_CLEAN(cleanUmacControl);
475 static THREAD_PING(pingAntennaControl);
482 static THREAD_PING(pingAntennaDrive);
489 static THREAD_PING(pingAntennaMonitor);
496 static THREAD_PING(pingAntennaRx);
506 sza::antenna::control::AntennaControl* controlTask_;
538 void processMsg(AntennaMasterMsg* taskMsg);
557 static ANTENNAMASTER_TASK_FWD_FN(forwardControlMsg);
562 static ANTENNAMASTER_TASK_FWD_FN(forwardDriveMsg);
567 static ANTENNAMASTER_TASK_FWD_FN(forwardMonitorMsg);
572 static ANTENNAMASTER_TASK_FWD_FN(forwardRxMsg);
577 static ANTENNAMASTER_TASK_FWD_FN(forwardUmacControlMsg);
584 ANTENNAMASTER_TASK_FWD_FN(**brd_fns_);
589 void initBoardFlagging();
608 void recordAdoption(AntennaMasterMsg* msg);
616 void flagBoard(AntennaMasterMsg* msg);
624 void sendHeartBeat();
629 void installTimers();
634 void installSignals();
A class to enumerate a single Antenna, or a set of Antennas.
SIGNALTASK_HANDLER_FN(doNothing)
A no-op signal handler for signals we wish to explicitly disable.
sza::antenna::control::AntennaControl * AntennaControl()
Return a pointer to the Control task resources.
~AntennaMaster()
Destructor.
std::string objectName()
A copy of the CORBA object name that the nameserver will associate with us.
Tagged: Thu Nov 13 16:53:31 UTC 2003.
std::string host()
A copy of the Nameserver name to which we will attach.
sza::antenna::control::AntennaMonitor * AntennaMonitor()
Return a pointer to the Monitor task resources.
Define a class for sending snapshots of the antenna state back to the control program for archiving...
std::string nameServer()
A copy of the Nameserver name to which we will attach.
sza::antenna::control::AntennaRx * AntennaRx()
Return a pointer to the Receiver task resources.
Tagged: Thu Nov 13 16:53:54 UTC 2003.
std::string eventChannelName()
A copy of the event channel name on which we will send data back to the outside world.
void restartServices()
Public interface to startThreads()
void sendRestartMsg()
Method to send a stop message to this task via its message queue.
AntennaRx class will handle all receiver functions.
sza::antenna::control::UmacControl * UmacControl()
Return a pointer to the Receiver task resources.
AntennaRx class will handle all receiver functions.
std::string notifyServer()
A copy of the Notifyserver name to which we will attach.
Tagged: Fri Nov 14 12:39:31 UTC 2003.
Tagged: Tue Jul 6 17:41:36 PDT 2004.
Tagged: Thu Nov 13 16:53:29 UTC 2003.
static void() forwardMasterMsg(AntennaMasterMsg *msg)
Public method by which other tasks can forward message to us.
sza::antenna::control::AntennaDrive * AntennaDrive()
Return a pointer to the Drive control task resources.
Tagged: Fri Nov 14 12:39:36 UTC 2003.
void sendAdoptBoardMsg(unsigned short, AntennaTask::Id taskId)
Method by which other tasks can ask us for control of boards.
std::string eventServer()
A copy of the Eventserver name to which we will attach.
sza::util::AntNum * getAnt()
Public method to get a reference to our antenna enumerator.
Id
An enumerator to identify a valid antenna task.
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.
The AntennaDrive collects together the functionality of the base class Drive and its descendants...
Tagged: Thu Nov 13 16:53:54 UTC 2003.
SzaShare * getShare()
Public method to get a reference to our shared resource object.
An instance of this class is created by AntennaMaster and passed to the constructors of other tasks...
Define a class to encapsulate the entire Antenna control system.