src/properties.h

00001 /***************************************************************************
00002                           properties.h  -  description
00003                              -------------------
00004     begin                : Sun Feb 29 2004
00005     copyright            : (C) 2004 by Lynn Hazan
00006     email                : lynn.hazan.myrealbox.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef PROPERTIES_H
00019 #define PROPERTIES_H
00020 
00021 // include files for QT
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 //includes files for KDE
00030 #include <kfiledialog.h>
00031 #include <klocale.h>
00032 
00033 //include files for the application
00034 #include <propertieslayout.h>
00035 
00036 
00037 //General C++ include files
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

Generated on Mon Sep 17 20:47:31 2007 for NeuroScope by  doxygen 1.5.1