Changeset 92 for drsdaq/SlowData.cc


Ignore:
Timestamp:
07/28/09 09:13:41 (15 years ago)
Author:
ogrimm
Message:
Added some configuration parameters. Log file written outside of repository.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/SlowData.cc

    r87 r92  
    33  SlowData.cc
    44
    5   Class handling the writing of slow data. String to be written in the
     5  Class handling the writing of slow data. Strings to be written in the
    66  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. 
    716   
    817  Oliver Grimm
     
    4554// Add a new entry to slow data file
    4655//
    47 bool SlowData::NewEntry(const char *Variable) {
     56bool SlowData::NewEntry(const char *Variable, const char *Text) {
    4857
    4958  time_t RawTime;
     
    5766  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);
    5867  InternalCall = false;
     68  if(Text != NULL && NewEntryCalled == true) NewEntryCalled = AddToEntry("%s", Text);
     69
    5970  return NewEntryCalled;
    6071}
     
    6576bool SlowData::AddToEntry(const char *Format, ...) {
    6677
    67   char Textbuffer[MAX_COM_SIZE];
     78  char Textbuffer[MAX_ENTRY_SIZE];
    6879  va_list ArgumentPointer;
    6980
Note: See TracChangeset for help on using the changeset viewer.