40#ifndef WOSS_TRANSDUCER_DEFINITIONS_H
41#define WOSS_TRANSDUCER_DEFINITIONS_H
58 #define BEAM_PATTERN_CUSTOM_BEAM_PRECISION (1.0)
59 #define CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION (1.0)
60 #define TVR_CUSTOM_FREQUENCY_PRECISION (1.0)
61 #define OCV_CUSTOM_FREQUENCY_PRECISION (1.0)
62 #define TRANSDUCER_NOT_SET (-1000)
80 typedef BeamPowerMap::iterator BPMIter;
81 typedef BeamPowerMap::reverse_iterator BPMRIter;
82 typedef BeamPowerMap::const_iterator BPMCIter;
83 typedef BeamPowerMap::const_reverse_iterator BPMCRIter;
90 typedef ConductanceMap::iterator CMIter;
91 typedef ConductanceMap::reverse_iterator CMRIter;
92 typedef ConductanceMap::const_iterator CMCIter;
93 typedef ConductanceMap::const_reverse_iterator CMCRIter;
99 typedef ::std::map< PDouble, double >
TVRMap;
100 typedef TVRMap::iterator TVRMIter;
101 typedef TVRMap::reverse_iterator TVRMRIter;
102 typedef TVRMap::const_iterator TVRMCIter;
103 typedef TVRMap::const_reverse_iterator TVRMCRIter;
109 typedef ::std::map< PDouble, double >
OCVMap;
110 typedef OCVMap::iterator OCVMIter;
111 typedef OCVMap::reverse_iterator OCVMRIter;
112 typedef OCVMap::const_iterator OCVMCIter;
113 typedef OCVMap::const_reverse_iterator OCVMCRIter;
126 Transducer(
long double beam_precision = BEAM_PATTERN_CUSTOM_BEAM_PRECISION,
long double conduct_precison = CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION,
164 virtual Transducer*
create(
long double beam_precision = BEAM_PATTERN_CUSTOM_BEAM_PRECISION,
long double conduct_precison = CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION,
165 long double tvr_precision = TVR_CUSTOM_FREQUENCY_PRECISION,
long double ocv_precision = OCV_CUSTOM_FREQUENCY_PRECISION )
const;
231 virtual double getSPL(
double frequency,
double power )
const;
238 double getMaxSPL(
double frequency )
const;
456 bool tvr_insert(
double frequency,
double tvr );
472 TVRMCIter
tvr_find(
double frequency )
const;
548 bool ocv_insert(
double frequency,
double ocv );
564 OCVMCIter
ocv_find(
double frequency )
const;
646 virtual bool import( ::std::istream& stream_in );
664 bool writeVertBeamPattern( ::std::ostream& stream_out,
const CoordZ& tx,
const CoordZ& rx,
double init_bearing,
double vert_rot = 0,
double horiz_rot = 0,
double mult_costant = 1,
double add_costant = 0 )
const;
672 bool writeSPL( ::std::ostream& stream_out,
double frequency_step,
double power )
const;
680 virtual bool write( ::std::ostream& stream_out )
const;
687 virtual bool writeBinary( ::std::fstream& file_out )
const;
694 Transducer& setResonanceFrequency(
double frequency );
696 Transducer& setBandwith3dB(
double frequency );
698 Transducer& setTypeName( const ::std::string& name );
730 bool hasToroidalSymmetry()
const;
732 bool hasConicalSymmetry()
const;
843 static const ::std::string conical_string;
845 static const ::std::string toroidal_string;
943 virtual double getValue(
double frequency, const ::std::map< PDouble, double >& map,
long double precision,
bool use_linear =
false,
double costant = 20.0 )
const;
973 virtual bool import( ::std::istream& stream_in, ::std::map< PDouble, double >& map,
long double precision,
bool is_angle = false );
983 virtual bool importBinary( ::std::fstream& file_in, ::std::map< PDouble, double >& map,
long double precision,
bool is_angle =
false );
992 virtual bool write( ::std::ostream& stream_out, const ::std::map< PDouble, double >& map )
const;
1000 virtual bool writeBinary( ::std::fstream& file_out, const ::std::map< PDouble, double >& map )
const;
1003 virtual const ::std::string& getSymmetryString()
const;
1011 inline Transducer& Transducer::setMaxPower(
double power ) {
1017 inline Transducer& Transducer::setDutyCycle(
double cycle ) {
1023 inline Transducer& Transducer::setResonanceFrequency(
double frequency ) {
1029 inline Transducer& Transducer::setBandwith3dB(
double bw ) {
1035 inline Transducer& Transducer::setTypeName( const ::std::string& name ) {
1041 inline bool Transducer::hasToroidalSymmetry()
const {
1046 inline bool Transducer::hasConicalSymmetry()
const {
1175 / ( ::std::pow( ::std::abs(impedance), 2.0 ) ) ) ).second;
1187 / ( ::std::pow( ::std::abs(impedance), 2.0 ) ) ;
1262 return tvr_map.find(frequency);
1330 return ocv_map.find(frequency);
1415 if ( &left == &right )
return true;
1422 if ( &left == &right )
return false;
1423 if ( &left == &right )
return true;
1430 if ( !instance.
write( os ) ) os.setstate( ::std::ios_base::failbit );
1435 inline ::std::istream& operator>>( ::std::istream& is, Transducer& instance ) {
1436 if ( !instance.import( is ) ) is.setstate( ::std::ios_base::failbit );
bool operator!=(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:846
std::ostream & operator<<(std::ostream &os, const Altimetry &instance)
Definition altimetry-definitions.h:826
bool operator==(const Altimetry &left, const Altimetry &right)
Definition altimetry-definitions.h:840
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:403
Custom precision long double class.
Definition custom-precision-double.h:67
Transducer class.
Definition transducer-definitions.h:70
virtual Transducer & setBeamPrecision(long double prec)
Definition transducer-definitions.cpp:262
Transducer & beampattern_sum(double value)
Definition transducer-definitions.h:1087
double getDutyCycle() const
Definition transducer-definitions.h:1056
Transducer & ocv_clear()
Definition transducer-definitions.h:1349
Transducer & beampattern_clear()
Definition transducer-definitions.h:1131
TVRMCRIter tvr_rbegin() const
Definition transducer-definitions.h:1297
double getMaxSPL(double frequency) const
Definition transducer-definitions.h:1076
::std::map< PDouble, double > ConductanceMap
Definition transducer-definitions.h:89
BPMCIter beampattern_begin() const
Definition transducer-definitions.h:1137
virtual double getPowerFromSPL(double frequency, double spl) const
Definition transducer-definitions.cpp:441
double max_power
Definition transducer-definitions.h:873
int conductance_size() const
Definition transducer-definitions.h:1202
Transducer & beampattern_erase(double angle)
Definition transducer-definitions.h:1116
::std::map< PDouble, double > TVRMap
Definition transducer-definitions.h:99
friend bool operator==(const Transducer &left, const Transducer &right)
Definition transducer-definitions.h:1414
virtual double normalizeAngle(double angle) const
Definition transducer-definitions.cpp:998
double duty_cycle
Definition transducer-definitions.h:878
long double getBeamPrecision() const
Definition transducer-definitions.h:1394
TVRMCIter tvr_begin() const
Definition transducer-definitions.h:1287
TVRMCIter tvr_lower_bound(double frequency) const
Definition transducer-definitions.h:1307
Transducer & ocv_erase(double frequency)
Definition transducer-definitions.h:1334
TVRMCIter tvr_upper_bound(double frequency) const
Definition transducer-definitions.h:1312
BPMCRIter beampattern_rbegin() const
Definition transducer-definitions.h:1147
bool ocv_empty() const
Definition transducer-definitions.h:1344
Transducer & conductance_clear()
Definition transducer-definitions.h:1212
virtual Transducer & setTVRPrecision(long double prec)
Definition transducer-definitions.cpp:301
OCVMCRIter ocv_rbegin() const
Definition transducer-definitions.h:1365
BPMCRIter beampattern_rend() const
Definition transducer-definitions.h:1152
Transducer & conductance_replace(double frequency, double conductance)
Definition transducer-definitions.h:1179
Transducer & operator=(const Transducer &x)
Definition transducer-definitions.cpp:239
BPMCIter beampattern_lower_bound(double angle) const
Definition transducer-definitions.h:1157
double getMaxPower() const
Definition transducer-definitions.h:1051
virtual bool write(::std::ostream &stream_out) const
Definition transducer-definitions.cpp:565
CMCIter conductance_upper_bound(double frequency) const
Definition transducer-definitions.h:1243
long double beam_precision
Definition transducer-definitions.h:884
virtual bool isValid() const
Definition transducer-definitions.cpp:232
friend::std::ostream & operator<<(::std::ostream &os, const Transducer &instance)
Transducer & clearAll()
Definition transducer-definitions.h:1385
double resonance_frequency
Definition transducer-definitions.h:863
bool has_conical_symmetry
Definition transducer-definitions.h:857
::std::map< PDouble, double > BeamPowerMap
Definition transducer-definitions.h:79
long double conductance_precision
Definition transducer-definitions.h:889
virtual Transducer & setConductancePrecision(long double prec)
Definition transducer-definitions.cpp:288
OCVMCIter ocv_upper_bound(double frequency) const
Definition transducer-definitions.h:1380
virtual bool importBinary(::std::fstream &stream_in)
ConductanceMap conductance_map
Definition transducer-definitions.h:915
virtual bool writeBinary(::std::fstream &file_out) const
Definition transducer-definitions.cpp:600
Transducer & beampattern_rotate(double angle)
Definition transducer-definitions.h:1081
CMCRIter conductance_rend() const
Definition transducer-definitions.h:1233
TVRMCRIter tvr_rend() const
Definition transducer-definitions.h:1302
bool conductance_insert(double frequency, double conductance)
Definition transducer-definitions.h:1168
virtual double getSPL(double frequency, double power) const
Definition transducer-definitions.cpp:427
virtual Transducer * clone() const
Definition transducer-definitions.cpp:227
CMCIter conductance_lower_bound(double frequency) const
Definition transducer-definitions.h:1238
Transducer & ocv_replace(double frequency, double ocv)
Definition transducer-definitions.h:1323
CMCIter conductance_find(double frequency) const
Definition transducer-definitions.h:1192
BPMCIter beampattern_find(double angle) const
Definition transducer-definitions.h:1111
OCVMCRIter ocv_rend() const
Definition transducer-definitions.h:1370
BPMCIter beampattern_upper_bound(double angle) const
Definition transducer-definitions.h:1162
TVRMCIter tvr_end() const
Definition transducer-definitions.h:1292
int ocv_size() const
Definition transducer-definitions.h:1339
friend::std::ostream & operator>>(::std::istream &is, const Transducer &instance)
double getResonanceFrequency() const
Definition transducer-definitions.h:1061
Transducer & conductance_erase(double frequency)
Definition transducer-definitions.h:1197
OCVMap ocv_map
Definition transducer-definitions.h:925
int beampattern_size() const
Definition transducer-definitions.h:1121
bool ocv_insert(double frequency, double ocv)
Definition transducer-definitions.h:1318
long double getConductancePrecision() const
Definition transducer-definitions.h:1399
bool beampattern_empty() const
Definition transducer-definitions.h:1126
OCVMCIter ocv_end() const
Definition transducer-definitions.h:1360
int tvr_size() const
Definition transducer-definitions.h:1271
OCVMCIter ocv_begin() const
Definition transducer-definitions.h:1355
CMCIter conductance_begin() const
Definition transducer-definitions.h:1218
OCVMCIter ocv_lower_bound(double frequency) const
Definition transducer-definitions.h:1375
Transducer & tvr_replace(double frequency, double tvr)
Definition transducer-definitions.h:1255
virtual Transducer * create(long double beam_precision=BEAM_PATTERN_CUSTOM_BEAM_PRECISION, long double conduct_precison=CONDUCTANCE_CUSTOM_FREQUENCY_PRECISION, long double tvr_precision=TVR_CUSTOM_FREQUENCY_PRECISION, long double ocv_precision=OCV_CUSTOM_FREQUENCY_PRECISION) const
Definition transducer-definitions.cpp:213
Transducer & tvr_clear()
Definition transducer-definitions.h:1281
double bandwith_3db
Definition transducer-definitions.h:868
long double ocv_precision
Definition transducer-definitions.h:899
long double getTVRPrecision() const
Definition transducer-definitions.h:1404
CMCIter conductance_end() const
Definition transducer-definitions.h:1223
virtual double getValue(double frequency, const ::std::map< PDouble, double > &map, long double precision, bool use_linear=false, double costant=20.0) const
Definition transducer-definitions.cpp:377
static void setDebug(bool flag)
Definition transducer-definitions.h:837
friend bool operator!=(const Transducer &left, const Transducer &right)
Definition transducer-definitions.h:1421
long double getOCVPrecision() const
Definition transducer-definitions.h:1409
BPMCIter beampattern_end() const
Definition transducer-definitions.h:1142
bool tvr_empty() const
Definition transducer-definitions.h:1276
TVRMap tvr_map
Definition transducer-definitions.h:920
double getBandwith3dB() const
Definition transducer-definitions.h:1066
bool beampattern_insert(double angle, double power)
Definition transducer-definitions.h:1099
CMCRIter conductance_rbegin() const
Definition transducer-definitions.h:1228
static bool debug
Definition transducer-definitions.h:851
bool writeSPL(::std::ostream &stream_out, double frequency_step, double power) const
Definition transducer-definitions.cpp:746
TVRMCIter tvr_find(double frequency) const
Definition transducer-definitions.h:1261
Transducer & beampattern_replace(double angle, double power)
Definition transducer-definitions.h:1104
virtual Transducer & setOCVPrecision(long double prec)
Definition transducer-definitions.cpp:275
::std::string type_name
Definition transducer-definitions.h:904
::std::string getTypeName() const
Definition transducer-definitions.h:1071
BeamPowerMap beam_power_map
Definition transducer-definitions.h:910
long double tvr_precision
Definition transducer-definitions.h:894
bool tvr_insert(double frequency, double tvr)
Definition transducer-definitions.h:1250
Transducer & beampattern_multiply(double value)
Definition transducer-definitions.h:1093
::std::map< PDouble, double > OCVMap
Definition transducer-definitions.h:109
bool conductance_empty() const
Definition transducer-definitions.h:1207
Transducer & tvr_erase(double frequency)
Definition transducer-definitions.h:1266
OCVMCIter ocv_find(double frequency) const
Definition transducer-definitions.h:1329
bool writeVertBeamPattern(::std::ostream &stream_out, const CoordZ &tx, const CoordZ &rx, double init_bearing, double vert_rot=0, double horiz_rot=0, double mult_costant=1, double add_costant=0) const
Definition transducer-definitions.cpp:766
Provides the interface for the woss::PDouble class.