mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
long vs quint32 issues in Linux. Need for iBreeze on linux with i7core
This commit is contained in:
parent
fec39bbc3c
commit
1c2db29cce
@ -2302,7 +2302,7 @@ QList<PRS1DataChunk *> PRS1Import::CoalesceWaveformChunks(QList<PRS1DataChunk *>
|
||||
QFileInfo fi(chunk->m_path);
|
||||
bool numeric;
|
||||
QString session_s = fi.fileName().section(".", 0, -2);
|
||||
qint32 sid = session_s.toInt(&numeric, m_sessionid_base);
|
||||
quint32 sid = session_s.toInt(&numeric, m_sessionid_base);
|
||||
if (!numeric || sid != chunk->sessionid) {
|
||||
qWarning() << chunk->m_path << "@" << chunk->m_filepos << "session ID mismatch:" << chunk->sessionid;
|
||||
}
|
||||
|
@ -628,6 +628,9 @@ void Machine::setInfo(MachineInfo inf)
|
||||
m_loader = GetLoader(inf.loadername);
|
||||
}
|
||||
|
||||
QString toHexid(quint32 id) { return QString("%1").arg(id,8,16,QLatin1Char('0')); };
|
||||
QString Machine::hexid() { return toHexid((qint32)m_id);};
|
||||
|
||||
const QString Machine::getDataPath()
|
||||
{
|
||||
// TODO: Rework the underlying database so that file storage doesn't rely on consistent presence or absence of the serial number.
|
||||
|
@ -159,8 +159,7 @@ class Machine
|
||||
|
||||
|
||||
//! \brief Returns the machineID as a lower case hexadecimal string
|
||||
QString hexid() { return QString::asprintf("%08lx", m_id); }
|
||||
|
||||
QString hexid() ;
|
||||
|
||||
//! \brief Unused, increments the most recent sessionID
|
||||
SessionID CreateSessionID() { return highest_sessionid + 1; }
|
||||
|
@ -23,10 +23,11 @@ using namespace std;
|
||||
|
||||
// Do not change these without considering the consequences.. For one the Loader needs changing & version increase
|
||||
typedef quint32 ChannelID;
|
||||
typedef long MachineID;
|
||||
typedef long SessionID;
|
||||
typedef quint32 MachineID;
|
||||
typedef quint32 SessionID;
|
||||
typedef float EventDataType;
|
||||
typedef qint16 EventStoreType;
|
||||
extern QString toHexid(quint32);
|
||||
|
||||
//! \brief Exception class for out of Bounds error.. Unused.
|
||||
class BoundsError {};
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <algorithm>
|
||||
#include <limits>
|
||||
|
||||
#include "SleepLib/machine_common.h"
|
||||
#include "SleepLib/calcs.h"
|
||||
#include "SleepLib/profiles.h"
|
||||
|
||||
@ -110,7 +111,7 @@ void Session::setEnabled(bool b)
|
||||
|
||||
QString Session::eventFile() const
|
||||
{
|
||||
return s_machine->getEventsPath()+QString::asprintf("%08lx.001", s_session);
|
||||
return s_machine->getEventsPath()+toHexid(s_session)+".001";
|
||||
}
|
||||
|
||||
//const int max_pack_size=128;
|
||||
@ -145,7 +146,7 @@ bool Session::Destroy()
|
||||
{
|
||||
QDir dir;
|
||||
QString base;
|
||||
base=QString::asprintf("%08lx", s_session);
|
||||
base=toHexid(s_session);
|
||||
|
||||
QString summaryfile = s_machine->getSummariesPath() + base + ".000";
|
||||
QString eventfile = s_machine->getEventsPath() + base + ".001";
|
||||
@ -320,7 +321,7 @@ bool Session::StoreSummary()
|
||||
return false;
|
||||
}
|
||||
|
||||
QString filename = s_machine->getSummariesPath() + QString::asprintf("%08lx.000", s_session) ;
|
||||
QString filename = s_machine->getSummariesPath() + toHexid(s_session) + ".000" ;
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
@ -397,7 +398,7 @@ bool Session::LoadSummary()
|
||||
// static int sumcnt = 0;
|
||||
|
||||
if (s_summary_loaded) return true;
|
||||
QString filename = s_machine->getSummariesPath() + QString::asprintf("%08lx.000", s_session);
|
||||
QString filename = s_machine->getSummariesPath() + toHexid(s_session) + ".000";
|
||||
|
||||
if (filename.isEmpty()) {
|
||||
qDebug() << "Empty summary filename";
|
||||
@ -448,11 +449,11 @@ bool Session::LoadSummary()
|
||||
}
|
||||
|
||||
|
||||
qint32 ts32;
|
||||
quint32 ts32;
|
||||
in >> ts32; // MachineID (dont need this result)
|
||||
|
||||
bool upgrade = false;
|
||||
if (ts32 != s_machine->id()) {
|
||||
if ( ts32 != s_machine->id()) {
|
||||
upgrade = true;
|
||||
qWarning() << "Machine ID does not match in" << filename <<
|
||||
" I will try to load anyway in case you know what your doing.";
|
||||
@ -678,7 +679,7 @@ bool Session::StoreEvents()
|
||||
QString path = s_machine->getEventsPath();
|
||||
QDir dir;
|
||||
dir.mkpath(path);
|
||||
QString filename = path+ QString::asprintf("%08lx.001", s_session) ;
|
||||
QString filename = path+ toHexid(s_session) +".001";
|
||||
|
||||
QFile file(filename);
|
||||
if (!file.open(QIODevice::WriteOnly)) {
|
||||
|
Loading…
Reference in New Issue
Block a user