00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _NDPARAMETERVIEW_H_
00022 #define _NDPARAMETERVIEW_H_
00023
00024
00025 #include <qwidget.h>
00026 #include <qvalidator.h>
00027 #include <qlistview.h>
00028 #include <qdict.h>
00029 #include <qwidget.h>
00030 #include <qvaluelist.h>
00031
00032
00033 #include <kjanuswidget.h>
00034 #include <kurl.h>
00035
00036
00037 #include "acquisitionsystempage.h"
00038 #include "anatomypage.h"
00039 #include "unitlistpage.h"
00040 #include "generalinfopage.h"
00041 #include "lfppage.h"
00042 #include "spikepage.h"
00043 #include "videopage.h"
00044 #include "filespage.h"
00045 #include "channelcolorspage.h"
00046 #include "clusterspage.h"
00047 #include "miscellaneouspage.h"
00048 #include "neuroscopevideopage.h"
00049 #include "programspage.h"
00050 #include "programpage.h"
00051 #include "generalinformation.h"
00052 #include "fileinformation.h"
00053 #include "programinformation.h"
00054 #include "neuroscopevideoinfo.h"
00055 #include "channeloffsetspage.h"
00056
00057 class ndManager;
00058 class ndManagerDoc;
00059 class KURL;
00060
00070 class ParameterView : public KJanusWidget
00071 {
00072 Q_OBJECT
00073 public:
00082 ParameterView(ndManager* mainWindow,ndManagerDoc& doc,QWidget *parent, const char* name, bool expertMode);
00083
00087 ~ParameterView();
00088
00110 void initialize(QMap<int, QValueList<int> >& anatomicalGroups,QMap<QString, QMap<int,QString> >& attributes,
00111 QMap<int, QValueList<int> >& spikeGroups,QMap<int, QMap<QString,QString> >& spikeGroupsInformation,QMap<int, QValueList<QString> >& units,
00112 GeneralInformation& generalInformation,QMap<QString,int>& acquisitionSystemInfo,QMap<QString,float>& videoInformation,
00113 QValueList<FileInformation>& files,QValueList<ChannelColors>& channelColors,QMap<int,int>& channelDefaultOffsets,
00114 NeuroscopeVideoInfo& neuroscopeVideoInfo,QValueList<ProgramInformation>& programs,
00115 int lfpRate,float screenGain,int nbSamples,int peakSampleIndex);
00116
00138 void getInformation(QMap<int, QValueList<int> >& anatomicalGroups,QMap<QString, QMap<int,QString> >& attributes,
00139 QMap<int, QValueList<int> >& spikeGroups,QMap<int, QMap<QString,QString> >& spikeGroupsInformation,QMap<int, QValueList<QString> >& units,
00140 GeneralInformation& generalInformation,QMap<QString,int>& acquisitionSystemInfo,QMap<QString,float>& videoInformation,
00141 QValueList<FileInformation>& files,QValueList<ChannelColors>& channelColors,QMap<int,int>& channelDefaultOffsets,
00142 NeuroscopeVideoInfo& neuroscopeVideoInfo,QValueList<ProgramInformation>& programs,
00143 int& lfpRate,float& screenGain,int& nbSamples,int& peakSampleIndex);
00144
00146 bool isModified();
00147
00151 QValueList<QString> modifiedScripts();
00152
00158 QValueList<QString> modifiedProgramDescription();
00159
00160
00162 void hasBeenSave();
00163
00168 bool saveScript(QString programName);
00169
00173 void saveProgramDescription(QString programName);
00174
00177 inline int getNbGroups()const{return spike->getNbGroups();}
00178
00182 inline QValueList<QString> getFileExtensions()const{return files->getFileExtensions();}
00183
00187 inline const QValueList<QString>& getFileScriptNames()const{return programNames;};
00188
00189 signals:
00193 void signalChangeStatusbar(const QString& text);
00194
00196 void resetModificationStatus();
00197
00199 void partShown(Kate::View* view);
00200
00202 void partHidden();
00203
00205 void nbSpikeGroupsHasBeenModified(int nbGroups);
00206
00208 void fileHasBeenModified(QValueList<QString> extensions);
00209
00211 void scriptListHasBeenModified(const QValueList<QString>& scriptNames);
00212
00213 public slots:
00214
00217 void addNewProgram();
00218
00222 void loadProgram(KURL programUrl);
00223
00227 void removeProgram(ProgramPage* programPage);
00228
00235 void changeProgramName(ProgramPage* programPage,const QString& newName,QString message,QString title);
00236
00240 void nbChannelsModified(int nbChannels);
00241
00245 inline void nbSpikeGroupsModified(int nbGroups){emit nbSpikeGroupsHasBeenModified(nbGroups);};
00246
00250 inline void fileModification(QValueList<QString> extensions){emit fileHasBeenModified(extensions);};
00251
00252 private slots:
00253
00254 void scriptShown(Kate::View* scriptView);
00255 void scriptHidden();
00256 void pageWillBeShown(QWidget * page);
00257
00258 private:
00259
00264 ProgramPage* addProgram(QString programName);
00265
00271 ProgramPage* addProgram(QString programName,bool show);
00272
00274 ndManagerDoc& doc;
00275
00277 GeneralInfoPage* generalInfo;
00278
00280 AcquisitionSystemPage* acquisitionSystem;
00281
00283 VideoPage* video;
00284
00286 LfpPage* lfp;
00287
00289 FilesPage* files;
00290
00292 AnatomyPage* anatomy;
00293
00295 SpikePage* spike;
00296
00298 UnitListPage* unitList;
00299
00301 MiscellaneousPage* miscellaneous;
00302
00304 NeuroscopeVideoPage* neuroscopeVideo;
00305
00307 ClustersPage* clusters;
00308
00310 ChannelColorsPage* channelColors;
00311
00313 ChannelOffsetsPage* channelDefaultOffsets;
00314
00316 ProgramsPage* programs;
00317
00319 QFrame* programsFrame;
00320
00322 QDict<ProgramPage> programDict;
00323
00325 QValueList<QString> programNames;
00326
00328 int counter;
00329
00330 static const QString DEFAULT_COLOR;
00331
00332 bool programsModified;
00333
00335 int programId;
00336
00338 bool expertMode;
00339 };
00340
00341 #endif // _NDPARAMETERVIEW_H_