Changeset 1442 in Sophya for trunk/ArchTOIPipe/ProcWSophya/rztoi.cc
- Timestamp:
- Mar 15, 2001, 1:09:31 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ArchTOIPipe/ProcWSophya/rztoi.cc
r1439 r1442 3 3 #include "pexceptions.h" 4 4 #include "fftpserver.h" 5 #include " timing.h"5 #include "ctimer.h" 6 6 7 7 RzTOIProc::RzTOIProc(int w1, int w2, int nmax) … … 15 15 void RzTOIProc::init() { 16 16 cout << "RzTOIProc::init" << endl; 17 declareInput(" signal");18 declareOutput(" sfout");17 declareInput("in"); 18 declareOutput("out"); 19 19 name = "rzproc"; 20 20 upExtra = 1; … … 33 33 34 34 try { 35 Timer tm("RzTOIProc::run()"); 35 36 36 37 FFTPackServer ffts; … … 116 117 nkv++; 117 118 } 118 PrtTim("End of bloc"); 119 120 tm.Split("End of bloc"); 119 121 } 120 122 … … 150 152 } 151 153 catch (PException & e) { 152 cout << "RzTOIProc exception Msg= " << e.Msg() << endl; 153 } 154 } 155 156 157 158 RzSimpleTOIProc::RzSimpleTOIProc(double fact, int npr) 154 cout << "RzTOIProc: Catched exception " << (string)typeid(e).name() 155 << "\n Msg= " << e.Msg() << endl; 156 } 157 } 158 159 160 161 RzSimpleTOIProc::RzSimpleTOIProc(int wsz, double fact) 159 162 { 163 if (wsz < 4) wsz = 4; 160 164 cout << "RzSimpleTOIProc::RzSimpleTOIProc() factor= " << fact 161 << " npr=" << npr<< endl;165 << " WSize=" << wsz << endl; 162 166 _fact = fact; 163 _ nprt = npr;167 _wsz = wsz; 164 168 } 165 169 166 170 void RzSimpleTOIProc::init() { 167 171 cout << "RzSimpleTOIProc::init" << endl; 168 declareInput(" signal");169 declareOutput(" sfout");172 declareInput("in"); 173 declareOutput("out"); 170 174 name = "rzsimpleproc"; 171 175 upExtra = 1; … … 177 181 int sne = getMaxIn(); 178 182 179 cout << " RzSimpleTOIProc::run(): snb=" << snb << " sne=" << sne << endl; 183 int nstot = sne-snb; 184 int nbloc = nstot/_wsz; 185 cout << " RzSimpleTOIProc::run(): snb=" << snb << " sne=" 186 << sne << " NBloc=" << nbloc << endl; 180 187 181 188 double val; 189 int snlast = snb; 190 int istart,ii,kb; 182 191 try { 183 for (int k=snb; k<sne; k++) { 184 if ((k-snb)%_nprt == 0) 185 cout << " RzSimpleTOIProc::run() - Processing sample k= " << k 186 << endl; 187 188 val = getData(0, k); 189 putData(0, k, val*_fact); 190 } 192 Timer tm("RzSimpleTOIProc::run()"); 193 Vector vin(_wsz); 194 for (kb=0; kb<nbloc; kb++) { 195 istart = kb*_wsz+snb; 196 if (kb%2 == 0) { // On parcourt a l'envers 197 cout << " ... Processing bloc[" << kb << "] (Reverse) SampleNum=" 198 << istart+_wsz << " ->" << istart << endl; 199 for(ii=_wsz-1; ii>=0; ii--) 200 vin(ii) = getData(0, ii+istart); 201 } 202 else { // On parcourt vers l'avant 203 cout << " ... Processing bloc[" << kb << "] SampleNum=" 204 << istart << " ->" << istart+_wsz << endl; 205 for(ii=0; ii<_wsz; ii++) 206 vin(ii) = getData(0, ii+istart); 207 } 208 for(ii=0; ii<_wsz; ii++) 209 putData(0, ii+istart, vin(ii)*_fact); 210 snlast = istart+_wsz; 211 } 212 cout << " ... Processing remaining Samples - SN=" 213 << snlast << " ->" << sne << endl; 214 for(ii=snlast; ii<sne; ii++) { 215 val = getData(0, ii); 216 putData(0, ii, val*_fact); 217 } 218 219 191 220 } 192 221 catch (PException & e) { 193 cout << "RzSimpleTOIProc exception Msg= " << e.Msg() << endl; 194 } 195 } 222 cout << "RzSimpleTOIProc exception " << (string)typeid(e).name() 223 << "\n Msg= " << e.Msg() << endl; 224 } 225 }
Note:
See TracChangeset
for help on using the changeset viewer.