Changeset 3674 in Sophya for trunk/AddOn/TAcq/brparam.cc
- Timestamp:
- Nov 15, 2009, 1:27:00 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AddOn/TAcq/brparam.cc
r3673 r3674 63 63 64 64 /* --Methode-- */ 65 void BRConfList::SetBaseDirectory(string basedir) 66 { 67 basedir_=basedir; 68 size_t len = basedir_.length(); 69 if ((len>1)&&(basedir_[len-1]!='/')) basedir_ += '/'; 70 } 71 72 /* --Methode-- */ 65 73 void BRConfList::Set(BRConfList const & cf) 66 74 { … … 86 94 87 95 /* --Methode-- */ 88 BRParList::BRParList(string fibres,unsigned int paqsz ,unsigned int nframeDMA,96 BRParList::BRParList(string fibres,unsigned int paqsz ,unsigned int dmaszkb, 89 97 int nfiles, string acqmod,int nblocfile,int nmxproc , 90 98 string outpath, uint_4 nzon , uint_4 npaqzon, bool fgcntlc) … … 94 102 for (int fib=0; fib<PMAXNBFIBRES;fib++) FiberNum[fib]=0; 95 103 PaqSize=paqsz; 96 nbFrameDMA=nframeDMA;104 dmasizekb=dmaszkb; 97 105 NbFiles=nfiles; 98 106 AcqMode=acqmod; … … 105 113 savesigfits=true; 106 114 fgnulldev4fits=false; 115 107 116 fg_hard_ctrlc=fgcntlc; 117 108 118 fgreducpsize=false; 119 reducneedcopy=false; 109 120 pqreducmode=BR_CopyRA; 110 121 redpqsize=PaqSize; 111 122 reducoffset=0; 112 123 124 skysource=""; 113 125 monothr=false; 114 126 activate_pattern=false; … … 130 142 for (int fib=0; fib<PMAXNBFIBRES;fib++) FiberNum[fib]=p.FiberNum[fib]; 131 143 PaqSize=p.PaqSize; 132 nbFrameDMA=p.nbFrameDMA;144 dmasizekb=p.dmasizekb; 133 145 NbFiles=p.NbFiles; 134 146 AcqMode=p.AcqMode; … … 145 157 146 158 fgreducpsize=p.fgreducpsize; 159 reducneedcopy=p.reducneedcopy; 147 160 pqreducmode=p.pqreducmode; 148 161 redpqsize=p.redpqsize; 149 162 reducoffset=p.reducoffset; 150 163 164 skysource=p.skysource; 165 151 166 monothr=p.monothr; 152 167 activate_pattern=p.activate_pattern; … … 158 173 { 159 174 DataCards conf(file); 160 FiberListS= conf.SParam(" Fibres",0,"1");161 PaqSize=(unsigned int)conf.IParam("PaqSZ",0,16424);162 nbFrameDMA =(unsigned int) conf.IParam("nbFrameDma",0,32);163 NbFiles=conf.IParam("NbFiles",0,1);164 NBlocPerFile=conf.IParam("NBlocPerFile",0,10);165 N MaxProc=conf.IParam("NMaxProc",0,0);166 OutPathName= conf.SParam("OutPathName",0,"TstAcq");175 FiberListS= conf.SParam("fibres",0,"1"); 176 OutPathName= conf.SParam("outpathname",0,"TstAcq"); 177 skysource= conf.SParam("skysource",0,""); 178 PaqSize=(uint_4)conf.IParam("paqsize",0,16424); 179 dmasizekb =(uint_4) conf.IParam("dmasizekb",0,32); 180 NbFiles=conf.IParam("nbfiles",0,1); 181 NBlocPerFile=conf.IParam("nblocperfile",0,10); 167 182 AcqMode =conf.SParam("acqmode",0,"std"); 168 nZones=(unsigned int)conf.IParam("nZones",0,4); 169 nPaqZone=(uint_4)conf.IParam("nPaqZone",0,128); 170 fg_hard_ctrlc=conf.HasKey("fg_hard_ctrlc"); 183 nZones=(uint_4)conf.IParam("memmgr",0,4); 184 nPaqZone=(uint_4)conf.IParam("memmgr",1,128); 185 if (conf.HasKey("reducpaqsz")) { // reduction des tailles de paquets 186 fgreducpsize=true; 187 redpqsize=(uint_4)conf.IParam("reducpaqsz",0,PaqSize/4); 188 reducoffset=(uint_4)conf.IParam("reducpaqsz",1,0); 189 } 190 NMaxProc=conf.IParam("monitor",0,0); 191 fg_hard_ctrlc=conf.HasKey("hard_ctrlc"); 171 192 172 193 Decode(); … … 191 212 } 192 213 string acqmode = AcqMode; 193 if (acqmode == "std") swapall = BR_Copy ; 214 reducneedcopy=false; pqreducmode=BR_TwoChanReduc; 215 if (acqmode == "std") swapall = BR_Copy ; 194 216 if (acqmode == "nosw") swapall = BR_Copy ; 195 217 if (acqmode == "nof") { swapall = BR_Copy ; savesigfits = false; } 196 if (acqmode == "fft1c") swapall = BR_FFTOneChan; 197 if (acqmode == "fft2c") swapall = BR_FFTTwoChan; 198 if (acqmode == "fft1cnof") { swapall = BR_FFTOneChan; savesigfits = false; } 199 if (acqmode == "fft2cnof") { swapall = BR_FFTTwoChan; savesigfits = false; } 218 if (acqmode == "fft1c") { swapall = BR_FFTOneChan; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 219 if (acqmode == "fft2c") { swapall = BR_FFTTwoChan; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 220 if (acqmode == "fft1cnof") 221 { swapall = BR_FFTOneChan; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 222 if (acqmode == "fft2cnof") 223 { swapall = BR_FFTTwoChan; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 200 224 if (acqmode == "mono") { monothr = true; swapall = BR_Copy; } 201 225 if (acqmode == "monodirect") { monothr = true; swapall = BR_CopyHDR;} … … 206 230 207 231 if (acqmode == "swapall") swapall = BR_SwapAll; 208 if (acqmode == "fft1csw") swapall = BR_FFTOneChanSwapAll; 209 if (acqmode == "fft2csw") swapall = BR_FFTTwoChanSwapAll; 210 if (acqmode == "fft1cswnof") { swapall = BR_FFTOneChanSwapAll; savesigfits = false; } 211 if (acqmode == "fft2cswnof") { swapall = BR_FFTTwoChanSwapAll; savesigfits = false; } 232 if (acqmode == "fft1csw") 233 { swapall = BR_FFTOneChanSwapAll; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 234 if (acqmode == "fft2csw") 235 { swapall = BR_FFTTwoChanSwapAll; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 236 if (acqmode == "fft1cswnof") 237 { swapall = BR_FFTOneChanSwapAll; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 238 if (acqmode == "fft2cswnof") 239 { swapall = BR_FFTTwoChanSwapAll; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 212 240 if ((acqmode == "swh") || (acqmode == "mxs") || (acqmode == "monoswh") ) swapall = BR_SwapHDR; 213 241 if ((acqmode == "swapallnof") || (acqmode == "mxs") ) savesigfits = false; … … 217 245 if (acqmode == "swap32") swapall = BR_Swap32 ; 218 246 if (acqmode == "nof32") { swapall = BR_Swap32 ; savesigfits = false; } 219 if (acqmode == "fft1c32") swapall = BR_FFTOneChanSwap32; 220 if (acqmode == "fft2c32") swapall = BR_FFTTwoChanSwap32; 221 if (acqmode == "fft1cnof32") { swapall = BR_FFTOneChanSwap32; savesigfits = false; } 222 if (acqmode == "fft2cnof32") { swapall = BR_FFTTwoChanSwap32; savesigfits = false; } 247 if (acqmode == "fft1c32") 248 { swapall = BR_FFTOneChanSwap32; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 249 if (acqmode == "fft2c32") 250 { swapall = BR_FFTTwoChanSwap32; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 251 if (acqmode == "fft1cnof32") 252 { swapall = BR_FFTOneChanSwap32; savesigfits = false; reducneedcopy=true; pqreducmode=BR_OneChanReducK0; } 253 if (acqmode == "fft2cnof32") 254 { swapall = BR_FFTTwoChanSwap32; savesigfits = false; reducneedcopy=true; pqreducmode=BR_TwoChanReducK0; } 255 256 if (fgreducpsize) { 257 if (redpqsize>=PaqSize) fgreducpsize=false; 258 else { 259 if(reducoffset>(PaqSize-redpqsize)/2) reducoffset=(PaqSize-redpqsize)/2; 260 } 261 } 223 262 } 224 263 … … 229 268 os << " FiberListS=" << FiberListS ; 230 269 os << " PaqSize=" <<PaqSize; 231 os << " nbFrameDMA=" <<nbFrameDMA<< endl;270 os << " DMA_Size_kb=" <<dmasizekb << endl; 232 271 os << " AcqMode="<<AcqMode; 233 272 os << " Type of acquisition :" << BRPaquet::FmtConvToString( swapall) << endl; 273 os << " SkySource=" << skysource; 234 274 os << " NbFiles="<<NbFiles; 235 275 os << " NBlocPerFile="<<NBlocPerFile; 236 276 os << " OutPathName="<<OutPathName << endl; 237 277 os << " MemMgr: nZones="<<nZones; 238 os << " nPaqZone="<<nPaqZone; 278 os << " nPaqZone="<<nPaqZone<<endl; 279 if (fgreducpsize) { 280 os << " PaquetSize Reduction, ReducedSize=" << redpqsize << " Offset=" << reducoffset << endl; 281 } 239 282 os << " fg_hard_ctrlc=" << ((fg_hard_ctrlc)?"true":"false"); 240 283 os << " Save to fits " << ((savesigfits)?"true":"false") << endl;
Note:
See TracChangeset
for help on using the changeset viewer.