FACT++  1.0
int DataLogger::GoToReady ( )
private

stop and reset transition

Implements the Stop and Reset transitions. Attempts to close any openned file.

Returns
kSM_Ready

Definition at line 2151 of file datalogger.cc.

References CompileFileNameWithPath(), CreateFitsGrouping(), MessageImp::Debug(), StateMachineImp::GetCurrentState(), i, kSM_Logging, kSM_NightlyOpen, StateMachineImp::kSM_Ready, kSM_WaitingRun, NotifyOpenedFile(), StopRunLogging(), and DimDescribedService::Update().

Referenced by DataLogger(), Report(), and ~DataLogger().

2152 {
2153  if (fDebugIsOn)
2154  {
2155  Debug("Going to the Ready state...");
2156  }
2158  StopRunLogging();
2159 
2160  //it may be that dim tries to write a dimInfo while we're closing files. Prevent that
2161  const string baseFileName = CompileFileNameWithPath(fFilePath, "", "");
2162 
2163 // if (fNightlyReportFile.is_open())
2164 // {
2165 // fNightlyReportFile.close();
2166 // Info("Closed: "+baseFileName+".rep");
2167 // }
2168 #ifdef HAVE_FITS
2169  for (SubscriptionsListType::iterator i = fServiceSubscriptions.begin(); i != fServiceSubscriptions.end(); i++)
2170  for (map<string, SubscriptionType>::iterator j = i->second.begin(); j != i->second.end(); j++)
2171  {
2172  if (j->second.nightlyFile.IsOpen())
2173  j->second.nightlyFile.Close();
2174  }
2175 #endif
2176  if (GetCurrentState() == kSM_Logging ||
2179  {
2181  if (fNumSubAndFitsIsOn)
2183  }
2184 #ifdef HAVE_FITS
2186 #endif
2187  return kSM_Ready;
2188 }
Mainloop running, state machine in operation.
int GetCurrentState() const
return the current state of the machine
void NotifyOpenedFile(const string &name, int type, DimDescribedService *service)
Definition: datalogger.cc:1781
int Debug(const std::string &str)
Definition: MessageImp.h:45
both files openned and writing
Definition: datalogger.cc:187
int i
Definition: db_dim_client.c:21
bool fDebugIsOn
configuration flags
Definition: datalogger.cc:315
int StopRunLogging()
from waiting to logging transition
Definition: datalogger.cc:2128
string fFilePath
ofstream for the Nightly report file
Definition: datalogger.cc:209
bool fNumSubAndFitsIsOn
Definition: datalogger.cc:317
DimDescribedService * fOpenedNightlyFiles
Service for opened files.
Definition: datalogger.cc:291
void CreateFitsGrouping(map< string, vector< string > > &filesToGroup)
creates a group fits file based on a list of files to be grouped
DimDescribedService * fNumSubAndFits
Definition: datalogger.cc:293
SubscriptionsListType fServiceSubscriptions
All the services to which we have subscribed to, sorted by server name.
Definition: datalogger.cc:224
Nightly file openned and writing.
Definition: datalogger.cc:185
map< string, vector< string > > fOpenedNightlyFits
vectors to keep track of opened Fits files, for grouping purposes.
Definition: datalogger.cc:331
string CompileFileNameWithPath(const string &path, const string &service, const string &extension)
Get the digits of year, month and day for filenames and paths.
Definition: datalogger.cc:851
waiting for the run number to open the run file
Definition: datalogger.cc:186

+ Here is the call graph for this function:

+ Here is the caller graph for this function: