diff --git a/Building/Windows/BuildInstall.iss b/Building/Windows/BuildInstall.iss
index faa3b7fa..1bb99ff3 100644
--- a/Building/Windows/BuildInstall.iss
+++ b/Building/Windows/BuildInstall.iss
@@ -7,29 +7,45 @@
#define MyAppVersion MyMajorVersion+"."+MyMinorVersion+"."+MyRevision+"-"+MyReleaseStatus
#if MyReleaseStatus == "r"
-#define MyAppVersion MyAppVersion+MyBuildNumber
+ #define MyAppVersion MyAppVersion+MyBuildNumber
#else
-#define MyAppVersion MyAppVersion+"-"+MyBuildNumber
+ #define MyAppVersion MyAppVersion+"-"+MyBuildNumber
#endif
-#define MyAppName "OSCAR"
#define MyAppPublisher "The OSCAR Team"
#define MyAppExeName "OSCAR.exe"
+#define MyAppName "OSCAR"
[Setup]
SetupLogging=yes
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
-; Now using separate AppID for Win32 and Win64 -- GTS 4/6/2019
+; Now using separate AppID for Win32 and Win64 and for test builds -- GTS 4/6/2019
#if MyPlatform == "Win64"
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
- AppId={{FC6F08E6-69BF-4469-ADE3-78199288D305}
+ #if MyReleaseStatus == "r" || MyReleaseStatus == "rc"
+ AppId={{FC6F08E6-69BF-4469-ADE3-78199288D305}
+ #define MyGroupName "OSCAR"
+ #define MyDirName "OSCAR"
+ #else
+ AppId={{C5E23210-4BC5-499D-A0E4-81192748D322}
+ #define MyGroupName "OSCAR (test)"
+ #define MyDirName "OSCAR-test"
+ #endif
; DefaultDirName={%PROGRAMFILES|{pf}}\OSCAR
; above doesn't work. Always returns x86 directory
#else // 32-bit
- AppId={{4F3EB81B-1866-4124-B388-5FB5DA34FFDD}
+ #if MyReleaseStatus == "r" || MyReleaseStatus == "rc"
+ AppId={{4F3EB81B-1866-4124-B388-5FB5DA34FFDD}
+ #define MyGroupName "OSCAR 32-bit"
+ #define MyDirName "OSCAR"
+ #else
+ AppId={{B0382AB3-ECB4-4F9D-ABB1-F6EF73D4E3DB}
+ #define MyGroupName "OSCAR 32-bit (test)"
+ #define MyDirName "OSCAR-test"
+ #endif
; DefaultDirName={%PROGRAMFILES(X86)|{pf}}\OSCAR
#endif
AppName={#MyAppName}
@@ -38,20 +54,20 @@ AppVerName={#MyAppName} {#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix
AppPublisher={#MyAppPublisher}
AppCopyright=Copyright 2019 {#MyAppPublisher}
; **** AppCopyright=Copyright {GetDateTimeString('yyyy', #0, #0)} {%MyAppPublisher}
-DefaultDirName={pf}\OSCAR
-DefaultGroupName={#MyAppName}
+DefaultDirName={pf}\{#MyDirName}
+DefaultGroupName={#MyGroupName}
OutputDir=.\Installer
#if MyReleaseStatus == "r"
-OutputBaseFilename={#MyAppName}-{#MyAppVersion}-{#MyPlatform}{#MySuffix}
+ OutputBaseFilename={#MyAppName}-{#MyAppVersion}-{#MyPlatform}{#MySuffix}
#else
-OutputBaseFilename={#MyAppName}-{#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix}
+ OutputBaseFilename={#MyAppName}-{#MyAppVersion}-{#MyPlatform}-{#MyGitRevision}{#MySuffix}
#endif
SetupIconFile=setup.ico
Compression=lzma
SolidCompression=yes
VersionInfoCompany={#MyAppPublisher}
VersionInfoProductName={#MyAppName}
-UninstallDisplayName={#MyAppName}
+UninstallDisplayName={#MyGroupName}
UninstallDisplayIcon={app}\{#MyAppExeName}
[Languages]
@@ -89,9 +105,9 @@ Source: ".\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs cre
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
-Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
-Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
-Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+Name: "{group}\{#MyGroupName}"; Filename: "{app}\{#MyAppExeName}"
+Name: "{group}\{cm:UninstallProgram,{#MyGroupName}}"; Filename: "{uninstallexe}"
+Name: "{commondesktop}\{#MyGroupName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
; Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Messages]
diff --git a/oscar/Graphs/MinutesAtPressure.h b/oscar/Graphs/MinutesAtPressure.h
index 8dceb6c3..d7420ddf 100644
--- a/oscar/Graphs/MinutesAtPressure.h
+++ b/oscar/Graphs/MinutesAtPressure.h
@@ -22,18 +22,7 @@ struct PressureInfo
peaktime = peakevents = 0;
min_pressure = max_pressure = 0;
}
- PressureInfo(PressureInfo ©) {
- code = copy.code;
- minx = copy.minx;
- maxx = copy.maxx;
- peaktime = copy.peaktime;
- peakevents = copy.peakevents;
- min_pressure = copy.min_pressure;
- max_pressure = copy.max_pressure;
- times = copy.times;
- events = copy.events;
- chans = copy.chans;
- }
+ PressureInfo(PressureInfo ©) = default;
PressureInfo(ChannelID code, qint64 minx, qint64 maxx) : code(code), minx(minx), maxx(maxx)
{
diff --git a/oscar/Graphs/gGraphView.cpp b/oscar/Graphs/gGraphView.cpp
index 9ca8074e..68f06828 100644
--- a/oscar/Graphs/gGraphView.cpp
+++ b/oscar/Graphs/gGraphView.cpp
@@ -1554,6 +1554,32 @@ void gGraphView::paintGL()
QString gGraphView::getRangeString()
{
+ QDateTime st = QDateTime::fromMSecsSinceEpoch(m_minx);
+ QDateTime et = QDateTime::fromMSecsSinceEpoch(m_maxx);
+
+ QDate std = st.date();
+ QDate etd = et.date();
+
+ // Format if Begin and End are on different days
+ if (std != etd) {
+ QString txt = st.toString(" d MMM [ HH:mm:ss") + " - " + et.toString("HH:mm:ss ] d MMM yyyy");
+ return txt;
+ }
+
+ // Range is within one (local) day
+ qint64 diff = m_maxx - m_minx;
+ QString fmt;
+
+ if (diff > 60000) {
+ fmt = "HH:mm:ss";
+ } else {
+ fmt = "HH:mm:ss:zzz";
+ }
+ QString txt = st.toString(QObject::tr("d MMM yyyy [ %1 - %2 ]").arg(fmt).arg(et.toString(fmt))) ;
+
+ return txt;
+
+/***** WTF is this code trying to do? Replaced by above 8/9/2019
// a note about time zone usage here
// even though this string will be displayed to the user
// the graph is drawn using UTC times, so no conversion
@@ -1566,7 +1592,7 @@ QString gGraphView::getRangeString()
qint64 diff = m_maxx - m_minx;
- if (diff > 86400000) {
+ if (diff > 86400000) { // 86400000 is one day, in milliseconds
int days = ceil(double(m_maxx-m_minx) / 86400000.0);
qint64 minx = floor(double(m_minx)/86400000.0);
@@ -1584,12 +1610,11 @@ QString gGraphView::getRangeString()
} else {
fmt = "HH:mm:ss:zzz";
}
- QDateTime st = QDateTime::fromMSecsSinceEpoch(m_minx, Qt::UTC);
- QDateTime et = QDateTime::fromMSecsSinceEpoch(m_maxx, Qt::UTC);
QString txt = st.toString(QObject::tr("d MMM [ %1 - %2 ]").arg(fmt).arg(et.toString(fmt))) ;
return txt;
+*/
}
void gGraphView::leaveEvent(QEvent * event)
@@ -3239,7 +3264,6 @@ void gGraphView::keyPressEvent(QKeyEvent *event)
//qDebug() << "Keypress??";
}
-
void gGraphView::setDay(Day *day)
{
@@ -3251,6 +3275,7 @@ void gGraphView::setDay(Day *day)
ResetBounds(false);
}
+
bool gGraphView::isEmpty()
{
bool res = true;
diff --git a/oscar/Graphs/gXAxis.cpp b/oscar/Graphs/gXAxis.cpp
index 29a29d8d..7239da73 100644
--- a/oscar/Graphs/gXAxis.cpp
+++ b/oscar/Graphs/gXAxis.cpp
@@ -13,6 +13,7 @@
#include "Graphs/gXAxis.h"
#include "SleepLib/profiles.h"
+#include "SleepLib/common.h"
#include "Graphs/glcommon.h"
#include "Graphs/gGraph.h"
#include "Graphs/gGraphView.h"
@@ -303,7 +304,8 @@ void gXAxis::paint(QPainter &painter, gGraph &w, const QRegion ®ion)
//dt.toString("MMM dd");
// Doing it this way instead because it's MUUUUUUCH faster
- tmpstr = QString("%1 %2").arg(months[date.month() - 1]).arg(date.day());
+ tmpstr = QString(dayFirst?"%1 %2":"%2 %1").arg(date.day()).arg(months[date.month() - 1]);
+
//} else if (fitmode==0) {
// tmpstr=QString("%1 %2:%3").arg(dow[d]).arg(h,2,10,QChar('0')).arg(m,2,10,QChar('0'));
} else if (fitmode == 1) { // minute
@@ -435,7 +437,7 @@ void gXAxisDay::paint(QPainter &painter, gGraph &graph, const QRegion ®ion)
if ((lastx + barw) > (left + width + 1))
break;
- QString tmpstr = QString("%1 %2").arg(months[date.month() - 1]).arg(date.day(), 2, 10, QChar('0'));
+ QString tmpstr = QString(dayFirst?"%2 %1":"%1 %2").arg(months[date.month() - 1]).arg(date.day(), 2, 10, QChar('0'));
float x1 = lastx + xpos;
//lines.append(QLine(lastx, top, lastx, top+6));
diff --git a/oscar/SleepLib/common.cpp b/oscar/SleepLib/common.cpp
index 380ec5f3..9c0aebca 100644
--- a/oscar/SleepLib/common.cpp
+++ b/oscar/SleepLib/common.cpp
@@ -37,8 +37,36 @@
extern MainWindow * mainwin;
-// Used by internal settings
+QString MedDateFormat = "ddd MMM d yyyy"; // QT default value, which we override if we can
+bool dayFirst = false;
+// System locale and regional settings support only a "short" date (m/d/yyy) and a "long"
+// date (day of week, month, day, year -- all spelled out fully). We get the formatting
+// for the long format, shorten day and month name, and remove excess commas.
+void SetDateFormat () {
+ QLocale sysLocale = QLocale::system();
+ QString dfmt = sysLocale.dateFormat();
+ qDebug() << "system locale date format" << dfmt;
+
+ QString s = dfmt.replace("dddd", "ddd");
+ if (!s.isEmpty()) s = s.replace("MMMM", "MMM");
+ if (!s.isEmpty()) s = s.replace(",", "");
+ if (!s.isEmpty()) {
+ QDate testDate (2018, 12, 31);
+ QString testresult = testDate.toString(s);
+ if (!testresult.isEmpty()) // make sure we can translate a date
+ MedDateFormat = s; // If we can, save the format for future use
+ }
+
+ // Record whether month or day is first in the formatting
+ QString s2 = MedDateFormat;
+ s2 = s2.replace("ddd","");
+ int monthidx = s2.indexOf("MMM");
+ if (s2.indexOf("d") < monthidx)
+ dayFirst = true;
+
+ qDebug() << "shortened date format" << MedDateFormat << "dayFirst" << dayFirst;
+}
const QString & gitRevision()
{
@@ -62,23 +90,35 @@ const QString getDeveloperDomain()
const QString getAppName()
{
QString name = STR_AppName;
- if ((GIT_BRANCH != "master") ||
- (!((ReleaseStatus.compare("r", Qt::CaseInsensitive)==0) ||
- (ReleaseStatus.compare("rc", Qt::CaseInsensitive)==0) ||
- (ReleaseStatus.compare("beta", Qt::CaseInsensitive)==0)))) {
+
+ // Append branch if there is a branch specified
+ if (GIT_BRANCH != "master") {
name += "-"+GIT_BRANCH;
+// qDebug() << "getAppName, not master, name is" << name << "branch is" << GIT_BRANCH;
}
+
+ // Append "-test" if not release
+ else if (!((ReleaseStatus.compare("r", Qt::CaseInsensitive)==0) ||
+ (ReleaseStatus.compare("rc", Qt::CaseInsensitive)==0) )) {
+ name += "-test";
+// qDebug() << "getAppName, not release, name is" << name << "release type is" << ReleaseStatus;
+ }
+
return name;
}
const QString getModifiedAppData()
{
QString appdata = STR_AppData;
- if ((GIT_BRANCH != "master") ||
- (!((ReleaseStatus.compare("r", Qt::CaseInsensitive)==0) ||
- (ReleaseStatus.compare("rc", Qt::CaseInsensitive)==0) ||
- (ReleaseStatus.compare("beta", Qt::CaseInsensitive)==0)))) {
+
+ // Append branch if there is a branch specified
+ if (GIT_BRANCH != "master")
appdata += "-"+GIT_BRANCH;
+
+ // Append "-test" if not release
+ else if (!((ReleaseStatus.compare("r", Qt::CaseInsensitive)==0) ||
+ (ReleaseStatus.compare("rc", Qt::CaseInsensitive)==0) )) {
+ appdata += "-test";
}
return appdata;
}
@@ -202,7 +242,7 @@ QStringList makeBuildInfo (QString relinfo, QString forcedEngine){
branch = QObject::tr("Branch:") + " " + GIT_BRANCH + ", ";
}
buildInfo << branch + (QObject::tr("Revision")) + " " + GIT_REVISION;
- if (GIT_BRANCH != "master")
+ if (getAppName() != STR_AppName) // Report any non-standard app key
buildInfo << (QObject::tr("App key:") + " " + getAppName());
buildInfo << QString("");
buildInfo << (QObject::tr("Operating system:") + " " + QSysInfo::prettyProductName());
diff --git a/oscar/SleepLib/common.h b/oscar/SleepLib/common.h
index b2f1eb94..21a31c86 100644
--- a/oscar/SleepLib/common.h
+++ b/oscar/SleepLib/common.h
@@ -27,6 +27,8 @@ const QString CSTR_GFX_ANGLE = "ANGLE";
const QString CSTR_GFX_OpenGL = "OpenGL";
const QString CSTR_GFX_BrokenGL = "LegacyGFX";
+extern QString MedDateFormat;
+extern bool dayFirst;
//! \brief Gets the first day of week from the system locale, to show in the calendars.
Qt::DayOfWeek firstDayOfWeekFromLocale();
@@ -49,6 +51,8 @@ QStringList makeBuildInfo(QString relinfo, QString forcedEngine);
QStringList getBuildInfo();
QStringList addBuildInfo (QString value);
+void SetDateFormat ();
+
QByteArray gCompress(const QByteArray& data);
QByteArray gUncompress(const QByteArray &data);
@@ -65,11 +69,7 @@ struct ValueCount {
ValueCount( EventDataType val, qint64 cnt, double pp)
:value(val), count(cnt), p(pp) {}
- ValueCount(const ValueCount ©) {
- value = copy.value;
- count = copy.count;
- p = copy.p;
- }
+ ValueCount(const ValueCount ©) = default;
EventDataType value;
qint64 count;
double p;
diff --git a/oscar/SleepLib/loader_plugins/prs1_loader.cpp b/oscar/SleepLib/loader_plugins/prs1_loader.cpp
index 8e9ce235..a5fc0369 100644
--- a/oscar/SleepLib/loader_plugins/prs1_loader.cpp
+++ b/oscar/SleepLib/loader_plugins/prs1_loader.cpp
@@ -6106,7 +6106,7 @@ PRS1DataChunk* PRS1DataChunk::ParseNext(QFile & f)
int sessionid_base = (chunk->fileVersion == 2 ? 10 : 16);
if (chunk->family == 3 && chunk->familyVersion >= 3) sessionid_base = 16;
QString session_s = fi.fileName().section(".", 0, -2);
- quint32 sid = session_s.toInt(&numeric, sessionid_base);
+ qint32 sid = session_s.toInt(&numeric, sessionid_base);
if (!numeric || sid != chunk->sessionid) {
qDebug() << chunk->m_path << chunk->sessionid;
}
diff --git a/oscar/SleepLib/loader_plugins/resmed_loader.h b/oscar/SleepLib/loader_plugins/resmed_loader.h
index bd7101a4..75d84821 100644
--- a/oscar/SleepLib/loader_plugins/resmed_loader.h
+++ b/oscar/SleepLib/loader_plugins/resmed_loader.h
@@ -125,82 +125,8 @@ struct STRRecord
date=QDate();
}
- STRRecord(const STRRecord & copy) {
- maskon = copy.maskon;
- maskoff = copy.maskoff;
- maskdur = copy.maskdur;
- maskevents = copy.maskevents;
- mode = copy.mode;
- rms9_mode = copy.rms9_mode;
- set_pressure = copy.set_pressure;
- epap = copy.epap;
- max_pressure = copy.max_pressure;
- min_pressure = copy.min_pressure;
- max_ps = copy.max_ps;
- min_ps = copy.min_ps;
- ps = copy.ps;
- max_epap = copy.max_epap;
- min_epap = copy.min_epap;
- ipap = copy.ipap;
- max_ipap = copy.max_ipap;
- min_ipap = copy.min_ipap;
- epr = copy.epr;
- epr_level = copy.epr_level;
- sessionid = copy.sessionid;
- ahi = copy.ahi;
- ai = copy.ai;
- oai = copy.oai;
- hi = copy.hi;
- uai = copy.uai;
- cai = copy.cai;
- csr = copy.csr;
+ STRRecord(const STRRecord & copy) = default;
- date = copy.date;
- leak50 = copy.leak50;
- leak95 = copy.leak95;
- leakmax = copy.leakmax;
- rr50 = copy.rr50;
- rr95 = copy.rr95;
- rrmax = copy.rrmax;
- mv50 = copy.mv50;
- mv95 = copy.mv95;
- mvmax = copy.mvmax;
- ie50 = copy.ie50;
- ie95 = copy.ie95;
- iemax = copy.iemax;
- tv50 = copy.tv50;
- tv95 = copy.tv95;
- tvmax = copy.tvmax;
- mp50 = copy.mp50;
- mp95 = copy.mp95;
- mpmax = copy.mpmax;
-
-
- tgtepap50 = copy.tgtepap50;
- tgtepap95 = copy.tgtepap95;
- tgtepapmax = copy.tgtepapmax;
- tgtipap50 = copy.tgtipap50;
- tgtipap95 = copy.tgtipap95;
- tgtipapmax = copy.tgtipapmax;
-
- s_EPREnable = copy.s_EPREnable;
- s_EPR_ClinEnable = copy.s_EPREnable;
- s_RampEnable = copy.s_RampEnable;
- s_RampTime = copy.s_RampTime;
-
- s_SmartStart = copy.s_SmartStart;
- s_PtAccess = copy.s_PtAccess;
- s_ABFilter = copy.s_ABFilter;
- s_Mask = copy.s_Mask;
-
- s_Tube = copy.s_Tube;
- s_ClimateControl = copy.s_ClimateControl;
- s_HumEnable = copy.s_HumEnable;
- s_HumLevel = copy.s_HumLevel;
- s_TempEnable = copy.s_TempEnable;
- s_Temp = copy.s_Temp;
- ramp_pressure = copy.ramp_pressure;
- }
QVector
+Changes and fixes in OSCAR AFTER v1.1.0-testing-3 +
Changes and fixes in OSCAR v1.1.0-testing-3
NOTE: Translations have NOT yet been updated for these changes
@@ -13,8 +25,10 @@ Which was written and copyright 2011-2018 © Mark Watkins