00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PROPERTIES_H
00019 #define PROPERTIES_H
00020
00021
00022 #include <qwidget.h>
00023 #include <qcombobox.h>
00024 #include <qspinbox.h>
00025 #include <qpushbutton.h>
00026 #include <qlineedit.h>
00027 #include <qvalidator.h>
00028
00029
00030 #include <kfiledialog.h>
00031 #include <klocale.h>
00032
00033
00034 #include <propertieslayout.h>
00035
00036
00037
00038 #include <iostream>
00039 using namespace std;
00040
00045 class Properties : public PropertiesLayout {
00046 Q_OBJECT
00047 public:
00048 Properties(QWidget *parent=0, const char *name=0);
00049 ~Properties();
00050
00053 inline void setScreenGain(float gain){
00054 screenGainLineEdit->setText(QString("%1").arg(gain));
00055 };
00056
00059 inline void setVoltageRange(int value){
00060 voltageRangeLineEdit->setText(QString("%1").arg(value));
00061 };
00062
00065 inline void setAmplification(int value){
00066 amplificationLineEdit->setText(QString("%1").arg(value));
00067 };
00068
00070 inline void setNbChannels(int nb){nbChannelsLineEdit->setText(QString("%1").arg(nb));};
00071
00073 inline void setSamplingRate(double rate){samplingRateLineEdit->setText(QString("%1").arg(rate,0,'g',14));};
00074
00076 inline void setAcquisitionSystemSamplingRate(double rate){asSamplingRateLineEdit->setText(QString("%1").arg(rate,0,'g',14));};
00077
00079 inline void setOffset(int offset){offsetLineEdit->setText(QString("%1").arg(offset));};
00080
00082 inline void setResolution(int res){
00083 switch(res){
00084 case 12:
00085 resolutionComboBox->setCurrentItem(0);
00086 break;
00087 case 14:
00088 resolutionComboBox->setCurrentItem(1);
00089 break;
00090 case 16:
00091 resolutionComboBox->setCurrentItem(2);
00092 break;
00093 case 32:
00094 resolutionComboBox->setCurrentItem(3);
00095 break;
00096 default:
00097 resolutionComboBox->setCurrentItem(2);
00098 break;
00099 }
00100 };
00101
00103 inline void setTraceBackgroundImage(QString image){
00104 traceBackgroundLineEdit->setText(image);
00105 };
00106
00109 inline float getScreenGain() const{
00110 return screenGainLineEdit->text().toFloat();
00111 };
00112
00115 inline int getVoltageRange() const{
00116 return voltageRangeLineEdit->text().toInt();
00117 };
00118
00121 inline int getAmplification() const{
00122 return amplificationLineEdit->text().toInt();
00123 };
00124
00126 inline int getNbChannels() const{return nbChannelsLineEdit->text().toInt();};
00127
00129 inline double getSamplingRate() const{return samplingRateLineEdit->text().toDouble();};
00130
00132 inline double getAcquisitionSystemSamplingRate(){return asSamplingRateLineEdit->text().toDouble();};
00133
00135 inline int getOffset() const{return offsetLineEdit->text().toInt();};
00136
00138 inline int getResolution()const{
00139 switch(resolutionComboBox->currentItem()){
00140 case 0:
00141 return 12;
00142 case 1:
00143 return 14;
00144 case 2:
00145 return 16;
00146 case 3:
00147 return 32;
00148 default:
00149 return 16;
00150 }
00151 };
00152
00154 inline QString getTraceBackgroundImage()const{
00155 return traceBackgroundLineEdit->text();};
00156
00160 inline void setCurrentSamplingRateEnabled(bool state){samplingRateLineEdit->setEnabled(state);};
00161
00162 private slots:
00163 inline void updateTraceBackgroundImage(){
00164 QString image = KFileDialog::getOpenFileName(QString::null,
00165 QString::null, this, i18n("Select the background image..."));
00166
00167 if(image != "") setTraceBackgroundImage(image);
00168 };
00169
00170 private:
00171 QIntValidator intValidator;
00172 QDoubleValidator doubleValidator;
00173 };
00174
00175 #endif