source: Sophya/trunk/Poubelle/archTOI.old/toillgyroproducer.cc@ 556

Last change on this file since 556 was 534, checked in by ansari, 26 years ago

V2

File size: 1.9 KB
Line 
1// toillgyroproducer.cc
2// Eric Aubourg CEA/DAPNIA/SPP octobre 1999
3
4#include "toillgyroproducer.h"
5#include "archfileset.h"
6#include "toimanager.h"
7#include "requesthandler.h"
8
9#define gyroRaw "gyroRaw"
10#define gyroV "gyroV"
11#define gyroCal "gyroCal"
12#define gyroSpeed "gyroSpeed"
13
14TOILLGyroProducer::TOILLGyroProducer()
15{
16 possibleTOIs.insert(TOI(gyroRaw, TOI::all, "", "ADU"));
17 possibleTOIs.insert(TOI(gyroV, TOI::all, "", "Volts"));
18 possibleTOIs.insert(TOI(gyroCal, TOI::unspec, "", "deg/s/V", "theoric"));
19 possibleTOIs.insert(TOI(gyroSpeed, TOI::all, "", "deg/s", "theoric"));
20}
21
22string TOILLGyroProducer::getName() {
23 return("TOILLGyroProducer 1.0");
24}
25
26
27static inline long gyrRaw(block_type_gyro* blk, int igyro, int imesure) {
28 return blk->gyro[igyro][imesure]-32768;
29}
30
31static inline double gyrV(block_type_gyro* blk, int igyro, int imesure) {
32 return gyrRaw(blk, igyro, imesure) * 2. / 32768.; // +- 2V dynamique sur 16 bits;
33}
34
35static inline double gyrSpeed(block_type_gyro* blk, int igyro, int imesure) {
36 return gyrV(blk, igyro, imesure) * 10;
37}
38
39void TOILLGyroProducer::handleBlock(ArchFileSet* fs)
40{
41 block_type_gyro* blk = fs->lastGyro();
42 long sample0 = numero_block(blk)*72;
43 for (set<TOI>::iterator i = producedTOIs.begin(); i != producedTOIs.end(); i++) {
44 int igyro = (*i).index;
45 if ((*i).name == gyroRaw) {
46 for (int j=0; j<nb_per_block*2; j++) {
47 computedValue((*i),sample0+j, gyrRaw(blk,igyro,j));
48 }
49 } else if ((*i).name == gyroV) {
50 for (int j=0; j<nb_per_block*2; j++) {
51 computedValue((*i),sample0+j, gyrV(blk,igyro,j));
52 }
53 } else if ((*i).name == gyroCal) {
54 for (int j=0; j<nb_per_block*2; j++) {
55 computedValue((*i),sample0+j, 10);
56 }
57 } else if ((*i).name == gyroSpeed) {
58 for (int j=0; j<nb_per_block*2; j++) {
59 computedValue((*i),sample0+j, gyrSpeed(blk,igyro,j));
60 }
61 }
62 }
63}
64
Note: See TracBrowser for help on using the repository browser.