00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef PARAMETERXMLMODIFIER_H
00019 #define PARAMETERXMLMODIFIER_H
00020
00021
00022 #include <kurl.h>
00023
00024
00025 #include "sessionInformation.h"
00026
00027
00028 #include <qvaluelist.h>
00029 #include <qmap.h>
00030 #include <qdom.h>
00031
00032
00033 class ChannelColors;
00034
00040 class ParameterXmlModifier {
00041 public:
00042
00045 ParameterXmlModifier();
00046
00047 ~ParameterXmlModifier();
00048
00053 bool parseFile(const KURL& url);
00054
00059 bool writeTofile(const KURL& url);
00060
00066 QDomNode findDirectChild(QString childName);
00067
00074 QDomNode findDirectChild(QString childName,QDomNode ancestor);
00075
00086 QDomNode findDirectChild(QString childName,QString grandChildName,QString value,QDomNode ancestor);
00087
00098 bool setAcquisitionSystemInformation(int resolution,int nbChannels,double samplingRate,int voltageRange,int amplification,int offset);
00099
00105 bool setLfpInformation(double lfpSamplingRate);
00106
00112 void setMiscellaneousInformation(float screenGain,QString traceBackgroungImage);
00113
00114
00123 void setNeuroscopeVideoInformation(int rotation,int flip,QString backgroundPath,int drawTrajectory);
00124
00131 bool setVideoInformation(int width,int height);
00132
00142 bool setChannelDisplayInformation(ChannelColors* channelColors,QMap<int,int>& channelsGroups,QMap<int,int>& channelDefaultOffsets);
00143
00150 bool setAnatomicalDescription(QMap<int, QValueList<int> >& anatomicalGroups,QMap<int,bool> skipStatus);
00151
00159 bool setSpikeDetectionInformation(int nbSamples,int peakSampleIndex,QMap<int, QValueList<int> >& spikeGroups);
00160
00166 bool setSpikeDetectionInformation(QMap<int, QValueList<int> >& spikeGroups);
00167
00175 bool setSampleRateByExtension(QMap<QString,double> extensionSamplingRates);
00176
00177
00178 private:
00179
00181 QDomDocument doc;
00182
00184 QDomNode root;
00185
00187 QDomNode miscellaneous;
00188
00190 QDomNode acquisitionSystem;
00191
00193 QDomNode channels;
00194
00196 QDomNode anatomicalDescription;
00197
00199 QDomNode spikeDetection;
00200
00202 QDomNode neuroscope;
00203
00205 QDomElement spikes;
00207 QDomElement neuroscopeVideo;
00208
00210 QDomNode video;
00211
00213 QDomNode lfp;
00214
00216 QDomNode files;
00217
00219 bool newVideoNode;
00220
00222 bool newFilesNode;
00223
00225 QString initialXmlDocument;
00226
00227 static const QString parameterVersion;
00228
00229 };
00230
00231 #endif