// antenna.hxx -- FGRadioAntenna: class to represent antenna properties
//
-// Written by Adrian Musceac, started December 2011.
+// Written by Adrian Musceac YO8RZZ, started December 2011.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
class FGRadioAntenna
{
private:
- void load_antenna_pattern(string type);
- int _mirror_y;
+
+/*** load external plot file generated by NEC2. needs to have a txt extension
+* when naming plots, use the following scheme: type_frequencyMHz.txt
+* eg: yagi_110.txt or LPDA_333.txt
+* @param: name of file
+* @return: none
+***/
+ void load_NEC_antenna_pattern(string type);
+
+ int _mirror_y;
int _mirror_z;
int _invert_ground;
double _heading_deg;
double gain;
};
SGPath _pattern_file;
- typedef std::vector<AntennaGain> AntennaPattern;
+ typedef std::vector<AntennaGain*> AntennaPattern;
AntennaPattern _pattern;
public:
FGRadioAntenna(string type);
~FGRadioAntenna();
+
+/*** calculate far-field antenna gain on a 3D volume around it
+* @param: bearing to the other station, vertical angle (some call it theta)
+* @return: gain relative to maximum normalized gain. will be negative in all cases
+***/
double calculate_gain(double bearing, double angle);
- void set_heading(double heading_deg) {_heading_deg = heading_deg ;};
- void set_elevation_angle(double elevation_angle_deg) {_elevation_angle_deg = elevation_angle_deg ;};
+
+ /// some convenience setters and getters (unused for now)
+ inline void set_heading(double heading_deg) {_heading_deg = heading_deg ;};
+ inline void set_elevation_angle(double elevation_angle_deg) {_elevation_angle_deg = elevation_angle_deg ;};
};