Changeset 10263


Ignore:
Timestamp:
Mar 29, 2011, 3:08:34 PM (10 years ago)
Author:
ogrimm
Message:
Limited DIM slow-control update rate
Location:
fact/FADctrl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fact/FADctrl/FAD.h

    r10212 r10263  
    4646        static void LaunchEventThread(class FAD *);
    4747        pthread_t Thread;
    48         float EventUpdateDelay;
    4948
    5049    int Datafile;
     
    9291        int Pipe[2];
    9392    int NumEventsRequested;     // Number of events requested
     93        float EventUpdateDelay;
    9494        std::vector<std::string> BoardList;
    9595};
  • fact/FADctrl/FADBoard.cc

    r10262 r10263  
    348348  struct sockaddr_in SocketAddress;
    349349  struct BoardStatus PrevStatus;
     350  time_t LastUpdate = 0;
    350351  int Ret;
    351352
     
    506507
    507508          // Update DIM services if necessary
    508           if (memcmp(PrevStatus.Temp, Status.Temp, sizeof(Status.Temp)) != 0) {
    509                 DIM_Temp->updateService(Status.Temp, sizeof(Status.Temp));
    510           }
    511           if (memcmp(PrevStatus.DAC, Status.DAC, sizeof(Status.DAC)) != 0) {
    512                 DIM_DAC->updateService(Status.DAC, sizeof(Status.DAC));
    513           } 
    514           if (memcmp(PrevStatus.ROI, Status.ROI, sizeof(Status.ROI)) != 0) {
    515                 DIM_ROI->updateService(Status.ROI, sizeof(Status.ROI));
    516           } 
    517           if (PrevStatus.BoardID != Status.BoardID) {
    518                 DIM_ID->updateService(&Status.BoardID, sizeof(Status.BoardID));
     509          if (time(NULL) - LastUpdate > m->EventUpdateDelay) {
     510                LastUpdate = time(NULL);
     511
     512                if (memcmp(PrevStatus.Temp, Status.Temp, sizeof(Status.Temp)) != 0) {
     513                  DIM_Temp->updateService(Status.Temp, sizeof(Status.Temp));
     514                }
     515                if (memcmp(PrevStatus.DAC, Status.DAC, sizeof(Status.DAC)) != 0) {
     516                  DIM_DAC->updateService(Status.DAC, sizeof(Status.DAC));
     517                } 
     518                if (memcmp(PrevStatus.ROI, Status.ROI, sizeof(Status.ROI)) != 0) {
     519                  DIM_ROI->updateService(Status.ROI, sizeof(Status.ROI));
     520                } 
     521                if (PrevStatus.BoardID != Status.BoardID) {
     522                  DIM_ID->updateService(&Status.BoardID, sizeof(Status.BoardID));
     523                }
    519524          }
    520525         
  • fact/FADctrl/History.txt

    r10262 r10263  
    191928/3/2011       Boards with communication error set themselves inactive
    202029/3/2011       Added Status message service for each board (removed several console messages in turn)
     21                        Limited update rate of slow control data to 1 second or interval set by 'update'
Note: See TracChangeset for help on using the changeset viewer.