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

start transition

Implements the Start transition. Concatenates the given path for the Nightly file and the filename itself (based on the day), and tries to open it.

Returns
kSM_NightlyOpen if success, kSM_BadFolder if failure

Definition at line 1818 of file datalogger.cc.

References CompileFileNameWithPath(), data, MessageImp::Debug(), MessageImp::Error(), SubscriptionType::fConv, DimWriteStatistics::FileOpened(), SubscriptionType::fitsBufferAllocated, GetDescription(), GoToNightlyWriteErrorState(), GoToRunWriteErrorState(), i, SubscriptionType::increment, MessageImp::Info(), kSM_BadFolder, kSM_NightlyOpen, NotifyOpenedFile(), NumSubAndFitsType::numOpenFits, OpenTextFile(), RemoveService(), SubscriptionType::server, SubscriptionType::service, str, and DimDescribedService::Update().

Referenced by DataLogger(), infoCallback(), and NightlyToWaitRun().

1819 {
1820  if (fDebugIsOn)
1821  {
1822  Debug("Starting...");
1823  }
1825  bool nightlyLogOpen = fNightlyLogFile.is_open();
1827  return kSM_BadFolder;
1828  if (!nightlyLogOpen)
1829  fNightlyLogFile << endl;
1830 
1831 // fFullNightlyReportFileName = CompileFileNameWithPath(fFilePath, "", "rep");
1832 // if (!OpenTextFile(fNightlyReportFile, fFullNightlyReportFileName))
1833 // {
1834 // fNightlyLogFile.close();
1835 // Info("Closed: "+fFullNightlyReportFileName);
1836 // return kSM_BadFolder;
1837 // }
1838 
1840 // fFilesStats.FileOpened(fFullNightlyReportFileName);
1841  //notify that a new file has been opened.
1842  const string baseFileName = CompileFileNameWithPath(fFilePath, "", "");
1843  NotifyOpenedFile(baseFileName, 3, fOpenedNightlyFiles);
1844 
1845  fOpenedNightlyFits.clear();
1846 
1847  return kSM_NightlyOpen;
1848 }
DimWriteStatistics fFilesStats
Definition: datalogger.cc:235
the folder specified for Nightly logging does not exist or has bad permissions
Definition: datalogger.cc:188
void NotifyOpenedFile(const string &name, int type, DimDescribedService *service)
Definition: datalogger.cc:1781
int Debug(const std::string &str)
Definition: MessageImp.h:45
ofstream fNightlyLogFile
ofstream for the NightlyLogfile
Definition: datalogger.cc:203
bool fDebugIsOn
configuration flags
Definition: datalogger.cc:315
string fFilePath
ofstream for the Nightly report file
Definition: datalogger.cc:209
bool FileOpened(const std::string &fileName)
DimDescribedService * fOpenedNightlyFiles
Service for opened files.
Definition: datalogger.cc:291
bool OpenTextFile(ofstream &stream, const string &name)
Subscribe to a given server and service.
Definition: datalogger.cc:782
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 fFullNightlyLogFileName
full name of the nightly log file
Definition: datalogger.cc:226
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

+ Here is the call graph for this function:

+ Here is the caller graph for this function: