Changeset 92 for drsdaq/SlowData.cc
- Timestamp:
- 07/28/09 09:13:41 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
drsdaq/SlowData.cc
r87 r92 3 3 SlowData.cc 4 4 5 Class handling the writing of slow data. String to be written in the5 Class handling the writing of slow data. Strings to be written in the 6 6 slow data file are checked that they do not contain control characters. 7 8 1. Call constructor with desired identification and directory 9 for slow data file. The public ErrorCode variable will be zero 10 if successful, otherwise contain the relevant errno. 11 2. Use NewEntry() to start a new entry with given variable name. A text 12 as second argument is optional. 13 3. If text should be added to an open entry, use AddToEntry(). It can 14 process printf()-style formatting. 15 4. The slow data file will be closed upon destruction of the instance. 7 16 8 17 Oliver Grimm … … 45 54 // Add a new entry to slow data file 46 55 // 47 bool SlowData::NewEntry(const char *Variable ) {56 bool SlowData::NewEntry(const char *Variable, const char *Text) { 48 57 49 58 time_t RawTime; … … 57 66 NewEntryCalled = AddToEntry("\n%s %s %d %d %d %d %d %d %d %lu ", Issuer, Variable, TM->tm_year+1900,TM->tm_mon+1,TM->tm_mday,TM->tm_hour,TM->tm_min,TM->tm_sec, Time.tv_usec/1000, Time.tv_sec); 58 67 InternalCall = false; 68 if(Text != NULL && NewEntryCalled == true) NewEntryCalled = AddToEntry("%s", Text); 69 59 70 return NewEntryCalled; 60 71 } … … 65 76 bool SlowData::AddToEntry(const char *Format, ...) { 66 77 67 char Textbuffer[MAX_ COM_SIZE];78 char Textbuffer[MAX_ENTRY_SIZE]; 68 79 va_list ArgumentPointer; 69 80
Note:
See TracChangeset
for help on using the changeset viewer.