mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 04:00:44 +00:00
Fix up a merge error
This commit is contained in:
commit
9f271c7e79
@ -811,7 +811,7 @@ bool PRS1Import::ParseF5Events()
|
|||||||
code = buffer[pos++];
|
code = buffer[pos++];
|
||||||
|
|
||||||
if (code >= ncodes) {
|
if (code >= ncodes) {
|
||||||
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos;
|
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos << "in" << event->sessionid;;
|
||||||
qDebug() << "1: (" << int(lastcode) << hex << lastpos << ")";
|
qDebug() << "1: (" << int(lastcode) << hex << lastpos << ")";
|
||||||
qDebug() << "2: (" << int(lastcode2) << hex << lastpos2 << ")";
|
qDebug() << "2: (" << int(lastcode2) << hex << lastpos2 << ")";
|
||||||
qDebug() << "3: (" << int(lastcode3) << hex << lastpos3 << ")";
|
qDebug() << "3: (" << int(lastcode3) << hex << lastpos3 << ")";
|
||||||
@ -925,11 +925,16 @@ bool PRS1Import::ParseF5Events()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x09: // ASV Codes
|
case 0x09: // ASV Codes
|
||||||
//code=CPAP_FlowLimit;
|
if (event->familyVersion<2) {
|
||||||
data0 = buffer[pos++];
|
//code=CPAP_FlowLimit;
|
||||||
tt -= qint64(data0) * 1000L; // Subtract Time Offset
|
data0 = buffer[pos++];
|
||||||
|
tt -= qint64(data0) * 1000L; // Subtract Time Offset
|
||||||
|
|
||||||
FL->AddEvent(tt, data0);
|
FL->AddEvent(tt, data0);
|
||||||
|
} else {
|
||||||
|
data0 = buffer[pos++];
|
||||||
|
data1 = buffer[pos++];
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1001,44 +1006,53 @@ bool PRS1Import::ParseF5Events()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x0d: // All the other ASV graph stuff.
|
case 0x0d: // All the other ASV graph stuff.
|
||||||
IPAP->AddEvent(t, currentPressure = data0 = buffer[pos++]); // 00=IAP
|
|
||||||
data4 = buffer[pos++];
|
|
||||||
IPAPLo->AddEvent(t, data4); // 01=IAP Low
|
|
||||||
data5 = buffer[pos++];
|
|
||||||
IPAPHi->AddEvent(t, data5); // 02=IAP High
|
|
||||||
|
|
||||||
TOTLEAK->AddEvent(t, leak=buffer[pos++]); // 03=LEAK
|
if (event->familyVersion>=2) {
|
||||||
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
data0 = (buffer[pos + 1] << 8 | buffer[pos]);
|
||||||
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
data0 *= 2;
|
||||||
if (leak < 0) leak = 0;
|
pos += 2;
|
||||||
|
data1 = buffer[pos++];
|
||||||
|
tt = t - qint64(data1) * 1000L;
|
||||||
|
} else {
|
||||||
|
IPAP->AddEvent(t, currentPressure = data0 = buffer[pos++]); // 00=IAP
|
||||||
|
data4 = buffer[pos++];
|
||||||
|
IPAPLo->AddEvent(t, data4); // 01=IAP Low
|
||||||
|
data5 = buffer[pos++];
|
||||||
|
IPAPHi->AddEvent(t, data5); // 02=IAP High
|
||||||
|
|
||||||
LEAK->AddEvent(t, leak);
|
TOTLEAK->AddEvent(t, leak=buffer[pos++]); // 03=LEAK
|
||||||
}
|
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
||||||
|
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
||||||
|
if (leak < 0) leak = 0;
|
||||||
|
|
||||||
|
LEAK->AddEvent(t, leak);
|
||||||
RR->AddEvent(t, buffer[pos++]); // 04=Breaths Per Minute
|
|
||||||
PTB->AddEvent(t, buffer[pos++]); // 05=Patient Triggered Breaths
|
|
||||||
MV->AddEvent(t, buffer[pos++]); // 06=Minute Ventilation
|
|
||||||
//tmp=buffer[pos++] * 10.0;
|
|
||||||
TV->AddEvent(t, buffer[pos++]); // 07=Tidal Volume
|
|
||||||
SNORE->AddEvent(t, data2 = buffer[pos++]); // 08=Snore
|
|
||||||
|
|
||||||
if (data2 > 0) {
|
|
||||||
if (!VS) {
|
|
||||||
if (!(VS = session->AddEventList(CPAP_VSnore, EVL_Event))) {
|
|
||||||
qDebug() << "!VS eventlist exit";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VS->AddEvent(t, 0); //data2); // VSnore
|
|
||||||
}
|
|
||||||
|
|
||||||
EPAP->AddEvent(t, data1 = buffer[pos++]); // 09=EPAP
|
RR->AddEvent(t, buffer[pos++]); // 04=Breaths Per Minute
|
||||||
data2 = data0 - data1;
|
PTB->AddEvent(t, buffer[pos++]); // 05=Patient Triggered Breaths
|
||||||
PS->AddEvent(t, data2); // Pressure Support
|
MV->AddEvent(t, buffer[pos++]); // 06=Minute Ventilation
|
||||||
if (event->familyVersion >= 1) {
|
//tmp=buffer[pos++] * 10.0;
|
||||||
data0 = buffer[pos++];
|
TV->AddEvent(t, buffer[pos++]); // 07=Tidal Volume
|
||||||
|
SNORE->AddEvent(t, data2 = buffer[pos++]); // 08=Snore
|
||||||
|
|
||||||
|
if (data2 > 0) {
|
||||||
|
if (!VS) {
|
||||||
|
if (!(VS = session->AddEventList(CPAP_VSnore, EVL_Event))) {
|
||||||
|
qDebug() << "!VS eventlist exit";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
VS->AddEvent(t, 0); //data2); // VSnore
|
||||||
|
}
|
||||||
|
|
||||||
|
EPAP->AddEvent(t, data1 = buffer[pos++]); // 09=EPAP
|
||||||
|
data2 = data0 - data1;
|
||||||
|
PS->AddEvent(t, data2); // Pressure Support
|
||||||
|
if (event->familyVersion >= 1) {
|
||||||
|
data0 = buffer[pos++];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1361,7 +1375,7 @@ bool PRS1Import::ParseF0Events()
|
|||||||
code = buffer[pos++];
|
code = buffer[pos++];
|
||||||
|
|
||||||
if (code > 0x15) {
|
if (code > 0x15) {
|
||||||
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos;
|
qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos << "in" << event->sessionid;
|
||||||
qDebug() << "1: (" << hex << int(lastcode) << hex << lastpos << ")";
|
qDebug() << "1: (" << hex << int(lastcode) << hex << lastpos << ")";
|
||||||
qDebug() << "2: (" << hex << int(lastcode2) << hex << lastpos2 << ")";
|
qDebug() << "2: (" << hex << int(lastcode2) << hex << lastpos2 << ")";
|
||||||
qDebug() << "3: (" << hex << int(lastcode3) << hex << lastpos3 << ")";
|
qDebug() << "3: (" << hex << int(lastcode3) << hex << lastpos3 << ")";
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QResource>
|
#include <QResource>
|
||||||
#include <QProgressBar>
|
#include <QProgressBar>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -71,21 +72,46 @@ UpdaterWindow::~UpdaterWindow()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString platformStr()
|
||||||
|
{
|
||||||
|
static QString platform;
|
||||||
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
|
platform="win32";
|
||||||
|
#elif defined(Q_OS_MAC)
|
||||||
|
platform="mac";
|
||||||
|
#elif defined(Q_OS_LINUX)
|
||||||
|
platform="ubuntu";
|
||||||
|
#else
|
||||||
|
platform="unknown";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return platform;
|
||||||
|
}
|
||||||
|
|
||||||
void UpdaterWindow::checkForUpdates()
|
void UpdaterWindow::checkForUpdates()
|
||||||
{
|
{
|
||||||
QString filename = QApplication::applicationDirPath() + "/Updates.xml";
|
QString platform=platformStr();
|
||||||
|
|
||||||
|
#ifdef Q_OS_WINDOWS
|
||||||
|
QString filename = QApplication::applicationDirPath() + "/Updates.xml";
|
||||||
|
#else
|
||||||
|
QString filename = QApplication::applicationDirPath() + QString("/LatestVersion-%1").arg(platform);
|
||||||
|
#endif
|
||||||
// Check updates.xml file if it's still recent..
|
// Check updates.xml file if it's still recent..
|
||||||
if (QFile::exists(filename)) {
|
if (QFile::exists(filename)) {
|
||||||
QFileInfo fi(filename);
|
QFileInfo fi(filename);
|
||||||
QDateTime created = fi.created();
|
QDateTime created = fi.created();
|
||||||
int age = created.secsTo(QDateTime::currentDateTime());
|
int age = created.secsTo(QDateTime::currentDateTime());
|
||||||
|
|
||||||
if (age < 0) { // 7200) {
|
if (age < 900) {
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
ParseUpdateXML(&file);
|
#ifdef Q_OS_WINDOWS
|
||||||
|
ParseUpdatesXML(&file);
|
||||||
|
#else
|
||||||
|
ParseLatestVersion(&file);
|
||||||
|
#endif
|
||||||
file.close();
|
file.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -93,8 +119,11 @@ void UpdaterWindow::checkForUpdates()
|
|||||||
|
|
||||||
mainwin->Notify(tr("Checking for SleepyHead Updates"));
|
mainwin->Notify(tr("Checking for SleepyHead Updates"));
|
||||||
|
|
||||||
// language code?
|
#ifdef Q_OS_WINDOWS
|
||||||
update_url = QUrl(QString("http://sourceforge.net/projects/sleepyhead/files/AutoUpdate/%1/Updates.xml/download").arg(PlatformString));
|
update_url = QUrl(QString("http://sleepyhead.jedimark.net/packages/%1/Updates.xml").arg(platform));
|
||||||
|
#else
|
||||||
|
update_url = QUrl(QString("http://sleepyhead.jedimark.net/releases/LatestVersion-%1").arg(platform));
|
||||||
|
#endif
|
||||||
downloadUpdateXML();
|
downloadUpdateXML();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,15 +167,27 @@ void UpdaterWindow::updateFinished(QNetworkReply *reply)
|
|||||||
|
|
||||||
|
|
||||||
ui->plainTextEdit->appendPlainText(tr("%1 bytes received").arg(reply->size()));
|
ui->plainTextEdit->appendPlainText(tr("%1 bytes received").arg(reply->size()));
|
||||||
|
|
||||||
|
#ifdef Q_OS_WINDOWS
|
||||||
QString filename = QApplication::applicationDirPath() + "/Updates.xml";
|
QString filename = QApplication::applicationDirPath() + "/Updates.xml";
|
||||||
|
#else
|
||||||
|
QString filename = QApplication::applicationDirPath() + QString("/LatestVersion-%1").arg(platformStr());
|
||||||
|
#endif
|
||||||
|
|
||||||
qDebug() << filename;
|
qDebug() << filename;
|
||||||
QFile file(filename);
|
QFile file(filename);
|
||||||
file.open(QFile::WriteOnly);
|
file.open(QFile::WriteOnly);
|
||||||
file.write(reply->readAll());
|
file.write(reply->readAll());
|
||||||
file.close();
|
file.close();
|
||||||
file.open(QFile::ReadOnly);
|
file.open(QFile::ReadOnly);
|
||||||
//QTextStream ts(&file);
|
|
||||||
|
#ifdef Q_OS_WINDOWS
|
||||||
ParseUpdatesXML(&file);
|
ParseUpdatesXML(&file);
|
||||||
|
#else
|
||||||
|
ParseLatestVersion(&file);
|
||||||
|
#endif
|
||||||
|
PREF[STR_GEN_UpdatesLastChecked] = QDateTime::currentDateTime();
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
}
|
}
|
||||||
@ -398,6 +439,23 @@ void StartMaintenanceTool()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdaterWindow::ParseLatestVersion(QIODevice *file)
|
||||||
|
{
|
||||||
|
// Temporary Cheat.. for linux & mac, just check the latest version number
|
||||||
|
QTextStream text(file);
|
||||||
|
|
||||||
|
QString version=text.readAll().trimmed();
|
||||||
|
qDebug() << "Latest version is" << version;
|
||||||
|
int i=compareVersion(version);
|
||||||
|
|
||||||
|
if (i>0) {
|
||||||
|
mainwin->Notify(tr("Version %1 of SleepyHead is available, opening link to download site.").arg(version), STR_TR_SleepyHead);
|
||||||
|
QDesktopServices::openUrl(QUrl(QString("http://sleepyhead.jedimark.net")));
|
||||||
|
} else {
|
||||||
|
mainwin->Notify(tr("You are already running the latest version."), STR_TR_SleepyHead);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//New, Qt Installer framework version
|
//New, Qt Installer framework version
|
||||||
void UpdaterWindow::ParseUpdatesXML(QIODevice *dev)
|
void UpdaterWindow::ParseUpdatesXML(QIODevice *dev)
|
||||||
{
|
{
|
||||||
|
@ -52,6 +52,7 @@ class UpdaterWindow : public QMainWindow
|
|||||||
*/
|
*/
|
||||||
void ParseUpdateXML(QIODevice *dev);
|
void ParseUpdateXML(QIODevice *dev);
|
||||||
void ParseUpdatesXML(QIODevice *dev);
|
void ParseUpdatesXML(QIODevice *dev);
|
||||||
|
void ParseLatestVersion(QIODevice *dev);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void updateFinished(QNetworkReply *reply);
|
void updateFinished(QNetworkReply *reply);
|
||||||
|
@ -506,7 +506,7 @@ retry_directory:
|
|||||||
|
|
||||||
loadChannels(changing_language);
|
loadChannels(changing_language);
|
||||||
|
|
||||||
// if (check_updates) { mainwin->CheckForUpdates(); }
|
if (check_updates) { mainwin->CheckForUpdates(); }
|
||||||
|
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
|
@ -154,5 +154,4 @@ class UpdatesParser
|
|||||||
QString currentTag;
|
QString currentTag;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // UPDATEPARSER_H
|
#endif // UPDATEPARSER_H
|
||||||
|
Loading…
Reference in New Issue
Block a user