OSCAR-code/daily.h

125 lines
3.3 KiB
C
Raw Normal View History

/*
2011-06-26 08:30:44 +00:00
Daily GUI Headers
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
License: GPL
*/
2011-06-26 08:30:44 +00:00
#ifndef DAILY_H
#define DAILY_H
#include <QScrollArea>
#include <QMenu>
#include <QAction>
2011-06-26 08:30:44 +00:00
#include <QWidget>
#include <QTreeWidget>
#include <QLabel>
#include <QtOpenGL/QGLContext>
2011-06-29 14:19:38 +00:00
#include <QWebPluginFactory>
2011-06-26 08:30:44 +00:00
#include <SleepLib/profiles.h>
#include <Graphs/graphwindow.h>
#include "mainwindow.h"
#include "Graphs/gSplitter.h"
2011-07-27 09:21:53 +00:00
#include "Graphs/gLineChart.h"
#include "Graphs/gFlagsLine.h"
2011-06-26 08:30:44 +00:00
namespace Ui {
class Daily;
}
2011-07-29 14:58:44 +00:00
class Daily;
class MyScrollArea:public QScrollArea
{
public:
MyScrollArea(Daily * parent);
virtual ~MyScrollArea();
protected:
virtual void scrollContentsBy(int dx, int dy);
Daily *daily;
};
class MainWindow;
2011-06-26 08:30:44 +00:00
class Daily : public QWidget
{
Q_OBJECT
public:
explicit Daily(QWidget *parent,QGLWidget *shared,MainWindow *mw);
2011-06-26 08:30:44 +00:00
~Daily();
void ReloadGraphs();
2011-06-27 15:00:00 +00:00
void RedrawGraphs();
2011-07-28 14:20:59 +00:00
void ResetGraphLayout();
2011-07-27 09:21:53 +00:00
QGLWidget *SharedWidget() { return SF; }
2011-06-26 08:30:44 +00:00
private slots:
void on_calendar_currentPageChanged(int year, int month);
void on_calendar_selectionChanged();
void on_JournalNotesItalic_clicked();
void on_JournalNotesBold_clicked();
void on_JournalNotesFontsize_activated(int index);
void on_JournalNotesColour_clicked();
void on_EnergySlider_sliderMoved(int position);
void on_treeWidget_itemSelectionChanged();
void on_JournalNotesUnderline_clicked();
void ShowHideGraphs();
2011-07-28 11:09:53 +00:00
protected:
virtual void resizeEvent (QResizeEvent * event);
2011-06-26 08:30:44 +00:00
private:
Session * CreateJournalSession(QDate date);
Session * GetJournalSession(QDate date);
void Load(QDate date);
void Unload(QDate date);
void UpdateCalendarDay(QDate date);
void UpdateEventsTree(QTreeWidget * tree,Day *day);
2011-07-27 09:21:53 +00:00
//gLineChart *frw,*prd,*leak,*pr_ipap,*pr_epap,*snore,*pulse,*spo2,*rr,*mv,*tv,*mp,*flg,*ptb;
//gPointData *tap,*tap_eap,*tap_iap,*g_ahi,*frw,*prd,*leak,*pressure_iap,*pressure_eap,*snore;
//gPointData *pulse,*spo2,*rr,*mv,*tv,*mp,*flg,*ptb;
2011-06-26 08:30:44 +00:00
gFlagsGroup *fg;
2011-08-07 00:22:54 +00:00
gGraphWindow *PRD,*FRW,*G_AHI,*TAP,*LEAK,*SF,*TAP_EAP,*TAP_IAP,*PULSE,*SPO2,
2011-08-07 01:26:28 +00:00
*SNORE,*RR,*MP,*MV,*TV,*FLG,*PTB,*OF,*INTPULSE,*INTSPO2, *THPR;
2011-06-26 08:30:44 +00:00
2011-08-07 02:11:54 +00:00
gLineChart *pressure, *epap, *ipap;
QList<gLayer *> OXIData;
QList<gLayer *> CPAPData;
QVector<gGraphWindow *> Graphs;
QVector<QAction *> GraphAction;
QGLContext *offscreen_context;
2011-07-28 14:20:59 +00:00
QList<int> splitter_sizes;
2011-07-27 09:21:53 +00:00
gLayer * AddCPAP(gLayer *d) { CPAPData.push_back(d); return d; }
gLayer * AddOXI(gLayer *d) { OXIData.push_back(d); return d; }
2011-07-04 11:37:26 +00:00
void AddGraph(gGraphWindow *w);
2011-06-26 08:30:44 +00:00
void UpdateCPAPGraphs(Day *day);
void UpdateOXIGraphs(Day *day);
MainWindow * mainwin;
2011-06-26 08:30:44 +00:00
Ui::Daily *ui;
Profile *profile;
QDate previous_date;
QScrollArea *scrollArea;
QVBoxLayout *splitter;
2011-06-26 08:30:44 +00:00
QLabel *NoData;
QWidget *spacer;
QMenu *show_graph_menu;
2011-08-02 12:32:03 +00:00
QWidget *GraphLayout;
2011-06-26 08:30:44 +00:00
};
2011-07-01 10:10:44 +00:00
/*class AHIGraph:public QWebPluginFactory
2011-06-29 14:19:38 +00:00
{
public:
AHIGraph(QObject * parent = 0);
virtual ~AHIGraph();
virtual QObject * create ( const QString & mimeType, const QUrl & url, const QStringList & argumentNames, const QStringList & argumentValues) const;
virtual QList<Plugin> plugins () const;
//virtual void refreshPlugins ();
2011-07-01 10:10:44 +00:00
}; */
2011-06-29 14:19:38 +00:00
2011-06-26 08:30:44 +00:00
#endif // DAILY_H