source: Sophya/trunk/Poubelle/archTOI.old/toiauxgpsproducer.cc@ 534

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

V2

File size: 2.0 KB
Line 
1// toiauxgpsproducer.cc
2// Eric Aubourg CEA/DAPNIA/SPP octobre 1999
3
4#include "toiauxgpsproducer.h"
5#include "archparam.h"
6#include "archexc.h"
7#include "requesthandler.h"
8
9#define latitude "latitude"
10#define longitude "longitude"
11#define altitude "altitude"
12
13
14TOIAuxGPSProducer::TOIAuxGPSProducer(AuxGPS* aux)
15: auxGPS(aux)
16{
17 possibleTOIs.insert(TOI(latitude, TOI::unspec, "auxGPS interp", "degrees")); // + = NORTH
18 possibleTOIs.insert(TOI(longitude, TOI::unspec, "auxGPS interp", "degrees")); // + = EAST
19 possibleTOIs.insert(TOI(altitude, TOI::unspec, "auxGPS interp", "meters"));
20}
21
22string TOIAuxGPSProducer::getName() {
23 return("TOIAuxGPSProducer 1.0");
24}
25
26
27
28long TOIAuxGPSProducer::firstSampleNum(TOI const& toi) {
29 CHKPROD
30 return -99999999;
31}
32
33long TOIAuxGPSProducer::lastSampleNum(TOI const& toi) {
34 CHKPROD
35 return 99999999;
36}
37
38bool TOIAuxGPSProducer::canGetValue(long sampleNum, TOI const& toi) {
39 CHKPROD
40 return auxGPS->canGetLocation(archParam.acq.SN2MJD(sampleNum));
41}
42
43bool TOIAuxGPSProducer::canGetValueLater(long /*sampleNum*/, TOI const& toi) {
44 CHKPROD
45 return false; // we can always get value NOW
46}
47
48bool TOIAuxGPSProducer::canGetPrevValue(long sampleNum, TOI const& toi) {
49 CHKPROD
50 return canGetValue(sampleNum-1, toi);
51}
52
53bool TOIAuxGPSProducer::canGetNextValue(long sampleNum, TOI const& toi) {
54 CHKPROD
55 return canGetValue(sampleNum+1, toi);
56}
57
58double TOIAuxGPSProducer::getValue(long sampleNum, TOI const& toi) {
59 CHKPROD
60 double lat, lon, alt;
61 auxGPS->getLocation(archParam.acq.SN2MJD(sampleNum), lat, lon, alt);
62 if (toi.name == latitude) return lat;
63 if (toi.name == longitude) return lon;
64 if (toi.name == altitude) return alt;
65 throw ArchExc("TOIAuxGPSProducer inconsistence " + toi.name);
66}
67
68double TOIAuxGPSProducer::getPrevValue(long& sampleNum, TOI const& toi) {
69 sampleNum--;
70 return getValue(sampleNum, toi);
71}
72
73double TOIAuxGPSProducer::getNextValue(long& sampleNum, TOI const& toi) {
74 sampleNum++;
75 return getValue(sampleNum, toi);
76}
77
Note: See TracBrowser for help on using the repository browser.