Changeset 3681 in Sophya for trunk/AddOn/TAcq/brparam.cc


Ignore:
Timestamp:
Nov 20, 2009, 12:46:54 PM (16 years ago)
Author:
ansari
Message:

Ajout classe de traitement en ligne (monitoring) MonitorProc , Reza 20/11/2009

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/AddOn/TAcq/brparam.cc

    r3674 r3681  
    9494
    9595/* --Methode-- */
    96 BRParList::BRParList(string fibres,unsigned int paqsz ,unsigned int dmaszkb,
    97                      int nfiles, string acqmod,int nblocfile,int nmxproc ,
    98                      string outpath, uint_4 nzon , uint_4 npaqzon, bool fgcntlc)
    99 {
     96BRParList::BRParList(string acqmod, string fibres,unsigned int paqsz,
     97                     unsigned int dmaszkb, int nfiles, int nblocfile,
     98                     string outpath, uint_4 nzon , uint_4 npaqzon)
     99{
     100  AcqMode=acqmod;
     101  fgdatafft=false;
     102  fgsinglechannel=false;
     103
    100104  FiberListS=fibres;
    101105  NbFibers=0;
     
    103107  PaqSize=paqsz;
    104108  dmasizekb=dmaszkb;
     109
    105110  NbFiles=nfiles;
    106   AcqMode=acqmod;
    107111  NBlocPerFile=nblocfile;
    108   NMaxProc=nmxproc;
    109112  OutPathName=outpath;
     113
    110114  nZones=nzon;
    111115  nPaqZone=npaqzon;
     116
    112117  swapall=BR_Copy;
    113118  savesigfits=true;
    114119  fgnulldev4fits=false;
    115120
    116   fg_hard_ctrlc=fgcntlc;
     121  fg_hard_ctrlc=false;
    117122
    118123  fgreducpsize=false;
     
    123128
    124129  skysource="";
     130
     131  fgdoProc=false;
     132  nmeanProc=512;
     133  stepProc=5;
     134  nmaxProc=0;
     135
    125136  monothr=false;
    126137  activate_pattern=false;
     138  nopciLossRate=0.;
    127139
    128140  Decode();    // On decode et on complete les parametres
     
    138150void BRParList::Set(BRParList const & p)
    139151{
     152  AcqMode=p.AcqMode;
     153  fgdatafft=p.fgdatafft;
     154  fgsinglechannel=p.fgsinglechannel;
     155
    140156  FiberListS=p.FiberListS;
    141157  NbFibers=p.NbFibers;
    142158  for (int fib=0; fib<PMAXNBFIBRES;fib++)  FiberNum[fib]=p.FiberNum[fib];
     159
    143160  PaqSize=p.PaqSize;
    144161  dmasizekb=p.dmasizekb;
     162
    145163  NbFiles=p.NbFiles;
    146   AcqMode=p.AcqMode;
    147164  NBlocPerFile=p.NBlocPerFile;
    148   NMaxProc=p.NMaxProc;
    149165  OutPathName=p.OutPathName;
     166
    150167  nZones=p.nZones;
    151168  nPaqZone=p.nPaqZone;
     169
    152170  swapall=p.swapall;
    153171  savesigfits=p.savesigfits;
     
    163181
    164182  skysource=p.skysource;
     183 
     184  fgdoProc=p.fgdoProc;
     185  nmeanProc=p.nmeanProc;
     186  stepProc=p.stepProc;
     187  nmaxProc=p.nmaxProc;
    165188
    166189  monothr=p.monothr;
    167190  activate_pattern=p.activate_pattern;
     191
     192  nopciLossRate=p.nopciLossRate;
    168193  return;
    169194}
     
    188213    reducoffset=(uint_4)conf.IParam("reducpaqsz",1,0);
    189214  }
    190   NMaxProc=conf.IParam("monitor",0,0);
     215  if (conf.HasKey("monitor")) {
     216    fgdoProc=true;
     217    nmeanProc=conf.IParam("monitor",0,512);
     218    stepProc=conf.IParam("monitor",1,10);
     219    nmaxProc=conf.IParam("monitor",2,0);
     220  }
     221  nopciLossRate=conf.DParam("nopcilossrate",0,0.);
     222
    191223  fg_hard_ctrlc=conf.HasKey("hard_ctrlc");
    192 
     224  if (conf.HasKey("nosavesigfits"))  savesigfits=false;
    193225  Decode();
    194226}
     
    212244  }
    213245  string acqmode = AcqMode;
     246  fgdatafft=false;  fgsinglechannel=false;
    214247  reducneedcopy=false;  pqreducmode=BR_TwoChanReduc;
    215   if (acqmode == "std")   swapall = BR_Copy ; 
     248  if ((acqmode == "std")||(acqmode=="raw2c"))   swapall = BR_Copy ; 
    216249  if (acqmode == "nosw")   swapall = BR_Copy ;
    217250  if (acqmode == "nof")  { swapall = BR_Copy ; savesigfits = false; }
     
    254287    { swapall = BR_FFTTwoChanSwap32;  savesigfits = false; reducneedcopy=true;  pqreducmode=BR_TwoChanReducK0; }
    255288
     289  if ((swapall==BR_FFTTwoChan)||(swapall==BR_FFTTwoChanSwapAll)||(swapall==BR_FFTTwoChanSwap32)) {
     290    fgdatafft=true; 
     291  }
     292  if ((swapall==BR_FFTOneChan)||(swapall==BR_FFTOneChanSwapAll)||(swapall==BR_FFTOneChanSwap32)) {
     293    fgdatafft=true;  fgsinglechannel=true;
     294  }
     295 
    256296  if (fgreducpsize) {
    257297    if (redpqsize>=PaqSize) fgreducpsize=false;
     
    280320    os << " PaquetSize Reduction, ReducedSize=" << redpqsize << " Offset=" << reducoffset << endl;
    281321  }
     322  if (fgdoProc>0)
     323    os << " Monitoring  NMeanProc=" << nmeanProc << " StepProc=" << stepProc << " NMaxProc=" << nmaxProc << endl;
     324  else os << " No monotoring thread " << endl;
    282325  os << " fg_hard_ctrlc=" << ((fg_hard_ctrlc)?"true":"false");
    283326  os << " Save to fits " << ((savesigfits)?"true":"false") << endl;
Note: See TracChangeset for help on using the changeset viewer.