Merge branch 'master' of gitlab.com:pholy/OSCAR-code

Merge over reverted commit of oximeterimport.cpp
This commit is contained in:
Phil Olynyk 2019-05-09 13:10:24 -04:00
commit 2dca95d0ba
7 changed files with 32 additions and 24 deletions

View File

@ -1074,8 +1074,8 @@ void gTTIAChart::afterDraw(QPainter &, gGraph &graph, QRectF rect)
} }
break; break;
case 2: case 2:
if (calc.divisor > 0) { if (calc.cnt > 0) {
mid = calc.avg_sum / calc.divisor; mid = calc.avg_sum / calc.cnt;
} }
break; break;
} }
@ -1142,7 +1142,8 @@ void gAHIChart::customCalc(Day *day, QVector<SummaryChartSlice> &list)
case 1: case 1:
calc->wavg_sum += value; calc->wavg_sum += value;
calc->divisor += hours; calc->divisor += hours;
default: break;
case 2:
calc->avg_sum += value; calc->avg_sum += value;
calc->cnt++; calc->cnt++;
break; break;

View File

@ -802,7 +802,8 @@ QByteArray gUncompress(const QByteArray & data)
switch (ret) { switch (ret) {
case Z_NEED_DICT: case Z_NEED_DICT:
ret = Z_DATA_ERROR; // and fall through ret = Z_DATA_ERROR;
// fall through
case Z_DATA_ERROR: case Z_DATA_ERROR:
case Z_MEM_ERROR: case Z_MEM_ERROR:
Q_UNUSED(ret) Q_UNUSED(ret)

View File

@ -692,8 +692,10 @@ void PRS1Loader::ScanFiles(const QStringList & paths, int sessionid_base, Machin
QDateTime datetime; QDateTime datetime;
/* Unused until we get an actual timestamp below.
QDateTime ignoreBefore = p_profile->session->ignoreOlderSessionsDate(); QDateTime ignoreBefore = p_profile->session->ignoreOlderSessionsDate();
bool ignoreOldSessions = p_profile->session->ignoreOlderSessions(); bool ignoreOldSessions = p_profile->session->ignoreOlderSessions();
*/
// for each p0/p1/p2/etc... folder // for each p0/p1/p2/etc... folder
for (int p=0; p < size; ++p) { for (int p=0; p < size; ++p) {
@ -723,12 +725,14 @@ void PRS1Loader::ScanFiles(const QStringList & paths, int sessionid_base, Machin
continue; continue;
} }
/* This never worked: the filename isn't a timestamp.
if (ignoreOldSessions) { if (ignoreOldSessions) {
datetime = QDateTime::fromTime_t(sid); datetime = QDateTime::fromTime_t(sid);
if (datetime < ignoreBefore) { if (datetime < ignoreBefore) {
continue; continue;
} }
} }
*/
if (m->SessionExists(sid)) { if (m->SessionExists(sid)) {

View File

@ -424,7 +424,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
GraphView->setEmptyText(STR_Empty_NoData); GraphView->setEmptyText(STR_Empty_NoData);
previous_date=QDate(); previous_date=QDate();
ui->calButton->setChecked(AppSetting->calendarVisible() ? Qt::Checked : Qt::Unchecked); ui->calButton->setChecked(AppSetting->calendarVisible() ? true : false);
on_calButton_toggled(AppSetting->calendarVisible()); on_calButton_toggled(AppSetting->calendarVisible());
GraphView->resetLayout(); GraphView->resetLayout();
@ -2350,10 +2350,10 @@ void Daily::updateCube()
} }
void Daily::on_toggleGraphs_clicked(bool checked) void Daily::on_toggleGraphs_clicked(bool /*checked*/)
{ {
QString s; QString s;
QIcon *icon=checked ? icon_off : icon_on; //QIcon *icon=checked ? icon_off : icon_on;
if (ui->graphCombo == nullptr ) if (ui->graphCombo == nullptr )
qDebug() << "ToggleGraphs clicked with null graphCombo ptr"; qDebug() << "ToggleGraphs clicked with null graphCombo ptr";
else else
@ -2414,10 +2414,10 @@ void Daily::on_eventsCombo_activated(int index)
GraphView->redraw(); GraphView->redraw();
} }
void Daily::on_toggleEvents_clicked(bool checked) void Daily::on_toggleEvents_clicked(bool /*checked*/)
{ {
QString s; QString s;
QIcon *icon=checked ? icon_on : icon_off; //QIcon *icon=checked ? icon_on : icon_off;
if (ui->toggleEvents == nullptr ) if (ui->toggleEvents == nullptr )
qDebug() << "ToggleEvents clicked with null toggleEvents ptr"; qDebug() << "ToggleEvents clicked with null toggleEvents ptr";

View File

@ -443,8 +443,8 @@ test {
CONFIG += console debug CONFIG += console debug
CONFIG -= app_bundle CONFIG -= app_bundle
!win32 { # add memory checking on Linux and macOS test builds !win32 { # add memory checking on Linux and macOS test builds
QMAKE_CFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope QMAKE_CFLAGS += -Werror -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope
QMAKE_CXXFLAGS += -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope QMAKE_CXXFLAGS += -Werror -fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope
QMAKE_LFLAGS += -fsanitize=address QMAKE_LFLAGS += -fsanitize=address
} }

View File

@ -1,10 +1,11 @@
@echo off @echo off
setlocal setlocal
set DIR=%~dp0 set DIR=%~dp0
cd %DIR%
for /f %%i in ('git --work-tree %DIR% rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i
for /f %%i in ('git --work-tree %DIR% rev-parse --short HEAD') do set GIT_REVISION=%%i for /f %%i in ('git rev-parse --short HEAD') do set GIT_REVISION=%%i
git --work-tree %DIR% diff-index --quiet HEAD || set GIT_REVISION=%GIT_REVISION%+ git diff-index --quiet HEAD -- || set GIT_REVISION=%GIT_REVISION%+
if "%GIT_BRANCH"=="" set GIT_BRANCH="Unknown" if "%GIT_BRANCH"=="" set GIT_BRANCH="Unknown"
if "%GIT_REVISION"=="" set GIT_REVISION="Unknown" if "%GIT_REVISION"=="" set GIT_REVISION="Unknown"
@ -13,10 +14,11 @@ echo // This is an auto generated file > %DIR%git_info.new
echo const QString GIT_BRANCH="%GIT_BRANCH%"; >> %DIR%git_info.new echo const QString GIT_BRANCH="%GIT_BRANCH%"; >> %DIR%git_info.new
echo const QString GIT_REVISION="%GIT_REVISION%"; >> %DIR%git_info.new echo const QString GIT_REVISION="%GIT_REVISION%"; >> %DIR%git_info.new
fc %DIR%git_info.h %DIR%git_info.new > nul fc %DIR%git_info.h %DIR%git_info.new >nul 2>nul && del /q %DIR%git_info.new || goto NewFile
if errorlevel 0 ( goto AllDone
del /q %DIR%git_info.new
) else ( :NewFile
echo Updating %DIR%git_info.h echo Updating %DIR%git_info.h
move /y %DIR%git_info.new %DIR%git_info.h move /y %DIR%git_info.new %DIR%git_info.h
)
:AllDone

View File

@ -3,9 +3,9 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR cd $DIR
GIT_BRANCH=`git --work-tree $DIR rev-parse --abbrev-ref HEAD` GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
GIT_REVISION=`git --work-tree $DIR rev-parse --short HEAD` GIT_REVISION=`git rev-parse --short HEAD`
$(git --work-tree $DIR diff-index --quiet HEAD) $(git diff-index --quiet HEAD --)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
GIT_REVISION="$GIT_REVISION+" # uncommitted changes GIT_REVISION="$GIT_REVISION+" # uncommitted changes
fi fi