CARMA C++
PmacBoard.h
Go to the documentation of this file.
1 #ifndef PMACBOARD_H
2 #define PMACBOARD_H
3 
11 #include <vector>
12 
19 
20 #define DPRAM_TIMEOUT 100
21 
22 #define PMAC_TEST
23 
24 namespace sza {
25  namespace antenna {
26  namespace control {
27 
31  class PmacBoard : public Board {
32 
33  public:
34 
40  PmacBoard(SzaShare* share, std::string name, bool simPmac=false);
41 
45  ~PmacBoard();
46 
50  bool isBusyOld(); // Version until 1 Oct 2008
51 
52  bool isBusy(); // No-op version for the new tracking mode,
53  // in which we don't synchronize with the
54  // pmac
55 
61  unsigned int readPositionFault();
62 
68  void commandNewPosition(PmacTarget* pmac);
69 
82  bool readPosition(AxisPositions* axes, Model* model);
83 
88  bool connect();
89 
94  void disconnect();
95 
100 
104  bool pmacIsConnected();
105 
106  unsigned char driveStatusToBit(unsigned int driveStatus);
107 
108  private:
109 
114  bool simPmac_;
115 
119  PmacComms* comms_;
120 
125  RegMapBlock* hostRead_;
126 
131  RegMapBlock* pmacWrite_;
132 
139  RegMapBlock* newPosition_;
140 
146  RegMapBlock* positionFault_;
147 
164  RegMapBlock* newMode_;
165 
169  RegMapBlock* newAz_;
170 
174  RegMapBlock* newEl_;
175 
179  RegMapBlock* newDk_;
180 
184  RegMapBlock* newAzRate_;
185 
189  RegMapBlock* newElRate_;
190 
194  RegMapBlock* newDkRate_;
195 
199  RegMapBlock* azPos_;
200 
204  RegMapBlock* elPos_;
205 
209  RegMapBlock* dkPos_;
210 
215  RegMapBlock* driveStatus_;
216  RegMapBlock* statusMask_;
217 
221  unsigned long dpramSize_;
222 
226  unsigned long dpramBaseAddr_;
227 
231  unsigned long dpramCmdSize_;
232 
236  unsigned long dpramCmdBaseAddr_;
237 
242  std::vector<unsigned char> dpramWork_;
243 
247  void computeDpramStats();
248 
252  unsigned int* readoutDpram();
253 
257  void readReg(RegMapBlock* blk, unsigned int first,
258  unsigned int nreg, unsigned int* value);
259 
263  void writeReg(RegMapBlock* blk, unsigned int first,
264  unsigned int nreg, unsigned int* value);
265 
269  void writeRegToWork(RegMapBlock *blk,
270  unsigned int first, unsigned int nreg,
271  unsigned int *value);
272 
276  void writeWork();
277 
281  void initializePmac();
282 
283  }; // End class PmacBoard
284 
285  }; // End namespace control
286  }; // End namespace antenna
287 }; // End namespace sza
288 
289 #endif // End #ifndef
The AxisPositions class is used by the Tracker class to record the positions of the telescope axes...
Definition: AxisPositions.h:31
PmacBoard(SzaShare *share, std::string name, bool simPmac=false)
Constructor function for this board.
Tagged: Thu Nov 13 16:53:41 UTC 2003.
Tagged: Thu Nov 13 16:53:54 UTC 2003.
Encapsulate the pointing model parameters.
Definition: Model.h:27
bool isBusyOld()
Returns true if the Pmac isn&#39;t ready to receive a new command.
void commandNewPosition(PmacTarget *pmac)
Tell the PMAC to read a new position.
bool readPosition(AxisPositions *axes, Model *model)
Read the pmac monitor data to update our view of where the telescope axes are currently positioned...
unsigned int readPositionFault()
Return the current value of the PMAC position-fault flag.
void disconnect()
Public interface to PmacComms::disconnect() to connect to the pmac.
~PmacBoard()
Destructor function for this board.
bool pmacIsConnected()
Return true if the pmac is connected.
Tagged: Thu Nov 13 16:53:33 UTC 2003.
Tagged: Thu Nov 13 16:53:44 UTC 2003.
Encapsulate details about the registers of the pmac board.
Definition: PmacBoard.h:31
A class which encapsulates resources of a board of the shared register map.
Definition: Board.h:24
void mirrorDpramToSharedMemory()
Mirror the DPRAM to shared memory.
bool connect()
Public interface to PmacComms::connect() to connect to the pmac.
Tagged: Thu Nov 13 16:53:46 UTC 2003.
Tagged: Thu Nov 13 16:53:34 UTC 2003.
An instance of this class is created by AntennaMaster and passed to the constructors of other tasks...
Definition: Share.h:38