versadac  1
versadac - Scalable Recorder Firmware
uhh_nav.h
1 /*****************************************************************************
2 FILE : U H H _ N A V . H
3 VERSION : $Id: uhh_nav.h 4938 2006-10-10 14:20:18Z martinto $
4 AUTHOR : Dave Storey
5 SYSTEM : Gnu C++
6 DESCRIPTION : Uhh Navigator
7 *****************************************************************************/
8 
9 #if !defined __UHH_NAV_H
10 #define __UHH_NAV_H
11 
12 extern "C" {
13 #include "uhh_msgiface.h"
14 }
15 
16 
17 #include "ENUM_UhhNav_Direction.h"
18 #include "ENUM_UhhNav_TraceMode.h"
19 #include "ENUM_UhhNav_MessageMode.h"
20 
21 
22 #include "uhh_walker.h"
23 
24 
25 class UhhNav : public UhhHeap
26 {
27 public:
28 
29  // Public methods
30 
31  UhhNav(class UhhNavMgr *z_pManager, ENUM_UhhMsg_Com z_eComType,
32  sint32 z_nComId);
33  ~UhhNav();
34 
35  bool isActive();
36 
37  void msg(uint8 *z_pReq, uint8 *z_pRes,
38  sint32 z_uResMax = ENUM_UhhMsg_Res_HdrSize);
39 
40  // Public methods called by Navigation Manager
41  UhhGroupHist *groupHist(){return m_pGroupHist;}
42  void setPassive();
43  void sliceDeleted(UhhSlice * z_pSli);
44 
45  // Public members, for use by Navigation Manager
46  ENUM_UhhMsg_Com m_eComType; // Used to allow deletion by comms type
47  sint32 m_nComId; // Used to allow deletion by comms type/id
48  UhhNav *m_pNext; // Used to keep a list
49 
50 protected:
51 
52 
53 private:
54 
55  // PRIVATE METHODS
56 
57  bool enlargeResBuf();
58 
59  void extraAscii(char *z_sz);
60  void extraBool(bool z_b);
61  void extraDblAsI56(double z_d);
62  void extraDouble(double z_d);
63  void extraFloat(float z_f);
64  void extraSint32(sint32 z_n);
65  void extraString(uc_char *z_sz);
66  void extraU8Array(uint8 *z_pu, sint32 z_n);
67  void extraUint8(sint32 z_n);
68  void extraUint16(sint32 z_n);
69  void extraUint24(sint32 z_n);
70 
71  void msgClose();
72  void msgDbgHistSummary();
73  void msgGetDirection();
74  void msgGetDirectory();
75  void msgGetEarliest();
76  void msgGetEarliestSNP();
77  void msgGetFinalRecStat();
78  void msgGetLatest();
79  void msgGetGroupNos();
80  void msgGetInstrNos();
81  void msgGetInterval();
82  void msgGetItemBackward();
83  void msgGetItemForward();
84  void msgGetNextMessage();
85  void msgGetPointHdr();
86  void msgGetPointOther();
87  void msgGetPseudotime();
88  void msgGetSegHdr();
89  void msgGetSegOther();
90  void msgGetUhhSeqNos();
91  void msgGetUhhSeqSup();
92  void msgOpen();
93  void msgOpenForMessages();
94  void msgPtimeToTime();
95  void msgRefresh();
96  void msgResume();
97  void msgSetDirection();
98  void msgSetDirectory();
99  void msgSetEarliest();
100  void msgSetInstrNo();
101  void msgSetInterval();
102  void msgSetLatest();
103  void msgSetMessageFilter();
104  void msgSetMessageMode();
105  void msgSetPseudotime();
106  void msgSetTraceMode();
107  void msgSetUhhSeqNos();
108  void msgSubtractClock();
109  void msgSuspend();
110 
111  double reqGetI56AsDbl(ENUM_UhhMsg_Req eOffset);
112 
113  void resItem();
114  void resMessageItem();
115  void resSetDblAsI56(ENUM_UhhMsg_Res eOffset, double z_d);
116  void resume(bool z_bFreezeHistory);
117 
118  bool setActive();
119 
120 
121 
122  // PRIVATE MEMBERS
123 
124 
125  class UhhNavMgr *m_pManager;
126 
127 
128  // Message stuff
129  uint8 *m_puReq; // Request buffer
130 
131  uint8 *m_puRes; // Response buffer
132  uint8 *m_puResExtra; // Start of 'extra' response bytes
133  uint8 *m_puResMax; // End of available bytes in response buffer
134  uint8 *m_puResEnd; // Walking pointer to end of response
135  uint8 *m_puOrgRes; // Original response buffer
136  bool m_bTempRes; // Whether using a temporary response buffer
137  bool m_bBigEndian; // - need to know for dealing with floating point
138 
139  ENUM_UhhMsg_Err m_eErr; // Message error code
140 
141  // History being navigated
142  class UhhGroupHist *m_pGroupHist;
143 
144  // Walker, associated data and ticks -> ms conversion
145  UhhWalker *m_pWalker;
146  UhhDataItem *m_pWalkItem;
147  UhhMessageItem *m_pMsgWalkItem; // used when navigating messages only
148  sint32 m_nMsPerTick;
149 
150  // Calculated data, to be passed back
151  UhhDataItem *m_pCalcItem;
152 
153 
154  // Navigator state
155 
156  sint32 m_nState;
157 
158  char *m_szDirectory;
159  sint32 m_nInstrument;
160  sint32 m_nUhhSeqNoMin;
161  sint32 m_nUhhSeqNoMax;
162  sint32 m_nMaxPoints;
163 
164  ENUM_UhhNav_Direction m_eDirection;
165  ENUM_UhhNav_MessageMode m_eMessageMode;
166  ENUM_UhhNav_TraceMode m_eTraceMode;
167  bool m_bMinMax;
168 
169  double m_dPtime; // Current pseudotime
170  bool m_bPtimeInvalid; // Whether current ptime invalid
171 
172  double m_dPtimeEarliest;
173  double m_dPtimeEarliestSNP;
174  double m_dPtimeLatest;
175  double m_dInterval;
176 
177  sint32 m_nFinalRecStatus;
178 };
179 
180 
181 #endif
Definition: uhh_navmgr.h:20
Definition: uhh_dataitem.h:53
Definition: uhh_messageitem.h:17
Definition: uhh_nav.h:25
Definition: uhh_grouphist.h:118
Definition: uhh_walker.h:17
Definition: uhh_heap.h:31
Definition: uhh_grouphist.h:52