source: Sophya/trunk/Poubelle/archTOI.old/gyrohandler.cc@ 623

Last change on this file since 623 was 407, checked in by ansari, 26 years ago

apres grenoble

File size: 1.0 KB
Line 
1// gyrohandler.cc
2// Eric Aubourg CEA/DAPNIA/SPP septembre 1999
3
4#include <string.h>
5#include "gyrohandler.h"
6
7
8GyroHandler::GyroHandler() {
9 memset(gyro, 0, 3*nb_per_block*2*sizeof(int4));
10}
11
12
13GyroHandler::GyroHandler(GyroHandler const& x) {
14 memcpy(gyro, x.gyro, 3*nb_per_block*2*sizeof(int4));
15}
16
17GyroHandler& GyroHandler::operator = (GyroHandler const& x) {
18 memcpy(gyro, x.gyro, 3*nb_per_block*2*sizeof(int4));
19 return *this;
20}
21
22GyroHandler::~GyroHandler() {
23
24}
25
26void GyroHandler::ProcessBlock(block_type_gyro* blk) {
27 memcpy(gyro, blk->gyro, 3*nb_per_block*2*sizeof(int4));
28}
29
30int4 GyroHandler::getRawSignal(int imesure, int igyro) {
31 if (igyro<0 || igyro>=3) return 0;
32 if (imesure<0 || imesure>=nb_per_block*2) return 0;
33 return gyro[igyro][imesure]-32768;
34}
35
36double GyroHandler::getSignal(int imesure, int igyro) { // V
37 return getRawSignal(imesure, igyro) * 2. / 32768.; // +- 2V dynamique sur 16 bits
38}
39
40double GyroHandler::getSpeed(int imesure, int igyro) {
41 return getSignal(imesure, igyro) * 10;
42}
Note: See TracBrowser for help on using the repository browser.