mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-22 05:30:44 +00:00
reduce rebug messages during noraml operations
This commit is contained in:
parent
e99a832a3f
commit
5f7c5650fb
@ -116,7 +116,7 @@ QString Session::eventFile() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
//const int max_pack_size=128;
|
//const int max_pack_size=128;
|
||||||
bool Session::OpenEvents()
|
bool Session::OpenEvents(bool debug)
|
||||||
{
|
{
|
||||||
if (s_events_loaded) {
|
if (s_events_loaded) {
|
||||||
return true;
|
return true;
|
||||||
@ -131,12 +131,12 @@ bool Session::OpenEvents()
|
|||||||
|
|
||||||
QString filename = eventFile();
|
QString filename = eventFile();
|
||||||
#ifdef DEBUG_EVENTS
|
#ifdef DEBUG_EVENTS
|
||||||
qDebug() << "Loading" << s_machine->loaderName().toLocal8Bit().data() << "Events:" << filename.toLocal8Bit().data();
|
if (debug) qDebug() << "Loading" << s_machine->loaderName().toLocal8Bit().data() << "Events:" << filename.toLocal8Bit().data();
|
||||||
#endif
|
#endif
|
||||||
bool b = LoadEvents(filename);
|
bool b = LoadEvents(filename,debug);
|
||||||
|
|
||||||
if ( ! b) {
|
if ( ! b) {
|
||||||
qWarning() << "Error Loading Events" << filename;
|
if (debug) qWarning() << "Error Loading Events" << filename;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ bool Session::StoreSummary()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Session::LoadSummary()
|
bool Session::LoadSummary(bool debug)
|
||||||
{
|
{
|
||||||
// static int sumcnt = 0;
|
// static int sumcnt = 0;
|
||||||
|
|
||||||
@ -402,14 +402,14 @@ bool Session::LoadSummary()
|
|||||||
QString filename = s_machine->getSummariesPath() + toHexid(s_session) + ".000";
|
QString filename = s_machine->getSummariesPath() + toHexid(s_session) + ".000";
|
||||||
|
|
||||||
if (filename.isEmpty()) {
|
if (filename.isEmpty()) {
|
||||||
qDebug() << "Empty summary filename";
|
if (debug) qDebug() << "Empty summary filename";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
qWarning() << "Could not open summary file" << filename << "for reading, error code" << file.error() << file.errorString();
|
if (debug) qWarning() << "Could not open summary file" << filename << "for reading, error code" << file.error() << file.errorString();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,7 +428,7 @@ bool Session::LoadSummary()
|
|||||||
in >> t32;
|
in >> t32;
|
||||||
|
|
||||||
if (t32 != magic) {
|
if (t32 != magic) {
|
||||||
qDebug() << "Wrong magic number in " << filename;
|
if (debug) qDebug() << "Wrong magic number in " << filename;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,7 +815,7 @@ bool Session::StoreEvents()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::LoadEvents(QString filename)
|
bool Session::LoadEvents(QString filename, bool debug)
|
||||||
{
|
{
|
||||||
quint32 magicnum, machid, sessid;
|
quint32 magicnum, machid, sessid;
|
||||||
quint16 version, type, crc16, machtype, compmethod;
|
quint16 version, type, crc16, machtype, compmethod;
|
||||||
@ -831,7 +831,7 @@ bool Session::LoadEvents(QString filename)
|
|||||||
|
|
||||||
if ( ! file.open(QIODevice::ReadOnly)) {
|
if ( ! file.open(QIODevice::ReadOnly)) {
|
||||||
// qDebug() << "No Event/Waveform data available for" << s_session;
|
// qDebug() << "No Event/Waveform data available for" << s_session;
|
||||||
qWarning() << "No Event/Waveform data available for" << s_session << "filename" << filename << "error code" << file.error() << file.errorString();
|
if (debug) qWarning() << "No Event/Waveform data available for" << s_session << "filename" << filename << "error code" << file.error() << file.errorString();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,13 +90,16 @@ class Session
|
|||||||
// void LoadSummaryData(QDataStream & in);
|
// void LoadSummaryData(QDataStream & in);
|
||||||
|
|
||||||
//! \brief Loads the Sessions Summary Indexes from filename, from SleepLibs custom data format.
|
//! \brief Loads the Sessions Summary Indexes from filename, from SleepLibs custom data format.
|
||||||
bool LoadSummary();
|
// debug option is set to false because file errors are normal when there is summary but no details data
|
||||||
|
bool LoadSummary(bool debug=false);
|
||||||
|
|
||||||
//! \brief Loads the Sessions EventLists from filename, from SleepLibs custom data format.
|
//! \brief Loads the Sessions EventLists from filename, from SleepLibs custom data format.
|
||||||
bool LoadEvents(QString filename);
|
// debug option is set to false because file errors are normal when there is summary but no details data
|
||||||
|
bool LoadEvents(QString filename, bool debug=false);
|
||||||
|
|
||||||
//! \brief Loads the events for this session when requested (only the summaries are loaded at startup)
|
//! \brief Loads the events for this session when requested (only the summaries are loaded at startup)
|
||||||
bool OpenEvents();
|
// debug option is set to false because file errors are normal when there is summary but no details data
|
||||||
|
bool OpenEvents(bool debug=false);
|
||||||
|
|
||||||
//! \brief Put the events away until needed again, freeing memory
|
//! \brief Put the events away until needed again, freeing memory
|
||||||
void TrashEvents();
|
void TrashEvents();
|
||||||
|
Loading…
Reference in New Issue
Block a user