125 fMsg.
Error(
"Data path "+path+
" does not exist!");
132 fMsg.
Info(
"Data path set to "+path+
".");
143 if (crosscheck!=to_string(night))
145 fMsg.
Warn(
"The crosscheck for the night failed. "+crosscheck+
" is not equal to "+to_string(night)+
"... keeping old one.");
146 fMsg.
Warn(
"This is a severe error. Please restart fadctrl.");
154 const uint32_t night_test =
Time(now-boost::posix_time::seconds(1)).
NightAsInt();
155 if (night_test != night)
163 if (
Time().NightAsInt() != night)
168 fMsg.
Warn(
"New night "+to_string(night)+
" ["+now.
GetAsStr()+
"] before current night "+to_string(night)+
"... keeping old one.");
169 fMsg.
Warn(
"Please check the system clock.");
180 if (access((name+
"bin").c_str(), F_OK) == 0)
182 if (access((name+
"fits").c_str(), F_OK) == 0)
184 if (access((name+
"fits.fz").c_str(), F_OK) == 0)
186 if (access((name+
"fits.gz").c_str(), F_OK) == 0)
188 if (access((name+
"drs.fits").c_str(), F_OK) == 0)
199 fMsg.
Error(
"You have a file with run-number 1000 in "+
fPath+
" ["+to_string(night)+
"]");
205 str <<
"First night...";
207 str <<
"Night has changed from " <<
fNightAsInt <<
" [" << now <<
"]... ";
208 str <<
" next run-number is " << night <<
"-" << setfill(
'0') << setw(3) <<
fRunNumber <<
" [" << (
fPath.empty()?
".":
fPath) <<
"]";
Time GetPrevSunRise(double horizon) const
Adds some functionality to boost::posix_time::ptime for our needs.
uint32_t NightAsInt() const
static bool DoesPathExist(std::string path, MessageImp &log)
int Error(const std::string &str)
int Warn(const std::string &str)
DimWriteStatistics fDimWriteStats
bool SetCurrentFolder(const std::string &folder)
Configures that current folder where files are written to.
int Info(const std::string &str)
int Message(const std::string &str)
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
static std::string FormFileName(const std::string &path, uint64_t night, uint32_t runid, const std::string &extension)