diff --git a/sleepyhead/Resources.qrc b/sleepyhead/Resources.qrc index 99af249c..9ed9ea3e 100644 --- a/sleepyhead/Resources.qrc +++ b/sleepyhead/Resources.qrc @@ -51,5 +51,6 @@ icons/airsense10.png icons/aircurve.png icons/prs1_960.png + icons/daily.png diff --git a/sleepyhead/icons/daily.png b/sleepyhead/icons/daily.png new file mode 100644 index 00000000..82fe5da7 Binary files /dev/null and b/sleepyhead/icons/daily.png differ diff --git a/sleepyhead/welcome.cpp b/sleepyhead/welcome.cpp index ac52c6da..36cf0aa5 100644 --- a/sleepyhead/welcome.cpp +++ b/sleepyhead/welcome.cpp @@ -100,29 +100,36 @@ QString GenerateWelcomeHTML() if (havecpapdata || haveoximeterdata) cols=4; - html+=QString("").arg(cols)+ - ""+((havecpapdata || haveoximeterdata) ? QObject::tr("What would you like to do?") : QObject::tr("Please Import Some Data")) +"" - "" - "" - "" - "" - "" - "

" + QObject::tr("CPAP
Importer")+"
" - "" - "" - "" - "" - "

" + QObject::tr("Oximetery
Wizard")+"
" - ""; - if (havecpapdata || haveoximeterdata) { - html += ""+QObject::tr("or")+"" - "" - "" - "" - "

" + QObject::tr("View
Statistics")+"
" - ""; - } - html += ""; + html+=QString("").arg(cols)+ + ""+((havecpapdata || haveoximeterdata) ? QObject::tr("What would you like to do?") : QObject::tr("Please Import Some Data")) +"" + "" + "" + " " + " " + " " + "

" + QObject::tr("CPAP
Importer")+"
" + " " + "" + " " + " " + "

" + QObject::tr("Oximetery
Wizard")+"
" + ""; + if (havecpapdata || haveoximeterdata) { + html += ""+QObject::tr("or")+"" + "" + " " + " " + "

" + QObject::tr("View
Statistics")+"
" + "" + "" + " " + " " + "

" + QObject::tr("View
Daily")+"
" + ""; + } + html += ""; + + Machine * cpap = nullptr; if (!havecpapdata && !haveoximeterdata) { html += "

" + QObject::tr("It might be a good idea to check preferences first,
as there are some options that affect import.")+"

" "

" + QObject::tr("First import can take a few minutes.") + "

"; @@ -130,7 +137,6 @@ QString GenerateWelcomeHTML() QDate date = p_profile->LastDay(MT_CPAP); Day *day = p_profile->GetDay(date, MT_CPAP); - Machine * cpap = nullptr; if (havecpapdata && day) { cpap = day->machine(MT_CPAP); } @@ -161,7 +167,7 @@ QString GenerateWelcomeHTML() QString timestr = QObject::tr("%1 hours, %2 minutes and %3 seconds").arg(hour).arg(minutes).arg(seconds); const EventDataType compliance_min = 4.0; - if (hours > compliance_min) html += QObject::tr("You machine was on for %1.").arg(timestr)+"
"; + if (hours > compliance_min) html += QObject::tr("Your machine was on for %1.").arg(timestr)+"
"; else html += QObject::tr("You only had the mask on for %1.").arg(timestr)+"
"; @@ -175,7 +181,8 @@ QString GenerateWelcomeHTML() const QString under = QObject::tr("under"); const QString over = QObject::tr("over"); - const QString onpar = QObject::tr("reasonably close to"); + const QString close = QObject::tr("reasonably close to"); + const QString equal = QObject::tr("equal to"); QString comp; @@ -183,17 +190,16 @@ QString GenerateWelcomeHTML() comp = under; } else if ((ahi > ahidays) && ((ahi - ahidays) >= 0.1)) { comp = over; + } else if ((fabs(ahi > ahidays) >= 0.01) ) { + comp = close; } else { - comp = onpar; + comp = equal; } html += QObject::tr("You had an AHI of %1, which is %2 your %3 day average of %4.").arg(ahi,0,'f',2).arg(comp).arg(averagedays).arg(ahidays,0,'f',2); html += "
"; - - //html += QObject::tr("You had an AHI of %1,").arg(ahi,0,'f',2)+QObject::tr(" your 7 day average was %1, 30 day average %2").arg(ahi7,0,'f',2).arg(ahi30,0,'f',2)+"
"; - CPAPMode cpapmode = (CPAPMode)(int)day->settings_max(CPAP_Mode); double perc= p_profile->general->prefCalcPercentile(); @@ -236,11 +242,12 @@ QString GenerateWelcomeHTML() comp = under; } else if ((leak > leakdays) && ((leak - leakdays) >= 0.1)) { comp = over; + } else if ((fabs(ahi > ahidays) >= 0.01) ) { + comp = close; } else { - comp = onpar; + comp = equal; } - html += QObject::tr("Your average leaks were %1 %2, which is %3 your %4 day average of %5.").arg(leak,0,'f',2).arg(schema::channel[CPAP_Leak].units()).arg(comp).arg(averagedays).arg(leakdays,0,'f',2); html += "
"; @@ -264,19 +271,35 @@ QString GenerateWelcomeHTML() } } - html += QString("
")+ - "" - "" - "" - "" - "" - "
"+QObject::tr("Very Important Warning")+"
"+ - QObject::tr("

ALWAYS write protect CPAP SDCards before inserting them into your computer.")+"

"+ - QObject::tr("

Certain operating systems write index files to the card without asking, which can render your card unreadable by your cpap machine.")+"

"+ - QObject::tr("

As a second line of protection, ALWAYS UNMOUNT the data card properly before removing it!

")+ - "
" - "
" - "" + + + // The SDCard warning does not need to be seen anymore for people who DON'T use ResMed S9's.. show first import and only when S9 is present + bool showCardWarning = (cpap == nullptr); + + QList mlist = p_profile->GetMachines(MT_CPAP); + for (int i=0; iseries().compare("S9") == 0) showCardWarning = true; + } + + + if (showCardWarning) { + html += QString("
")+ + "" + "" + "" + "" + "" + "
"+QObject::tr("Very Important Warning For ResMed S9 Users")+"
"+ + QObject::tr("

ALWAYS write protect CPAP SDCards before inserting them into your computer.")+"

"+ + QObject::tr("

Certain operating systems write index files to the card without asking, which can render your card unreadable by your cpap machine.")+"

"+ + QObject::tr("

As a second line of protection, ALWAYS UNMOUNT the data card properly before removing it!

")+ + "
" + "
"; + } else { + } + + html += "" ""; return html; }