Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JTransceiver.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JTRANSCEIVER__
2 #define __JACOUSTICS__JTRANSCEIVER__
3 
4 #include "JDB/JToAshort.hh"
5 
6 #include "JAcoustics/JEmitter.hh"
10 
11 
12 /**
13  * \file
14  *
15  * Acoustic transceiver.
16  * \author mdejong
17  */
18 namespace JACOUSTICS {}
19 namespace JPP { using namespace JACOUSTICS; }
20 
21 namespace JACOUSTICS {
22 
24 
25 
26  /**
27  * Acoustic transceiver.
28  */
29  struct JTransceiver :
30  public JEmitter,
31  public JReceiver
32  {
33  /**
34  * Default constructor.
35  */
37  emitter (),
38  receiver()
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param emitter emitter
46  * \param receiver receiver
47  */
49  const JReceiver& receiver) :
50  emitter (emitter),
51  receiver(receiver)
52  {}
53 
54 
55  /**
56  * Get transmission.
57  *
58  * \param data time-of-arrival
59  * \param V sound velocity
60  * \return transmission
61  */
63  const JAbstractSoundVelocity& V) const
64  {
65  const double toa = data.UNIXTIMEBASE + receiver.getT(data.TOA_S);
66  const double t1 = V.getTime(this->getDistance(),
67  this->emitter .getZ(),
68  this->receiver.getZ());
69 
70  return JTransmission(data.RUNNUMBER,
71  this->receiver.getID(),
72  data.QUALITYFACTOR,
73  toa,
74  toa - t1);
75  }
76 
77 
78  /**
79  * Get distance between emitter and receiver.
80  *
81  * \return distance
82  */
83  inline double getDistance() const
84  {
86  }
87 
90  };
91 }
92 
93 #endif
double UNIXTIMEBASE
[s]
Definition: JToAshort.hh:25
Acoustic receiver.
Definition: JReceiver.hh:27
Sound velocity.
JTransceiver()
Default constructor.
Definition: JTransceiver.hh:36
Acoustic emitter.
double getDistance(const JVector3D &pos) const
Get distance to point.
Definition: JVector3D.hh:270
Acoustic transmission.
Acoustic emitter.
Definition: JEmitter.hh:27
virtual double getTime(const double D_m, const double z1, const double z2) const =0
Get propagation time of sound.
JTransmission getTransmission(const JToAshort &data, const JAbstractSoundVelocity &V) const
Get transmission.
Definition: JTransceiver.hh:62
Acoustic transceiver.
Definition: JTransceiver.hh:29
JTransceiver(const JEmitter &emitter, const JReceiver &receiver)
Constructor.
Definition: JTransceiver.hh:48
double getT(const double t_s) const
Get corrected time.
Definition: JReceiver.hh:72
Acoustic receiver.
Acoustic transmission.
double TOA_S
[s]
Definition: JToAshort.hh:28
Interface for velocity of sound.
double getDistance() const
Get distance between emitter and receiver.
Definition: JTransceiver.hh:83
double getZ() const
Get z position.
Definition: JVector3D.hh:115