00001 /****************************************************************************** 00002 * 00003 * This file is part of Cardio Curves. 00004 * Copyright (C) 2009 Jan Gunnar Andreassen 00005 * Copyright (C) 2009 Lars Magne Engedal 00006 * 00007 * Cardio Curves is free software: you can redistribute it and/or modify 00008 * it under the terms of the GNU Lesser General Public License as published 00009 * by the Free Software Foundation, either version 2.1 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * Cardio Cruves is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with Cardio Curves. If not, see <http://www.gnu.org/licenses/>. 00019 * 00020 * Developer contact: 00021 * (janislazzaroni at users.sourceforge.net) 00022 * (engedal at users.sourceforge.net ) 00023 ******************************************************************************/ 00024 00025 #ifndef CENTRALWIDGET_H 00026 #define CENTRALWIDGET_H 00027 00028 #include <QWidget> 00029 00030 class Plotting; 00031 class QPrintPreviewDialog; 00032 class DataHandler; 00033 class MferReader; 00034 class SimplePlot; 00035 class FileReader; 00036 class QDateTime; 00037 class QLabel; 00038 00050 class CentralWidget : public QWidget 00051 { 00052 Q_OBJECT 00053 public: 00055 enum ModeSelector 00056 { 00057 NODATA_MODE, 00059 SINGLECHANNEL_MODE, 00061 MULTICHANNEL_MODE, 00063 LIVE_MODE 00065 }; 00066 00071 CentralWidget(QWidget *parent = 0); 00072 00077 void setActiveMode(ModeSelector newMode); 00078 00083 ModeSelector getActiveMode() const { return activeMode; } 00090 bool readFile(const QString &fileName); 00091 00095 MferReader *getReader() const; 00096 00097 public slots: 00102 void printSlot(QPrinter *printer); 00103 00108 void updateScreen(int screenIndex); 00109 00110 signals: 00121 void setupSliders(int screens, int patientId, QDateTime *startingPoint); 00122 00123 private: 00124 void init(); 00125 00126 Plotting *plotting; 00127 ModeSelector activeMode; 00128 DataHandler* dataToPlot; 00129 MferReader *mferReader; 00130 SimplePlot *simplePlot; 00131 FileReader *fileReader; 00132 QLabel *noDataModeImageLabel; 00133 QLabel *noDataModeTextLabel; 00134 QString fileName; 00135 }; 00136 inline MferReader *CentralWidget::getReader() const 00137 { return mferReader; } 00138 #endif // CENTRALWIDGET_H