16 #include "Coordinate.h"
19 #include "Properties.h"
21 extern bool globWarningFlag;
22 extern bool globReportFlag;
24 Mic::Mic(
double x,
double y,
double z,
double newAzi,
double newEle) :
Moveable(x, y, z)
26 aziAng_ =
Angle(newAzi, -180.0, 180.0, 2 * 180.0);
27 eleAng_ =
Angle(newEle, -90.0, 90.0, 90.0);
44 post(
"/MicAzi = %f, /MicEle = %f", aziAng_() * Properties::RAD2DEG, eleAng_() * Properties::RAD2DEG);
100 if (newDirGain > 1.0) {
104 else if (newDirGain < -1.0) {
109 dirGainA_ = newDirGain;
110 dirGainB_ = 1.0 - dirGainA_;
111 if (capped && globWarningFlag)
112 post(
"Directivity gain capped at %f", dirGainA_);
115 post(
"DirGainA: %f, DirGainB: %f", dirGainA_, dirGainB_);
140 else if (newDirPow < 0.0)
148 if (capped && globWarningFlag)
149 post(
"Directivity power capped at %f", dirPow_);
152 post(
"Mic dirPow = %f", dirPow_);
167 if (newDistPow > 9.0)
172 else if (newDistPow < 0.0)
177 newDistPow = -1.0 * newDistPow;
178 distPow_ = newDistPow;
179 if (capped && globWarningFlag)
180 post(
"Distance power capped at %f", distPow_);
183 post(
"Mic distpow = %f", distPow_);
197 if (newDbUnit > 60.0)
202 else if (newDbUnit < 0.0)
207 newDbUnit = -0.05 * newDbUnit;
209 if (capped && globWarningFlag)
210 post(
"dB Unit for exponential distance model capped at %f", dbUnit_);
213 post(
"dB Unit for exponential distance model = %f", dbUnit_);
233 else if (newGain < 0.0)
240 if (capped && globWarningFlag)
241 post(
"Mic gain capped at %f", gain_);
244 post(
"Mic gain = %f", gain_);
double gain() const
Get gain.
double azi() const
Get azimuth angle.
virtual void printPos() const
Print position in x,y,z.
void printAngles() const
Print azimuth and elevation.
Mic(double x, double y, double z, double azi, double ele)
Class constructor, taking 3d position and azimuth and elevation angles.
double distPow() const
Get distance power.
double xPos() const
Get x position.
virtual ~Mic()
Class destructor.
void reset()
Reset microphone to default values.
double dirPow() const
Get directivity power.
double dirGainB() const
Get directivity gain b.
bool flag() const
True if object has moved.
double dirGainA() const
Get directivity gain a.
double ele() const
Get elevation angle.
double zPos() const
Get z position.
double dbUnit() const
Get distance power.
double yPos() const
Get y position.