| [534] | 1 | // toillreglageproducer.cc | 
|---|
|  | 2 | // Eric Aubourg         CEA/DAPNIA/SPP   septembre 1999 | 
|---|
|  | 3 |  | 
|---|
|  | 4 | #include "toillreglageproducer.h" | 
|---|
|  | 5 | #include "archfileset.h" | 
|---|
|  | 6 | #include "toimanager.h" | 
|---|
|  | 7 | #include "requesthandler.h" | 
|---|
|  | 8 |  | 
|---|
|  | 9 | // horloge | 
|---|
|  | 10 | #define horlPeriode    "horlPeriode" | 
|---|
|  | 11 | #define horlNbMesures  "horlNbMesures" | 
|---|
|  | 12 | #define horlTempMort   "horlTempMort" | 
|---|
|  | 13 | #define horlFlag       "horlFlag" | 
|---|
|  | 14 |  | 
|---|
|  | 15 | // regul_bolo | 
|---|
|  | 16 | #define regMode        "regMode"         // index regul | 
|---|
|  | 17 | #define regNumBolo     "regNumBolo" | 
|---|
|  | 18 | #define regVoieChauf   "regVoieChauf" | 
|---|
|  | 19 | #define regProp        "regProp" | 
|---|
|  | 20 | #define regInteg       "regInteg" | 
|---|
|  | 21 | #define regDeriv       "regDeriv" | 
|---|
|  | 22 | #define regChauffage   "regChauffage" | 
|---|
|  | 23 |  | 
|---|
|  | 24 | // auto_bolo | 
|---|
|  | 25 | #define autoBolMode    "autoBolMode"     // index voie | 
|---|
|  | 26 | #define autoBolGain    "autoBolGain" | 
|---|
|  | 27 | #define autoBolCourant "autoBolCourant" | 
|---|
|  | 28 | #define autoBolDelai   "autoBolDelai" | 
|---|
|  | 29 |  | 
|---|
|  | 30 | // auto_dilu | 
|---|
|  | 31 | #define autoDilVanne   "autoDilVanne" | 
|---|
|  | 32 | #define autoDilHelium  "autoDilHelium" | 
|---|
|  | 33 | #define autoDilChauff  "autoDilChauff" | 
|---|
|  | 34 | #define autoDilPiles   "autoDilPiles" | 
|---|
|  | 35 | #define autoDilTrans   "autoDilTrans" | 
|---|
|  | 36 | #define autoDilTMxVan  "autoDilTMxVan" | 
|---|
|  | 37 | #define autoDilxx7     "autoDilxx7" | 
|---|
|  | 38 | #define autoDilxx8     "autoDilxx8" | 
|---|
|  | 39 |  | 
|---|
|  | 40 | // reglage_un_bolo | 
|---|
|  | 41 | #define boloDACV       "boloDACV"       // index bolo | 
|---|
|  | 42 | #define boloDACI       "boloDACI" | 
|---|
|  | 43 |  | 
|---|
|  | 44 |  | 
|---|
|  | 45 | TOILLReglageProducer::TOILLReglageProducer() | 
|---|
|  | 46 | { | 
|---|
|  | 47 | possibleTOIs.insert(TOI(horlPeriode,   TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 48 | possibleTOIs.insert(TOI(horlNbMesures, TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 49 | possibleTOIs.insert(TOI(horlTempMort,  TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 50 | possibleTOIs.insert(TOI(horlFlag,      TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 51 |  | 
|---|
|  | 52 | possibleTOIs.insert(TOI(regMode,       TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 53 | possibleTOIs.insert(TOI(regNumBolo,    TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 54 | possibleTOIs.insert(TOI(regVoieChauf,  TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 55 | possibleTOIs.insert(TOI(regProp,       TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 56 | possibleTOIs.insert(TOI(regInteg,      TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 57 | possibleTOIs.insert(TOI(regDeriv,      TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 58 | possibleTOIs.insert(TOI(regChauffage,  TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 59 |  | 
|---|
|  | 60 | possibleTOIs.insert(TOI(autoBolMode,   TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 61 | possibleTOIs.insert(TOI(autoBolGain,   TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 62 | possibleTOIs.insert(TOI(autoBolCourant,TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 63 | possibleTOIs.insert(TOI(autoBolDelai,  TOI::all,    "", "CHAR-CODED")); | 
|---|
|  | 64 |  | 
|---|
|  | 65 | possibleTOIs.insert(TOI(autoDilVanne,  TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 66 | possibleTOIs.insert(TOI(autoDilHelium, TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 67 | possibleTOIs.insert(TOI(autoDilChauff, TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 68 | possibleTOIs.insert(TOI(autoDilPiles,  TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 69 | possibleTOIs.insert(TOI(autoDilTrans,  TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 70 | possibleTOIs.insert(TOI(autoDilTMxVan, TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 71 | possibleTOIs.insert(TOI(autoDilxx7,    TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 72 | possibleTOIs.insert(TOI(autoDilxx8,    TOI::unspec, "", "CHAR-CODED")); | 
|---|
|  | 73 |  | 
|---|
|  | 74 | possibleTOIs.insert(TOI(boloDACV,      TOI::all,    "", "microVolts")); | 
|---|
|  | 75 | possibleTOIs.insert(TOI(boloDACI,      TOI::all,    "", "microAmps")); | 
|---|
|  | 76 | } | 
|---|
|  | 77 |  | 
|---|
|  | 78 | string TOILLReglageProducer::getName() { | 
|---|
|  | 79 | return("TOILLReglageProducer 1.0"); | 
|---|
|  | 80 | } | 
|---|
|  | 81 |  | 
|---|
|  | 82 |  | 
|---|
|  | 83 |  | 
|---|
|  | 84 | #define COMPTOI(_toi_, _field_)                               \ | 
|---|
|  | 85 | if ((*i).name == _toi_) {                                 \ | 
|---|
|  | 86 | computedValue((*i),sample0, blk->reglage._field_);      \ | 
|---|
|  | 87 | } | 
|---|
|  | 88 |  | 
|---|
|  | 89 | void TOILLReglageProducer::handleBlock(ArchFileSet* fs) | 
|---|
|  | 90 | { | 
|---|
|  | 91 | block_type_reglage* blk = fs->lastReglage(); | 
|---|
|  | 92 | long sample0 = numero_block(blk)*72; | 
|---|
|  | 93 | for (set<TOI>::iterator i = producedTOIs.begin(); i != producedTOIs.end(); i++) { | 
|---|
|  | 94 | int k = (*i).index; | 
|---|
|  | 95 | COMPTOI(horlPeriode,    horloge.periode) else | 
|---|
|  | 96 | COMPTOI(horlNbMesures,  horloge.nb_mesures) else | 
|---|
|  | 97 | COMPTOI(horlTempMort,   horloge.temp_mort) else | 
|---|
|  | 98 | COMPTOI(horlFlag,       horloge.flag) else | 
|---|
|  | 99 | COMPTOI(regMode,        regul[k].mode) else | 
|---|
|  | 100 | COMPTOI(regNumBolo,     regul[k].num_bolo) else | 
|---|
|  | 101 | COMPTOI(regVoieChauf,   regul[k].voie_chauf) else | 
|---|
|  | 102 | COMPTOI(regProp,        regul[k].prop) else | 
|---|
|  | 103 | COMPTOI(regInteg,       regul[k].integ) else | 
|---|
|  | 104 | COMPTOI(regDeriv,       regul[k].deriv) else | 
|---|
|  | 105 | COMPTOI(regChauffage,   regul[k].chauffage) else | 
|---|
|  | 106 | COMPTOI(autoBolMode,    autom[k].mode) else | 
|---|
|  | 107 | COMPTOI(autoBolGain,    autom[k].gain) else | 
|---|
|  | 108 | COMPTOI(autoBolCourant, autom[k].courant) else | 
|---|
|  | 109 | COMPTOI(autoBolDelai,   autom[k].delai) else | 
|---|
|  | 110 | COMPTOI(autoDilVanne,   dilu.vanne) else | 
|---|
|  | 111 | COMPTOI(autoDilHelium,  dilu.helium) else | 
|---|
|  | 112 | COMPTOI(autoDilChauff,  dilu.chauffage) else | 
|---|
|  | 113 | COMPTOI(autoDilPiles,   dilu.piles) else | 
|---|
|  | 114 | COMPTOI(autoDilTrans,   dilu.transmission) else | 
|---|
|  | 115 | COMPTOI(autoDilTMxVan,  dilu.temps_max_vanne) else | 
|---|
|  | 116 | COMPTOI(autoDilxx7,     dilu.xx7) else | 
|---|
|  | 117 | COMPTOI(autoDilxx8,     dilu.xx8) else | 
|---|
|  | 118 | if ((*i).name == boloDACV) { | 
|---|
|  | 119 | computedValue((*i), sample0, DAC_muV(&fs->lastParam()->param, &blk->reglage, k)); | 
|---|
|  | 120 | } else | 
|---|
|  | 121 | if ((*i).name == boloDACI) { | 
|---|
|  | 122 | computedValue((*i), sample0, DAC_muA(&fs->lastParam()->param, &blk->reglage, k)); | 
|---|
|  | 123 | } | 
|---|
|  | 124 | } | 
|---|
|  | 125 | } | 
|---|
|  | 126 |  | 
|---|
|  | 127 |  | 
|---|
|  | 128 |  | 
|---|