Changeset 11621 for trunk/FACT++


Ignore:
Timestamp:
07/26/11 15:58:59 (13 years ago)
Author:
lyard
Message:
added run number distribution check
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/datalogger.cc

    r11604 r11621  
    363363    ///Remove all the services associated with a given server
    364364    void RemoveAllServices(const string&);
     365    ///pointer to the dim's subscription that should distribute the run numbers.
     366    DimInfo* fRunNumberService;
    365367    /***************************************************
    366368     * Overwritten from MessageImp
     
    501503    list[service].service = service;
    502504    fNumSubAndFitsData.numSubscriptions++;
     505    //check if this is the run numbers service
     506    if ((server == "FAD_CONTROL") && (service == "START_RUN"))
     507        fRunNumberService = list[service].dimInfo.get();
    503508    if (fDebugIsOn)
    504509        Debug("Added subscription to " + server + "/" + service);
     
    529534    }
    530535    fNumSubAndFitsData.numSubscriptions--;
     536
     537    if ((server == "FAD_CONTROL") && (service == "START_RUN"))
     538        fRunNumberService = NULL;
     539
    531540    if (fDebugIsOn)
    532541    {
     
    544553    fServiceSubscriptions[server].clear();
    545554    fServiceSubscriptions.erase(server);
     555    fRunNumberService = NULL;
    546556    if (fDebugIsOn)
    547557    {
     
    921931     NotifyOpenedFile("", 0, fOpenedNightlyFiles);
    922932     NotifyOpenedFile("", 0, fOpenedRunFiles);
     933
     934     fRunNumberService = NULL;
    923935
    924936     if(fDebugIsOn)
     
    11671179void DataLogger::CheckForRunNumber(DimInfo* I)
    11681180{
    1169     if (strstr(I->getName(), "SET_RUN_NUMBER") != NULL)
    1170     {//assumes that the run number is an integer
    1171         //check if some run number entries can be deleted leave one so that two remain after adding the new one
    1172         AddNewRunNumber(I->getLonglong(), Time(I->getTimestamp(), I->getTimestampMillisecs()*1000));
    1173     }
     1181    if (I != fRunNumberService)
     1182        return;
     1183
     1184    AddNewRunNumber(I->getLonglong(), Time(I->getTimestamp(), I->getTimestampMillisecs()*1000));
    11741185}
    11751186
Note: See TracChangeset for help on using the changeset viewer.