mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Pie & Candlesticks cause crashes on some old graphics card drivers, so disabled by default.. Added an option to turn on
This commit is contained in:
parent
8ca96d752f
commit
f2af25faaf
@ -12,5 +12,6 @@
|
||||
<file>icons/back.png</file>
|
||||
<file>fonts/FreeSans.ttf</file>
|
||||
<file>icons/refresh.png</file>
|
||||
<file>docs/usage.html</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -45,14 +45,14 @@ ChannelID OXI_Pulse, OXI_SPO2, OXI_Plethysomogram, OXI_PulseChange, OXI_SPO2Drop
|
||||
ChannelID ZEO_SleepStage, ZEO_Waveform;
|
||||
ChannelID JOURNAL_Notes, JOURNAL_Weight;
|
||||
|
||||
ChannelID ChannelGroup::Get(ChannelType ctype,QString description,QString label,QString lookup)
|
||||
ChannelID ChannelGroup::Get(ChannelType ctype,QString description,QString label,QString lookup,QColor color)
|
||||
{
|
||||
ChannelID id=m_first+m_pos;
|
||||
if (++m_pos>=m_size) {
|
||||
qCritical("Not enough slots allocated for channel group");
|
||||
abort();
|
||||
}
|
||||
channel[id]=Channel(id,m_type,ctype,description,label);
|
||||
channel[id]=Channel(id,m_type,ctype,description,label,color);
|
||||
m_channelsbytype[ctype][id]=channel_lookup[lookup]=m_channel[id]=&channel[id];
|
||||
|
||||
return id;
|
||||
|
@ -82,9 +82,6 @@ protected:
|
||||
bool firstsession;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class CPAP:public Machine
|
||||
{
|
||||
public:
|
||||
|
@ -8,6 +8,7 @@
|
||||
#define MACHINE_COMMON_H
|
||||
|
||||
#include <QHash>
|
||||
#include <QColor>
|
||||
#include <QVector>
|
||||
#include <QVariant>
|
||||
#include <QString>
|
||||
@ -41,14 +42,15 @@ protected:
|
||||
ChannelType m_ctype;
|
||||
QString m_details;
|
||||
QString m_label;
|
||||
QColor m_color;
|
||||
QVector<QVariant> m_option;
|
||||
EventDataType m_min_value;
|
||||
EventDataType m_max_value;
|
||||
public:
|
||||
Channel()
|
||||
:m_id(0),m_mtype(MT_UNKNOWN), m_ctype(CT_Unknown), m_details(""), m_label("") {}
|
||||
Channel(ChannelID id, MachineType mtype, ChannelType ctype, QString details, QString label)
|
||||
:m_id(id),m_mtype(mtype),m_ctype(ctype),m_details(details),m_label(label) {}
|
||||
:m_id(0),m_mtype(MT_UNKNOWN), m_ctype(CT_Unknown), m_details(""), m_label(""),m_color(Qt::black) {}
|
||||
Channel(ChannelID id, MachineType mtype, ChannelType ctype, QString details, QString label, QColor color)
|
||||
:m_id(id),m_mtype(mtype),m_ctype(ctype),m_details(details),m_label(label),m_color(color) {}
|
||||
ChannelID & id() { return m_id; }
|
||||
MachineType & machinetype() { return m_mtype; }
|
||||
ChannelType & channeltype() { return m_ctype; }
|
||||
@ -92,7 +94,7 @@ public:
|
||||
Channel & operator [](QString lookup) { return *m_channel_lookup[lookup]; }
|
||||
QHash<ChannelID, Channel *> & operator [](ChannelType type) { return m_channelsbytype[type]; }
|
||||
|
||||
ChannelID Get(ChannelType ctype,QString description="",QString label="",QString lookup="");
|
||||
ChannelID Get(ChannelType ctype,QString description="",QString label="",QString lookup="",QColor color=Qt::black);
|
||||
ChannelGroup();
|
||||
ChannelGroup(MachineType type, ChannelID first, ChannelID reserved=0x200);
|
||||
};
|
||||
|
@ -122,4 +122,5 @@ RESOURCES += \
|
||||
Resources.qrc
|
||||
|
||||
OTHER_FILES += \
|
||||
docs/index.html
|
||||
docs/index.html \
|
||||
docs/usage.html
|
||||
|
15
daily.cpp
15
daily.cpp
@ -699,8 +699,8 @@ void Daily::Load(QDate date)
|
||||
"</table></td>";
|
||||
}
|
||||
|
||||
html+="</tr>\n<tr><td colspan=4 align=center><i>"+tr("Event Breakdown")+"</i></td></tr>\n";
|
||||
if (1) { // AHI Pie Chart
|
||||
if (pref["EnableGraphSnapshots"].toBool()) { // AHI Pie Chart
|
||||
html+="</tr>\n<tr><td colspan=4 align=center><i>"+tr("Event Breakdown")+"</i></td></tr>\n";
|
||||
G_AHI->setFixedSize(gwwidth,120);
|
||||
QPixmap pixmap=G_AHI->renderPixmap(gwwidth,120,false); //gwwidth,gwheight,false);
|
||||
QByteArray byteArray;
|
||||
@ -795,7 +795,8 @@ void Daily::Load(QDate date)
|
||||
|
||||
if (cpap) {
|
||||
if (mode==MODE_BIPAP) {
|
||||
{
|
||||
if (pref["EnableGraphSnapshots"].toBool()) {
|
||||
{
|
||||
html+=("<tr><td colspan=4 align=center><i>")+tr("Time@EPAP")+("</i></td></tr>\n");
|
||||
TAP_EAP->setFixedSize(gwwidth,30);
|
||||
QPixmap pixmap=TAP_EAP->renderPixmap(gwwidth,30,false);
|
||||
@ -804,8 +805,8 @@ void Daily::Load(QDate date)
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG");
|
||||
html+="<tr><td colspan=4 align=center><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"></td></tr>\n";
|
||||
}
|
||||
{
|
||||
}
|
||||
{
|
||||
html+=("<tr><td colspan=4 align=center><i>")+tr("Time@IPAP")+("</i></td></tr>\n");
|
||||
TAP_IAP->setFixedSize(gwwidth,30);
|
||||
QPixmap pixmap=TAP_IAP->renderPixmap(gwwidth,30,false);
|
||||
@ -814,10 +815,11 @@ void Daily::Load(QDate date)
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG");
|
||||
html+="<tr><td colspan=4 align=center><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"></td></tr>\n";
|
||||
}
|
||||
}
|
||||
} else if (mode==MODE_APAP) {
|
||||
if (pref["EnableGraphSnapshots"].toBool()) {
|
||||
html+=("<tr><td colspan=4 align=center><i>")+tr("Time@Pressure")+("</i></td></tr>\n");
|
||||
|
||||
TAP->setFixedSize(gwwidth,30);
|
||||
QPixmap pixmap=TAP->renderPixmap(gwwidth,30,false);
|
||||
QByteArray byteArray;
|
||||
@ -825,6 +827,7 @@ void Daily::Load(QDate date)
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
pixmap.save(&buffer, "PNG");
|
||||
html+="<tr><td colspan=4 align=center><img src=\"data:image/png;base64," + byteArray.toBase64() + "\"></td></tr>\n";
|
||||
}
|
||||
}
|
||||
html+="</table><hr height=2><table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
||||
html+="<tr><td align=center>SessionID</td><td align=center>Date</td><td align=center>Start</td><td align=center>End</td></tr>";
|
||||
|
6
daily.h
6
daily.h
@ -1,8 +1,8 @@
|
||||
/********************************************************************
|
||||
/*
|
||||
Daily GUI Headers
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*********************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef DAILY_H
|
||||
#define DAILY_H
|
||||
@ -100,7 +100,7 @@ private:
|
||||
Ui::Daily *ui;
|
||||
Profile *profile;
|
||||
QDate previous_date;
|
||||
MyScrollArea *scrollArea;
|
||||
QScrollArea *scrollArea;
|
||||
QVBoxLayout *splitter;
|
||||
QLabel *NoData;
|
||||
QWidget *spacer;
|
||||
|
@ -15,7 +15,8 @@ p,a,td,body { font-size: 14px }
|
||||
<li>Philips Respironics System One (Including ASV models)</li>
|
||||
<li>ResMed S9 models (AutoSet and lower)</li>
|
||||
<li>Contec CMS50 Oximeters</li>
|
||||
<p>This is a developer preview, features are missing and bugs will be plentyful.
|
||||
<p><a href='qrc:/docs/usage.html'>A few usage notes and basic instructions</a></p>
|
||||
<p><i>This is a developer preview, features are missing and bugs will be plentyful.</i></p>
|
||||
<p><b>Project Website:</b> <a href='http://sleepyhead.sourceforge.net'>http://sleepyhead.sourceforge.net</a><br>
|
||||
<b>About Sleep Apnea:</b> <a href='http://en.wikipedia.org/wiki/Sleep_apnea'>http://en.wikipedia.org/wiki/Sleep_apnea</a><br>
|
||||
<b>CPAPTalk Forum:</b> <a href='http://www.cpaptalk.com'>http://www.cpaptalk.com</a></p>
|
||||
|
19
docs/usage.html
Normal file
19
docs/usage.html
Normal file
@ -0,0 +1,19 @@
|
||||
<html>
|
||||
<head>
|
||||
<style type='text/css'>
|
||||
<!--h1,p,a,td,body { font-family: 'FreeSans', 'Sans Serif' } --/>
|
||||
p,a,td,body { font-size: 14px }
|
||||
</style>
|
||||
</head>
|
||||
<body leftmargin=0 topmargin=0 rightmargin=0>
|
||||
<div align='center'><font size="+3">Usage Notes</font></div>
|
||||
<p>To import your PRS1 or S9 CPAP data, select either the root or drive letter of the SD card, or any folder containing a copy of it.
|
||||
On the PRS1 this folder should either contain or be the P-Series folder.. For the S9, the folder you select must contain the DATALOG folder, and Journal.dat, etc..</p>
|
||||
<p><b>ResMed S9 Users Please Note:</b> It's a good idea to keep a running backup of your DATALOG folder as your machine automatically deletes Flow waveform data past 7 days, and other waveforms after 30 days.</p>
|
||||
<p><b>CMS50 users:</b> To import data recorded by the SpO2Review software, look for the "Application Data" folder in your Home directory, point at the folder containing the Spo2.ini, Spo2Review.ini and Data folder.
|
||||
Serial importing is still a work in progress and may or may not behave how you would expect.</p>
|
||||
|
||||
<hr>
|
||||
<p><i>Do NOT rely on this softwares accuracy when making medical decisions. Talk to your doctor.</i></p>
|
||||
</body>
|
||||
</html>
|
@ -97,6 +97,10 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
if (!pref.Exists("NoonDateSplit")) pref["NoonDateSplit"]=false;
|
||||
ui->action_Noon_Date_Split->setChecked(pref["NoonDateSplit"].toBool());
|
||||
|
||||
if (!pref.Exists("EnableGraphSnapshots")) pref["EnableGraphSnapshots"]=false;
|
||||
ui->actionDisplay_Graph_Snapshots->setChecked(pref["EnableGraphSnapshots"].toBool());
|
||||
|
||||
|
||||
if (!pref.Exists("MemoryHog")) pref["MemoryHog"]=true;
|
||||
ui->action_Memory_Hog->setChecked(pref["MemoryHog"].toBool());
|
||||
|
||||
@ -360,3 +364,10 @@ void MainWindow::on_action_Preferences_triggered()
|
||||
qDebug() << "Preferences Accepted";
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionDisplay_Graph_Snapshots_toggled(bool checked)
|
||||
{
|
||||
//if (QMessageBox::question(this,"Warning","Turning this feature on has caused crashes on some hardware configurations due to OpenGL/Qt bugs.\nIf you have already seen Pie Charts & CandleSticks in the left panel of daily view previously, you're not affected by this bug.\nAre you sure you want to enable this?",QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) {
|
||||
pref["EnableGraphSnapshots"]=checked;
|
||||
//}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
/********************************************************************
|
||||
/*
|
||||
MainWindow Headers
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*********************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
@ -82,6 +82,8 @@ private slots:
|
||||
|
||||
void on_action_Preferences_triggered();
|
||||
|
||||
void on_actionDisplay_Graph_Snapshots_toggled(bool arg1);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
Daily * daily;
|
||||
|
@ -592,6 +592,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionUse_AntiAliasing"/>
|
||||
<addaction name="actionOverlay_Bars"/>
|
||||
<addaction name="actionDisplay_Graph_Snapshots"/>
|
||||
<addaction name="action_Link_Graphs"/>
|
||||
<addaction name="action_Noon_Date_Split"/>
|
||||
<addaction name="action_Memory_Hog"/>
|
||||
@ -733,6 +734,18 @@
|
||||
<string>&Reset Graph Layout</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDisplay_Graph_Snapshots">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display Crashy Snapshots</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Warning: Enabling this feature may require you to either hand edit the Preferences.xml or delete SleepyHeads data folder.
|
||||
</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
@ -1,8 +1,8 @@
|
||||
/********************************************************************
|
||||
/*
|
||||
Overview GUI Headers
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*********************************************************************/
|
||||
*/
|
||||
|
||||
#ifndef OVERVIEW_H
|
||||
#define OVERVIEW_H
|
||||
|
@ -1,3 +1,9 @@
|
||||
/*
|
||||
Oximetry GUI Headers
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*/
|
||||
|
||||
#ifndef OXIMETRY_H
|
||||
#define OXIMETRY_H
|
||||
|
||||
|
@ -10,7 +10,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->eventTable->setColumnWidth(0,40);
|
||||
ui->eventTable->setColumnWidth(1,50);
|
||||
ui->eventTable->setColumnWidth(1,55);
|
||||
int row=0;
|
||||
QTableWidgetItem *item;
|
||||
QHash<ChannelID, Channel>::iterator ci;
|
||||
@ -20,11 +20,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
item=new QTableWidgetItem(ci.value().details());
|
||||
ui->eventTable->setItem(row,2,item);
|
||||
QCheckBox *c=new QCheckBox(ui->eventTable);
|
||||
c->setChecked(true);
|
||||
QLabel *pb=new QLabel(ui->eventTable);
|
||||
pb->setText("foo");
|
||||
ui->eventTable->setCellWidget(row,0,c);
|
||||
ui->eventTable->setCellWidget(row,1,pb);
|
||||
QColor a(random() % 255, random() %255, random()%255, 255);
|
||||
QColor a(random() % 255, random() % 255, random() % 255, 255);
|
||||
QPalette p(a,a,a,a,a,a,a);
|
||||
|
||||
pb->setPalette(p);
|
||||
|
@ -1,3 +1,9 @@
|
||||
/*
|
||||
SleepyHead Preferences Dialog GUI Headers
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*/
|
||||
|
||||
#ifndef PREFERENCESDIALOG_H
|
||||
#define PREFERENCESDIALOG_H
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user