versadac  1
versadac - Scalable Recorder Firmware
uhh_dataitem.h
1 /*****************************************************************************
2 FILE : U H H _ D A T A I T E M . H
3 VERSION : $Id: uhh_dataitem.h 4938 2006-10-10 14:20:18Z martinto $
4 AUTHOR : Dave Storey
5 SYSTEM : Gnu C++
6 DESCRIPTION : UHH data item class and related structures
7 *****************************************************************************/
8 
9 #if !defined __UHH_DATAITEM_H
10 #define __UHH_DATAITEM_H
11 
12 #include "uhh_grouphist.h"
13 
14 
15 
16 // Data value structure
17 
18 struct UhhDataVal
19 {
20  double dVal;
21  sint32 nStatusChanges;
22  uint8 uStatus;
23 };
24 
25 
26 // Point data structure
27 
28 struct UhhDataPt
29 {
30  sint32 nColourChanges;
31  sint32 nSpanChanges;
32  sint32 nTraceChanges;
33  bool bColourB;
34  bool bSpanB;
35  bool bTrace;
36  uint8 uVals; // Size of array below
37  UhhDataVal *pVals; // Array of 'values' e.g. 2 for min-max
38 };
39 
40 
41 // Message structure
42 
44  UhhDataMessage *pNext; // uUsed to for list of messages
45  uint8 *puBytes; // Pointer to mesage bytes
46  sint32 nBytes; // Bytes in the message
47  sint32 nAlloc; // Bytes allocated, possibly > nBytes
48 };
49 
50 
51 // UHH DATA ITEM CLASS
52 
53 class UhhDataItem : public UhhHeap
54 {
55 public:
56  double m_dPtime; // Pseudo-time (ms) at interval start
57  double m_dEndPtime; // Pseudo-time (ms) at interval end
58  sint32 m_nRecStatus; // Recording status at interval end
59 
60  sint32 m_nSamples; // No of samples within the interval
61  sint32 m_nCfgChanges; // No of config changes during interval
62  sint32 m_nClkChanges; // No of clock changes during interval
63  sint32 m_nOutages; // No of 'outages' e.g. power cyclings
64  sint32 m_nRecChanges; // No of recording status changes
65  sint32 m_nLapses; // No of 'lapses' e.g. missing file
66  bool m_bMissing; // History not complete for whole interval
67  bool m_bLeader; // Interval includes 'leader' period
68  bool m_bTrailer; // Interval includes 'trailer' period
69 
70  uint16 m_uPts; // Number of points
71  UhhDataPt *m_pPts; // Point data array - see above
72 
73  sint32 m_nMessages; // Number of messages during interval
74  UhhDataMessage *m_pMessages; // List of messages during interval
75 
76  // NB If new fields are added, remember to add them to the copy method
77 
78 
79  // PUBLIC METHODS
80 
81  UhhDataItem();
82  ~UhhDataItem();
83 
84  void clearCumulative();
85  void clearMessages();
86 
87  void copyCumulative(UhhDataItem *z_pItem);
88  bool copyCurrent(UhhDataItem *z_pItem, bool z_bMinMax);
89  void copyMessages(UhhDataItem *z_pItem);
90  void copyValues(UhhDataItem *z_pItem, bool z_bMinMax);
91 
92  void minmax(UhhDataItem *z_pItem, bool z_bLater);
93 
94 };
95 
96 
97 
98 
99 #endif
Definition: uhh_dataitem.h:18
Definition: uhh_dataitem.h:53
Definition: uhh_dataitem.h:28
Definition: uhh_dataitem.h:43
Definition: uhh_heap.h:31