CARMA C++
SharedOpticsSeqNo.h
1 #ifndef CARMA_ANTENNA_OVRO_SHAREDOPTICSSEQNO_H
2 #define CARMA_ANTENNA_OVRO_SHAREDOPTICSSEQNO_H
3 
4 #include "carma/util/PthreadMutex.h"
5 #include "carma/util/types.h"
6 
7 namespace carma {
8 
9 namespace monitor {
10  class AntennaCommon;
11 }
12 
13 namespace antenna {
14 namespace ovro {
15 
16 class SharedOpticsSeqNo {
17 public:
18 
19  SharedOpticsSeqNo( carma::monitor::AntennaCommon & mon );
20 
21  ~SharedOpticsSeqNo( );
22 
23  enum Axis { X = 0, Y = 1, Z = 2 };
24 
25  void setPolarizerRequestPending( long seqNo );
26  void setFocusPositionRequestPending( long seqNo, enum Axis axis );
27  void setFocusZTrackingRequestPending( long seqNo );
28  void setBeamSelectionRequestPending( long seqNo );
29 
30  void markPolarizerRequestCompleteIfPending(
31  carma::util::frameType minWaitFrames );
32  void markFocusPositionRequestCompleteIfPending(
33  enum Axis axis, carma::util::frameType minWaitFrames );
34  void markFocusZTrackingRequestCompleteIfPending(
35  carma::util::frameType minWaitFrames );
36  void markBeamSelectionRequestCompleteIfPending(
37  carma::util::frameType minWaitFrames );
38 
39  void writeToMonitorSystem( );
40 
41 private:
42 
43  void completeRequestHoldingLock( );
44 
45  void verifyRequestExclusivityHoldingLock( );
46 
47  bool polarizerRequestPending_;
48  bool focusPositionRequestPending_[3];
49  bool focusZTrackingRequestPending_;
50  bool beamSelectionRequestPending_;
51  long pendingSequenceNo_;
52  long currentSequenceNo_;
53  carma::util::frameType requestFrame_;
54  mutable carma::util::PthreadMutex mutex_;
55  carma::monitor::AntennaCommon & mon_;
56 };
57 
58 }}}
59 #endif
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
Definition: PthreadMutex.h:41
Various type definitions for util classes.