Changeset 274 for drsdaq


Ignore:
Timestamp:
07/30/10 12:35:09 (14 years ago)
Author:
ogrimm
Message:
drsdaq publishes some more run-related services
Location:
drsdaq
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/DAQReadout.cc

    r269 r274  
    7878  LastBoard                     = -1;
    7979  MinDelay                      = 1;
     80  RunNumber                     = -1;
    8081
    8182  // Get configuration data (static needed for c_str() pointers to remain valid after constructor finished)
     
    142143  // Create DIM event data service
    143144  EventService = new DimService (SERVER_NAME"/EventData", (char *) "C", DIMEventData, 0);
     145  RunNumService = new DimService (SERVER_NAME"/RunNumber", RunNumber);
    144146                                                   
    145147  // Install DIM command (after all initialized)
     
    155157  delete Command;
    156158
     159  delete RunNumService;
    157160  delete EventService;  delete[] DIMEventData;
    158161  delete RHeader;               delete EHeader;
     
    299302  }
    300303  else RunNumber = -1;
     304  RunNumService->updateService();
    301305
    302306  // Create DAQ thread
     
    11971201  off_t FileSize;
    11981202  int DIMSize;
     1203  float RunSizeMB=0, FileSizeMB=0;
    11991204
    12001205  // Initialize run
     
    12021207  FileNumber = 0;
    12031208  DimClient::sendCommandNB("Feedback/Command", "clear");
     1209
     1210  DimService RunSizeService(SERVER_NAME"/RunSizeMB", RunSizeMB);
     1211  DimService FileSizeService(SERVER_NAME"/FileSizeMB", FileSizeMB);
     1212  DimService EventNumService(SERVER_NAME"/EventNumber", NumEvents);
     1213  DimService FilenameService(SERVER_NAME"/FileName", FileName);
    12041214   
    12051215  gettimeofday(&StartTime, NULL);
     
    12181228    EventsInFile = 0;
    12191229    FileSize = 0;
     1230        FilenameService.updateService();
    12201231
    12211232    WriteError |= !WriteRunHeader();
     
    12771288          }
    12781289
    1279       // Call routine to update DIM service (update rate is limited)
     1290      // Update DIM services (update rate is limited)
    12801291          if (time(NULL) - LastDIMUpdate < MinDelay) continue;
    12811292          LastDIMUpdate = time(NULL);
     1293         
     1294          RunSizeMB = (RunSize+FileSize)/1024.0/1024.0;
     1295          RunSizeService.updateService();
     1296          FileSizeMB = FileSize/1024.0/1024.0;
     1297          FileSizeService.updateService();
     1298          EventNumService.updateService();
    12821299         
    12831300          // Copy new event header
     
    13381355  }
    13391356 
     1357  RunNumber = -1;
     1358  RunNumService->updateService();
     1359
    13401360  daq_state = stopped;
    13411361}
  • drsdaq/DAQReadout.h

    r269 r274  
    3333        pid_t MainThread;
    3434        DimService *EventService;
     35        DimService *RunNumService;
    3536        int MinDelay;
    3637    unsigned int CmdNumber;
     
    6465    runtype_enum daq_runtype;
    6566    bool Stop;                  // Set to true to stop run
    66     unsigned int NumEvents;             // Number of event taken           
    67     unsigned int NumEventsRequested;    // Number of events requested
     67    int NumEvents;              // Number of event taken           
     68    int NumEventsRequested;     // Number of events requested
    6869    int RunNumber;
    6970    unsigned int FileNumber;
  • drsdaq/History.txt

    r269 r274  
    7373                        invoked through a DIM command. Last revision with feedback integrated into
    7474                        drsdaq is 264.
     7530/7/2010       Published some run-related information as DIM service.
    7576                       
Note: See TracChangeset for help on using the changeset viewer.