| Line |  | 
|---|
| 1 | #include "asciitoiwtr.h" | 
|---|
| 2 | #include "toimanager.h" | 
|---|
| 3 |  | 
|---|
| 4 | ASCIITOIWriter::ASCIITOIWriter(string fn) | 
|---|
| 5 | : fname(fn), s(fn.c_str()) | 
|---|
| 6 | { | 
|---|
| 7 | name = "ascii writer"; | 
|---|
| 8 | outFlags = false; | 
|---|
| 9 | } | 
|---|
| 10 |  | 
|---|
| 11 | ASCIITOIWriter::~ASCIITOIWriter() | 
|---|
| 12 | {} | 
|---|
| 13 |  | 
|---|
| 14 | void ASCIITOIWriter::setOutFlags(bool yn) { | 
|---|
| 15 | outFlags = yn; | 
|---|
| 16 | } | 
|---|
| 17 |  | 
|---|
| 18 | void ASCIITOIWriter::addInput(string name, TOI* toi) { | 
|---|
| 19 | declareInput(name); | 
|---|
| 20 | fwinputs.push_back(toi); | 
|---|
| 21 | } | 
|---|
| 22 |  | 
|---|
| 23 |  | 
|---|
| 24 | void ASCIITOIWriter::run() { | 
|---|
| 25 | cout << "asciitoiwriter running" << endl; | 
|---|
| 26 | // init done here | 
|---|
| 27 | delete[] inTOIs; | 
|---|
| 28 | inTOIs = new (TOI*[fwinputs.size()]); | 
|---|
| 29 |  | 
|---|
| 30 | for (int i=0; i<fwinputs.size(); i++) { | 
|---|
| 31 | inTOIs[i] = fwinputs[i]; | 
|---|
| 32 | } | 
|---|
| 33 |  | 
|---|
| 34 | int ncols = inIx.size(); | 
|---|
| 35 |  | 
|---|
| 36 |  | 
|---|
| 37 | TOIManager* mgr = TOIManager::getManager(); | 
|---|
| 38 | int snb = getMinIn(); | 
|---|
| 39 | int sne = getMaxIn(); | 
|---|
| 40 |  | 
|---|
| 41 | for (int sn = snb; sn <= sne; sn++) { | 
|---|
| 42 | s << sn << "   "; | 
|---|
| 43 | for (int i=0; i<ncols; i++) { | 
|---|
| 44 | double x = getData(i, sn); | 
|---|
| 45 | s << x << "   "; | 
|---|
| 46 | if (outFlags) { | 
|---|
| 47 | int_4 f = getFlag(i, sn); | 
|---|
| 48 | s << f << "   "; | 
|---|
| 49 | } | 
|---|
| 50 | } | 
|---|
| 51 | s << '\n'; | 
|---|
| 52 | } | 
|---|
| 53 | } | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.