| [534] | 1 | // toimanager.cc | 
|---|
|  | 2 | // Eric Aubourg         CEA/DAPNIA/SPP   septembre 1999 | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #include "toimanager.h" | 
|---|
|  | 5 | #include "archexc.h" | 
|---|
|  | 6 | #include "toiproducer.h" | 
|---|
|  | 7 | //#include "toiabsorber.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 |  | 
|---|
|  | 10 | void TOIManager::registerProducer(TOIProducer* p) { | 
|---|
|  | 11 | producers.insert(p); | 
|---|
|  | 12 | } | 
|---|
|  | 13 |  | 
|---|
|  | 14 | TOIProducer* TOIManager::findTOIProducer(TOI const& toi) { | 
|---|
|  | 15 | TOIProducer* p = NULL; | 
|---|
|  | 16 | for (set<TOIProducer*>::iterator i=producers.begin(); | 
|---|
|  | 17 | i != producers.end(); i++) { | 
|---|
|  | 18 | if ((*i)->canProduce(toi)) { | 
|---|
|  | 19 | if (p) throw ArchExc("Duplicate producers for toi" + toi.name); | 
|---|
|  | 20 | p = *i; | 
|---|
|  | 21 | } | 
|---|
|  | 22 | } | 
|---|
|  | 23 | if (!p) return NULL; // no producer for this TOI | 
|---|
|  | 24 | //  p->addTOI(toi, client); | 
|---|
|  | 25 | return p; | 
|---|
|  | 26 | } | 
|---|
|  | 27 |  | 
|---|
|  | 28 | set<TOIProducer*> TOIManager::producers; | 
|---|
|  | 29 | map<TOILowLevProducer*, long> TOIManager::llProducers; | 
|---|
|  | 30 | map<TOILowLevProducer*, long> TOIManager::activeLLProducers; | 
|---|
|  | 31 | int TOIManager::trigMask = 0; | 
|---|
|  | 32 |  | 
|---|
|  | 33 | void TOIManager::registerLLProducer(TOILowLevProducer* p, int blk_mask) { | 
|---|
|  | 34 | registerProducer(p); | 
|---|
|  | 35 | //trigMask |= blk_mask; | 
|---|
|  | 36 | llProducers[p] = blk_mask; | 
|---|
|  | 37 | } | 
|---|
|  | 38 |  | 
|---|
|  | 39 | void TOIManager::activateLLProducer(TOILowLevProducer* p) { | 
|---|
|  | 40 | //registerProducer(p); | 
|---|
|  | 41 | int blk_mask = llProducers[p]; | 
|---|
|  | 42 | trigMask |= blk_mask; | 
|---|
|  | 43 | activeLLProducers[p] = blk_mask; | 
|---|
|  | 44 | } | 
|---|
|  | 45 |  | 
|---|
|  | 46 |  | 
|---|
|  | 47 | void TOIManager::dumpAvailTOIs(ostream& s) { | 
|---|
|  | 48 | s << "*** Available TOIs\n"; | 
|---|
|  | 49 | for (set<TOIProducer*>::iterator i = producers.begin(); i != producers.end(); i++) { | 
|---|
|  | 50 | TOIProducer* prod = *i; | 
|---|
|  | 51 | set<TOI> x = prod->getPossibleTOIs(); | 
|---|
|  | 52 | for (set<TOI>::iterator j = x.begin(); j != x.end(); j++) { | 
|---|
|  | 53 | TOI toi = *j; | 
|---|
|  | 54 | cout << toi.name; | 
|---|
|  | 55 | if (toi.index == TOI::all) cout << " * "; | 
|---|
|  | 56 | for (set<string>::iterator k = toi.options.begin(); k != toi.options.end(); k++) { | 
|---|
|  | 57 | cout << " "; | 
|---|
|  | 58 | if (toi.reqOptions.find(*k) != toi.reqOptions.end()) cout << "+"; | 
|---|
|  | 59 | cout << *k; | 
|---|
|  | 60 | } | 
|---|
|  | 61 | cout << "\n"; | 
|---|
|  | 62 | } | 
|---|
|  | 63 | } | 
|---|
|  | 64 |  | 
|---|
|  | 65 | } | 
|---|
|  | 66 |  | 
|---|
|  | 67 |  | 
|---|
|  | 68 |  | 
|---|
|  | 69 | #include "archeopsfile.h" | 
|---|
|  | 70 |  | 
|---|
|  | 71 | #include "toillboloproducer.h" | 
|---|
|  | 72 | #include "toillreglageproducer.h" | 
|---|
|  | 73 | #include "toilldiluproducer.h" | 
|---|
|  | 74 | #include "toillgpsproducer.h" | 
|---|
|  | 75 | #include "toillgyroproducer.h" | 
|---|
|  | 76 | #include "toillsstproducer.h" | 
|---|
|  | 77 |  | 
|---|
|  | 78 | #include "timetoiproducer.h" | 
|---|
| [555] | 79 | #include "toiinterpolator.h" | 
|---|
|  | 80 | #include "toirepeater.h" | 
|---|
|  | 81 | #include "toiflagger.h" | 
|---|
| [534] | 82 | #include "toiboloproducer.h" | 
|---|
|  | 83 | #include "sststarfinder.h" | 
|---|
|  | 84 | #include "tsidproducer.h" | 
|---|
|  | 85 | #include "galcrosslocator.h" | 
|---|
|  | 86 | #include "starmatcher.h" | 
|---|
| [555] | 87 | #include "rotspeed.h" | 
|---|
|  | 88 | #include "gyrocalibrator.h" | 
|---|
| [534] | 89 |  | 
|---|
|  | 90 | void TOIManager::registerDefaultProducers() { | 
|---|
|  | 91 | REGLLPROD(TOILLBoloProducer,    block_bolo_mask); | 
|---|
|  | 92 | REGLLPROD(TOILLReglageProducer, block_reglage_mask); | 
|---|
|  | 93 | REGLLPROD(TOILLDiluProducer,    block_dilution_mask); | 
|---|
|  | 94 | REGLLPROD(TOILLGPSProducer,     block_gps_mask); | 
|---|
|  | 95 | REGLLPROD(TOILLGyroProducer,    block_gyro_mask); | 
|---|
|  | 96 | REGLLPROD(TOILLSSTProducer,     block_sst_mask); | 
|---|
|  | 97 |  | 
|---|
|  | 98 | REGPROD(TimeTOIProducer); | 
|---|
| [555] | 99 | REGPROD(TOIInterpolator); | 
|---|
|  | 100 | REGPROD(TOIRepeater); | 
|---|
|  | 101 | REGPROD(TOIFlagger); | 
|---|
| [534] | 102 | REGPROD(TOIBoloProducer); | 
|---|
|  | 103 | REGPROD(SSTStarFinder); | 
|---|
|  | 104 | REGPROD(TSidProducer); | 
|---|
|  | 105 | REGPROD(GalCrossLocator); | 
|---|
|  | 106 | REGPROD(StarMatcher); | 
|---|
| [555] | 107 | REGPROD(RotSpeed); | 
|---|
|  | 108 | REGPROD(GyroCalibrator); | 
|---|
| [534] | 109 | } | 
|---|
|  | 110 |  | 
|---|
|  | 111 |  | 
|---|
|  | 112 |  | 
|---|