| Rev | Line |  | 
|---|
| [1738] | 1 | // ArchTOIPipe           (C)     CEA/DAPNIA/SPP IN2P3/LAL | 
|---|
|  | 2 | //                               Eric Aubourg | 
|---|
|  | 3 | //                               Christophe Magneville | 
|---|
|  | 4 | //                               Reza Ansari | 
|---|
|  | 5 | // $Id: asciitoiwtr.cc,v 1.7 2001-11-08 15:47:44 aubourg Exp $ | 
|---|
|  | 6 |  | 
|---|
| [1368] | 7 | #include "asciitoiwtr.h" | 
|---|
|  | 8 | #include "toimanager.h" | 
|---|
|  | 9 |  | 
|---|
|  | 10 | ASCIITOIWriter::ASCIITOIWriter(string fn) | 
|---|
|  | 11 | : fname(fn), s(fn.c_str()) | 
|---|
|  | 12 | { | 
|---|
|  | 13 | name = "ascii writer"; | 
|---|
| [1370] | 14 | outFlags = false; | 
|---|
| [1368] | 15 | } | 
|---|
|  | 16 |  | 
|---|
|  | 17 | ASCIITOIWriter::~ASCIITOIWriter() | 
|---|
|  | 18 | {} | 
|---|
|  | 19 |  | 
|---|
| [1370] | 20 | void ASCIITOIWriter::setOutFlags(bool yn) { | 
|---|
|  | 21 | outFlags = yn; | 
|---|
|  | 22 | } | 
|---|
|  | 23 |  | 
|---|
| [1368] | 24 | void ASCIITOIWriter::addInput(string name, TOI* toi) { | 
|---|
|  | 25 | declareInput(name); | 
|---|
|  | 26 | fwinputs.push_back(toi); | 
|---|
| [1692] | 27 | toi->addConsumer(this); | 
|---|
| [1368] | 28 | } | 
|---|
|  | 29 |  | 
|---|
|  | 30 |  | 
|---|
|  | 31 | void ASCIITOIWriter::run() { | 
|---|
|  | 32 | cout << "asciitoiwriter running" << endl; | 
|---|
|  | 33 | // init done here | 
|---|
|  | 34 | delete[] inTOIs; | 
|---|
|  | 35 | inTOIs = new (TOI*[fwinputs.size()]); | 
|---|
|  | 36 |  | 
|---|
|  | 37 | for (int i=0; i<fwinputs.size(); i++) { | 
|---|
|  | 38 | inTOIs[i] = fwinputs[i]; | 
|---|
|  | 39 | } | 
|---|
|  | 40 |  | 
|---|
|  | 41 | int ncols = inIx.size(); | 
|---|
|  | 42 |  | 
|---|
|  | 43 |  | 
|---|
|  | 44 | TOIManager* mgr = TOIManager::getManager(); | 
|---|
|  | 45 | int snb = getMinIn(); | 
|---|
|  | 46 | int sne = getMaxIn(); | 
|---|
|  | 47 |  | 
|---|
| [1462] | 48 | double val; | 
|---|
| [1532] | 49 | uint_8 flg; | 
|---|
| [1368] | 50 | for (int sn = snb; sn <= sne; sn++) { | 
|---|
|  | 51 | s << sn << "   "; | 
|---|
|  | 52 | for (int i=0; i<ncols; i++) { | 
|---|
| [1462] | 53 | getData(i, sn, val, flg); | 
|---|
|  | 54 | s << val << "   "; | 
|---|
|  | 55 | if (outFlags) | 
|---|
|  | 56 | s << flg << "   "; | 
|---|
| [1368] | 57 | } | 
|---|
|  | 58 | s << '\n'; | 
|---|
|  | 59 | } | 
|---|
|  | 60 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.