00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PREFDEFAULTS_H
00019 #define PREFDEFAULTS_H
00020
00021
00022 #include <qwidget.h>
00023 #include <qcombobox.h>
00024 #include <qcheckbox.h>
00025 #include <qspinbox.h>
00026 #include <qpushbutton.h>
00027 #include <qlineedit.h>
00028 #include <qvalidator.h>
00029
00030
00031 #include <kfiledialog.h>
00032 #include <klocale.h>
00033
00034
00035 #include <prefdefaultslayout.h>
00036
00042 class PrefDefaults : public PrefDefaultsLayout {
00043 Q_OBJECT
00044 public:
00045 PrefDefaults(QWidget *parent=0, const char *name=0);
00046 ~PrefDefaults();
00047
00048
00051 inline void setScreenGain(float gain){
00052 screenGainLineEdit->setText(QString("%1").arg(gain));
00053 };
00054
00057 inline void setVoltageRange(int value){
00058 voltageRangeLineEdit->setText(QString("%1").arg(value));
00059 };
00060
00063 inline void setAmplification(int value){
00064 amplificationLineEdit->setText(QString("%1").arg(value));
00065 };
00066
00068 inline void setNbChannels(int nb){nbChannelsLineEdit->setText(QString("%1").arg(nb));};
00069
00071 inline void setDatSamplingRate(double rate){datSamplingRateLineEdit->setText(QString("%1").arg(rate,0,'g',14));};
00072
00074 inline void setEegSamplingRate(double rate){eegSamplingRateLineEdit->setText(QString("%1").arg(rate,0,'g',14));};
00075
00077 inline void setOffset(int offset){offsetLineEdit->setText(QString("%1").arg(offset));};
00078
00080 inline void setResolutionIndex(int index){resolutionComboBox->setCurrentItem(index);};
00081
00083 inline void setTraceBackgroundImage(QString image){
00084 traceBackgroundLineEdit->setText(image);
00085 };
00086
00089 inline float getScreenGain() const{
00090 return screenGainLineEdit->text().toFloat();
00091 };
00092
00095 inline int getVoltageRange() const{
00096 return voltageRangeLineEdit->text().toInt();
00097 };
00098
00101 inline int getAmplification() const{
00102 return amplificationLineEdit->text().toInt();
00103 };
00104
00106 inline int getNbChannels() const{return nbChannelsLineEdit->text().toInt();};
00107
00109 inline double getDatSamplingRate() const{return datSamplingRateLineEdit->text().toDouble();};
00110
00112 inline double getEegSamplingRate() const{return eegSamplingRateLineEdit->text().toDouble();};
00113
00115 inline int getOffset() const{return offsetLineEdit->text().toInt();};
00116
00118 inline int getResolutionIndex()const{return resolutionComboBox->currentItem();};
00119
00121 inline QString getTraceBackgroundImage()const{return traceBackgroundLineEdit->text();};
00122
00123 private slots:
00124 inline void updateTraceBackgroundImage(){
00125 QString image = KFileDialog::getOpenFileName(QString::null,
00126 QString::null, this, i18n("Select the background image..."));
00127
00128 if(image != "") setTraceBackgroundImage(image);
00129 };
00130
00131 private:
00132
00133 QIntValidator intValidator;
00134 QDoubleValidator doubleValidator;
00135 };
00136
00137 #endif